Commit e9de47fd by Scott

Allow hidden form fields to have extra attributes

parent fc634ce0
...@@ -280,8 +280,14 @@ ...@@ -280,8 +280,14 @@
), ),
'hidden' => array( 'hidden' => array(
'dosaveprofile' => '1', 'dosaveprofile' => array(
'code' => qa_get_form_security_code('account'), 'tags' => 'name="dosaveprofile"',
'value' => '1',
),
'code' => array(
'tags' => 'name="code"',
'value' => qa_get_form_security_code('account'),
),
), ),
); );
...@@ -421,8 +427,14 @@ ...@@ -421,8 +427,14 @@
), ),
'hidden' => array( 'hidden' => array(
'dochangepassword' => '1', 'dochangepassword' => array(
'code' => qa_get_form_security_code('password'), 'tags' => 'name="dochangepassword"',
'value' => '1',
),
'code' => array(
'tags' => 'name="code"',
'value' => qa_get_form_security_code('password'),
),
), ),
); );
......
...@@ -1197,9 +1197,18 @@ class qa_html_theme_base ...@@ -1197,9 +1197,18 @@ class qa_html_theme_base
public function form_hidden_elements($hidden) public function form_hidden_elements($hidden)
{ {
if (!empty($hidden)) { if (empty($hidden))
foreach ($hidden as $name => $value) return;
$this->output('<input type="hidden" name="'.$name.'" value="'.$value.'"/>');
foreach ($hidden as $name => $value) {
if (is_array($value)) {
// new method of outputting tags
$this->output('<input '.@$value['tags'].' type="hidden" value="'.@$value['value'].'"/>');
}
else {
// old method
$this->output('<input name="'.$name.'" type="hidden" value="'.$value.'"/>');
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment