Index: lib/weblib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v retrieving revision 1.970.2.58 diff -u -r1.970.2.58 weblib.php --- lib/weblib.php 3 Feb 2008 12:52:29 -0000 1.970.2.58 +++ lib/weblib.php 15 Feb 2008 14:25:59 -0000 @@ -1126,11 +1126,14 @@ * @param string $targetwindow The name of the target page to open the linked page in. * @param string $selectlabel Text to place in a [label] element - preferred for accessibility. * @param array $optionsextra TODO, an array? + * @param mixed $gobutton If set, this turns off the JavaScript and uses a 'go' + * button instead (as is always included for JS-disabled users). Set to true + * for a literal 'Go' button, or to a string to change the name of the button. * @return string If $return is true then the entire form is returned as a string. * @todo Finish documenting this function
*/ function popup_form($common, $options, $formid, $selected='', $nothing='choose', $help='', $helptext='', $return=false, -$targetwindow='self', $selectlabel='', $optionsextra=NULL) { +$targetwindow='self', $selectlabel='', $optionsextra=NULL, $gobutton=NULL) { global $CFG; static $go, $choose; /// Locally cached, in case there's lots on a page @@ -1166,8 +1169,17 @@ if ($selectlabel) { $selectlabel = ''; } + + if ($gobutton) { + $javascript = ''; + } else { + $javascript = ' onchange="'.$targetwindow. + '.location=document.getElementById(\''.$formid. + '\').jump.options[document.getElementById(\''. + $formid.'\').jump.selectedIndex].value;"'; + } - $output .= '
'.$selectlabel.$button.''."\n"; if ($nothing != '') { $output .= " \n"; @@ -1245,13 +1257,18 @@ $output .= ''; $output .= ''; - $output .= '
'; - $output .= '
'; - $output .= ''; - $output .= '
'; + if ($gobutton) { + $output .= ''; + } else { + $output .= '
'; + $output .= '
'; + $output .= ''; + $output .= ''; + } $output .= ''; if ($return) { Index: mod/forum/discuss.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/forum/discuss.php,v retrieving revision 1.112.2.4 diff -u -r1.112.2.4 discuss.php --- mod/forum/discuss.php 15 Feb 2008 00:50:10 -0000 1.112.2.4 +++ mod/forum/discuss.php 15 Feb 2008 14:25:59 -0000 @@ -230,7 +230,8 @@ if (!empty($forummenu)) { echo "
"; echo popup_form("$CFG->wwwroot/mod/forum/", $forummenu, "forummenu", "", - get_string("movethisdiscussionto", "forum"), "", "", true); + get_string("movethisdiscussionto", "forum"), "", "", true,'self','',NULL, + get_string('move')); echo "
"; } }