From 57fb427c9be0467915ec4cc7f6c9d1acdc9ceb52 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Thu, 22 May 2008 09:18:03 +0000 Subject: [PATCH] MDL-14943 "moodle_url : need way to add extra params when outputting params as hidden fields for forms" added new optional param to method hidden_params_out --- lib/weblib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index b9f2acf06af2b..8bf830af5001f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -392,12 +392,15 @@ function get_query_string($overrideparams = array()){ * * @param array $exclude params to ignore * @param integer $indent indentation + * @param array $overrideparams params to add to the output params, these + * override existing ones with the same name. * @return string html for form elements. */ - function hidden_params_out($exclude = array(), $indent = 0){ + function hidden_params_out($exclude = array(), $indent = 0, $overrideparams=array()){ $tabindent = str_repeat("\t", $indent); $str = ''; - foreach ($this->params as $key => $val){ + $params = $overrideparams + $this->params; + foreach ($params as $key => $val){ if (FALSE === array_search($key, $exclude)) { $val = s($val); $str.= "$tabindent\n";