Merge branch 'w36_MDL-41267_m26_toolsubplugins' of https://github.com/skodak/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 3 Sep 2013 23:08:37 +0000 (01:08 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 3 Sep 2013 23:08:37 +0000 (01:08 +0200)
Conflicts:
lib/upgrade.txt

lib/classes/component.php
lib/upgrade.txt

index 0fa7c30..d5ec8ac 100644 (file)
@@ -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;
index 61f80d1..e58fe6d 100644 (file)
@@ -21,6 +21,7 @@ information provided here is intended especially for developers.
 * Function moveto_module() does not modify $mod argument and instead now returns the new module visibility value.
 * Use behat_selectors::get_allowed_text_selectors() and behat_selectors::get_allowed_selectors() instead of
   behat_command::$allowedtextselectors and behat_command::$allowedselectors
+* Subplugins are supported in admin tools and local plugins.
 
 DEPRECATIONS:
 Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices