From 9f3193726c570f060177e04983ecf00794f811f2 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Tue, 23 Jun 2009 01:18:22 +0000 Subject: [PATCH] javascript MDL-16706 Removed inline script call in mod choice and scorm --- lib/javascript-static.js | 10 ++++++++++ mod/choice/lib.php | 5 +++-- mod/scorm/report.php | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 641ef08dcc..bd42ac72b0 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -1020,3 +1020,13 @@ function close_window_reloading_opener() { // 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 diff --git a/mod/choice/lib.php b/mod/choice/lib.php index 73cf853e8e..e1de214bb9 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -399,6 +399,7 @@ function choice_show_reportlink($user, $cm) { * @global object * @global int * @global string + * @global object * @uses CONTEXT_MODULE * @uses CHOICE_PUBLISH_NAMES * @uses CHOICE_PUBLISH_ANONYMOUS @@ -410,7 +411,7 @@ function choice_show_reportlink($user, $cm) { * @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 @@ -548,7 +549,7 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish echo ''; - echo ''; + $PAGE->requires->js_function_call('hide_item', Array('noscriptmenuaction')); echo ''; } diff --git a/mod/scorm/report.php b/mod/scorm/report.php index 7c5e74fdc3..cb5ca372cd 100755 --- a/mod/scorm/report.php +++ b/mod/scorm/report.php @@ -205,7 +205,7 @@ echo ''; - echo ''; + $PAGE->requires->js_function_call('hide_item', Array('noscriptmenuaction')); echo ''; } else { print_table($table); -- 2.39.5