Skip to content
Browse files

MDL-35442 Add settings and uninstall link for local plugins

  • Loading branch information...
1 parent daccc92 commit 3e8d7ca16e02062d5a4bb04115890531b5469bff @kabalin kabalin committed with danpoltawski Sep 14, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 lib/pluginlib.php
View
19 lib/pluginlib.php
@@ -2504,3 +2504,22 @@ public function get_uninstall_url() {
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();
+ }
+ }
+}

0 comments on commit 3e8d7ca

Please sign in to comment.
Something went wrong with that request. Please try again.