Skip to content

Commit

Permalink
MDL-14943 "moodle_url : need way to add extra params when outputting …
Browse files Browse the repository at this point in the history
…params as hidden fields for forms" added new optional param to method hidden_params_out
  • Loading branch information
jamiesensei committed May 22, 2008
1 parent fdab35a commit 57fb427
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/weblib.php
Expand Up @@ -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<input type=\"hidden\" name=\"$key\" value=\"$val\" />\n";
Expand Down

0 comments on commit 57fb427

Please sign in to comment.