MDL-39087 Simplify get_uninstall_url() interpretation
authorDavid Mudrák <david@moodle.com>
Thu, 11 Apr 2013 23:00:51 +0000 (01:00 +0200)
committerDavid Mudrák <david@moodle.com>
Thu, 11 Apr 2013 23:44:35 +0000 (01:44 +0200)
commit73658371eb3a7f6569e0d9d9cafff1dfb4beea02
tree54f6b681bc63f35cac1975a1a1f47254a618e8c7
parentd7d48b40910092f0e4f1e7851980776c5e5cf8d9
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).
admin/renderer.php
lib/editor/tinymce/adminlib.php
lib/pluginlib.php
lib/tests/fixtures/mockplugins/mod/baz/meg/one/version.php [new file with mode: 0644]
lib/tests/fixtures/mockplugins/mod/baz/version.php [new file with mode: 0644]
lib/tests/fixtures/mockplugins/mod/foo/lish/hippo/version.php [new file with mode: 0644]
lib/tests/fixtures/mockplugins/mod/foo/version.php
lib/tests/fixtures/mockplugins/mod/qux/cat/one/version.php [new file with mode: 0644]
lib/tests/fixtures/mockplugins/mod/qux/version.php [new file with mode: 0644]
lib/tests/pluginlib_test.php
lib/upgrade.txt