MDL-7742 added nested drop down box to add activities/resources to course, 3rd party mods can specify type

MDL-6987 preparation for migration of mod/assignment/mod.html
This commit is contained in:
skodak
2007-01-02 09:33:07 +00:00
parent 17a67c9690
commit 89bfeee0d6
5 changed files with 121 additions and 45 deletions
+12 -1
View File
@@ -966,9 +966,20 @@ function popup_form($common, $options, $formname, $selected='', $nothing='choose
}
$inoptgroup = false;
foreach ($options as $value => $label) {
if (substr($label,0,2) == '--') { /// we are starting a new optgroup
if ($label == '--') { /// we are ending previous optgroup
/// Check to see if we already have a valid open optgroup
/// XHTML demands that there be at least 1 option within an optgroup
if ($inoptgroup and (count($optgr) > 1) ) {
$output .= implode('', $optgr);
$output .= ' </optgroup>';
}
$optgr = array();
$inoptgroup = false;
continue;
} else if (substr($label,0,2) == '--') { /// we are starting a new optgroup
/// Check to see if we already have a valid open optgroup
/// XHTML demands that there be at least 1 option within an optgroup