From 888ce02a82227502f1209696ddaed45b9e35274b Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Fri, 14 Sep 2012 09:33:02 +0100 Subject: [PATCH] MDL-35442 Add settings and uninstall link for local plugins --- lib/pluginlib.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/pluginlib.php b/lib/pluginlib.php index b1139ebe8e0..0b5817980aa 100644 --- a/lib/pluginlib.php +++ b/lib/pluginlib.php @@ -2519,3 +2519,22 @@ class plugininfo_report extends plugininfo_base { return new moodle_url('/admin/reports.php', array('delete' => $this->name, 'sesskey' => sesskey())); } } + + +/** + * Class for local plugins + */ +class plugininfo_local extends plugininfo_base { + + public function get_uninstall_url() { + return new moodle_url('/admin/localplugins.php', array('delete' => $this->name, 'sesskey' => sesskey())); + } + + public function get_settings_url() { + if (file_exists($this->full_path('settings.php'))) { + return new moodle_url('/admin/settings.php', array('section' => 'local_' . $this->name)); + } else { + return parent::get_settings_url(); + } + } +}