@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | parent::__construct([]); |
54 | 54 | $this->setCaption($caption); |
55 | 55 | $this->setName($name); |
56 | - $this->setWithDefaults('value', (array) $values, []); |
|
56 | + $this->setWithDefaults('value', (array)$values, []); |
|
57 | 57 | $this->set(':groupid', $groupId); |
58 | 58 | } |
59 | 59 | $this->groupId = $this->get(':groupid', 0); |
@@ -90,21 +90,21 @@ discard block |
||
90 | 90 | $tree = '<td valign="top">'; |
91 | 91 | $prefix = ''; |
92 | 92 | $this->renderOptionTree($tree, $this->optionTree[$topitem], $prefix); |
93 | - $ret .= $tree . '</td>'; |
|
93 | + $ret .= $tree.'</td>'; |
|
94 | 94 | ++$cols; |
95 | 95 | } |
96 | 96 | $ret .= '</tr></table></td><td class="even" valign="top">'; |
97 | 97 | $option_ids = array(); |
98 | 98 | foreach (array_keys($this->optionTree) as $id) { |
99 | 99 | if (!empty($id)) { |
100 | - $option_ids[] = "'" . $ele_name . '[groups][' . $this->groupId . '][' . $id . ']' . "'"; |
|
100 | + $option_ids[] = "'".$ele_name.'[groups]['.$this->groupId.']['.$id.']'."'"; |
|
101 | 101 | } |
102 | 102 | } |
103 | - $checkAllButtonId = $ele_name . '[checkallbtn][' . $this->groupId . ']'; |
|
103 | + $checkAllButtonId = $ele_name.'[checkallbtn]['.$this->groupId.']'; |
|
104 | 104 | $option_ids_str = implode(', ', $option_ids); |
105 | - $ret .= \XoopsLocale::ALL . " <input id=\"" . $checkAllButtonId . "\" type=\"checkbox\" value=\"\" " |
|
106 | - . "onclick=\"var optionids = new Array(" . $option_ids_str . "); " |
|
107 | - . "xoopsCheckAllElements(optionids, '" . $checkAllButtonId . "');\" />"; |
|
105 | + $ret .= \XoopsLocale::ALL." <input id=\"".$checkAllButtonId."\" type=\"checkbox\" value=\"\" " |
|
106 | + . "onclick=\"var optionids = new Array(".$option_ids_str."); " |
|
107 | + . "xoopsCheckAllElements(optionids, '".$checkAllButtonId."');\" />"; |
|
108 | 108 | $ret .= '</td></tr></table>'; |
109 | 109 | return $ret; |
110 | 110 | } |
@@ -122,15 +122,15 @@ discard block |
||
122 | 122 | private function renderOptionTree(&$tree, $option, $prefix, $parentIds = array()) |
123 | 123 | { |
124 | 124 | $elementName = $this->getName(); |
125 | - $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $elementName . "[groups][" |
|
126 | - . $this->groupId . "][" . $option['id'] . "]\" id=\"" . $elementName |
|
127 | - . "[groups][" . $this->groupId . "][" . $option['id'] . "]\" onclick=\""; |
|
125 | + $tree .= $prefix."<input type=\"checkbox\" name=\"".$elementName."[groups][" |
|
126 | + . $this->groupId."][".$option['id']."]\" id=\"".$elementName |
|
127 | + . "[groups][".$this->groupId."][".$option['id']."]\" onclick=\""; |
|
128 | 128 | // If there are parent elements, add javascript that will |
129 | 129 | // make them selected when this element is checked to make |
130 | 130 | // sure permissions to parent items are added as well. |
131 | 131 | foreach ($parentIds as $pid) { |
132 | - $parent_ele = $elementName . '[groups][' . $this->groupId . '][' . $pid . ']'; |
|
133 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele |
|
132 | + $parent_ele = $elementName.'[groups]['.$this->groupId.']['.$pid.']'; |
|
133 | + $tree .= "var ele = xoopsGetElementById('".$parent_ele |
|
134 | 134 | . "'); if(ele.checked != true) {ele.checked = this.checked;}"; |
135 | 135 | } |
136 | 136 | // If there are child elements, add javascript that will |
@@ -138,22 +138,22 @@ discard block |
||
138 | 138 | // sure permissions to child items are not added when there |
139 | 139 | // is no permission to this item. |
140 | 140 | foreach ($option['allchild'] as $cid) { |
141 | - $child_ele = $elementName . '[groups][' . $this->groupId . '][' . $cid . ']'; |
|
142 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele |
|
141 | + $child_ele = $elementName.'[groups]['.$this->groupId.']['.$cid.']'; |
|
142 | + $tree .= "var ele = xoopsGetElementById('".$child_ele |
|
143 | 143 | . "'); if(this.checked != true) {ele.checked = false;}"; |
144 | 144 | } |
145 | 145 | $tree .= '" value="1"'; |
146 | 146 | if (in_array($option['id'], $this->get('value', []))) { |
147 | 147 | $tree .= ' checked="checked"'; |
148 | 148 | } |
149 | - $tree .= " />" . $option['name'] . "<input type=\"hidden\" name=\"" . $elementName . "[parents][" |
|
150 | - . $option['id'] . "]\" value=\"" . implode(':', $parentIds) . "\" /><input type=\"hidden\" name=\"" |
|
151 | - . $elementName . "[itemname][" . $option['id'] . "]\" value=\"" |
|
152 | - . htmlspecialchars($option['name']) . "\" /><br />\n"; |
|
149 | + $tree .= " />".$option['name']."<input type=\"hidden\" name=\"".$elementName."[parents][" |
|
150 | + . $option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"" |
|
151 | + . $elementName."[itemname][".$option['id']."]\" value=\"" |
|
152 | + . htmlspecialchars($option['name'])."\" /><br />\n"; |
|
153 | 153 | if (isset($option['children'])) { |
154 | 154 | foreach ($option['children'] as $child) { |
155 | 155 | array_push($parentIds, $option['id']); |
156 | - $this->renderOptionTree($tree, $this->optionTree[$child], $prefix . ' -', $parentIds); |
|
156 | + $this->renderOptionTree($tree, $this->optionTree[$child], $prefix.' -', $parentIds); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $ele_options = $this->getOptions(); |
61 | 61 | $ele_value = $this->getValue(); |
62 | 62 | $ele_name = $this->getName(); |
63 | - $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); |
|
63 | + $extra = ($this->getExtra() != '' ? " ".$this->getExtra() : ''); |
|
64 | 64 | $ret = ""; |
65 | 65 | $inline = $this->has(':inline'); |
66 | 66 | if ($inline) { |
@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | } |
75 | 75 | $this->set('value', $value); |
76 | 76 | ++$id_ele; |
77 | - $this->set('id', $ele_name . $id_ele); |
|
77 | + $this->set('id', $ele_name.$id_ele); |
|
78 | 78 | if ($inline) { |
79 | 79 | $ret .= '<label class="radio-inline">'; |
80 | - $ret .= '<input ' . $this->renderAttributeString() . $extra . ">" . $buttonCaption . "\n"; |
|
80 | + $ret .= '<input '.$this->renderAttributeString().$extra.">".$buttonCaption."\n"; |
|
81 | 81 | $ret .= "</label>\n"; |
82 | 82 | } else { |
83 | 83 | $ret .= "<div class=\"radio\">\n<label>"; |
84 | - $ret .= '<input ' . $this->renderAttributeString() . $extra . '>' . "\n"; |
|
85 | - $ret .= $buttonCaption . "\n"; |
|
84 | + $ret .= '<input '.$this->renderAttributeString().$extra.'>'."\n"; |
|
85 | + $ret .= $buttonCaption."\n"; |
|
86 | 86 | $ret .= "</label>\n</div>\n"; |
87 | 87 | } |
88 | 88 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function getType() |
60 | 60 | { |
61 | - return (string) $this->get('type', ''); |
|
61 | + return (string)$this->get('type', ''); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -70,18 +70,18 @@ discard block |
||
70 | 70 | { |
71 | 71 | $ret = ''; |
72 | 72 | $this->add('class', 'btn'); |
73 | - $class = 'class="' . $this->getClass() . '"'; |
|
73 | + $class = 'class="'.$this->getClass().'"'; |
|
74 | 74 | |
75 | 75 | $attributes = $this->renderAttributeString(); |
76 | 76 | |
77 | - if ((bool) $this->get(':showdelete', false)) { |
|
78 | - $ret .= '<input type="submit"' . $class . ' name="delete" id="delete" value="' |
|
79 | - . \XoopsLocale::A_DELETE . '" onclick="this.form.elements.op.value=\'delete\'">'; |
|
77 | + if ((bool)$this->get(':showdelete', false)) { |
|
78 | + $ret .= '<input type="submit"'.$class.' name="delete" id="delete" value="' |
|
79 | + . \XoopsLocale::A_DELETE.'" onclick="this.form.elements.op.value=\'delete\'">'; |
|
80 | 80 | } |
81 | - $ret .= ' <input type="button" ' . $class . ' value="' . \XoopsLocale::A_CANCEL |
|
81 | + $ret .= ' <input type="button" '.$class.' value="'.\XoopsLocale::A_CANCEL |
|
82 | 82 | . '" onclick="history.go(-1);return true;" />' |
83 | - . ' <input type="reset"' . $class . ' name="reset" id="reset" value="' . \XoopsLocale::A_RESET . '" />' |
|
84 | - . ' <input ' . $attributes . $this->getExtra() . ' />'; |
|
83 | + . ' <input type="reset"'.$class.' name="reset" id="reset" value="'.\XoopsLocale::A_RESET.'" />' |
|
84 | + . ' <input '.$attributes.$this->getExtra().' />'; |
|
85 | 85 | return $ret; |
86 | 86 | } |
87 | 87 | } |
@@ -59,15 +59,15 @@ |
||
59 | 59 | } |
60 | 60 | $elementClass = $specification[self::CLASS_KEY]; |
61 | 61 | if (false === strpos($elementClass, '\\')) { |
62 | - $elementClass = '\Xoops\Form\\' . $elementClass; |
|
62 | + $elementClass = '\Xoops\Form\\'.$elementClass; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if (!class_exists($elementClass)) { |
66 | - throw new \DomainException('Unknown element class: ' . $specification[self::CLASS_KEY]); |
|
66 | + throw new \DomainException('Unknown element class: '.$specification[self::CLASS_KEY]); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | if (!is_a($elementClass, '\Xoops\Form\Element', true)) { |
70 | - throw new \DomainException('Not an Element subclass: ' . $specification[self::CLASS_KEY]); |
|
70 | + throw new \DomainException('Not an Element subclass: '.$specification[self::CLASS_KEY]); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | $specification[self::CLASS_KEY] = $elementClass; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | if (is_array($caption)) { |
38 | 38 | parent::__construct($caption); |
39 | - $value = $this->get('value',''); |
|
39 | + $value = $this->get('value', ''); |
|
40 | 40 | if (empty($value)) { |
41 | 41 | $this->set('value', '#FFFFFF'); |
42 | 42 | } |
@@ -64,21 +64,21 @@ discard block |
||
64 | 64 | if ($xoops->theme()) { |
65 | 65 | $xoops->theme()->addScript('include/color-picker.js'); |
66 | 66 | } else { |
67 | - echo '<script type="text/javascript" src="' . $xoops->url('/include/color-picker.js') . '"></script>'; |
|
67 | + echo '<script type="text/javascript" src="'.$xoops->url('/include/color-picker.js').'"></script>'; |
|
68 | 68 | } |
69 | 69 | $temp = $this->get('value', ''); |
70 | 70 | if (!empty($temp)) { |
71 | - $this->set('style', 'background-color:' . $temp . ';'); |
|
71 | + $this->set('style', 'background-color:'.$temp.';'); |
|
72 | 72 | } |
73 | 73 | $this->set('class', 'form-control'); |
74 | 74 | $ret = '<div class="input-group">'; |
75 | 75 | $attributes = $this->renderAttributeString(); |
76 | - $ret .= '<input ' . $attributes . ' ' . $this->getExtra() .' >'; |
|
76 | + $ret .= '<input '.$attributes.' '.$this->getExtra().' >'; |
|
77 | 77 | $ret .= '<span class="input-group-btn">'; |
78 | 78 | $ret .= '<button class="btn btn-default" type="button" '; |
79 | - $ret .= 'data-toggle="tooltip" data-placement="left" title="' . \XoopsLocale::A_SELECT . '" '; |
|
79 | + $ret .= 'data-toggle="tooltip" data-placement="left" title="'.\XoopsLocale::A_SELECT.'" '; |
|
80 | 80 | $ret .= 'onclick="return TCP.popup(\''; |
81 | - $ret .= $xoops->url('/include/') . '\',document.getElementById(\'' . $this->getName() . '\'));">'; |
|
81 | + $ret .= $xoops->url('/include/').'\',document.getElementById(\''.$this->getName().'\'));">'; |
|
82 | 82 | $ret .= '<span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></button>'; |
83 | 83 | $ret .= '</span></div>'; |
84 | 84 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $user_count = $member_handler->getUserCount(); |
54 | 54 | $value = is_array($value) ? $value : (empty($value) ? array() : array($value)); |
55 | 55 | if ($user_count > $limit && count($value) > 0) { |
56 | - $criteria = new CriteriaCompo(new Criteria('uid', '(' . implode(',', $value) . ')', 'IN')); |
|
56 | + $criteria = new CriteriaCompo(new Criteria('uid', '('.implode(',', $value).')', 'IN')); |
|
57 | 57 | } else { |
58 | 58 | $criteria = new CriteriaCompo(); |
59 | 59 | $criteria->setLimit($limit); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | function addusers(opts){ |
73 | 73 | var num = opts.substring(0, opts.indexOf(':')); |
74 | 74 | opts = opts.substring(opts.indexOf(':')+1, opts.length); |
75 | - var sel = xoopsGetElementById('" . $name . "'); |
|
75 | + var sel = xoopsGetElementById('" . $name."'); |
|
76 | 76 | var arr = new Array(num); |
77 | 77 | for (var n=0; n < num; n++) { |
78 | 78 | var nm = opts.substring(0, opts.indexOf(':')); |
@@ -99,14 +99,14 @@ discard block |
||
99 | 99 | $token = $xoops->security()->createToken(); |
100 | 100 | $action_tray = new Label( |
101 | 101 | '', |
102 | - '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name |
|
102 | + '<a href="#" onclick="var sel = xoopsGetElementById(\''.$name |
|
103 | 103 | . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) ' |
104 | - .'{sel.options[i] = null;}}; return false;">' . \XoopsLocale::REMOVE_UNSELECTED_USERS . "</a>" |
|
104 | + .'{sel.options[i] = null;}}; return false;">'.\XoopsLocale::REMOVE_UNSELECTED_USERS."</a>" |
|
105 | 105 | . ' | ' |
106 | - . '<a href="#" onclick="openWithSelfMain(\'' . \XoopsBaseConfig::get('url') . '/include/findusers.php?target=' |
|
107 | - . $name . '&multiple=' . $multiple . '&token=' . $token |
|
106 | + . '<a href="#" onclick="openWithSelfMain(\''.\XoopsBaseConfig::get('url').'/include/findusers.php?target=' |
|
107 | + . $name.'&multiple='.$multiple.'&token='.$token |
|
108 | 108 | . '\', \'userselect\', 800, 600, null); return false;" >' |
109 | - . \XoopsLocale::SEARCH_USERS . "</a>" . $js_addusers |
|
109 | + . \XoopsLocale::SEARCH_USERS."</a>".$js_addusers |
|
110 | 110 | ); |
111 | 111 | parent::__construct($caption, '', $name); |
112 | 112 | $this->addElement($select_element); |
@@ -581,7 +581,7 @@ |
||
581 | 581 | $class = 'form-control'; |
582 | 582 | } |
583 | 583 | } |
584 | - */ |
|
584 | + */ |
|
585 | 585 | $this->add('class', $class); |
586 | 586 | } |
587 | 587 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if (!$this->has('id')) { |
93 | 93 | $id = $this->get('name'); |
94 | 94 | if (substr($id, -2) === '[]') { |
95 | - $id = substr($id, 0, strlen($id)-2); |
|
95 | + $id = substr($id, 0, strlen($id) - 2); |
|
96 | 96 | } |
97 | 97 | $this->set('id', $id); |
98 | 98 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function getName() |
152 | 152 | { |
153 | - return (string) $this->get('name'); |
|
153 | + return (string)$this->get('name'); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function getAccessKey() |
174 | 174 | { |
175 | - return (string) $this->get('accesskey'); |
|
175 | + return (string)$this->get('accesskey'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | if (!empty($access) && (false !== ($pos = strpos($str, $access)))) { |
189 | 189 | return htmlspecialchars(substr($str, 0, $pos), ENT_QUOTES) |
190 | 190 | . '<span style="text-decoration: underline;">' |
191 | - . htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES) . '</span>' |
|
191 | + . htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES).'</span>' |
|
192 | 192 | . htmlspecialchars(substr($str, $pos + 1), ENT_QUOTES); |
193 | 193 | } |
194 | 194 | return htmlspecialchars($str, ENT_QUOTES); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function setClass($class) |
205 | 205 | { |
206 | - $this->add('class', (string) $class); |
|
206 | + $this->add('class', (string)$class); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public function getPattern() |
243 | 243 | { |
244 | - return (string) $this->get('pattern', ''); |
|
244 | + return (string)$this->get('pattern', ''); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function getPatternDescription() |
253 | 253 | { |
254 | - return (string) $this->get(':pattern_description', ''); |
|
254 | + return (string)$this->get(':pattern_description', ''); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
@@ -276,11 +276,11 @@ discard block |
||
276 | 276 | if (!$this->isDatalist()) { |
277 | 277 | return ''; |
278 | 278 | } |
279 | - $ret = "\n" . '<datalist id="list_' . $this->getName() . '">' . "\n"; |
|
279 | + $ret = "\n".'<datalist id="list_'.$this->getName().'">'."\n"; |
|
280 | 280 | foreach ($this->get('datalist') as $datalist) { |
281 | - $ret .= '<option value="' . htmlspecialchars($datalist, ENT_QUOTES) . '">' . "\n"; |
|
281 | + $ret .= '<option value="'.htmlspecialchars($datalist, ENT_QUOTES).'">'."\n"; |
|
282 | 282 | } |
283 | - $ret .= '</datalist>' . "\n"; |
|
283 | + $ret .= '</datalist>'."\n"; |
|
284 | 284 | return $ret; |
285 | 285 | } |
286 | 286 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | } else { |
342 | 342 | if ($this->has(':pattern_description')) { |
343 | 343 | return htmlspecialchars( |
344 | - strip_tags($this->get('caption') . ' - ' . $this->get(':pattern_description')), |
|
344 | + strip_tags($this->get('caption').' - '.$this->get(':pattern_description')), |
|
345 | 345 | ENT_QUOTES |
346 | 346 | ); |
347 | 347 | } else { |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | $class = $this->get('class'); |
527 | 527 | if ($class) { |
528 | 528 | $length = strlen($pattern); |
529 | - foreach ((array) $class as $i => $value) { |
|
529 | + foreach ((array)$class as $i => $value) { |
|
530 | 530 | if (0 === strncmp($value, $pattern, $length)) { |
531 | 531 | return $i; |
532 | 532 | } |
@@ -48,14 +48,14 @@ |
||
48 | 48 | } |
49 | 49 | if (!$ele->isHidden()) { |
50 | 50 | $ret .= '<div class="form-group">'; |
51 | - $ret .= '<label>' . $ele->getCaption(); |
|
52 | - $ret .= ($ele->isRequired() ? '<span class="caption-required">*</span>' : '') . '</label>'; |
|
51 | + $ret .= '<label>'.$ele->getCaption(); |
|
52 | + $ret .= ($ele->isRequired() ? '<span class="caption-required">*</span>' : '').'</label>'; |
|
53 | 53 | $ret .= $ele->render(); |
54 | - $ret .= '<small class="text-muted">' . $ele->getDescription() . '</small>'; |
|
55 | - $ret .= '<p class="dsc_pattern_vertical">' . $ele->getPatternDescription() . '</p>'; |
|
56 | - $ret .= '</div>' . "\n"; |
|
54 | + $ret .= '<small class="text-muted">'.$ele->getDescription().'</small>'; |
|
55 | + $ret .= '<p class="dsc_pattern_vertical">'.$ele->getPatternDescription().'</p>'; |
|
56 | + $ret .= '</div>'."\n"; |
|
57 | 57 | } else { |
58 | - $ret .= $ele->render(). "\n"; |
|
58 | + $ret .= $ele->render()."\n"; |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | $ret .= '</div>'; |
@@ -76,14 +76,14 @@ |
||
76 | 76 | return (int) $this->get('size'); |
77 | 77 | } |
78 | 78 | |
79 | - /** |
|
80 | - * Add multiple optgroup |
|
81 | - * |
|
82 | - * @param string $name name attribute |
|
83 | - * @param array $optgroup Associative array of value->name pairs |
|
84 | - * |
|
85 | - * @return void |
|
86 | - */ |
|
79 | + /** |
|
80 | + * Add multiple optgroup |
|
81 | + * |
|
82 | + * @param string $name name attribute |
|
83 | + * @param array $optgroup Associative array of value->name pairs |
|
84 | + * |
|
85 | + * @return void |
|
86 | + */ |
|
87 | 87 | public function addOptionGroup($name, $optgroup) |
88 | 88 | { |
89 | 89 | $this->setArrayItem('option', $name, $optgroup); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function getSize() |
75 | 75 | { |
76 | - return (int) $this->get('size'); |
|
76 | + return (int)$this->get('size'); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | */ |
101 | 101 | protected function renderOption($optionValue, $optionDisplay, $selected) |
102 | 102 | { |
103 | - $rendered = '<option value="' . htmlspecialchars($optionValue, ENT_QUOTES) . '"'; |
|
103 | + $rendered = '<option value="'.htmlspecialchars($optionValue, ENT_QUOTES).'"'; |
|
104 | 104 | if (in_array($optionValue, $selected)) { |
105 | 105 | $rendered .= ' selected="selected"'; |
106 | 106 | } |
107 | - $rendered .= '>' . $optionDisplay . '</option>' . "\n"; |
|
107 | + $rendered .= '>'.$optionDisplay.'</option>'."\n"; |
|
108 | 108 | |
109 | 109 | return $rendered; |
110 | 110 | } |
@@ -116,19 +116,19 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function render() |
118 | 118 | { |
119 | - $selected = (array) $this->getValue(); |
|
119 | + $selected = (array)$this->getValue(); |
|
120 | 120 | |
121 | 121 | $ele_options = $this->getOptions(); |
122 | 122 | |
123 | - $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); |
|
123 | + $extra = ($this->getExtra() != '' ? " ".$this->getExtra() : ''); |
|
124 | 124 | $this->themeDecorateElement(); |
125 | 125 | $attributes = $this->renderAttributeString(); |
126 | - $rendered = '<select ' . $attributes . $extra .' >' . "\n"; |
|
126 | + $rendered = '<select '.$attributes.$extra.' >'."\n"; |
|
127 | 127 | |
128 | 128 | if (empty($ele_optgroup)) { |
129 | 129 | foreach ($ele_options as $value => $display) { |
130 | 130 | if (is_array($display)) { |
131 | - $rendered .= '<optgroup label="' . $value . '">' . "\n"; |
|
131 | + $rendered .= '<optgroup label="'.$value.'">'."\n"; |
|
132 | 132 | foreach ($display as $optvalue => $optdisplay) { |
133 | 133 | $rendered .= $this->renderOption($optvalue, $optdisplay, $selected); |
134 | 134 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | } |
139 | 139 | } |
140 | - $rendered .= '</select>' . "\n"; |
|
140 | + $rendered .= '</select>'."\n"; |
|
141 | 141 | |
142 | 142 | return $rendered; |
143 | 143 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | return "\nvar hasSelected = false; var selectBox = myform.{$eltname};" |
164 | 164 | . "for (i = 0; i < selectBox.options.length; i++ ) { " |
165 | 165 | . "if (selectBox.options[i].selected == true && selectBox.options[i].value != '') " |
166 | - . "{ hasSelected = true; break; } }" . "if (!hasSelected) " |
|
166 | + . "{ hasSelected = true; break; } }"."if (!hasSelected) " |
|
167 | 167 | . "{ window.alert(\"{$eltmsg}\"); selectBox.focus(); return false; }"; |
168 | 168 | } |
169 | 169 | return ''; |