needed to add the option to pass an element id rather than a name to index.php as the choose parameter. XHTML strict doesn't allow giving a form a name attribute so we use the id of the form element to select the element to return the filename to. We use getElementById to find the element in the document.

This commit is contained in:
jamiesensei 2006-11-15 07:26:48 +00:00
parent 7cf0769e97
commit f1e6550be2

View File

@ -23,7 +23,7 @@
$confirm = optional_param('confirm', 0, PARAM_BOOL);
if ($choose) {
if (count(explode('.', $choose)) != 2) {
if (count(explode('.', $choose)) > 2) {
error('Incorrect format for choose parameter');
}
}
@ -78,7 +78,7 @@
print_header();
$chooseparts = explode('.', $choose);
if (count($chooseparts)==2){
?>
<script language="javascript" type="text/javascript">
<!--
@ -90,6 +90,20 @@
</script>
<?php
} elseif (count($chooseparts)==1){
?>
<script language="javascript" type="text/javascript">
<!--
function set_value(txt) {
opener.document.getElementById('<?php echo $chooseparts[0] ?>').value = txt;
window.close();
}
-->
</script>
<?php
}
$fullnav = str_replace('->', '&raquo;', "$course->shortname -> $fullnav");
echo '<div id="nav-bar">'.$fullnav.'</div>';