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:
moodler 2007-07-04 09:34:17 +00:00
parent d30c99c107
commit 28e2c55641
4 changed files with 81 additions and 4 deletions

View File

@ -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
View 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);
}
}
?>

View File

@ -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')));

View 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));
?>