Added a Grades section to the Admin menu. It dynamically checks the plugins for...
[moodle.git] / admin / settings / grades.php
CommitLineData
28e2c556 1<?php // $Id$
2
3// This file defines settingpages and externalpages under the "grades" section
4
5// General settings
6
7$temp = new admin_settingpage('gradessettings', get_string('gradessettings'));
8$temp->add(new admin_setting_special_gradeexport());
9$ADMIN->add('grades', $temp);
10
11
12// The plugins must implement a settings.php file that adds their admin settings to the $settings object
13
14// Reports
15
16$first = true;
17foreach (get_list_of_plugins('grade/report') as $plugin) {
18 // Include all the settings commands for this plugin if there are any
19 if (file_exists($CFG->dirroot.'/grade/report/'.$plugin.'/settings.php')) {
20 if ($first) {
21 $ADMIN->add('grades', new admin_category('gradereports', get_string('reports')));
22 $first = false;
23 }
24
25 $settings = new admin_settingpage('gradereport'.$plugin, get_string('modulename', 'gradereport_'.$plugin));
26
27 include_once($CFG->dirroot.'/grade/report/'.$plugin.'/settings.php');
28
29 $ADMIN->add('gradereports', $settings);
30 }
31}
32
33
34// Imports
35
36$first = true;
37foreach (get_list_of_plugins('grade/import') as $plugin) {
38 // Include all the settings commands for this plugin if there are any
39 if (file_exists($CFG->dirroot.'/grade/import/'.$plugin.'/settings.php')) {
40 if ($first) {
41 $ADMIN->add('grades', new admin_category('gradeimports', get_string('imports')));
42 $first = false;
43 }
44
45 $settings = new admin_settingpage('gradeimport'.$plugin, get_string('modulename', 'gradeimport_'.$plugin));
46
47 include_once($CFG->dirroot.'/grade/import/'.$plugin.'/settings.php');
48
49 $ADMIN->add('gradeimports', $settings);
50 }
51}
52
53
54// Exports
55
56$first = true;
57foreach (get_list_of_plugins('grade/export') as $plugin) {
58 // Include all the settings commands for this plugin if there are any
59 if (file_exists($CFG->dirroot.'/grade/export/'.$plugin.'/settings.php')) {
60 if ($first) {
61 $ADMIN->add('grades', new admin_category('gradeexports', get_string('exports')));
62 $first = false;
63 }
64
65 $settings = new admin_settingpage('gradeexport'.$plugin, get_string('modulename', 'gradeexport_'.$plugin));
66
67 include_once($CFG->dirroot.'/grade/export/'.$plugin.'/settings.php');
68
69 $ADMIN->add('gradeexports', $settings);
70 }
71}
72
73?>