// Intentionally, only try to close the window if there is some evidence we are in a popup.
}
}
+
+/**
+ * Used in a couple of modules to hide navigation areas when using AJAX
+ */
+function hide_item(itemid) {
+ var item = document.getElementById(itemid);
+ if (item) {
+ item.style.display = "none";
+ }
+}
\ No newline at end of file
* @global object
* @global int
* @global string
+ * @global object
* @uses CONTEXT_MODULE
* @uses CHOICE_PUBLISH_NAMES
* @uses CHOICE_PUBLISH_ANONYMOUS
* @return void Output is echo'd
*/
function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish='') {
- global $CFG, $CHOICE_COLUMN_HEIGHT, $FULLSCRIPT;
+ global $CFG, $CHOICE_COLUMN_HEIGHT, $FULLSCRIPT, $PAGE;
print_heading(get_string("responses", "choice"));
if (empty($forcepublish)) { //alow the publish setting to be overridden
echo '<noscript id="noscriptmenuaction" style="display: inline;">';
echo '<div>';
echo '<input type="submit" value="'.get_string('go').'" /></div></noscript>';
- echo '<script type="text/javascript">'."\n<!--\n".'document.getElementById("noscriptmenuaction").style.display = "none";'."\n-->\n".'</script>';
+ $PAGE->requires->js_function_call('hide_item', Array('noscriptmenuaction'));
echo '</td><td></td></tr>';
}
echo '<noscript id="noscriptmenuaction" style="display: inline;">';
echo '<div>';
echo '<input type="submit" value="'.get_string('go').'" /></div></noscript>';
- echo '<script type="text/javascript">'."\n<!--\n".'document.getElementById("noscriptmenuaction").style.display = "none";'."\n-->\n".'</script>';
+ $PAGE->requires->js_function_call('hide_item', Array('noscriptmenuaction'));
echo '</form>';
} else {
print_table($table);