]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18004 Fixed problem of duplicate entries in the drop-down
authornicolasconnault <nicolasconnault>
Fri, 27 Feb 2009 15:25:05 +0000 (15:25 +0000)
committernicolasconnault <nicolasconnault>
Fri, 27 Feb 2009 15:25:05 +0000 (15:25 +0000)
grade/lib.php
theme/standard/styles_fonts.css

index fc9e10e7ebcbabe46b8384728d80a86e9db6a05a..6d732420f2f8cd4e3f3dd379ad3e28dda7c8b221 100644 (file)
@@ -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'].'&amp;'] = '**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']] = '&nbsp;&nbsp;&nbsp;&nbsp;' . $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 '';
index f70eb1fcc7992861260d9734823197b30a91b9a6..48218b7a31bc88067990655a6b9826b541968248 100644 (file)
@@ -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