mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-17372 admin reports: Added full plugin support for admin reports - fixed sorting regression, plugins now loaded as last category
This commit is contained in:
parent
86ed86b8dd
commit
b63a6a6338
@ -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'));
|
||||
}
|
||||
|
||||
|
@ -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'));
|
||||
}
|
||||
|
||||
?>
|
@ -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')));
|
||||
|
@ -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'));
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user