@@ -44,32 +44,32 @@ discard block |
||
| 44 | 44 | return ''; |
| 45 | 45 | }*/ |
| 46 | 46 | |
| 47 | - /** |
|
| 47 | + /** |
|
| 48 | 48 | * Render support for XoopsFormButton |
| 49 | 49 | * |
| 50 | 50 | * @param XoopsFormButton $element form element |
| 51 | 51 | * |
| 52 | 52 | * @return string rendered form element |
| 53 | 53 | */ |
| 54 | - protected function renderXoopsFormButton(\Xoops\Form\Button $element):string |
|
| 54 | + protected function renderXoopsFormButton(\Xoops\Form\Button $element):string |
|
| 55 | 55 | { |
| 56 | - if (false == $element->hasClassLike('btn')) { |
|
| 57 | - $element->add('class', 'btn btn-default'); |
|
| 58 | - } |
|
| 59 | - $attributes = $element->renderAttributeString(); |
|
| 56 | + if (false == $element->hasClassLike('btn')) { |
|
| 57 | + $element->add('class', 'btn btn-default'); |
|
| 58 | + } |
|
| 59 | + $attributes = $element->renderAttributeString(); |
|
| 60 | 60 | return '<input ' . $attributes . $element->getExtra() .' >'; |
| 61 | - } |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 63 | + /** |
|
| 64 | 64 | * Render support for XoopsFormButtonTray |
| 65 | 65 | * |
| 66 | 66 | * @param XoopsFormButtonTray $element form element |
| 67 | 67 | * |
| 68 | 68 | * @return string rendered form element |
| 69 | 69 | */ |
| 70 | - protected function renderXoopsFormButtonTray(\Xoops\Form\ButtonTray $element):string |
|
| 70 | + protected function renderXoopsFormButtonTray(\Xoops\Form\ButtonTray $element):string |
|
| 71 | 71 | { |
| 72 | - $ret = ''; |
|
| 72 | + $ret = ''; |
|
| 73 | 73 | $element->add('class', 'btn'); |
| 74 | 74 | $class = 'class="' . $element->getClass() . '"'; |
| 75 | 75 | |
@@ -84,16 +84,16 @@ discard block |
||
| 84 | 84 | . ' <input type="reset"' . $class . ' name="reset" id="reset" value="' . \XoopsLocale::A_RESET . '" />' |
| 85 | 85 | . ' <input ' . $attributes . $element->getExtra() . ' />'; |
| 86 | 86 | return $ret; |
| 87 | - } |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - /** |
|
| 89 | + /** |
|
| 90 | 90 | * Render support for XoopsFormColorPicker |
| 91 | 91 | * |
| 92 | 92 | * @param XoopsFormColorPicker $element form element |
| 93 | 93 | * |
| 94 | 94 | * @return string rendered form element |
| 95 | 95 | */ |
| 96 | - protected function renderXoopsFormColorPicker(\Xoops\Form\ColorPicker $element):string |
|
| 96 | + protected function renderXoopsFormColorPicker(\Xoops\Form\ColorPicker $element):string |
|
| 97 | 97 | { |
| 98 | 98 | $xoops = \Xoops::getInstance(); |
| 99 | 99 | if ($xoops->theme()) { |
@@ -118,16 +118,16 @@ discard block |
||
| 118 | 118 | $ret .= '</span></div>'; |
| 119 | 119 | |
| 120 | 120 | return $ret; |
| 121 | - } |
|
| 121 | + } |
|
| 122 | 122 | |
| 123 | - /** |
|
| 123 | + /** |
|
| 124 | 124 | * Render support for XoopsFormDateSelect |
| 125 | 125 | * |
| 126 | 126 | * @param XoopsFormDateSelect $element form element |
| 127 | 127 | * |
| 128 | 128 | * @return string rendered form element |
| 129 | 129 | */ |
| 130 | - protected function renderXoopsFormDateSelect(\Xoops\Form\DateSelect $element):string |
|
| 130 | + protected function renderXoopsFormDateSelect(\Xoops\Form\DateSelect $element):string |
|
| 131 | 131 | { |
| 132 | 132 | $xoops = \Xoops::getInstance(); |
| 133 | 133 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $element->add('list', 'list_' . $element->getName()); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - $element->add('class', 'form-control'); |
|
| 141 | + $element->add('class', 'form-control'); |
|
| 142 | 142 | $element->suppressRender(['value']); |
| 143 | 143 | $attributes = $element->renderAttributeString(); |
| 144 | 144 | |
@@ -164,16 +164,16 @@ discard block |
||
| 164 | 164 | $ret .= '</span></div>'; |
| 165 | 165 | |
| 166 | 166 | return $ret; |
| 167 | - } |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | - /** |
|
| 169 | + /** |
|
| 170 | 170 | * Render support for XoopsFormDhtmlTextArea |
| 171 | 171 | * |
| 172 | 172 | * @param XoopsFormDhtmlTextArea $element form element |
| 173 | 173 | * |
| 174 | 174 | * @return string rendered form element |
| 175 | 175 | */ |
| 176 | - protected function renderXoopsFormDhtmlTextArea(\Xoops\Form\DhtmlTextArea $element):string |
|
| 176 | + protected function renderXoopsFormDhtmlTextArea(\Xoops\Form\DhtmlTextArea $element):string |
|
| 177 | 177 | { |
| 178 | 178 | if ($element->htmlEditor && is_object($element->htmlEditor)) { |
| 179 | 179 | if (!isset($element->htmlEditor->isEnabled) || $element->htmlEditor->isEnabled) { |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | // actions |
| 190 | 190 | $ret .= $this->XoopsFormDhtmlTextAreaCodeIcon($element) . "<br>\n"; |
| 191 | 191 | // fonts |
| 192 | - $ret .= $this->XoopsFormDhtmlTextAreaTypography($element); |
|
| 193 | - $ret .= "<br>\n"; |
|
| 192 | + $ret .= $this->XoopsFormDhtmlTextAreaTypography($element); |
|
| 193 | + $ret .= "<br>\n"; |
|
| 194 | 194 | // the textarea box |
| 195 | - $element->add('class', 'form-control'); |
|
| 195 | + $element->add('class', 'form-control'); |
|
| 196 | 196 | $element->suppressRender(['value']); |
| 197 | 197 | $attributes = $element->renderAttributeString(); |
| 198 | 198 | |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | $js_loaded = true; |
| 217 | 217 | } |
| 218 | 218 | return $ret; |
| 219 | - } |
|
| 219 | + } |
|
| 220 | 220 | |
| 221 | - /** |
|
| 221 | + /** |
|
| 222 | 222 | * Render xoopscode buttons for editor, include calling text sanitizer extensions |
| 223 | 223 | * |
| 224 | 224 | * @param XoopsFormDhtmlTextArea $element form element |
@@ -226,19 +226,19 @@ discard block |
||
| 226 | 226 | * @return string rendered buttons for xoopscode assistance |
| 227 | 227 | */ |
| 228 | 228 | |
| 229 | - public function XoopsFormDhtmlTextAreaCodeIcon($element) |
|
| 229 | + public function XoopsFormDhtmlTextAreaCodeIcon($element) |
|
| 230 | 230 | { |
| 231 | 231 | $textarea_id = $element->getName(); |
| 232 | - $xoops = \Xoops::getInstance(); |
|
| 232 | + $xoops = \Xoops::getInstance(); |
|
| 233 | 233 | $myts = \Xoops\Core\Text\Sanitizer::getInstance(); |
| 234 | 234 | |
| 235 | - $code = ''; |
|
| 235 | + $code = ''; |
|
| 236 | 236 | $code .= "<div class='row'><div class='col-md-12'>"; |
| 237 | 237 | $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeUrl(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_LINK_URL) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_WEBSITE_TITLE) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::URL . "'><span class='fa fa-fw fa-link' aria-hidden='true'></span></button>"; |
| 238 | 238 | $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeEmail(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_EMAIL) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::EMAIL . "'><span class='fa fa-fw fa-envelope-o' aria-hidden='true'></span></button>"; |
| 239 | 239 | $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeImg(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_URL) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_POSITION) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::IMAGE_POSITION_DESCRIPTION) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::E_ENTER_IMAGE_POSITION) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::WIDTH) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::IMAGES . "'><span class='fa fa-fw fa-file-image-o' aria-hidden='true'></span></button>"; |
| 240 | 240 | |
| 241 | - $response = \Xoops::getInstance()->service('emoji')->renderEmojiSelector($element->getName()); |
|
| 241 | + $response = \Xoops::getInstance()->service('emoji')->renderEmojiSelector($element->getName()); |
|
| 242 | 242 | if ($response->isSuccess()) { |
| 243 | 243 | $emojiSelector = $response->getValue(); |
| 244 | 244 | $code .= $emojiSelector; |
@@ -255,14 +255,14 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeCode(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_CODE) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::SOURCE_CODE . "'><span class='fa fa-fw fa-code' aria-hidden='true'></span></button>"; |
|
| 258 | + $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeCode(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_CODE) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::SOURCE_CODE . "'><span class='fa fa-fw fa-code' aria-hidden='true'></span></button>"; |
|
| 259 | 259 | $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeQuote(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_QUOTE) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::QUOTE . "'><span class='fa fa-fw fa-quote-right' aria-hidden='true'></span></button>"; |
| 260 | 260 | $code .= "</div></div>"; |
| 261 | 261 | |
| 262 | 262 | return $code; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - /** |
|
| 265 | + /** |
|
| 266 | 266 | * Render typography controls for editor (font, size, color) |
| 267 | 267 | * |
| 268 | 268 | * @param XoopsFormDhtmlTextArea $element form element |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | protected function XoopsFormDhtmlTextAreaTypography($element) |
| 273 | 273 | { |
| 274 | 274 | $textarea_id = $element->getName(); |
| 275 | - $hiddentext = $element->hiddenText; |
|
| 275 | + $hiddentext = $element->hiddenText; |
|
| 276 | 276 | |
| 277 | 277 | $fontarray = !empty($GLOBALS['formtextdhtml_fonts']) ? $GLOBALS['formtextdhtml_fonts'] : array( |
| 278 | 278 | 'Arial', |
@@ -357,28 +357,28 @@ discard block |
||
| 357 | 357 | return $fontStr; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | - /** |
|
| 360 | + /** |
|
| 361 | 361 | * Render support for XoopsFormPassword |
| 362 | 362 | * |
| 363 | 363 | * @param XoopsFormPassword $element form element |
| 364 | 364 | * |
| 365 | 365 | * @return string rendered form element |
| 366 | 366 | */ |
| 367 | - protected function renderXoopsFormPassword(\Xoops\Form\Password $element):string |
|
| 367 | + protected function renderXoopsFormPassword(\Xoops\Form\Password $element):string |
|
| 368 | 368 | { |
| 369 | 369 | $element->add('class', 'form-control'); |
| 370 | - $attributes = $element->renderAttributeString(); |
|
| 370 | + $attributes = $element->renderAttributeString(); |
|
| 371 | 371 | return '<input ' . $attributes . $element->getExtra() .' >'; |
| 372 | - } |
|
| 372 | + } |
|
| 373 | 373 | |
| 374 | - /** |
|
| 374 | + /** |
|
| 375 | 375 | * Render support for XoopsFormSelect |
| 376 | 376 | * |
| 377 | 377 | * @param XoopsFormSelect $element form element |
| 378 | 378 | * |
| 379 | 379 | * @return string rendered form element |
| 380 | 380 | */ |
| 381 | - protected function renderXoopsFormSelect(\Xoops\Form\Select $element):string |
|
| 381 | + protected function renderXoopsFormSelect(\Xoops\Form\Select $element):string |
|
| 382 | 382 | { |
| 383 | 383 | $selected = (array) $element->getValue(); |
| 384 | 384 | |
@@ -404,16 +404,16 @@ discard block |
||
| 404 | 404 | $ret .= '</select>' . "\n"; |
| 405 | 405 | |
| 406 | 406 | return $ret; |
| 407 | - } |
|
| 407 | + } |
|
| 408 | 408 | |
| 409 | - /** |
|
| 409 | + /** |
|
| 410 | 410 | * Render support for XoopsFormText |
| 411 | 411 | * |
| 412 | 412 | * @param XoopsFormText $element form element |
| 413 | 413 | * |
| 414 | 414 | * @return string rendered form element |
| 415 | 415 | */ |
| 416 | - protected function renderXoopsFormText(\Xoops\Form\Text $element):string |
|
| 416 | + protected function renderXoopsFormText(\Xoops\Form\Text $element):string |
|
| 417 | 417 | { |
| 418 | 418 | $element->add('class', 'form-control'); |
| 419 | 419 | $dataList = $element->isDatalist(); |
@@ -423,21 +423,21 @@ discard block |
||
| 423 | 423 | |
| 424 | 424 | $attributes = $element->renderAttributeString(); |
| 425 | 425 | return '<input ' . $attributes . ' ' . $element->getExtra() .' >'; |
| 426 | - } |
|
| 426 | + } |
|
| 427 | 427 | |
| 428 | - /** |
|
| 428 | + /** |
|
| 429 | 429 | * Render support for XoopsFormTextArea |
| 430 | 430 | * |
| 431 | 431 | * @param XoopsFormTextArea $element form element |
| 432 | 432 | * |
| 433 | 433 | * @return string rendered form element |
| 434 | 434 | */ |
| 435 | - protected function renderXoopsFormTextArea(\Xoops\Form\TextArea $element):string |
|
| 435 | + protected function renderXoopsFormTextArea(\Xoops\Form\TextArea $element):string |
|
| 436 | 436 | { |
| 437 | 437 | $element->suppressRender(['value']); |
| 438 | - $element->add('class', 'form-control'); |
|
| 438 | + $element->add('class', 'form-control'); |
|
| 439 | 439 | $attributes = $element->renderAttributeString(); |
| 440 | 440 | return '<textarea ' . $attributes . ' ' . $element->getExtra() .' >' |
| 441 | 441 | . $element->getValue() . '</textarea>'; |
| 442 | - } |
|
| 442 | + } |
|
| 443 | 443 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | public function render(\Xoops\Form\Element $element):string |
| 24 | 24 | { |
| 25 | - $methodName = 'render' . str_replace('\\' , '', get_class($element)); |
|
| 25 | + $methodName = 'render'.str_replace('\\', '', get_class($element)); |
|
| 26 | 26 | if (true === method_exists($this, $methodName)) { |
| 27 | 27 | return $this->$methodName($element); |
| 28 | 28 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $element->add('class', 'btn btn-default'); |
| 58 | 58 | } |
| 59 | 59 | $attributes = $element->renderAttributeString(); |
| 60 | - return '<input ' . $attributes . $element->getExtra() .' >'; |
|
| 60 | + return '<input '.$attributes.$element->getExtra().' >'; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -71,18 +71,18 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $ret = ''; |
| 73 | 73 | $element->add('class', 'btn'); |
| 74 | - $class = 'class="' . $element->getClass() . '"'; |
|
| 74 | + $class = 'class="'.$element->getClass().'"'; |
|
| 75 | 75 | |
| 76 | 76 | $attributes = $element->renderAttributeString(); |
| 77 | 77 | |
| 78 | - if ((bool) $element->get(':showdelete', false)) { |
|
| 79 | - $ret .= '<input type="submit"' . $class . ' name="delete" id="delete" value="' |
|
| 80 | - . \XoopsLocale::A_DELETE . '" onclick="this.form.elements.op.value=\'delete\'">'; |
|
| 78 | + if ((bool)$element->get(':showdelete', false)) { |
|
| 79 | + $ret .= '<input type="submit"'.$class.' name="delete" id="delete" value="' |
|
| 80 | + . \XoopsLocale::A_DELETE.'" onclick="this.form.elements.op.value=\'delete\'">'; |
|
| 81 | 81 | } |
| 82 | - $ret .= ' <input type="button" ' . $class . ' value="' . \XoopsLocale::A_CANCEL |
|
| 82 | + $ret .= ' <input type="button" '.$class.' value="'.\XoopsLocale::A_CANCEL |
|
| 83 | 83 | . '" onclick="history.go(-1);return true;" />' |
| 84 | - . ' <input type="reset"' . $class . ' name="reset" id="reset" value="' . \XoopsLocale::A_RESET . '" />' |
|
| 85 | - . ' <input ' . $attributes . $element->getExtra() . ' />'; |
|
| 84 | + . ' <input type="reset"'.$class.' name="reset" id="reset" value="'.\XoopsLocale::A_RESET.'" />' |
|
| 85 | + . ' <input '.$attributes.$element->getExtra().' />'; |
|
| 86 | 86 | return $ret; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -99,21 +99,21 @@ discard block |
||
| 99 | 99 | if ($xoops->theme()) { |
| 100 | 100 | $xoops->theme()->addScript('include/color-picker.js'); |
| 101 | 101 | } else { |
| 102 | - echo '<script type="text/javascript" src="' . $xoops->url('/include/color-picker.js') . '"></script>'; |
|
| 102 | + echo '<script type="text/javascript" src="'.$xoops->url('/include/color-picker.js').'"></script>'; |
|
| 103 | 103 | } |
| 104 | 104 | $temp = $element->get('value', ''); |
| 105 | 105 | if (!empty($temp)) { |
| 106 | - $element->set('style', 'background-color:' . $temp . ';'); |
|
| 106 | + $element->set('style', 'background-color:'.$temp.';'); |
|
| 107 | 107 | } |
| 108 | 108 | $element->set('class', 'form-control'); |
| 109 | 109 | $ret = '<div class="input-group">'; |
| 110 | 110 | $attributes = $element->renderAttributeString(); |
| 111 | - $ret .= '<input ' . $attributes . ' ' . $element->getExtra() .' >'; |
|
| 111 | + $ret .= '<input '.$attributes.' '.$element->getExtra().' >'; |
|
| 112 | 112 | $ret .= '<span class="input-group-btn">'; |
| 113 | 113 | $ret .= '<button class="btn btn-default" type="button" '; |
| 114 | - $ret .= 'data-toggle="tooltip" data-placement="left" title="' . \XoopsLocale::A_SELECT . '" '; |
|
| 114 | + $ret .= 'data-toggle="tooltip" data-placement="left" title="'.\XoopsLocale::A_SELECT.'" '; |
|
| 115 | 115 | $ret .= 'onclick="return TCP.popup(\''; |
| 116 | - $ret .= $xoops->url('/include/') . '\',document.getElementById(\'' . $element->getName() . '\'));">'; |
|
| 116 | + $ret .= $xoops->url('/include/').'\',document.getElementById(\''.$element->getName().'\'));">'; |
|
| 117 | 117 | $ret .= '<span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></button>'; |
| 118 | 118 | $ret .= '</span></div>'; |
| 119 | 119 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | $dataList = $element->isDatalist(); |
| 137 | 137 | if (!empty($dataList)) { |
| 138 | - $element->add('list', 'list_' . $element->getName()); |
|
| 138 | + $element->add('list', 'list_'.$element->getName()); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $element->add('class', 'form-control'); |
@@ -149,17 +149,17 @@ discard block |
||
| 149 | 149 | $xoops->theme()->addScript( |
| 150 | 150 | '', |
| 151 | 151 | '', |
| 152 | - ' $(function() { $( "#' . $element->get('id') . '" ).datepicker({' . |
|
| 153 | - 'showOn: "focus", changeYear: true, constrainInput: false ' . |
|
| 152 | + ' $(function() { $( "#'.$element->get('id').'" ).datepicker({'. |
|
| 153 | + 'showOn: "focus", changeYear: true, constrainInput: false '. |
|
| 154 | 154 | ' }); }); ' |
| 155 | 155 | ); |
| 156 | 156 | |
| 157 | 157 | $ret = '<div class="input-group">'; |
| 158 | - $ret .= '<input ' . $attributes . ' value="' . $display_value . '" ' . $element->getExtra() .' >'; |
|
| 158 | + $ret .= '<input '.$attributes.' value="'.$display_value.'" '.$element->getExtra().' >'; |
|
| 159 | 159 | $ret .= '<span class="input-group-btn">'; |
| 160 | 160 | $ret .= '<button class="btn btn-default" type="button" '; |
| 161 | - $ret .= 'data-toggle="tooltip" data-placement="left" title="' . \XoopsLocale::A_SELECT . '" '; |
|
| 162 | - $ret .= 'onclick="$( \'#' . $element->get('id') . '\' ).datepicker( \'show\' );"> '; |
|
| 161 | + $ret .= 'data-toggle="tooltip" data-placement="left" title="'.\XoopsLocale::A_SELECT.'" '; |
|
| 162 | + $ret .= 'onclick="$( \'#'.$element->get('id').'\' ).datepicker( \'show\' );"> '; |
|
| 163 | 163 | $ret .= '<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span></button>'; |
| 164 | 164 | $ret .= '</span></div>'; |
| 165 | 165 | |
@@ -184,10 +184,10 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | $xoops = \Xoops::getInstance(); |
| 186 | 186 | |
| 187 | - $extra = ($element->getExtra() != '' ? " " . $element->getExtra() : ''); |
|
| 187 | + $extra = ($element->getExtra() != '' ? " ".$element->getExtra() : ''); |
|
| 188 | 188 | $ret = ""; |
| 189 | 189 | // actions |
| 190 | - $ret .= $this->XoopsFormDhtmlTextAreaCodeIcon($element) . "<br>\n"; |
|
| 190 | + $ret .= $this->XoopsFormDhtmlTextAreaCodeIcon($element)."<br>\n"; |
|
| 191 | 191 | // fonts |
| 192 | 192 | $ret .= $this->XoopsFormDhtmlTextAreaTypography($element); |
| 193 | 193 | $ret .= "<br>\n"; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $element->suppressRender(['value']); |
| 197 | 197 | $attributes = $element->renderAttributeString(); |
| 198 | 198 | |
| 199 | - $ret .= '<textarea ' . $attributes . $extra . '>' . $element->getValue() . "</textarea>\n"; |
|
| 199 | + $ret .= '<textarea '.$attributes.$extra.'>'.$element->getValue()."</textarea>\n"; |
|
| 200 | 200 | |
| 201 | 201 | if (empty($element->skipPreview)) { |
| 202 | 202 | if (!$xoops->theme()) { |
@@ -204,15 +204,15 @@ discard block |
||
| 204 | 204 | } else { |
| 205 | 205 | $xoops->theme()->addScript('media/xoops/image.js', array('type' => 'text/javascript')); |
| 206 | 206 | } |
| 207 | - $button = "<input id='" . $element->getName() . "_preview_button' " . "type='button' " . "class='btn btn-sm btn-default' value='" . \XoopsLocale::A_PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $element->getName() . "','" . XOOPS_URL . "/images', " . (int)($element->doHtml) . ", '" . $xoops->security()->createToken() . "')\"" . " />"; |
|
| 208 | - $ret .= "<br />" . "<div id='" . $element->getName() . "_hidden' style='display: block;'> " . "<fieldset>" . "<legend>" . $button . "</legend>" . "<div id='" . $element->getName() . "_hidden_data'>" . \XoopsLocale::CLICK_PREVIEW_TO_SEE_CONTENT . "</div>" . "</fieldset>" . "</div>"; |
|
| 207 | + $button = "<input id='".$element->getName()."_preview_button' "."type='button' "."class='btn btn-sm btn-default' value='".\XoopsLocale::A_PREVIEW."' "."onclick=\"form_instantPreview('".XOOPS_URL."', '".$element->getName()."','".XOOPS_URL."/images', ".(int)($element->doHtml).", '".$xoops->security()->createToken()."')\""." />"; |
|
| 208 | + $ret .= "<br />"."<div id='".$element->getName()."_hidden' style='display: block;'> "."<fieldset>"."<legend>".$button."</legend>"."<div id='".$element->getName()."_hidden_data'>".\XoopsLocale::CLICK_PREVIEW_TO_SEE_CONTENT."</div>"."</fieldset>"."</div>"; |
|
| 209 | 209 | } |
| 210 | 210 | // Load javascript |
| 211 | 211 | if (empty($js_loaded)) { |
| 212 | 212 | $javascript = (($element->js) |
| 213 | - ? '<script type="text/javascript">' . $element->js . '</script>' |
|
| 214 | - : '') . '<script type="text/javascript" src="' . \XoopsBaseConfig::get('url') . '/include/formdhtmltextarea.js"></script>'; |
|
| 215 | - $ret = $javascript . $ret; |
|
| 213 | + ? '<script type="text/javascript">'.$element->js.'</script>' |
|
| 214 | + : '').'<script type="text/javascript" src="'.\XoopsBaseConfig::get('url').'/include/formdhtmltextarea.js"></script>'; |
|
| 215 | + $ret = $javascript.$ret; |
|
| 216 | 216 | $js_loaded = true; |
| 217 | 217 | } |
| 218 | 218 | return $ret; |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | $code = ''; |
| 236 | 236 | $code .= "<div class='row'><div class='col-md-12'>"; |
| 237 | - $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeUrl(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_LINK_URL) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_WEBSITE_TITLE) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::URL . "'><span class='fa fa-fw fa-link' aria-hidden='true'></span></button>"; |
|
| 238 | - $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeEmail(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_EMAIL) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::EMAIL . "'><span class='fa fa-fw fa-envelope-o' aria-hidden='true'></span></button>"; |
|
| 239 | - $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeImg(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_URL) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_POSITION) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::IMAGE_POSITION_DESCRIPTION) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::E_ENTER_IMAGE_POSITION) . "\", \"" . $myts->escapeForJavascript(\XoopsLocale::WIDTH) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::IMAGES . "'><span class='fa fa-fw fa-file-image-o' aria-hidden='true'></span></button>"; |
|
| 237 | + $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeUrl(\"{$textarea_id}\", \"".$myts->escapeForJavascript(\XoopsLocale::ENTER_LINK_URL)."\", \"".$myts->escapeForJavascript(\XoopsLocale::ENTER_WEBSITE_TITLE)."\");' onmouseover='style.cursor=\"hand\"' title='".\XoopsLocale::URL."'><span class='fa fa-fw fa-link' aria-hidden='true'></span></button>"; |
|
| 238 | + $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeEmail(\"{$textarea_id}\", \"".$myts->escapeForJavascript(\XoopsLocale::ENTER_EMAIL)."\");' onmouseover='style.cursor=\"hand\"' title='".\XoopsLocale::EMAIL."'><span class='fa fa-fw fa-envelope-o' aria-hidden='true'></span></button>"; |
|
| 239 | + $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeImg(\"{$textarea_id}\", \"".$myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_URL)."\", \"".$myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_POSITION)."\", \"".$myts->escapeForJavascript(\XoopsLocale::IMAGE_POSITION_DESCRIPTION)."\", \"".$myts->escapeForJavascript(\XoopsLocale::E_ENTER_IMAGE_POSITION)."\", \"".$myts->escapeForJavascript(\XoopsLocale::WIDTH)."\");' onmouseover='style.cursor=\"hand\"' title='".\XoopsLocale::IMAGES."'><span class='fa fa-fw fa-file-image-o' aria-hidden='true'></span></button>"; |
|
| 240 | 240 | |
| 241 | 241 | $response = \Xoops::getInstance()->service('emoji')->renderEmojiSelector($element->getName()); |
| 242 | 242 | if ($response->isSuccess()) { |
@@ -255,8 +255,8 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeCode(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_CODE) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::SOURCE_CODE . "'><span class='fa fa-fw fa-code' aria-hidden='true'></span></button>"; |
|
| 259 | - $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeQuote(\"{$textarea_id}\", \"" . $myts->escapeForJavascript(\XoopsLocale::ENTER_QUOTE) . "\");' onmouseover='style.cursor=\"hand\"' title='" . \XoopsLocale::QUOTE . "'><span class='fa fa-fw fa-quote-right' aria-hidden='true'></span></button>"; |
|
| 258 | + $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeCode(\"{$textarea_id}\", \"".$myts->escapeForJavascript(\XoopsLocale::ENTER_CODE)."\");' onmouseover='style.cursor=\"hand\"' title='".\XoopsLocale::SOURCE_CODE."'><span class='fa fa-fw fa-code' aria-hidden='true'></span></button>"; |
|
| 259 | + $code .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsCodeQuote(\"{$textarea_id}\", \"".$myts->escapeForJavascript(\XoopsLocale::ENTER_QUOTE)."\");' onmouseover='style.cursor=\"hand\"' title='".\XoopsLocale::QUOTE."'><span class='fa fa-fw fa-quote-right' aria-hidden='true'></span></button>"; |
|
| 260 | 260 | $code .= "</div></div>"; |
| 261 | 261 | |
| 262 | 262 | return $code; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | protected function XoopsFormDhtmlTextAreaTypography($element) |
| 273 | 273 | { |
| 274 | 274 | $textarea_id = $element->getName(); |
| 275 | - $hiddentext = $element->hiddenText; |
|
| 275 | + $hiddentext = $element->hiddenText; |
|
| 276 | 276 | |
| 277 | 277 | $fontarray = !empty($GLOBALS['formtextdhtml_fonts']) ? $GLOBALS['formtextdhtml_fonts'] : array( |
| 278 | 278 | 'Arial', |
@@ -299,59 +299,59 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | $fontStr = '<div class="row"><div class="col-md-12"><div class="btn-group" role="toolbar">'; |
| 301 | 301 | $fontStr .= '<div class="btn-group">' |
| 302 | - . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'. \XoopsLocale::SIZE .'"' |
|
| 302 | + . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'.\XoopsLocale::SIZE.'"' |
|
| 303 | 303 | . ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' |
| 304 | 304 | . '<span class = "glyphicon glyphicon-text-height"></span><span class="caret"></span></button>' |
| 305 | 305 | . '<ul class="dropdown-menu">'; |
| 306 | 306 | foreach (\XoopsLocale::getFontSizes() as $value => $name) { |
| 307 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'size\', \'' . $value . '\', \'' |
|
| 308 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' . $name . '</a></li>'; |
|
| 307 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'size\', \''.$value.'\', \'' |
|
| 308 | + . $textarea_id.'\', \''.$hiddentext.'\');">'.$name.'</a></li>'; |
|
| 309 | 309 | } |
| 310 | 310 | $fontStr .= '</ul></div>'; |
| 311 | 311 | |
| 312 | 312 | $fontStr .= '<div class="btn-group">' |
| 313 | - . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'. \XoopsLocale::FONT .'"' |
|
| 313 | + . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'.\XoopsLocale::FONT.'"' |
|
| 314 | 314 | . ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' |
| 315 | 315 | . '<span class = "glyphicon glyphicon-font"></span><span class="caret"></span></button>' |
| 316 | 316 | . '<ul class="dropdown-menu">'; |
| 317 | 317 | foreach ($fontarray as $font) { |
| 318 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'font\', \'' . $font . '\', \'' |
|
| 319 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' . $font . '</a></li>'; |
|
| 318 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'font\', \''.$font.'\', \'' |
|
| 319 | + . $textarea_id.'\', \''.$hiddentext.'\');">'.$font.'</a></li>'; |
|
| 320 | 320 | } |
| 321 | 321 | $fontStr .= '</ul></div>'; |
| 322 | 322 | |
| 323 | 323 | $fontStr .= '<div class="btn-group">' |
| 324 | - . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'. \XoopsLocale::COLOR .'"' |
|
| 324 | + . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'.\XoopsLocale::COLOR.'"' |
|
| 325 | 325 | . ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' |
| 326 | 326 | . '<span class = "glyphicon glyphicon-text-color"></span><span class="caret"></span></button>' |
| 327 | 327 | . '<ul class="dropdown-menu">'; |
| 328 | 328 | foreach ($colorArray as $color => $hex) { |
| 329 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'color\', \'' . $hex . '\', \'' |
|
| 330 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' |
|
| 331 | - . '<span style="color:#' . $hex . ';">' . $color .'</span></a></li>'; |
|
| 329 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'color\', \''.$hex.'\', \'' |
|
| 330 | + . $textarea_id.'\', \''.$hiddentext.'\');">' |
|
| 331 | + . '<span style="color:#'.$hex.';">'.$color.'</span></a></li>'; |
|
| 332 | 332 | } |
| 333 | 333 | $fontStr .= '</ul></div>'; |
| 334 | 334 | $fontStr .= '</div>'; |
| 335 | 335 | |
| 336 | 336 | $styleStr = "<div class='btn-group' role='group'>"; |
| 337 | - $styleStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeBold(\"{$hiddentext}\", \"{$textarea_id}\");' title='" . \XoopsLocale::BOLD . "' aria-label='Left Align'><span class='fa fa-bold' aria-hidden='true'></span></button>"; |
|
| 338 | - $styleStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeItalic(\"{$hiddentext}\", \"{$textarea_id}\");' title='" . \XoopsLocale::ITALIC . "' aria-label='Left Align'><span class='fa fa-italic' aria-hidden='true'></span></button>"; |
|
| 339 | - $styleStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeUnderline(\"{$hiddentext}\", \"{$textarea_id}\");' title='" . \XoopsLocale::UNDERLINE . "' aria-label='Left Align'>" . '<span class="fa fa-underline"></span></button>'; |
|
| 340 | - $styleStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeLineThrough(\"{$hiddentext}\", \"{$textarea_id}\");' title='" . \XoopsLocale::LINE_THROUGH . "' aria-label='Left Align'>" . '<span class="fa fa-strikethrough"></span></button>'; |
|
| 337 | + $styleStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeBold(\"{$hiddentext}\", \"{$textarea_id}\");' title='".\XoopsLocale::BOLD."' aria-label='Left Align'><span class='fa fa-bold' aria-hidden='true'></span></button>"; |
|
| 338 | + $styleStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeItalic(\"{$hiddentext}\", \"{$textarea_id}\");' title='".\XoopsLocale::ITALIC."' aria-label='Left Align'><span class='fa fa-italic' aria-hidden='true'></span></button>"; |
|
| 339 | + $styleStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeUnderline(\"{$hiddentext}\", \"{$textarea_id}\");' title='".\XoopsLocale::UNDERLINE."' aria-label='Left Align'>".'<span class="fa fa-underline"></span></button>'; |
|
| 340 | + $styleStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeLineThrough(\"{$hiddentext}\", \"{$textarea_id}\");' title='".\XoopsLocale::LINE_THROUGH."' aria-label='Left Align'>".'<span class="fa fa-strikethrough"></span></button>'; |
|
| 341 | 341 | $styleStr .= "</div>"; |
| 342 | 342 | |
| 343 | 343 | $alignStr = "<div class='btn-group' role='group'>"; |
| 344 | - $alignStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeLeft(\"{$hiddentext}\", \"{$textarea_id}\");' title='" . \XoopsLocale::LEFT . "' aria-label='Left Align'><span class='fa fa-align-left' aria-hidden='true'></span></button>"; |
|
| 345 | - $alignStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeCenter(\"{$hiddentext}\", \"{$textarea_id}\");' title='" . \XoopsLocale::CENTER . "' aria-label='Left Align'><span class='fa fa-align-center' aria-hidden='true'></span></button>"; |
|
| 346 | - $alignStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeRight(\"{$hiddentext}\", \"{$textarea_id}\");' title='" . \XoopsLocale::RIGHT . "' aria-label='Left Align'><span class='fa fa-align-right' aria-hidden='true'></span></button>"; |
|
| 344 | + $alignStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeLeft(\"{$hiddentext}\", \"{$textarea_id}\");' title='".\XoopsLocale::LEFT."' aria-label='Left Align'><span class='fa fa-align-left' aria-hidden='true'></span></button>"; |
|
| 345 | + $alignStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeCenter(\"{$hiddentext}\", \"{$textarea_id}\");' title='".\XoopsLocale::CENTER."' aria-label='Left Align'><span class='fa fa-align-center' aria-hidden='true'></span></button>"; |
|
| 346 | + $alignStr .= "<button type='button' class='btn btn-default btn-sm' onclick='xoopsMakeRight(\"{$hiddentext}\", \"{$textarea_id}\");' title='".\XoopsLocale::RIGHT."' aria-label='Left Align'><span class='fa fa-align-right' aria-hidden='true'></span></button>"; |
|
| 347 | 347 | $alignStr .= "</div>"; |
| 348 | 348 | |
| 349 | 349 | $fontStr .= " {$styleStr} {$alignStr} \n"; |
| 350 | 350 | |
| 351 | 351 | $fontStr .= "<button type='button' class='btn btn-default btn-sm' onclick=\"XoopsCheckLength('" |
| 352 | - . $element->getName() . "', '" . @$element->configs['maxlength'] . "', '" |
|
| 353 | - . \XoopsLocale::F_CURRENT_TEXT_LENGTH . "', '" . \XoopsLocale::MAXIMUM_LENGTH . "');\" title='" |
|
| 354 | - . \XoopsLocale::CHECK_TEXT_LENGTH . "'><span class='fa fa-check-square-o' aria-hidden='true'></span></button>"; |
|
| 352 | + . $element->getName()."', '".@$element->configs['maxlength']."', '" |
|
| 353 | + . \XoopsLocale::F_CURRENT_TEXT_LENGTH."', '".\XoopsLocale::MAXIMUM_LENGTH."');\" title='" |
|
| 354 | + . \XoopsLocale::CHECK_TEXT_LENGTH."'><span class='fa fa-check-square-o' aria-hidden='true'></span></button>"; |
|
| 355 | 355 | $fontStr .= "</div></div>"; |
| 356 | 356 | |
| 357 | 357 | return $fontStr; |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | { |
| 369 | 369 | $element->add('class', 'form-control'); |
| 370 | 370 | $attributes = $element->renderAttributeString(); |
| 371 | - return '<input ' . $attributes . $element->getExtra() .' >'; |
|
| 371 | + return '<input '.$attributes.$element->getExtra().' >'; |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | /** |
@@ -380,19 +380,19 @@ discard block |
||
| 380 | 380 | */ |
| 381 | 381 | protected function renderXoopsFormSelect(\Xoops\Form\Select $element):string |
| 382 | 382 | { |
| 383 | - $selected = (array) $element->getValue(); |
|
| 383 | + $selected = (array)$element->getValue(); |
|
| 384 | 384 | |
| 385 | 385 | $ele_options = $element->getOptions(); |
| 386 | 386 | |
| 387 | - $extra = ($element->getExtra() != '' ? " " . $element->getExtra() : ''); |
|
| 387 | + $extra = ($element->getExtra() != '' ? " ".$element->getExtra() : ''); |
|
| 388 | 388 | $element->add('class', 'form-control'); |
| 389 | 389 | $attributes = $element->renderAttributeString(); |
| 390 | - $ret = '<select ' . $attributes . $extra .' >' . "\n"; |
|
| 390 | + $ret = '<select '.$attributes.$extra.' >'."\n"; |
|
| 391 | 391 | |
| 392 | 392 | if (empty($ele_optgroup)) { |
| 393 | 393 | foreach ($ele_options as $value => $display) { |
| 394 | 394 | if (is_array($display)) { |
| 395 | - $ret .= '<optgroup label="' . $value . '">' . "\n"; |
|
| 395 | + $ret .= '<optgroup label="'.$value.'">'."\n"; |
|
| 396 | 396 | foreach ($display as $optvalue => $optdisplay) { |
| 397 | 397 | $ret .= $element->renderOption($optvalue, $optdisplay, $selected); |
| 398 | 398 | } |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | - $ret .= '</select>' . "\n"; |
|
| 404 | + $ret .= '</select>'."\n"; |
|
| 405 | 405 | |
| 406 | 406 | return $ret; |
| 407 | 407 | } |
@@ -418,11 +418,11 @@ discard block |
||
| 418 | 418 | $element->add('class', 'form-control'); |
| 419 | 419 | $dataList = $element->isDatalist(); |
| 420 | 420 | if (!empty($dataList)) { |
| 421 | - $element->add('list', 'list_' . $element->getName()); |
|
| 421 | + $element->add('list', 'list_'.$element->getName()); |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | $attributes = $element->renderAttributeString(); |
| 425 | - return '<input ' . $attributes . ' ' . $element->getExtra() .' >'; |
|
| 425 | + return '<input '.$attributes.' '.$element->getExtra().' >'; |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | /** |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $element->suppressRender(['value']); |
| 438 | 438 | $element->add('class', 'form-control'); |
| 439 | 439 | $attributes = $element->renderAttributeString(); |
| 440 | - return '<textarea ' . $attributes . ' ' . $element->getExtra() .' >' |
|
| 441 | - . $element->getValue() . '</textarea>'; |
|
| 440 | + return '<textarea '.$attributes.' '.$element->getExtra().' >' |
|
| 441 | + . $element->getValue().'</textarea>'; |
|
| 442 | 442 | } |
| 443 | 443 | } |