mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Added a Grades section to the Admin menu. It dynamically checks the plugins for settings.php files to define global settings. MDL-10210
This commit is contained in:
parent
d30c99c107
commit
28e2c55641
@ -47,9 +47,5 @@ $temp->add(new admin_setting_special_backuptime());
|
||||
$temp->add(new admin_setting_special_backupsaveto());
|
||||
$ADMIN->add('courses', $temp);
|
||||
|
||||
// new CFG variable for coursemanager (what roles to display)
|
||||
$temp = new admin_settingpage('grades', get_string('grades'));
|
||||
$temp->add(new admin_setting_special_gradeexport());
|
||||
$ADMIN->add('courses', $temp);
|
||||
|
||||
?>
|
||||
|
73
admin/settings/grades.php
Normal file
73
admin/settings/grades.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php // $Id$
|
||||
|
||||
// This file defines settingpages and externalpages under the "grades" section
|
||||
|
||||
// General settings
|
||||
|
||||
$temp = new admin_settingpage('gradessettings', get_string('gradessettings'));
|
||||
$temp->add(new admin_setting_special_gradeexport());
|
||||
$ADMIN->add('grades', $temp);
|
||||
|
||||
|
||||
// The plugins must implement a settings.php file that adds their admin settings to the $settings object
|
||||
|
||||
// Reports
|
||||
|
||||
$first = true;
|
||||
foreach (get_list_of_plugins('grade/report') as $plugin) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($CFG->dirroot.'/grade/report/'.$plugin.'/settings.php')) {
|
||||
if ($first) {
|
||||
$ADMIN->add('grades', new admin_category('gradereports', get_string('reports')));
|
||||
$first = false;
|
||||
}
|
||||
|
||||
$settings = new admin_settingpage('gradereport'.$plugin, get_string('modulename', 'gradereport_'.$plugin));
|
||||
|
||||
include_once($CFG->dirroot.'/grade/report/'.$plugin.'/settings.php');
|
||||
|
||||
$ADMIN->add('gradereports', $settings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Imports
|
||||
|
||||
$first = true;
|
||||
foreach (get_list_of_plugins('grade/import') as $plugin) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($CFG->dirroot.'/grade/import/'.$plugin.'/settings.php')) {
|
||||
if ($first) {
|
||||
$ADMIN->add('grades', new admin_category('gradeimports', get_string('imports')));
|
||||
$first = false;
|
||||
}
|
||||
|
||||
$settings = new admin_settingpage('gradeimport'.$plugin, get_string('modulename', 'gradeimport_'.$plugin));
|
||||
|
||||
include_once($CFG->dirroot.'/grade/import/'.$plugin.'/settings.php');
|
||||
|
||||
$ADMIN->add('gradeimports', $settings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Exports
|
||||
|
||||
$first = true;
|
||||
foreach (get_list_of_plugins('grade/export') as $plugin) {
|
||||
// Include all the settings commands for this plugin if there are any
|
||||
if (file_exists($CFG->dirroot.'/grade/export/'.$plugin.'/settings.php')) {
|
||||
if ($first) {
|
||||
$ADMIN->add('grades', new admin_category('gradeexports', get_string('exports')));
|
||||
$first = false;
|
||||
}
|
||||
|
||||
$settings = new admin_settingpage('gradeexport'.$plugin, get_string('modulename', 'gradeexport_'.$plugin));
|
||||
|
||||
include_once($CFG->dirroot.'/grade/export/'.$plugin.'/settings.php');
|
||||
|
||||
$ADMIN->add('gradeexports', $settings);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -15,6 +15,7 @@ $ADMIN->add('root', new admin_externalpage('search', get_string('search', 'admin
|
||||
|
||||
$ADMIN->add('root', new admin_category('users', get_string('users','admin')));
|
||||
$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')));
|
||||
$ADMIN->add('root', new admin_category('language', get_string('language')));
|
||||
|
||||
|
7
grade/report/grader/settings.php
Normal file
7
grade/report/grader/settings.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php // $Id$
|
||||
|
||||
/// Add settings for this module to the $settings object (it's already defined)
|
||||
|
||||
$settings->add(new admin_setting_configcheckbox('gradereport_grader_enableajax', 'Enable AJAX in gradebook', 'This setting will enable the AJAX interface in the gradebooks, depending on the site setting and the individual user profile choice.', 1));
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user