]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18004 Combined the two admin settings into one dropdown
authornicolasconnault <nicolasconnault>
Thu, 12 Feb 2009 11:00:16 +0000 (11:00 +0000)
committernicolasconnault <nicolasconnault>
Thu, 12 Feb 2009 11:00:16 +0000 (11:00 +0000)
admin/settings/grades.php
grade/lib.php
lang/en_utf8/grades.php
lib/grade/constants.php

index 6da457bb4660e236f68a8b38d8f72d505db03b1c..50862f3b8e55131c54e641579da6fb1dc4ae2c9b 100644 (file)
@@ -52,8 +52,11 @@ if (has_capability('moodle/grade:manage', $systemcontext)
                                                          '3' => '3',
                                                          '4' => '4',
                                                          '5' => '5')));
-        $temp->add(new admin_setting_configcheckbox('grade_shownavmenu', get_string('shownavmenu', 'grades'), get_string('configshownavmenu', 'grades'), 1));
-        $temp->add(new admin_setting_configcheckbox('grade_showtabs', get_string('showtabs', 'grades'), get_string('configshowtabs', 'grades'), 0));
+        $temp->add(new admin_setting_configselect('grade_navmethod', get_string('navmethod', 'grades'), null, 0,
+                                                  array(GRADE_NAVMETHOD_DROPDOWN => get_string('dropdown', 'grades'),
+                                                        GRADE_NAVMETHOD_TABS => get_string('tabs', 'grades'),
+                                                        GRADE_NAVMETHOD_COMBO => get_string('combo', 'grades'))));
+
         $temp->add(new admin_setting_special_gradeexport());
     }
     $ADMIN->add('grades', $temp);
index 50fd597db7978bff014a603efa5b440aecb70ea1..90ee91cbc0053caca94175a3294850e9d522a793 100644 (file)
@@ -661,12 +661,12 @@ function print_grade_page_head($courseid, $active_type, $active_plugin=null, $he
         $heading = $stractive_plugin;
     }
 
