@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | // }}} |
157 | 157 | // {{{ setValue() |
158 | 158 | |
159 | - /** |
|
160 | - * Sets the element's value |
|
161 | - * |
|
162 | - * @param mixed Element's value |
|
163 | - * @access public |
|
164 | - */ |
|
159 | + /** |
|
160 | + * Sets the element's value |
|
161 | + * |
|
162 | + * @param mixed Element's value |
|
163 | + * @access public |
|
164 | + */ |
|
165 | 165 | function setValue($value) |
166 | 166 | { |
167 | 167 | $this->setChecked(isset($this->_values[1]) && $value == $this->_values[1]); |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | // }}} |
172 | 172 | // {{{ getValue() |
173 | 173 | |
174 | - /** |
|
175 | - * Returns the element's value |
|
176 | - * |
|
177 | - * @access public |
|
178 | - * @return mixed |
|
179 | - */ |
|
174 | + /** |
|
175 | + * Returns the element's value |
|
176 | + * |
|
177 | + * @access public |
|
178 | + * @return mixed |
|
179 | + */ |
|
180 | 180 | function getValue() |
181 | 181 | { |
182 | 182 | if (is_array($this->_values)) { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | 'type' => 'hidden', |
206 | 206 | 'name' => $this->getName(), |
207 | 207 | 'value' => $this->_values[0] |
208 | - )) . ' />' . parent::toHtml(); |
|
208 | + )) . ' />' . parent::toHtml(); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | } //end func toHtml |
@@ -213,14 +213,14 @@ discard block |
||
213 | 213 | // }}} |
214 | 214 | // {{{ getFrozenHtml() |
215 | 215 | |
216 | - /** |
|
217 | - * Unlike checkbox, this has to append a hidden input in both |
|
218 | - * checked and non-checked states |
|
219 | - */ |
|
216 | + /** |
|
217 | + * Unlike checkbox, this has to append a hidden input in both |
|
218 | + * checked and non-checked states |
|
219 | + */ |
|
220 | 220 | function getFrozenHtml() |
221 | 221 | { |
222 | 222 | return ($this->getChecked()? '<tt>[x]</tt>': '<tt>[ ]</tt>') . |
223 | - $this->_getPersistantData(); |
|
223 | + $this->_getPersistantData(); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | // }}} |
@@ -262,10 +262,10 @@ discard block |
||
262 | 262 | // }}} |
263 | 263 | // {{{ exportValue() |
264 | 264 | |
265 | - /** |
|
266 | - * This element has a value even if it is not checked, thus we override |
|
267 | - * checkbox's behaviour here |
|
268 | - */ |
|
265 | + /** |
|
266 | + * This element has a value even if it is not checked, thus we override |
|
267 | + * checkbox's behaviour here |
|
268 | + */ |
|
269 | 269 | function exportValue(&$submitValues, $assoc) |
270 | 270 | { |
271 | 271 | $value = $this->_findValue($submitValues); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @access public |
82 | 82 | * @return void |
83 | 83 | */ |
84 | - function HTML_QuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null) |
|
84 | + function HTML_QuickForm_advcheckbox($elementName = null, $elementLabel = null, $text = null, $attributes = null, $values = null) |
|
85 | 85 | { |
86 | 86 | $this->HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes); |
87 | 87 | $this->setValues($values); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | function getValue() |
181 | 181 | { |
182 | 182 | if (is_array($this->_values)) { |
183 | - return $this->_values[$this->getChecked()? 1: 0]; |
|
183 | + return $this->_values[$this->getChecked() ? 1 : 0]; |
|
184 | 184 | } else { |
185 | 185 | return null; |
186 | 186 | } |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | if ($this->_flagFrozen) { |
202 | 202 | return parent::toHtml(); |
203 | 203 | } else { |
204 | - return '<input' . $this->_getAttrString(array( |
|
204 | + return '<input'.$this->_getAttrString(array( |
|
205 | 205 | 'type' => 'hidden', |
206 | 206 | 'name' => $this->getName(), |
207 | 207 | 'value' => $this->_values[0] |
208 | - )) . ' />' . parent::toHtml(); |
|
208 | + )).' />'.parent::toHtml(); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | } //end func toHtml |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | */ |
220 | 220 | function getFrozenHtml() |
221 | 221 | { |
222 | - return ($this->getChecked()? '<tt>[x]</tt>': '<tt>[ ]</tt>') . |
|
222 | + return ($this->getChecked() ? '<tt>[x]</tt>' : '<tt>[ ]</tt>'). |
|
223 | 223 | $this->_getPersistantData(); |
224 | 224 | } |
225 | 225 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * Freeze the element so that only its value is returned |
61 | 61 | * |
62 | 62 | * @access public |
63 | - * @return void |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | function freeze() |
66 | 66 | { |
@@ -37,26 +37,26 @@ |
||
37 | 37 | class HTML_QuickForm_html extends HTML_QuickForm_static |
38 | 38 | { |
39 | 39 | |
40 | - /** |
|
41 | - * Class constructor |
|
42 | - * |
|
43 | - * @param string $text raw HTML to add |
|
44 | - * @access public |
|
45 | - * @return void |
|
46 | - */ |
|
40 | + /** |
|
41 | + * Class constructor |
|
42 | + * |
|
43 | + * @param string $text raw HTML to add |
|
44 | + * @access public |
|
45 | + * @return void |
|
46 | + */ |
|
47 | 47 | public function __construct($text = null) |
48 | 48 | { |
49 | 49 | parent::__construct(null, null, $text); |
50 | 50 | $this->_type = 'html'; |
51 | 51 | } |
52 | 52 | |
53 | - /** |
|
54 | - * Accepts a renderer |
|
55 | - * |
|
56 | - * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!) |
|
57 | - * @access public |
|
58 | - * @return void |
|
59 | - */ |
|
53 | + /** |
|
54 | + * Accepts a renderer |
|
55 | + * |
|
56 | + * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!) |
|
57 | + * @access public |
|
58 | + * @return void |
|
59 | + */ |
|
60 | 60 | public function accept(&$renderer, $required = false, $error = null) |
61 | 61 | { |
62 | 62 | $renderer->renderHtml($this); |
@@ -91,6 +91,6 @@ |
||
91 | 91 | { |
92 | 92 | $value = $this->getValue(); |
93 | 93 | return ('' != $value? '**********': ' ') . |
94 | - $this->_getPersistantData(); |
|
94 | + $this->_getPersistantData(); |
|
95 | 95 | } |
96 | 96 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @access public |
47 | 47 | * @throws |
48 | 48 | */ |
49 | - public function __construct($elementName=null, $elementLabel=null, $attributes=null) |
|
49 | + public function __construct($elementName = null, $elementLabel = null, $attributes = null) |
|
50 | 50 | { |
51 | 51 | $attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'form-control'; |
52 | 52 | parent::__construct($elementName, $elementLabel, $attributes); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function getFrozenHtml() |
91 | 91 | { |
92 | 92 | $value = $this->getValue(); |
93 | - return ('' != $value? '**********': ' ') . |
|
93 | + return ('' != $value ? '**********' : ' '). |
|
94 | 94 | $this->_getPersistantData(); |
95 | 95 | } |
96 | 96 | } |
@@ -100,9 +100,9 @@ |
||
100 | 100 | // }}} |
101 | 101 | // {{{ accept() |
102 | 102 | |
103 | - /** |
|
104 | - * This is essentially a hidden element and should be rendered as one |
|
105 | - */ |
|
103 | + /** |
|
104 | + * This is essentially a hidden element and should be rendered as one |
|
105 | + */ |
|
106 | 106 | function accept(&$renderer) |
107 | 107 | { |
108 | 108 | $renderer->renderHidden($this); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @access public |
52 | 52 | * @return void |
53 | 53 | */ |
54 | - function HTML_QuickForm_hiddenselect($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
54 | + function HTML_QuickForm_hiddenselect($elementName = null, $elementLabel = null, $options = null, $attributes = null) |
|
55 | 55 | { |
56 | 56 | parent::__construct($elementName, $elementLabel, $attributes); |
57 | 57 | $this->_persistantFreeze = true; |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | foreach ($this->_values as $key => $val) { |
86 | 86 | for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) { |
87 | 87 | if ($val == $this->_options[$i]['attr']['value']) { |
88 | - $strHtml .= $tabs . '<input' . $this->_getAttrString(array( |
|
88 | + $strHtml .= $tabs.'<input'.$this->_getAttrString(array( |
|
89 | 89 | 'type' => 'hidden', |
90 | 90 | 'name' => $name, |
91 | 91 | 'value' => $val |
92 | - )) . " />\n" ; |
|
92 | + ))." />\n"; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } |
@@ -183,9 +183,9 @@ |
||
183 | 183 | return true; |
184 | 184 | } |
185 | 185 | |
186 | - /** |
|
187 | - * We don't need values from button-type elements (except submit) and files |
|
188 | - */ |
|
186 | + /** |
|
187 | + * We don't need values from button-type elements (except submit) and files |
|
188 | + */ |
|
189 | 189 | function exportValue(&$submitValues, $assoc = false) |
190 | 190 | { |
191 | 191 | $type = $this->getType(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @access public |
48 | 48 | * @return void |
49 | 49 | */ |
50 | - public function __construct($elementName=null, $elementLabel=null, $attributes=null) |
|
50 | + public function __construct($elementName = null, $elementLabel = null, $attributes = null) |
|
51 | 51 | { |
52 | 52 | parent::__construct($elementName, $elementLabel, $attributes); |
53 | 53 | } //end constructor |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if ($this->_flagFrozen) { |
147 | 147 | return $this->getFrozenHtml(); |
148 | 148 | } else { |
149 | - return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />'; |
|
149 | + return $this->_getTabs().'<input'.$this->_getAttrString($this->_attributes).' />'; |
|
150 | 150 | } |
151 | 151 | } //end func toHtml |
152 | 152 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * Freeze the element so that only its value is returned |
61 | 61 | * |
62 | 62 | * @access public |
63 | - * @return void |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | function freeze() |
66 | 66 | { |
@@ -184,9 +184,9 @@ |
||
184 | 184 | // }}} |
185 | 185 | // {{{ exportValue() |
186 | 186 | |
187 | - /** |
|
188 | - * We override this here because we don't want any values from static elements |
|
189 | - */ |
|
187 | + /** |
|
188 | + * We override this here because we don't want any values from static elements |
|
189 | + */ |
|
190 | 190 | function exportValue(&$submitValues, $assoc = false) |
191 | 191 | { |
192 | 192 | return null; |
@@ -131,7 +131,7 @@ |
||
131 | 131 | */ |
132 | 132 | public function toHtml() |
133 | 133 | { |
134 | - return $this->_getTabs() . $this->_text; |
|
134 | + return $this->_getTabs().$this->_text; |
|
135 | 135 | } //end func toHtml |
136 | 136 | |
137 | 137 | // }}} |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * Freeze the element so that only its value is returned |
61 | 61 | * |
62 | 62 | * @access public |
63 | - * @return void |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | function freeze() |
66 | 66 | { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | if ($this->getChecked()) { |
177 | 177 | return '<code>[x]</code>' . |
178 | - $this->_getPersistantData(); |
|
178 | + $this->_getPersistantData(); |
|
179 | 179 | } else { |
180 | 180 | return '<code>[ ]</code>'; |
181 | 181 | } |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | // }}} |
289 | 289 | // {{{ exportValue() |
290 | 290 | |
291 | - /** |
|
292 | - * Return true if the checkbox is checked, null if it is not checked (getValue() returns false) |
|
293 | - */ |
|
291 | + /** |
|
292 | + * Return true if the checkbox is checked, null if it is not checked (getValue() returns false) |
|
293 | + */ |
|
294 | 294 | function exportValue(&$submitValues, $assoc = false) |
295 | 295 | { |
296 | 296 | $value = $this->_findValue($submitValues); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | function getChecked() |
126 | 126 | { |
127 | - return (bool)$this->getAttribute('checked'); |
|
127 | + return (bool) $this->getAttribute('checked'); |
|
128 | 128 | } //end func getChecked |
129 | 129 | |
130 | 130 | // }}} |
@@ -147,9 +147,9 @@ discard block |
||
147 | 147 | $labelClass = $this->labelClass; |
148 | 148 | $checkboxClass = $this->checkboxClass; |
149 | 149 | |
150 | - $label =' |
|
150 | + $label = ' |
|
151 | 151 | <div class="'.$checkboxClass.'"> |
152 | - <label class="'.$labelClass.'">' . |
|
152 | + <label class="'.$labelClass.'">'. |
|
153 | 153 | HTML_QuickForm_input::toHtml().$this->_text. |
154 | 154 | '</label> |
155 | 155 | </div> |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | return $label; |
159 | 159 | } |
160 | 160 | |
161 | - return HTML_QuickForm_input::toHtml() . $label; |
|
161 | + return HTML_QuickForm_input::toHtml().$label; |
|
162 | 162 | } //end func toHtml |
163 | 163 | |
164 | 164 | // }}} |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | function getFrozenHtml() |
175 | 175 | { |
176 | 176 | if ($this->getChecked()) { |
177 | - return '<code>[x]</code>' . |
|
177 | + return '<code>[x]</code>'. |
|
178 | 178 | $this->_getPersistantData(); |
179 | 179 | } else { |
180 | 180 | return '<code>[ ]</code>'; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | { |
296 | 296 | $value = $this->_findValue($submitValues); |
297 | 297 | if (null === $value) { |
298 | - $value = $this->getChecked()? true: null; |
|
298 | + $value = $this->getChecked() ? true : null; |
|
299 | 299 | } |
300 | 300 | return $this->_prepareValue($value, $assoc); |
301 | 301 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * Freeze the element so that only its value is returned |
61 | 61 | * |
62 | 62 | * @access public |
63 | - * @return void |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | function freeze() |
66 | 66 | { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | function validate($email, $checkDomain = false) |
46 | 46 | { |
47 | 47 | // Fix for bug #10799: add 'D' modifier to regex |
48 | - if (preg_match($this->regex . 'D', $email)) { |
|
48 | + if (preg_match($this->regex.'D', $email)) { |
|
49 | 49 | if ($checkDomain && function_exists('checkdnsrr')) { |
50 | 50 | $tokens = explode('@', $email); |
51 | 51 | if (checkdnsrr($tokens[1], 'MX') || checkdnsrr($tokens[1], 'A')) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | function getValidationScript($options = null) |
63 | 63 | { |
64 | - return array(" var regex = " . $this->regex . ";\n", "{jsVar} != '' && !regex.test({jsVar})"); |
|
64 | + return array(" var regex = ".$this->regex.";\n", "{jsVar} != '' && !regex.test({jsVar})"); |
|
65 | 65 | } // end func getValidationScript |
66 | 66 | |
67 | 67 | } // end class HTML_QuickForm_Rule_Email |
@@ -44,16 +44,16 @@ |
||
44 | 44 | */ |
45 | 45 | var $_data = array(); |
46 | 46 | |
47 | - /** |
|
48 | - * Whether to use BC mode for specific rules |
|
49 | - * |
|
50 | - * Previous versions of QF passed element's name as a first parameter |
|
51 | - * to validation functions, but not to validation methods. This behaviour |
|
52 | - * is emulated if you are using 'function' as rule type when registering. |
|
53 | - * |
|
54 | - * @var array |
|
55 | - * @access private |
|
56 | - */ |
|
47 | + /** |
|
48 | + * Whether to use BC mode for specific rules |
|
49 | + * |
|
50 | + * Previous versions of QF passed element's name as a first parameter |
|
51 | + * to validation functions, but not to validation methods. This behaviour |
|
52 | + * is emulated if you are using 'function' as rule type when registering. |
|
53 | + * |
|
54 | + * @var array |
|
55 | + * @access private |
|
56 | + */ |
|
57 | 57 | var $_BCMode = array(); |
58 | 58 | |
59 | 59 | /** |
@@ -106,10 +106,10 @@ |
||
106 | 106 | { |
107 | 107 | if (isset($this->_data[$this->name])) { |
108 | 108 | $callback = $this->_data[$this->name][0]; |
109 | - $params = ($this->_BCMode[$this->name]? "'', {jsVar}": '{jsVar}') . |
|
110 | - (isset($options)? ", '{$options}'": ''); |
|
109 | + $params = ($this->_BCMode[$this->name] ? "'', {jsVar}" : '{jsVar}'). |
|
110 | + (isset($options) ? ", '{$options}'" : ''); |
|
111 | 111 | } else { |
112 | - $callback = is_array($options)? $options[1]: $options; |
|
112 | + $callback = is_array($options) ? $options[1] : $options; |
|
113 | 113 | $params = '{jsVar}'; |
114 | 114 | } |
115 | 115 | return array('', "{jsVar} != '' && !{$callback}({$params})"); |