]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16348 Reorganise admin tree:
authortjhunt <tjhunt>
Mon, 8 Sep 2008 11:32:31 +0000 (11:32 +0000)
committertjhunt <tjhunt>
Mon, 8 Sep 2008 11:32:31 +0000 (11:32 +0000)
* New Capability report put under Users -> Permissions
* Miscellaneous category renamed to Development
* Unit tests and Functional DB test moved to be under Development.
* The hard-coded hack that was used to change the permission that controls the Backups and stats reports replaced with settings.php files.
* There were two hidden Miscellaneous things in the old category, so I moved them. Multilan upgrade now under Lanuages, and Online assignment cleanup now under Plugins -> Activity modules. Both still hidden.

There was already a way for admin report plugins to control where they appeared in the tree, but it was not documented, so see http://docs.moodle.org/en/Development:Admin_reports

admin/report/backups/settings.php [new file with mode: 0644]
admin/report/capability/settings.php [new file with mode: 0644]
admin/report/simpletest/settings.php
admin/report/stats/settings.php [new file with mode: 0644]
admin/settings/development.php [moved from admin/settings/misc.php with 67% similarity]
admin/settings/language.php
admin/settings/plugins.php
admin/settings/top.php
lang/en_utf8/admin.php
lib/adminlib.php

diff --git a/admin/report/backups/settings.php b/admin/report/backups/settings.php
new file mode 100644 (file)
index 0000000..e80322b
--- /dev/null
@@ -0,0 +1,3 @@
+<?php  // $Id$
+$ADMIN->add('reports', new admin_externalpage('reportbackups', get_string('backups', 'admin'), "$CFG->wwwroot/$CFG->admin/report/backups/index.php",'moodle/site:backup'));
+?>
\ No newline at end of file
diff --git a/admin/report/capability/settings.php b/admin/report/capability/settings.php
new file mode 100644 (file)
index 0000000..0a1eeb3
--- /dev/null
@@ -0,0 +1,3 @@
+<?php  // $Id$
+$ADMIN->add('roles', new admin_externalpage('reportcapability', get_string('capability', 'report_capability'), "$CFG->wwwroot/$CFG->admin/report/capability/index.php",'moodle/role:manage'));
+?>
\ No newline at end of file
index 437a2788d445f5ff6246f3916cbc75073073112c..375f952e2b45681b39eb606d9e30b2ae7fb3a9bd 100644 (file)
@@ -1,10 +1,3 @@
 <?php  //$Id$
-
-$reportname = get_string('simpletest', 'report_simpletest');
-if ($reportname[1] == '[') {
-    $reportname = get_string('simpletest', 'admin');
-}
-$ADMIN->add('reports', new admin_externalpage('reportsimpletest', $reportname, "$CFG->wwwroot/$CFG->admin/report/simpletest/index.php",'moodle/site:config'));
-
-//TODO: localise
-$ADMIN->add('reports', new admin_externalpage('reportdbtest', 'Functional DB tests', "$CFG->wwwroot/$CFG->admin/report/simpletest/dbtest.php",'moodle/site:config'));
+$ADMIN->add('development', new admin_externalpage('reportsimpletest', get_string('simpletest', 'admin'), "$CFG->wwwroot/$CFG->admin/report/simpletest/index.php",'moodle/site:config'));
+$ADMIN->add('development', new admin_externalpage('reportdbtest', get_string('dbtest', 'admin'), "$CFG->wwwroot/$CFG->admin/report/simpletest/dbtest.php",'moodle/site:config'));
\ No newline at end of file
diff --git a/admin/report/stats/settings.php b/admin/report/stats/settings.php
new file mode 100644 (file)
index 0000000..beb5c03
--- /dev/null
@@ -0,0 +1,5 @@
+<?php  // $Id$
+if (!empty($CFG->enablestats)) {
+    $ADMIN->add('reports', new admin_externalpage('reportstats', get_string('stats', 'admin'), "$CFG->wwwroot/$CFG->admin/report/stats/index.php",'moodle/site:viewreports'));
+}
+?>
\ No newline at end of file
similarity index 67%
rename from admin/settings/misc.php
rename to admin/settings/development.php
index 21ef81e0d4d3f3ecf74e859e20f8434534ec852f..c246d3980ed53c01cb4c1eafcb1b95fc03a5b7ff 100644 (file)
@@ -5,7 +5,7 @@
 if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
 
     // Experimental settings page
