MDL-29029 add new "Admin tool" plugin type

This commit is contained in:
Petr Skoda 2011-09-17 08:43:58 +02:00
parent 9cfaebbd0e
commit 11b24ce7b2
4 changed files with 15 additions and 1 deletions

View File

@ -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) {

View File

@ -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';

View File

@ -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) {

View File

@ -366,6 +366,9 @@ class plugin_manager {
'standardold'
),
'tool' => array(
),
'webservice' => array(
'amf', 'rest', 'soap', 'xmlrpc'
),