mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
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:
parent
7cf0769e97
commit
f1e6550be2
@ -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('->', '»', "$course->shortname -> $fullnav");
|
||||
echo '<div id="nav-bar">'.$fullnav.'</div>';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user