-    $ADMIN->add('misc', new admin_category('experimental', get_string('experimental','admin')));
+    $ADMIN->add('development', new admin_category('experimental', get_string('experimental','admin')));
 
     $temp = new admin_settingpage('experimentalsettings', get_string('experimentalsettings', 'admin'));
     $temp->add(new admin_setting_configcheckbox('enableglobalsearch', get_string('enableglobalsearch', 'admin'), get_string('configenableglobalsearch', 'admin'), 0));
@@ -22,16 +22,11 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $ADMIN->add('experimental', $temp);
 
     // DB transfer related pages
-    $ADMIN->add('experimental', new admin_externalpage('dbtransfer', get_string('dbtransfer', 'dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/dbtransfer/index.php', 'moodle/site:config', false));
-    $ADMIN->add('experimental', new admin_externalpage('dbexport', get_string('dbexport', 'dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/dbtransfer/dbexport.php', 'moodle/site:config', false));
+    $ADMIN->add('experimental', new admin_externalpage('dbtransfer', get_string('dbtransfer', 'dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/dbtransfer/index.php', 'moodle/site:config'));
+    $ADMIN->add('experimental', new admin_externalpage('dbexport', get_string('dbexport', 'dbtransfer'), $CFG->wwwroot.'/'.$CFG->admin.'/dbtransfer/dbexport.php', 'moodle/site:config'));
 
     // XMLDB editor
-    $ADMIN->add('misc', new admin_externalpage('xmldbeditor', get_string('xmldbeditor'), "$CFG->wwwroot/$CFG->admin/xmldb/"));
-
-
-    // hidden scripts linked from elsewhere
-    $ADMIN->add('misc', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot.'/'.$CFG->admin.'/oacleanup.php', 'moodle/site:config', true));
-    $ADMIN->add('misc', new admin_externalpage('multilangupgrade', get_string('multilangupgrade', 'admin'), $CFG->wwwroot.'/'.$CFG->admin.'/multilangupgrade.php', 'moodle/site:config', !empty($CFG->filter_multilang_converted)));
+    $ADMIN->add('development', new admin_externalpage('xmldbeditor', get_string('xmldbeditor'), "$CFG->wwwroot/$CFG->admin/xmldb/"));
 
 } // end of speedup
 
index 51fd03c8aed2f7075b6b13fc13e8394b12d3169e..3c82865013e8a8c0002e301e6ad696b9860d5a93 100644 (file)
@@ -14,16 +14,16 @@ if ($hassiteconfig
     $temp->add(new admin_setting_langlist());
     $temp->add(new admin_setting_configcheckbox('langcache', get_string('langcache', 'admin'), get_string('configlangcache', 'admin'), 1));
     $temp->add(new admin_setting_configtext('locale', get_string('localetext', 'admin'), get_string('configlocale', 'admin'), '', PARAM_FILE));
-
-    // new CFG variable for excel encoding
     $temp->add(new admin_setting_configselect('latinexcelexport', get_string('latinexcelexport', 'admin'), get_string('configlatinexcelexport', 'admin'), '0', array('0'=>'Unicode','1'=>'Latin')));
 
-
     $ADMIN->add('language', $temp);
 
     $ADMIN->add('language', new admin_externalpage('langedit', get_string('langedit', 'admin'), "$CFG->wwwroot/$CFG->admin/lang.php", array('moodle/site:langeditmaster', 'moodle/site:langeditlocal') ));
     $ADMIN->add('language', new admin_externalpage('langimport', get_string('langpacks', 'admin'), "$CFG->wwwroot/$CFG->admin/langimport.php"));
 
+    // Hidden multilang upgrade page.
+    $ADMIN->add('language', new admin_externalpage('multilangupgrade', get_string('multilangupgrade', 'admin'), $CFG->wwwroot.'/'.$CFG->admin.'/multilangupgrade.php', 'moodle/site:config', !empty($CFG->filter_multilang_converted)));
+
 } // end of speedup
 
 ?>
index e24c59ceb1dbc16e574e10d4ebe0fcca4335b37d..20e31f91bb340e2c84752bea8fe136360fd9badd 100644 (file)
@@ -33,6 +33,8 @@ if ($hassiteconfig) {
         }
     }
 
