]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17372 admin reports: Added full plugin support for admin reports - fixed sorting...
authorskodak <skodak>
Fri, 28 Nov 2008 08:04:23 +0000 (08:04 +0000)
committerskodak <skodak>
Fri, 28 Nov 2008 08:04:23 +0000 (08:04 +0000)
admin/settings/plugins.php
admin/settings/report.php [deleted file]
admin/settings/top.php
admin/settings/users.php
lib/adminlib.php

index 9b21688cca11cb2423d07f30a5ff9fd938509741..265931c7342689c8facf241251e1af914fb36865 100644 (file)
@@ -1,5 +1,9 @@
 <?php  //$Id$
 
+/*
+ * Please note that is file is always loaded last - it means that you can inject entries into other categories too.
+ */
+
 if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
 
     require_once($CFG->libdir. '/portfoliolib.php');
@@ -260,3 +264,22 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
         }
     }
 }
+
+
+/// Now add reports
+
+foreach (get_list_of_plugins($CFG->admin.'/report') as $plugin) {
+    $settings_path = "$CFG->dirroot/$CFG->admin/report/$plugin/settings.php";
+    if (file_exists($settings_path)) {
+        include($settings_path);
+        continue;
+    }
+
+    $index_path = "$CFG->dirroot/$CFG->admin/report/$plugin/index.php";
+    if (!file_exists($index_path)) {
+        continue;
+    }
+    // old style 3rd party plugin without settings.php
+    $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $plugin, $index_path, 'moodle/site:viewreports'));
+}
+
diff --git a/admin/settings/report.php b/admin/settings/report.php
deleted file mode 100644 (file)
index 790d0d7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php //$Id$
-
-foreach (get_list_of_plugins($CFG->admin.'/report') as $plugin) {
-    $settings_path = "$CFG->dirroot/$CFG->admin/report/$plugin/settings.php";
-    if (file_exists($settings_path)) {
-        include($settings_path);
-        continue;
-    }
-
-    $index_path = "$CFG->dirroot/$CFG->admin/report/$plugin/index.php";
-    if (!file_exists($index_path)) {
-        continue;
-    }
-    // old style 3rd party plugin without settings.php
-    $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $plugin, $index_path, 'moodle/site:viewreports'));
-}
-
-?>
index b09703ee1b0fdc5f2a4200aa815a65a0f3f31d98..f179cda7a5ef96840e407d97f0555a98738c11f1 100644 (file)
@@ -24,9 +24,6 @@ if ($hassiteconfig) {
 }
 
 $ADMIN->add('root', new admin_category('users', get_string('users','admin')));
-  $ADMIN->add('users', new admin_category('authsettings', get_string('authentication','admin')));
-  $ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
-  $ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
 $ADMIN->add('root', new admin_category('courses', get_string('courses','admin')));
 $ADMIN->add('root', new admin_category('grades', get_string('grades')));
 $ADMIN->add('root', new admin_category('location', get_string('location','admin')));
index 17de059d2e63f5e171dc9649ac4490773422e6f2..f703294c9ddd632129f4615c01e22f6f7936d416 100644 (file)
@@ -11,6 +11,8 @@ if ($hassiteconfig
  or has_capability('moodle/role:assign', $systemcontext)) { // speedup for non-admins, add all caps used on this page
 
 
+    $ADMIN->add('users', new admin_category('authsettings', get_string('authentication','admin')));
+
     $temp = new admin_settingpage('manageauths', get_string('authsettings', 'admin'));
     $temp->add(new admin_setting_manageauths());
     $temp->add(new admin_setting_heading('manageauthscommonheading', get_string('commonsettings', 'admin'), ''));
@@ -68,6 +70,7 @@ if ($hassiteconfig
         $securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
     }
     // stuff under the "accounts" subcategory
+    $ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
     $ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
     $ADMIN->add('accounts', new admin_externalpage('userbulk', get_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
     $ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
@@ -77,6 +80,7 @@ if ($hassiteconfig
 
 
     // stuff under the "roles" subcategory
+    $ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
 
     // "userpolicies" settingpage
     $temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin'));
index 027452dc19f4936bf89031dbccdcdd923f46881f..3b56e1d28e1b006e840fc39172d5932dbfd376fc 100644 (file)
@@ -5378,10 +5378,16 @@ function &admin_get_root($reload=false, $requirefulltree=true) {
 
         // now we process all other files in admin/settings to build the admin tree
         foreach (glob($CFG->dirroot.'/'.$CFG->admin.'/settings/*.php') as $file) {
-            if ($file != $CFG->dirroot.'/'.$CFG->admin.'/settings/top.php') {
-                include($file);
+            if ($file == $CFG->dirroot.'/'.$CFG->admin.'/settings/top.php') {
+                continue;
+            }
+            if ($file == $CFG->dirroot.'/'.$CFG->admin.'/settings/plugins.php') {
+                // plugins are loaded last - they may insert pages anywhere
+                continue;
             }
+            include($file);
         }
+        include($CFG->dirroot.'/'.$CFG->admin.'/settings/plugins.php');
 
         if (file_exists($CFG->dirroot.'/local/settings.php')) {
             include_once($CFG->dirroot.'/local/settings.php');