Bin will be removed on June 1, 2014 in favor of http://gist.github.com. Please save all your pastes before then. So long, and thanks for all the fish!×
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff --git app/webroot/css/cake.generic.css app/webroot/css/cake.generic.css
index 676cf4b..c1ddf5b 100644
--- app/webroot/css/cake.generic.css
+++ app/webroot/css/cake.generic.css
@@ -239,6 +239,9 @@ fieldset fieldset div {
    clear: left;
    margin: 0 20px;
 }
+fieldset.hidden {
+   display: none;
+}
 form div {
    clear: both;
    margin-bottom: 1em;
diff --git cake/console/templates/skel/webroot/css/cake.generic.css cake/console/templates/skel/webroot/css/cake.generic.css
index 5042adf..a4a3a97 100644
--- cake/console/templates/skel/webroot/css/cake.generic.css
+++ cake/console/templates/skel/webroot/css/cake.generic.css
@@ -240,6 +240,9 @@ fieldset fieldset div {
    clear: left;
    margin: 0 20px;
 }
+fieldset.hidden {
+   display: none;
+}
 form div {
    clear: both;
    margin-bottom: 1em;
diff --git cake/libs/view/helpers/form.php cake/libs/view/helpers/form.php
index eac7e5f..c5e1e4b 100755
--- cake/libs/view/helpers/form.php
+++ cake/libs/view/helpers/form.php
@@ -287,8 +287,9 @@ class FormHelper extends AppHelper {
            );
        }
 
-       if (!empty($append)) {
-           $append = sprintf($this->Html->tags['fieldset'], ' style="display:none;"', $append);
+       if (!empty($append) && isset($this->_inputDefaults['hiddenFieldset'])
+       && $this->_inputDefaults['hiddenFieldset'] == true) {
+           $append = sprintf($this->Html->tags['fieldset'], ' class="hidden"', $append);
        }
 
        $this->setEntity($model . '.', true);
@@ -362,7 +363,6 @@ class FormHelper extends AppHelper {
        if (!isset($this->params['_Token']) || empty($this->params['_Token'])) {
            return;
        }
-       $out = '<fieldset style="display:none;">';
        $locked = array();
 
        foreach ($fields as $key => $value) {
@@ -378,11 +378,15 @@ class FormHelper extends AppHelper {
        $fields = Security::hash(serialize($fields) . Configure::read('Security.salt'));
        $locked = str_rot13(serialize(array_keys($locked)));
 
-       $out .= $this->hidden('_Token.fields', array(
+       $out = $this->hidden('_Token.fields', array(
            'value' => urlencode($fields . ':' . $locked),
            'id' => 'TokenFields' . mt_rand()
        ));
-       return $out .= '</fieldset>';
+       if (isset($this->_inputDefaults['hiddenFieldset'])
+       && $this->_inputDefaults['hiddenFieldset'] == true) {
+           $out = sprintf($this->Html->tags['fieldset'], ' class="hidden"', $out);
+       }
+       return $out;
    }
 
 /**