]> git.mjollnir.org Git - moodle.git/commitdiff
Added a Grades section to the Admin menu. It dynamically checks the plugins for...
authormoodler <moodler>
Wed, 4 Jul 2007 09:34:17 +0000 (09:34 +0000)
committermoodler <moodler>
Wed, 4 Jul 2007 09:34:17 +0000 (09:34 +0000)
admin/settings/courses.php
admin/settings/grades.php [new file with mode: 0644]
admin/settings/top.php
grade/report/grader/settings.php [new file with mode: 0644]

index 7b75c29aadcfc08d8b5c2fc6a974e620122de2b3..c08e9eb17169a6c997c05a013882713d5463e455 100644 (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);
 
 ?>
diff --git a/admin/settings/grades.php b/admin/settings/grades.php
new file mode 100644 (file)
index 0000000..e7b3826
--- /dev/null
@@ -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);
+    }
+}
+
+?>
index e538b68c313ebc41612ab5ba2ec232f3e2715893..315b79afb550aa47905e2acca64fa98fda9f5768 100644 (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')));
 
diff --git a/grade/report/grader/settings.php b/grade/report/grader/settings.php
new file mode 100644 (file)
index 0000000..3563220
--- /dev/null
@@ -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));
+
+?>