~sander-sinaasappel/anewt/anewt.new.cxs

« back to all changes in this revision

Viewing changes to form/renderer/base.lib.php

  • Committer: Sander van Schouwenburg
  • Date: 2010-02-25 19:43:58 UTC
  • Revision ID: sander@controlxs.com-20100225194358-4ca27kdp8m6ktybz
[form] Merged subform support from a private project.

See also bug #527946

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
 
92
92
                $form = new AnewtXHTMLForm(null, $attributes);
93
93
 
 
94
                $form->append_child($this->render_hidden_controls());
 
95
 
 
96
                return $form;
 
97
        }
 
98
 
 
99
        /**
 
100
         * Renders the hidden controls.
 
101
         */
 
102
        function render_hidden_controls() {
 
103
 
 
104
                $fragment = new AnewtXHTMLFragment();
 
105
 
94
106
                /* The HTML DTD does not allow <input> elements as direct childs of
95
107
                 * a <form> element. Use a <fieldset> that is completely hidden from
96
108
                 * view instead. */
97
 
                $hidden_controls_fieldset = new AnewtXHTMLFieldset();
98
 
                $hidden_controls_fieldset->set_attribute('style', 'display: none;');
99
 
                foreach ($this->_form->_hidden_controls() as $hidden_control)
100
 
                        $hidden_controls_fieldset->append_child($hidden_control->build_widget());
101
 
 
102
 
                $form->append_child($hidden_controls_fieldset);
103
 
 
104
 
                return $form;
 
109
                $hidden_controls = $this->_form->_hidden_controls();
 
110
                if ($hidden_controls)
 
111
                {
 
112
                        $hidden_controls_fieldset = new AnewtXHTMLFieldset();
 
113
                        $hidden_controls_fieldset->set_attribute('style', 'display: none;');
 
114
 
 
115
                        foreach ($hidden_controls as $hidden_control)
 
116
                                $hidden_controls_fieldset->append_child($hidden_control->build_widget());
 
117
 
 
118
                        $fragment->append_child($hidden_controls_fieldset);
 
119
                }
 
120
 
 
121
                return $fragment;
105
122
        }
106
123
 
107
124
        /**