]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14943 "moodle_url : need way to add extra params when outputting params as hidden...
authorjamiesensei <jamiesensei>
Thu, 22 May 2008 13:29:19 +0000 (13:29 +0000)
committerjamiesensei <jamiesensei>
Thu, 22 May 2008 13:29:19 +0000 (13:29 +0000)
lib/weblib.php

index e9d7819c906d4d853423e9c97cf5f2b8efb6ce7f..f88e0341c29a1f5dbd0b4d76ada54238ccb88d21 100644 (file)
@@ -392,12 +392,15 @@ class moodle_url {
      *
      * @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<input type=\"hidden\" name=\"$key\" value=\"$val\" />\n";