From ac2b2713bacc0542b992f3b2037c1976b418d965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Sat, 24 Aug 2013 18:32:45 +0200 Subject: [PATCH] MDL-41267 add support for subplugins in admin tools --- lib/classes/component.php | 5 ++++- lib/upgrade.txt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/classes/component.php b/lib/classes/component.php index 0fa7c30d5fe..d5ec8ac8597 100644 --- a/lib/classes/component.php +++ b/lib/classes/component.php @@ -31,7 +31,7 @@ class core_component { /** @var array list of ignored directories - watch out for auth/db exception */ protected static $ignoreddirs = array('CVS'=>true, '_vti_cnf'=>true, 'simpletest'=>true, 'db'=>true, 'yui'=>true, 'tests'=>true, 'classes'=>true, 'fonts'=>true); /** @var array list plugin types that support subplugins, do not add more here unless absolutely necessary */ - protected static $supportsubplugins = array('mod', 'editor', 'local'); + protected static $supportsubplugins = array('mod', 'editor', 'tool', 'local'); /** @var null cache of plugin types */ protected static $plugintypes = null; @@ -429,6 +429,9 @@ $cache = '.var_export($cache, true).'; error_log("Invalid subtype '$subtype'' detected in '$ownerdir', duplicates core subsystem."); continue; } + if ($CFG->admin !== 'admin' and strpos($dir, 'admin/') === 0) { + $dir = preg_replace('|^admin/|', "$CFG->admin/", $dir); + } if (!is_dir("$CFG->dirroot/$dir")) { error_log("Invalid subtype directory '$dir' detected in '$ownerdir'."); continue; diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 2e017654204..964b5cee962 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -19,6 +19,7 @@ information provided here is intended especially for developers. * Use $CFG->debugdeveloper instead of debugging('', DEBUG_DEVELOPER). * Use set_debugging(DEBUG_xxx) when changing debugging level for current request. * Function moveto_module() does not modify $mod argument and instead now returns the new module visibility value. +* Subplugins are supported in admin tools and local plugins. DEPRECATIONS: Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices