Skip to content

Commit

Permalink
MDL-18004 Fixed problem of duplicate entries in the drop-down
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Feb 27, 2009
1 parent ca6b2d6 commit 7981d53
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
20 changes: 15 additions & 5 deletions grade/lib.php
Expand Up @@ -324,21 +324,31 @@ 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++;
}
}
}

/// 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 '';
Expand Down
5 changes: 4 additions & 1 deletion theme/standard/styles_fonts.css
Expand Up @@ -579,7 +579,7 @@ h2.headingblock {
}
#course-view .dimmed_text img {
opacity:0.3;
filter: alpha(opacity='30');
filter: alpha(opacity='30');
}

/***
Expand Down Expand Up @@ -618,6 +618,9 @@ body#grade-index .grades .header {
#grade-aggregation-help code {
font-style: normal;
}
option.optionheader {
font-weight: bold;
}

/***
*** Login
Expand Down

0 comments on commit 7981d53

Please sign in to comment.