From: samhemelryk Date: Thu, 2 Jul 2009 03:47:05 +0000 (+0000) Subject: weblib MDL-16706 Elimate inline scripts, replaced with PAGE methods X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e1524dbe5c434306869e72e312ecb54b4d3b6a0b;p=moodle.git weblib MDL-16706 Elimate inline scripts, replaced with PAGE methods --- diff --git a/lib/weblib.php b/lib/weblib.php index a2d9f38fdc..e9ec3324ee 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1113,7 +1113,7 @@ function print_textfield ($name, $value, $alt = '',$size=50,$maxlength=0, $retur */ function popup_form($baseurl, $options, $formid, $selected='', $nothing='choose', $help='', $helptext='', $return=false, $targetwindow='self', $selectlabel='', $optionsextra=NULL, $submitvalue='', $disabled=false, $showbutton=false) { - global $CFG, $SESSION; + global $CFG, $SESSION, $PAGE; static $go, $choose; /// Locally cached, in case there's lots on a page if (empty($options)) { @@ -1264,10 +1264,7 @@ function popup_form($baseurl, $options, $formid, $selected='', $nothing='choose' } $output .= ''; if (!$showbutton) { - $output .= ''; + $output .= $PAGE->requires->js_function_call('hide_item', Array('noscript'.$formid))->asap(); } $output .= ''; @@ -5714,6 +5711,7 @@ EOT; * @return void Echo's output */ function _update($percent, $msg, $es){ + global $PAGE; if(empty($this->time_start)){ $this->time_start = microtime(true); } @@ -5727,7 +5725,7 @@ EOT; if ($es === null){ $es = "Infinity"; } - echo ""; + echo $PAGE->requires->js_function_call("up_".$this->html_id, Array($this->html_id, $w, $this->percent, $msg, $es))->asap(); flush(); } /**