@@ -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); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function getSize() |
74 | 74 | { |
75 | - return (int) $this->get('size'); |
|
75 | + return (int)$this->get('size'); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function renderOption($optionValue, $optionDisplay, $selected) |
101 | 101 | { |
102 | - $rendered = '<option value="' . htmlspecialchars($optionValue, ENT_QUOTES) . '"'; |
|
102 | + $rendered = '<option value="'.htmlspecialchars($optionValue, ENT_QUOTES).'"'; |
|
103 | 103 | if (in_array($optionValue, $selected)) { |
104 | 104 | $rendered .= ' selected'; |
105 | 105 | } |
106 | - $rendered .= '>' . $optionDisplay . '</option>' . "\n"; |
|
106 | + $rendered .= '>'.$optionDisplay.'</option>'."\n"; |
|
107 | 107 | |
108 | 108 | return $rendered; |
109 | 109 | } |
@@ -115,18 +115,18 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function defaultRender() |
117 | 117 | { |
118 | - $selected = (array) $this->getValue(); |
|
118 | + $selected = (array)$this->getValue(); |
|
119 | 119 | |
120 | 120 | $ele_options = $this->getOptions(); |
121 | 121 | |
122 | - $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); |
|
122 | + $extra = ($this->getExtra() != '' ? " ".$this->getExtra() : ''); |
|
123 | 123 | $attributes = $this->renderAttributeString(); |
124 | - $rendered = '<select ' . $attributes . $extra .' >' . "\n"; |
|
124 | + $rendered = '<select '.$attributes.$extra.' >'."\n"; |
|
125 | 125 | |
126 | 126 | if (empty($ele_optgroup)) { |
127 | 127 | foreach ($ele_options as $value => $display) { |
128 | 128 | if (is_array($display)) { |
129 | - $rendered .= '<optgroup label="' . $value . '">' . "\n"; |
|
129 | + $rendered .= '<optgroup label="'.$value.'">'."\n"; |
|
130 | 130 | foreach ($display as $optvalue => $optdisplay) { |
131 | 131 | $rendered .= $this->renderOption($optvalue, $optdisplay, $selected); |
132 | 132 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | } |
137 | 137 | } |
138 | - $rendered .= '</select>' . "\n"; |
|
138 | + $rendered .= '</select>'."\n"; |
|
139 | 139 | |
140 | 140 | return $rendered; |
141 | 141 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | return "\nvar hasSelected = false; var selectBox = myform.{$eltname};" |
162 | 162 | . "for (i = 0; i < selectBox.options.length; i++ ) { " |
163 | 163 | . "if (selectBox.options[i].selected == true && selectBox.options[i].value != '') " |
164 | - . "{ hasSelected = true; break; } }" . "if (!hasSelected) " |
|
164 | + . "{ hasSelected = true; break; } }"."if (!hasSelected) " |
|
165 | 165 | . "{ window.alert(\"{$eltmsg}\"); selectBox.focus(); return false; }"; |
166 | 166 | } |
167 | 167 | return ''; |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | $elementOptions = $this->getOptions(); |
69 | 69 | $elementValue = $this->getValue(); |
70 | 70 | if (!is_array($elementValue)) { |
71 | - $elementValue = (array) $elementValue; |
|
71 | + $elementValue = (array)$elementValue; |
|
72 | 72 | } |
73 | - $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); |
|
73 | + $extra = ($this->getExtra() != '' ? " ".$this->getExtra() : ''); |
|
74 | 74 | |
75 | 75 | $elementName = $this->getName(); |
76 | 76 | $elementId = $elementName; |
77 | 77 | if (count($elementOptions) > 1 && substr($elementName, -2, 2) !== '[]') { |
78 | - $elementName = $elementName . '[]'; |
|
78 | + $elementName = $elementName.'[]'; |
|
79 | 79 | $this->setName($elementName); |
80 | 80 | // If required is set, all checkboxes will be required by the browser, |
81 | 81 | // which is not usually useful. We stash the value of required above |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | $ret = ""; |
88 | - $inline = (bool) $this->get(':inline', false); |
|
88 | + $inline = (bool)$this->get(':inline', false); |
|
89 | 89 | if ($inline) { |
90 | 90 | $ret .= '<div class="input-group">'; |
91 | 91 | } |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | } |
98 | 98 | $this->set('value', $value); |
99 | 99 | ++$idCount; |
100 | - $this->set('id', $elementId . $idCount); |
|
100 | + $this->set('id', $elementId.$idCount); |
|
101 | 101 | if ($inline) { |
102 | 102 | $ret .= '<label class="checkbox-inline">'; |
103 | - $ret .= '<input ' . $this->renderAttributeString() . $extra . ">" . $name . "\n"; |
|
103 | + $ret .= '<input '.$this->renderAttributeString().$extra.">".$name."\n"; |
|
104 | 104 | $ret .= "</label>\n"; |
105 | 105 | } else { |
106 | 106 | $ret .= "<div class=\"checkbox\">\n<label>"; |
107 | - $ret .= '<input ' . $this->renderAttributeString() . $extra . '>' . $name . "\n"; |
|
107 | + $ret .= '<input '.$this->renderAttributeString().$extra.'>'.$name."\n"; |
|
108 | 108 | $ret .= "</label>\n</div>\n"; |
109 | 109 | } |
110 | 110 |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | { |
50 | 50 | $xoops = \Xoops::getInstance(); |
51 | 51 | |
52 | - $ret = '<div id="tabs_' . $this->getName() . '">' . "\n"; |
|
53 | - $ret .= '<ul class="nav nav-tabs">' . "\n"; |
|
52 | + $ret = '<div id="tabs_'.$this->getName().'">'."\n"; |
|
53 | + $ret .= '<ul class="nav nav-tabs">'."\n"; |
|
54 | 54 | $active = ' active'; |
55 | 55 | foreach ($this->getElements() as $ele) { |
56 | 56 | if ($ele instanceof Tab) { |
57 | - $ret .= '<li class="nav' . $active . '"><a href="#tab_' . $ele->getName() |
|
58 | - . '" data-toggle="tab">' . $ele->getCaption() . '</a></li>' . "\n"; |
|
57 | + $ret .= '<li class="nav'.$active.'"><a href="#tab_'.$ele->getName() |
|
58 | + . '" data-toggle="tab">'.$ele->getCaption().'</a></li>'."\n"; |
|
59 | 59 | $active = ''; |
60 | 60 | } |
61 | 61 | } |
62 | - $ret .= '</ul><br>' . "\n"; |
|
62 | + $ret .= '</ul><br>'."\n"; |
|
63 | 63 | |
64 | 64 | $hidden = ''; |
65 | 65 | $extras = array(); |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | if (!$ele->isHidden()) { |
73 | 73 | if (!$ele instanceof Raw) { |
74 | 74 | if ($ele instanceof Tab) { |
75 | - $ret .= '<div class="tab-pane fade' . $active .'" id="tab_'. $ele->getName() . '">'; |
|
75 | + $ret .= '<div class="tab-pane fade'.$active.'" id="tab_'.$ele->getName().'">'; |
|
76 | 76 | $ret .= $ele->render(); |
77 | - $ret .= '</div>' . "\n"; |
|
77 | + $ret .= '</div>'."\n"; |
|
78 | 78 | $active = ''; |
79 | 79 | } else { |
80 | 80 | $extras[] = $ele; |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | $ret .= "\n"; |
96 | 96 | } |
97 | 97 | |
98 | - $ret .= $hidden . "\n"; |
|
99 | - $ret .= '</div>' . "\n"; |
|
100 | - $ret .= '</div>' . "\n"; |
|
98 | + $ret .= $hidden."\n"; |
|
99 | + $ret .= '</div>'."\n"; |
|
100 | + $ret .= '</div>'."\n"; |
|
101 | 101 | return $ret; |
102 | 102 | } |
103 | 103 | } |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function insertBreak($extra = '', $class = '') |
35 | 35 | { |
36 | - $class = empty($class) ? '' : ' class="' . $class . '"'; |
|
37 | - $value = '<br' . $class . ' />' . $extra; |
|
36 | + $class = empty($class) ? '' : ' class="'.$class.'"'; |
|
37 | + $value = '<br'.$class.' />'.$extra; |
|
38 | 38 | $ele = new Raw($value); |
39 | 39 | $this->addElement($ele); |
40 | 40 | } |
@@ -46,19 +46,19 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function render() |
48 | 48 | { |
49 | - $ret = $this->getTitle() . "\n<form name=\"" . $this->getName() . "\" id=\"" |
|
50 | - . $this->getName() . "\" action=\"" . $this->getAction() . "\" method=\"" |
|
51 | - . $this->getMethod() . "\"" . $this->getExtra() . ">\n"; |
|
49 | + $ret = $this->getTitle()."\n<form name=\"".$this->getName()."\" id=\"" |
|
50 | + . $this->getName()."\" action=\"".$this->getAction()."\" method=\"" |
|
51 | + . $this->getMethod()."\"".$this->getExtra().">\n"; |
|
52 | 52 | foreach ($this->getElements() as $ele) { |
53 | 53 | /* @var $ele Element */ |
54 | 54 | if (!$ele->isHidden()) { |
55 | 55 | if (!$ele instanceof Raw) { |
56 | - $ret .= "<strong>" . $ele->getCaption() . "</strong><br />" . $ele->render() . "<br />\n"; |
|
56 | + $ret .= "<strong>".$ele->getCaption()."</strong><br />".$ele->render()."<br />\n"; |
|
57 | 57 | } else { |
58 | 58 | $ret .= $ele->render(); |
59 | 59 | } |
60 | 60 | } else { |
61 | - $ret .= $ele->render() . "\n"; |
|
61 | + $ret .= $ele->render()."\n"; |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | $ret .= "</form>\n"; |
@@ -160,10 +160,10 @@ |
||
160 | 160 | } |
161 | 161 | if ($ele->getCaption() != '') { |
162 | 162 | $ret .= '<div class="form-group">'; |
163 | - $ret .= '<label class="control-label">' . $ele->getCaption() . "</label> "; |
|
163 | + $ret .= '<label class="control-label">'.$ele->getCaption()."</label> "; |
|
164 | 164 | $ret .= '</div>'; |
165 | 165 | } |
166 | - $ret .= $ele->render() . "\n"; |
|
166 | + $ret .= $ele->render()."\n"; |
|
167 | 167 | if (!$ele->isHidden()) { |
168 | 168 | ++$count; |
169 | 169 | } |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $myts = Sanitizer::getInstance(); |
79 | 79 | $value = array(); |
80 | 80 | foreach ($options as $val => $name) { |
81 | - $value[(bool) $encode ? $myts->htmlSpecialChars($val) : $val] = ($encode > 1) |
|
81 | + $value[(bool)$encode ? $myts->htmlSpecialChars($val) : $val] = ($encode > 1) |
|
82 | 82 | ? $myts->htmlSpecialChars($name) : $name; |
83 | 83 | } |
84 | 84 | return $value; |
@@ -44,27 +44,27 @@ |
||
44 | 44 | */ |
45 | 45 | public function render() |
46 | 46 | { |
47 | - $ret = $this->getTitle() . "\n" . '<form name="' . $this->getName() . '" id="' |
|
48 | - . $this->getName() . '" action="' . $this->getAction() . '" method="' . $this->getMethod() |
|
49 | - . '"' . $this->getExtra() . '>' . "\n" . '<table border="0" width="100%">' . "\n"; |
|
47 | + $ret = $this->getTitle()."\n".'<form name="'.$this->getName().'" id="' |
|
48 | + . $this->getName().'" action="'.$this->getAction().'" method="'.$this->getMethod() |
|
49 | + . '"'.$this->getExtra().'>'."\n".'<table border="0" width="100%">'."\n"; |
|
50 | 50 | $hidden = ""; |
51 | 51 | foreach ($this->getElements() as $ele) { |
52 | 52 | /* @var $ele Element */ |
53 | 53 | if (!$ele->isHidden()) { |
54 | 54 | if (!$ele instanceof Raw) { |
55 | - $ret .= '<tr valign="top" align="left"><td>' . $ele->getCaption(); |
|
55 | + $ret .= '<tr valign="top" align="left"><td>'.$ele->getCaption(); |
|
56 | 56 | if ($ele_desc = $ele->getDescription()) { |
57 | - $ret .= '<br /><br /><span style="font-weight: normal;">' . $ele_desc . '</span>'; |
|
57 | + $ret .= '<br /><br /><span style="font-weight: normal;">'.$ele_desc.'</span>'; |
|
58 | 58 | } |
59 | - $ret .= '</td><td>' . $ele->render() . '</td></tr>'; |
|
59 | + $ret .= '</td><td>'.$ele->render().'</td></tr>'; |
|
60 | 60 | } else { |
61 | 61 | $ret .= $ele->render(); |
62 | 62 | } |
63 | 63 | } else { |
64 | - $hidden .= $ele->render() . "\n"; |
|
64 | + $hidden .= $ele->render()."\n"; |
|
65 | 65 | } |
66 | 66 | } |
67 | - $ret .= '</table>' . "\n" . ' ' . $hidden . '</form>' . "\n"; |
|
67 | + $ret .= '</table>'."\n".' '.$hidden.'</form>'."\n"; |
|
68 | 68 | return $ret; |
69 | 69 | } |
70 | 70 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | $editor_handler->allowed_editors = $this->allowed_editors; |
84 | 84 | $option_select = new Select("", $this->name, $this->value); |
85 | 85 | $onchangeCode = '"if(this.options[this.selectedIndex].value.length > 0 ){window.document.forms.' |
86 | - . $this->form->getName() . '.submit();}"'; |
|
86 | + . $this->form->getName().'.submit();}"'; |
|
87 | 87 | $option_select->set('onchange', $onchangeCode); |
88 | 88 | $option_select->addOptionArray($editor_handler->getList($this->nohtml)); |
89 | 89 | $this->addElement($option_select); |
@@ -74,7 +74,7 @@ |
||
74 | 74 | $configs = $this->captchaHandler->loadConfig(); |
75 | 75 | |
76 | 76 | $this->captchaHandler->setConfigs($configs); |
77 | - if (! $this->captchaHandler->isActive()) { |
|
77 | + if (!$this->captchaHandler->isActive()) { |
|
78 | 78 | $this->setHidden(); |
79 | 79 | } |
80 | 80 | } |