+    // hidden script for converting journals to online assignments (or something like that) linked from elsewhere
+    $ADMIN->add('modsettings', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot.'/'.$CFG->admin.'/oacleanup.php', 'moodle/site:config', true));
 
     $ADMIN->add('modules', new admin_category('blocksettings', get_string('blocks')));
     $ADMIN->add('blocksettings', new admin_page_manageblocks());
index 782ce434292754a7e7d4863ce313d999607fb65b..e295eae03510e220becb9205791203aa3f29db1c 100644 (file)
@@ -33,34 +33,11 @@ $ADMIN->add('root', new admin_category('security', get_string('security','admin'
 $ADMIN->add('root', new admin_category('appearance', get_string('appearance','admin')));
 $ADMIN->add('root', new admin_category('frontpage', get_string('frontpage','admin')));
 $ADMIN->add('root', new admin_category('server', get_string('server','admin')));
-
 $ADMIN->add('root', new admin_category('mnet', get_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
-
 $ADMIN->add('root', new admin_category('reports', get_string('reports')));
-foreach (get_list_of_plugins($CFG->admin.'/report') as $plugin) {
-    $settingsfile = "$CFG->dirroot/$CFG->admin/report/$plugin/settings.php";
-    if (file_exists($settingsfile)) {
-        include($settingsfile);
-    } else {
-        $reportname = get_string($plugin, 'report_' . $plugin);
-        if ($reportname[1] == '[') {
-            $reportname = get_string($plugin, 'admin');
-        }
-        // ugly hack for special access control in reports
-        switch($plugin) {
-            case 'backups': $cap = 'moodle/site:backup'; break;
-            case 'stats': if (empty($CFG->enablestats)) {continue 2;};
-            default: $cap = 'moodle/site:viewreports';
-        }
-        $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",$cap));
-    }
-}
-
-$ADMIN->add('root', new admin_category('misc', get_string('miscellaneous')));
-
+$ADMIN->add('root', new admin_category('development', get_string('development', 'admin')));
 // hidden unsupported category
 $ADMIN->add('root', new admin_category('unsupported', get_string('unsupported', 'admin'), true));
-
 // hidden search script
 $ADMIN->add('root', new admin_externalpage('search', get_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
 
index 88f29d7f064e17d76138dcba82fd8996ab5fa9c1..79b364da577238309c0c94435c6e0a5e556c2fa1 100644 (file)
@@ -308,6 +308,7 @@ $string['deleteunconfirmed'] = 'Delete not fully setup users after';
 $string['deleteuser'] = 'Delete user';
 $string['density'] = 'Density';
 $string['denyemailaddresses'] = 'Denied email domains';
+$string['development'] = 'Development';
 $string['digestmailtime'] = 'Hour to send digest emails';
 $string['disablecourseajax'] = 'Disable AJAX course editing';
 $string['disableuserimages'] = 'Disable User Profile Images';
@@ -659,6 +660,7 @@ $string['sessionhandling'] = 'Session Handling';
 $string['sessiontimeout'] = 'Timeout';
 $string['showblocksonmodpages'] = 'Show blocks on module pages';
 $string['simpletest'] = 'Unit tests';
+$string['dbtest'] = 'Functional DB tests';
 $string['sitelangchanged'] = 'Site language setting changed successfully';
 $string['sitemailcharset'] = 'Character set';
 $string['sitemaintenance'] = 'The site is undergoing maintenance and is currently not available';
index b72c2f98939044618452fd590bd5146dd2b51a2e..f9b653c01f383d7f852c40349fc517b7b31e858b 100644 (file)
@@ -4950,6 +4950,22 @@ function &admin_get_root($reload=false, $requirefulltree=true) {
                 include($file);
             }
         }
+
+        // Add all the report plugings. Do this last so they can choose where in the tree
+        // they want to be added.
+        foreach (get_list_of_plugins($CFG->admin.'/report') as $plugin) {
+            $settingsfile = "$CFG->dirroot/$CFG->admin/report/$plugin/settings.php";
+            if (file_exists($settingsfile)) {
+                include($settingsfile);
+            } else {
+                $reportname = get_string($plugin, 'report_' . $plugin);
+                if ($reportname[1] == '[') {
+                    $reportname = get_string($plugin, 'admin');
+                }
+                $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",'moodle/site:viewreports'));
+            }
+        }
+
         if (file_exists($CFG->dirroot.'/local/settings.php')) {
             include_once($CFG->dirroot.'/local/settings.php');
         }