Skip to content

Commit

Permalink
MDL-29029 add new "Admin tool" plugin type
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 17, 2011
1 parent 9cfaebb commit 11b24ce
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions admin/settings/plugins.php
Expand Up @@ -474,6 +474,13 @@
$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) {
Expand Down
2 changes: 2 additions & 0 deletions lang/en/plugin.php
Expand Up @@ -98,6 +98,8 @@
$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';
Expand Down
4 changes: 3 additions & 1 deletion lib/moodlelib.php
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions lib/pluginlib.php
Expand Up @@ -366,6 +366,9 @@ public static function standard_plugins_list($type) {
'standardold'
),

'tool' => array(
),

'webservice' => array(
'amf', 'rest', 'soap', 'xmlrpc'
),
Expand Down

0 comments on commit 11b24ce

Please sign in to comment.