diff --git a/admin/settings/plugins.php b/admin/settings/plugins.php index 0e86f80d6df..d1016e3e4e4 100644 --- a/admin/settings/plugins.php +++ b/admin/settings/plugins.php @@ -474,6 +474,13 @@ foreach (get_plugin_list('report') as $plugin => $plugindir) { $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, $www_path, 'moodle/site:viewreports')); } +// Now add various admin tools +foreach (get_plugin_list('tool') as $plugin => $plugindir) { + $settings_path = "$plugindir/settings.php"; + if (file_exists($settings_path)) { + include($settings_path); + } +} /// Add all local plugins - must be always last! if ($hassiteconfig) { diff --git a/lang/en/plugin.php b/lang/en/plugin.php index b9c0a166e8e..2c82c4e2c6b 100644 --- a/lang/en/plugin.php +++ b/lang/en/plugin.php @@ -98,6 +98,8 @@ $string['type_repository'] = 'Repository'; $string['type_repository_plural'] = 'Repositories'; $string['type_theme'] = 'Theme'; $string['type_theme_plural'] = 'Themes'; +$string['type_tool'] = 'Admin tool'; +$string['type_tool_plural'] = 'Admin tools'; $string['type_webservice'] = 'Webservice protocol'; $string['type_webservice_plural'] = 'Webservice protocols'; $string['uninstall'] = 'Uninstall'; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 52064ad2a2e..619f97a9156 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -7294,7 +7294,9 @@ function get_plugin_types($fullpaths=true) { 'qbehaviour' => 'question/behaviour', 'qformat' => 'question/format', 'plagiarism' => 'plagiarism', - 'theme' => 'theme'); // this is a bit hacky, themes may be in $CFG->themedir too + 'tool' => $CFG->admin.'/tool', + 'theme' => 'theme', // this is a bit hacky, themes may be in $CFG->themedir too + ); $mods = get_plugin_list('mod'); foreach ($mods as $mod => $moddir) { diff --git a/lib/pluginlib.php b/lib/pluginlib.php index 80d6088334d..1d88d2f36ae 100644 --- a/lib/pluginlib.php +++ b/lib/pluginlib.php @@ -366,6 +366,9 @@ class plugin_manager { 'standardold' ), + 'tool' => array( + ), + 'webservice' => array( 'amf', 'rest', 'soap', 'xmlrpc' ),