MDL-35442 Add settings and uninstall link for local plugins

This commit is contained in:
Ruslan Kabalin
2012-09-24 11:19:58 +08:00
committed by Dan Poltawski
parent 3900516886
commit 7fa1f180d6
+19
View File
@@ -1689,3 +1689,22 @@ class plugintype_report extends plugintype_base implements plugin_information {
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();
}
}
}