MDL-19808 Fixed dropdown for moving forum discussions

This commit is contained in:
nicolasconnault
2009-08-13 01:43:57 +00:00
parent 7a5c78e049
commit e4c5abdc56
2 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -555,7 +555,10 @@ class html_select extends labelled_html_component {
public function override_option_values($options) {
global $PAGE;
$originalcount = count($options);
$this->initialise_options();
$newcount = count($this->options);
$first = true;
reset($options);
@@ -572,15 +575,16 @@ class html_select extends labelled_html_component {
}
}
next($options);
} else if ($optgroup instanceof html_select_option) {
next($options);
} else if ($optgroup instanceof html_select_option && !($first && $originalcount < $newcount)) {
$this->options[$optkey]->value = key($options);
$optionurl = new moodle_url(key($options));
if ($optionurl->compare($PAGE->url, URL_MATCH_PARAMS)) {
$this->options[$optkey]->selected = 'selected';
}
next($options);
}
$first = false;
}
}