From 7981d537da8e1fa9da62e116fae53cdceb94cacc Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 27 Feb 2009 15:25:05 +0000 Subject: [PATCH] MDL-18004 Fixed problem of duplicate entries in the drop-down --- grade/lib.php | 20 +++++++++++++++----- theme/standard/styles_fonts.css | 5 ++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/grade/lib.php b/grade/lib.php index fc9e10e7eb..6d732420f2 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -324,13 +324,17 @@ function print_grade_plugin_selector($plugin_info, $return=false) { continue; } - $menu[$plugin_type.'group'] = '--'.$plugin_info['strings'][$plugin_type]; + $first_plugin = reset($plugins); - if (!empty($plugins['id'])) { - $menu[$plugins['link']] = $plugins['string']; + if (is_array($first_plugin)) { + $menu[$first_plugin['link'].'&'] = '**header**'.get_string($plugin_type, 'grades'); } else { + $menu[$plugins['link']] = '**header**'.$plugins['string']; + } + + if (empty($plugins['id'])) { foreach ($plugins as $plugin) { - $menu[$plugin['link']] = $plugin['string']; + $menu[$plugin['link']] = '    ' . $plugin['string']; $count++; } } @@ -338,7 +342,13 @@ function print_grade_plugin_selector($plugin_info, $return=false) { /// finally print/return the popup form if ($count > 1) { - return popup_form('', $menu, 'choosepluginreport', '', get_string('chooseaction', 'grades'), '', '', $return, 'self'); + $select = popup_form('', $menu, 'choosepluginreport', '', get_string('chooseaction', 'grades'), '', '', true, 'self'); + $select = preg_replace('/\>\*\*header\*\*/', ' class="optionheader">', $select); + if ($return) { + return $select; + } else { + echo $select; + } } else { // only one option - no plugin selector needed return ''; diff --git a/theme/standard/styles_fonts.css b/theme/standard/styles_fonts.css index f70eb1fcc7..48218b7a31 100644 --- a/theme/standard/styles_fonts.css +++ b/theme/standard/styles_fonts.css @@ -579,7 +579,7 @@ h2.headingblock { } #course-view .dimmed_text img { opacity:0.3; - filter: alpha(opacity='30'); + filter: alpha(opacity='30'); } /*** @@ -618,6 +618,9 @@ body#grade-index .grades .header { #grade-aggregation-help code { font-style: normal; } +option.optionheader { + font-weight: bold; +} /*** *** Login -- 2.39.5