-    if ($CFG->grade_shownavmenu) {
+    if ($CFG->grade_method == GRADE_NAVMETHOD_COMBO || $CFG->grade_method == GRADE_NAVMETHOD_DROPDOWN) {
         $returnval .= print_grade_plugin_selector($plugin_info, $return);
     }
     $returnval .= print_heading($heading);
 
-    if ($CFG->grade_showtabs) {
+    if ($CFG->grade_method == GRADE_NAVMETHOD_COMBO || $CFG->grade_method == GRADE_NAVMETHOD_TABS) {
         $returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return, $preferences_page_url);
     }
 
index be905b6d97bb8c025ed5a560d9682ed5f8824535..9197ddf15f3b7805d42870c53b45b0f8f4e7a75c 100644 (file)
@@ -52,6 +52,7 @@ $string['badgrade'] = 'Supplied grade is invalid';
 $string['badlyformattedscale'] = 'Please enter a comma-separated list of values (at least two values required).';
 $string['baduser'] = 'Supplied user is invalid';
 $string['bonuspoints'] = 'Bonus points';
+$string['combo'] = 'Tabs and Dropdown';
 $string['bulkcheckboxes'] = 'Bulk checkboxes';
 $string['calculatedgrade'] = 'Calculated grade';
 $string['calculation'] = 'Calculation';
@@ -106,12 +107,10 @@ $string['configshowgroups'] = 'Whether to show the mean for each group.';
 $string['configshowhiddenitems'] = 'Specifies how hidden grade items are shown. If Hide is selected, they are hidden completely. If Show is selected, the hidden grade item row is shown in grey with the grade hidden completely. If \"Only hidden until\" is selected, grade items with a \"hide until\" date set are shown in grey with the grades hidden completely until the set date, after which the whole item is shown.';
 $string['configshowlocks'] = 'Whether to show a lock/unlock icon near each grade.';
 $string['configshowfeedback'] = 'Whether to show a feedback icon (for adding/editing) near each grade.';
-$string['configshownavmenu'] = 'Whether to show a drop-down menu for quick navigation to various gradebook pages. ';
 $string['configshownumberofgrades'] = 'Whether to show the number of grades used when calculating the mean in brackets after each average, for example 45 (34).';
 $string['configshowranges'] = 'Whether to show the range of grades for each column in an additional row.';
 $string['configshowpercentage'] = 'Whether to show the percentage value of each grade item.';
 $string['configshowrank'] = 'Whether to show the position of the user in relation to the rest of the class, for each grade item.';
-$string['configshowtabs'] = 'Whether to show tabs for navigating to various gradebook pages. Tabs are an alternative gradebook navigation method from the \"Choose an action\" dropdown menu.';
 $string['configshowuseridnumber'] = 'Whether to show user id numbers in an additional column.';
 $string['configshowuserimage'] = 'Whether to show the user\'s profile image next to the name in the grader report.';
 $string['configstudentsperpage'] = 'The number of students to display per page in the grader report.';
@@ -140,6 +139,7 @@ $string['displaylettergrade'] = 'Display letter grades';
 $string['displaypercent'] = 'Display percents';
 $string['displaypoints'] = 'Display points';
 $string['displayweighted'] = 'Display weighted grades';
+$string['dropdown'] = 'Dropdown';
 $string['droplow'] = 'Drop the lowest';
 $string['droplowhelp'] = 'If set, this option will drop the X lowest grades, X being the selected value for this option.';
 $string['dropped'] = 'Dropped';
@@ -348,6 +348,7 @@ $string['movingelement'] = 'Moving $a';
 $string['multfactor'] = 'Multiplicator';
 $string['multfactorhelp'] = 'Factor by which all grades for this grade item will be multiplied.';
 $string['myreportpreferences'] = 'My report preferences';
+$string['navmethod'] = 'Navigation method';
 $string['neverdeletehistory'] = 'Never delete history';
 $string['newcategory'] = 'New category';
 $string['newitem'] = 'New grade item';
@@ -485,7 +486,6 @@ $string['showgroups'] = 'Show groups';
 $string['showhiddenitems'] = 'Show hidden items';
 $string['showhiddenuntilonly'] = 'Only hidden until';
 $string['showlocks'] = 'Show locks';
-$string['shownavmenu'] = 'Show the \"Choose an action\" dropdown menu';
 $string['shownohidden'] = 'No hidden';
 $string['shownooutcomes'] = 'Hide outcomes';
 $string['shownumberofgrades'] = 'Show number of grades in averages';
@@ -493,7 +493,6 @@ $string['showpercentage'] = 'Show percentage';
 $string['showquickfeedback'] = 'Show Quick Feedback';
 $string['showranges'] = 'Show ranges';
 $string['showrank'] = 'Show rank';
-$string['showtabs'] = 'Show navigation tabs';
 $string['showuseridnumber'] = 'Show user idnumber';
 $string['showuserimage'] = 'Show user profile images';
 $string['showverbose'] = 'Show $a->category$a->itemmodule $a->itemname';
@@ -515,6 +514,7 @@ $string['submittedon'] = 'Submitted: $a';
 $string['switchtofullview'] = 'Switch to full view';
 $string['switchtosimpleview'] = 'Switch to simple view';
 $string['synclegacygrades'] = 'Synchronise legacy grades';
+$string['tabs'] = 'Tabs';
 $string['topcategory'] = 'Super category';
 $string['total'] = 'Total';
 $string['totalweight100'] = 'The total weight is equal to 100';
index fd84192f66ad9e67a17416568f9de49622bc7f3b..f048417a1ba9c907b7ea071878d917ae0105800e 100644 (file)
@@ -85,4 +85,8 @@ define('GRADE_REPORT_PREFERENCE_UNUSED', -1);
 
 define('GRADE_REPORT_MEAN_ALL', 0);
 define('GRADE_REPORT_MEAN_GRADED', 1);
+
+define('GRADE_NAVMETHOD_DROPDOWN', 0);
+define('GRADE_NAVMETHOD_TABS', 1);
+define('GRADE_NAVMETHOD_COMBO', 2);
 ?>