MDL-33041 (1) Add subplugin support for 'editor' plugins

This commit is contained in:
sam marshall
2012-08-10 14:57:57 +02:00
committed by Petr Škoda
parent 87e9331d93
commit c57fc98b27
3 changed files with 28 additions and 21 deletions
+5 -4
View File
@@ -123,11 +123,12 @@ define('INSECURE_DATAROOT_ERROR', 2);
function uninstall_plugin($type, $name) {
global $CFG, $DB, $OUTPUT;
// recursively uninstall all module subplugins first
if ($type === 'mod') {
if (file_exists("$CFG->dirroot/mod/$name/db/subplugins.php")) {
// recursively uninstall all module/editor subplugins first
if ($type === 'mod' || $type === 'editor') {
$base = get_component_directory($type . '_' . $name);
if (file_exists("$base/db/subplugins.php")) {
$subplugins = array();
include("$CFG->dirroot/mod/$name/db/subplugins.php");
include("$base/db/subplugins.php");
foreach ($subplugins as $subplugintype=>$dir) {
$instances = get_plugin_list($subplugintype);
foreach ($instances as $subpluginname => $notusedpluginpath) {