MDL-39087 Simplify get_uninstall_url() interpretation
The get_uninstall_url() method of all subclasses of plugininfo_base class is now expected to always return moodle_url. Subclasses can use the new method is_uninstall_allowed() to control the availability of the 'Uninstall' link at the Plugins overview page (previously they would do it by get_uninstall_url() returning null). By default, URL to a new general plugin uninstall tool is returned. Unless the plugin type needs extra steps that can't be handled by plugininfo_xxx::uninstall() method or xmldb_xxx_uninstall() function, this default URL should satisfy all plugin types. The overall logic is implemented in plugin_manager::can_install_plugin() that respects the plugininfo class decision and vetoes it in certain cases (typically when plugin or its subplugin is required by some other plugin).
This commit is contained in:
@@ -35,6 +35,11 @@ require_once("$CFG->libdir/pluginlib.php");
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class plugininfo_tinymce extends plugininfo_base {
|
||||
|
||||
public function is_uninstall_allowed() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_uninstall_url() {
|
||||
return new moodle_url('/lib/editor/tinymce/subplugins.php', array('delete' => $this->name, 'sesskey' => sesskey()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user