From 8354e7161816f20924d29475f56ce4a83c822940 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 12 Feb 2009 10:27:23 +0000 Subject: [PATCH] MDL-18004 Added two admin settings for showing/hiding the gradebook dropdown and tab navigation --- admin/settings/grades.php | 3 ++- grade/lib.php | 13 +++++++++++-- grade/report/grader/index.php | 2 +- lang/en_utf8/grades.php | 4 ++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/admin/settings/grades.php b/admin/settings/grades.php index f703ef6486c..6da457bb466 100644 --- a/admin/settings/grades.php +++ b/admin/settings/grades.php @@ -52,7 +52,8 @@ 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_special_gradeexport()); } $ADMIN->add('grades', $temp); diff --git a/grade/lib.php b/grade/lib.php index 033ada52464..50fd597db79 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -615,6 +615,10 @@ function grade_get_plugin_info($courseid, $active_type, $active_plugin) { } } + // Put settings last + $settings = $plugin_info['settings']; + unset($plugin_info['settings']); + $plugin_info['settings'] = $settings; return $plugin_info; } @@ -657,9 +661,14 @@ function print_grade_page_head($courseid, $active_type, $active_plugin=null, $he $heading = $stractive_plugin; } - $returnval .= print_grade_plugin_selector($plugin_info, $return); + if ($CFG->grade_shownavmenu) { + $returnval .= print_grade_plugin_selector($plugin_info, $return); + } $returnval .= print_heading($heading); - $returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return, $preferences_page_url); + + if ($CFG->grade_showtabs) { + $returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return, $preferences_page_url); + } if ($return) { return $returnval; diff --git a/grade/report/grader/index.php b/grade/report/grader/index.php index 8d8b837277d..fa55d4307fe 100644 --- a/grade/report/grader/index.php +++ b/grade/report/grader/index.php @@ -173,7 +173,7 @@ if ($USER->gradeediting[$course->id] and !$report->get_pref('enableajax')) { } echo $reporthtml; -var_dump($report->get_pref('enableajax')); + // print submit button if ($USER->gradeediting[$course->id] && ($report->get_pref('showquickfeedback') || diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index 9c147b54d3e..be905b6d97b 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -106,10 +106,12 @@ $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.'; @@ -483,6 +485,7 @@ $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'; @@ -490,6 +493,7 @@ $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';