@@ -69,12 +69,12 @@ |
||
69 | 69 | $altText = $this->ts->escapeForJavascript($altText); |
70 | 70 | |
71 | 71 | $buttonCode = '<button type="button" class="btn btn-default btn-sm" ' |
72 | - . ' alt="' . $altText .'" title="' . $altText . '"' |
|
73 | - . ' onclick="' . $onclick . '(\'' . $textAreaId . '\''; |
|
72 | + . ' alt="'.$altText.'" title="'.$altText.'"' |
|
73 | + . ' onclick="'.$onclick.'(\''.$textAreaId.'\''; |
|
74 | 74 | foreach ($prompts as $prompt) { |
75 | - $buttonCode .= ', \'' . $this->ts->escapeForJavascript($prompt) . '\''; |
|
75 | + $buttonCode .= ', \''.$this->ts->escapeForJavascript($prompt).'\''; |
|
76 | 76 | } |
77 | - $buttonCode .= ');" /><span class="' . $iconClass . '" aria-hidden="true"></span></button>'; |
|
77 | + $buttonCode .= ');" /><span class="'.$iconClass.'" aria-hidden="true"></span></button>'; |
|
78 | 78 | |
79 | 79 | return $buttonCode; |
80 | 80 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | public function render() |
43 | 43 | { |
44 | 44 | $this->suppressRender(['value']); |
45 | - $tag = '<button ' . $this->renderAttributeString() . '>' |
|
45 | + $tag = '<button '.$this->renderAttributeString().'>' |
|
46 | 46 | . $this->get('value', '') |
47 | 47 | . '</button>'; |
48 | 48 |
@@ -42,113 +42,113 @@ |
||
42 | 42 | |
43 | 43 | $shortcodes->addShortcode( |
44 | 44 | 'siteurl', |
45 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
45 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
46 | 46 | $url = ltrim($attributes[0], '='); |
47 | 47 | $url = \Xoops::getInstance()->url($url); |
48 | - $newcontent = '<a href="' .$url. '">' . $shortcodes->process($content) . '</a>'; |
|
48 | + $newcontent = '<a href="'.$url.'">'.$shortcodes->process($content).'</a>'; |
|
49 | 49 | return $newcontent; |
50 | 50 | } |
51 | 51 | ); |
52 | 52 | |
53 | 53 | $shortcodes->addShortcode( |
54 | 54 | 'url', |
55 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
55 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
56 | 56 | $url = ltrim($attributes[0], '='); |
57 | 57 | $url = \Xoops::getInstance()->url($url); |
58 | - $newcontent = '<a href="' .$url. '">' . $shortcodes->process($content) . '</a>'; |
|
58 | + $newcontent = '<a href="'.$url.'">'.$shortcodes->process($content).'</a>'; |
|
59 | 59 | return $newcontent; |
60 | 60 | } |
61 | 61 | ); |
62 | 62 | |
63 | 63 | $shortcodes->addShortcode( |
64 | 64 | 'color', |
65 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
65 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
66 | 66 | $color = ltrim($attributes[0], '='); |
67 | - $color = preg_match('/^[a-f0-9]{3}$|^[a-f0-9]{6}$/i', $color) ? '#' . $color : $color; |
|
68 | - $newcontent = '<span style="color: ' .$color. '">' . $shortcodes->process($content) . '</span>'; |
|
67 | + $color = preg_match('/^[a-f0-9]{3}$|^[a-f0-9]{6}$/i', $color) ? '#'.$color : $color; |
|
68 | + $newcontent = '<span style="color: '.$color.'">'.$shortcodes->process($content).'</span>'; |
|
69 | 69 | return $newcontent; |
70 | 70 | } |
71 | 71 | ); |
72 | 72 | |
73 | 73 | $shortcodes->addShortcode( |
74 | 74 | 'size', |
75 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
75 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
76 | 76 | $size = ltrim($attributes[0], '='); |
77 | - $newcontent = '<span style="font-size: ' .$size. '">' . $shortcodes->process($content) . '</span>'; |
|
77 | + $newcontent = '<span style="font-size: '.$size.'">'.$shortcodes->process($content).'</span>'; |
|
78 | 78 | return $newcontent; |
79 | 79 | } |
80 | 80 | ); |
81 | 81 | |
82 | 82 | $shortcodes->addShortcode( |
83 | 83 | 'font', |
84 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
84 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
85 | 85 | $font = ltrim($attributes[0], '='); |
86 | - $newcontent = '<span style="font-family: ' .$font. '">' . $shortcodes->process($content) . '</span>'; |
|
86 | + $newcontent = '<span style="font-family: '.$font.'">'.$shortcodes->process($content).'</span>'; |
|
87 | 87 | return $newcontent; |
88 | 88 | } |
89 | 89 | ); |
90 | 90 | |
91 | 91 | $shortcodes->addShortcode( |
92 | 92 | 'email', |
93 | - function ($attributes, $content, $tagName) { |
|
93 | + function($attributes, $content, $tagName) { |
|
94 | 94 | $content = trim($content); |
95 | - $newcontent = '<a href="mailto:' . $content . '">' . $content . '</a>'; |
|
95 | + $newcontent = '<a href="mailto:'.$content.'">'.$content.'</a>'; |
|
96 | 96 | return $newcontent; |
97 | 97 | } |
98 | 98 | ); |
99 | 99 | |
100 | 100 | $shortcodes->addShortcode( |
101 | 101 | 'b', |
102 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
103 | - $newcontent = '<strong>' . $shortcodes->process($content) . '</strong>'; |
|
102 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
103 | + $newcontent = '<strong>'.$shortcodes->process($content).'</strong>'; |
|
104 | 104 | return $newcontent; |
105 | 105 | } |
106 | 106 | ); |
107 | 107 | |
108 | 108 | $shortcodes->addShortcode( |
109 | 109 | 'i', |
110 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
111 | - $newcontent = '<em>' . $shortcodes->process($content) . '</em>'; |
|
110 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
111 | + $newcontent = '<em>'.$shortcodes->process($content).'</em>'; |
|
112 | 112 | return $newcontent; |
113 | 113 | } |
114 | 114 | ); |
115 | 115 | |
116 | 116 | $shortcodes->addShortcode( |
117 | 117 | 'u', |
118 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
119 | - $newcontent = '<u>' . $shortcodes->process($content) . '</u>'; |
|
118 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
119 | + $newcontent = '<u>'.$shortcodes->process($content).'</u>'; |
|
120 | 120 | return $newcontent; |
121 | 121 | } |
122 | 122 | ); |
123 | 123 | |
124 | 124 | $shortcodes->addShortcode( |
125 | 125 | 'd', |
126 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
127 | - $newcontent = '<del>' . $shortcodes->process($content) . '</del>'; |
|
126 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
127 | + $newcontent = '<del>'.$shortcodes->process($content).'</del>'; |
|
128 | 128 | return $newcontent; |
129 | 129 | } |
130 | 130 | ); |
131 | 131 | |
132 | 132 | $shortcodes->addShortcode( |
133 | 133 | 'center', |
134 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
135 | - $newcontent = '<div style="text-align: center;">' . $shortcodes->process($content) . '</div>'; |
|
134 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
135 | + $newcontent = '<div style="text-align: center;">'.$shortcodes->process($content).'</div>'; |
|
136 | 136 | return $newcontent; |
137 | 137 | } |
138 | 138 | ); |
139 | 139 | |
140 | 140 | $shortcodes->addShortcode( |
141 | 141 | 'left', |
142 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
143 | - $newcontent = '<div style="text-align: left;">' . $shortcodes->process($content) . '</div>'; |
|
142 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
143 | + $newcontent = '<div style="text-align: left;">'.$shortcodes->process($content).'</div>'; |
|
144 | 144 | return $newcontent; |
145 | 145 | } |
146 | 146 | ); |
147 | 147 | |
148 | 148 | $shortcodes->addShortcode( |
149 | 149 | 'right', |
150 | - function ($attributes, $content, $tagName) use ($shortcodes) { |
|
151 | - $newcontent = '<div style="text-align: right;">' . $shortcodes->process($content) . '</div>'; |
|
150 | + function($attributes, $content, $tagName) use ($shortcodes) { |
|
151 | + $newcontent = '<div style="text-align: right;">'.$shortcodes->process($content).'</div>'; |
|
152 | 152 | return $newcontent; |
153 | 153 | } |
154 | 154 | ); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | } else { |
145 | 145 | list ($class, $path) = $this->htmlEditor; |
146 | - include_once \XoopsBaseConfig::get('root-path') . $path; |
|
146 | + include_once \XoopsBaseConfig::get('root-path').$path; |
|
147 | 147 | if (class_exists($class)) { |
148 | 148 | $this->htmlEditor = new $class($options); |
149 | 149 | } |
@@ -172,10 +172,10 @@ discard block |
||
172 | 172 | |
173 | 173 | $xoops = \Xoops::getInstance(); |
174 | 174 | |
175 | - $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); |
|
175 | + $extra = ($this->getExtra() != '' ? " ".$this->getExtra() : ''); |
|
176 | 176 | $ret = ""; |
177 | 177 | // actions |
178 | - $ret .= $this->xoopsCodeControls() . "<br />\n"; |
|
178 | + $ret .= $this->xoopsCodeControls()."<br />\n"; |
|
179 | 179 | // fonts |
180 | 180 | $ret .= $this->typographyControls(); |
181 | 181 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $this->suppressRender(['value']); |
185 | 185 | $attributes = $this->renderAttributeString(); |
186 | 186 | |
187 | - $ret .= '<textarea ' . $attributes . $extra . '>' . $this->getValue() . "</textarea>\n"; |
|
187 | + $ret .= '<textarea '.$attributes.$extra.'>'.$this->getValue()."</textarea>\n"; |
|
188 | 188 | |
189 | 189 | if (empty($this->skipPreview)) { |
190 | 190 | if (!$xoops->theme()) { |
@@ -192,15 +192,15 @@ discard block |
||
192 | 192 | } else { |
193 | 193 | $xoops->theme()->addScript('media/xoops/image.js', array('type' => 'text/javascript')); |
194 | 194 | } |
195 | - $button = "<input id='" . $this->getName() . "_preview_button' " . "type='button' " . "class='btn btn-sm btn-default' value='" . \XoopsLocale::A_PREVIEW . "' " . "onclick=\"form_instantPreview('" . XOOPS_URL . "', '" . $this->getName() . "','" . XOOPS_URL . "/images', " . (int)($this->doHtml) . ", '" . $xoops->security()->createToken() . "')\"" . " />"; |
|
196 | - $ret .= "<br />" . "<div id='" . $this->getName() . "_hidden' style='display: block;'> " . "<fieldset>" . "<legend>" . $button . "</legend>" . "<div id='" . $this->getName() . "_hidden_data'>" . \XoopsLocale::CLICK_PREVIEW_TO_SEE_CONTENT . "</div>" . "</fieldset>" . "</div>"; |
|
195 | + $button = "<input id='".$this->getName()."_preview_button' "."type='button' "."class='btn btn-sm btn-default' value='".\XoopsLocale::A_PREVIEW."' "."onclick=\"form_instantPreview('".XOOPS_URL."', '".$this->getName()."','".XOOPS_URL."/images', ".(int)($this->doHtml).", '".$xoops->security()->createToken()."')\""." />"; |
|
196 | + $ret .= "<br />"."<div id='".$this->getName()."_hidden' style='display: block;'> "."<fieldset>"."<legend>".$button."</legend>"."<div id='".$this->getName()."_hidden_data'>".\XoopsLocale::CLICK_PREVIEW_TO_SEE_CONTENT."</div>"."</fieldset>"."</div>"; |
|
197 | 197 | } |
198 | 198 | // Load javascript |
199 | 199 | if (empty($js_loaded)) { |
200 | 200 | $javascript = (($this->js) |
201 | - ? '<script type="text/javascript">' . $this->js . '</script>' |
|
202 | - : '') . '<script type="text/javascript" src="' . \XoopsBaseConfig::get('url') . '/include/formdhtmltextarea.js"></script>'; |
|
203 | - $ret = $javascript . $ret; |
|
201 | + ? '<script type="text/javascript">'.$this->js.'</script>' |
|
202 | + : '').'<script type="text/javascript" src="'.\XoopsBaseConfig::get('url').'/include/formdhtmltextarea.js"></script>'; |
|
203 | + $ret = $javascript.$ret; |
|
204 | 204 | $js_loaded = true; |
205 | 205 | } |
206 | 206 | return $ret; |
@@ -332,63 +332,63 @@ discard block |
||
332 | 332 | |
333 | 333 | $fontStr = '<div class="row"><div class="col-md-12"><div class="btn-group" role="toolbar">'; |
334 | 334 | $fontStr .= '<div class="btn-group">' |
335 | - . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'. \XoopsLocale::SIZE .'"' |
|
335 | + . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'.\XoopsLocale::SIZE.'"' |
|
336 | 336 | . ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' |
337 | 337 | . '<span class = "glyphicon glyphicon-text-height"></span><span class="caret"></span></button>' |
338 | 338 | . '<ul class="dropdown-menu">'; |
339 | 339 | $localeFontSizes = \XoopsLocale::getFontSizes(); |
340 | 340 | foreach ($localeFontSizes as $value => $name) { |
341 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'size\', \'' . $value . '\', \'' |
|
342 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' . $name . '</a></li>'; |
|
341 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'size\', \''.$value.'\', \'' |
|
342 | + . $textarea_id.'\', \''.$hiddentext.'\');">'.$name.'</a></li>'; |
|
343 | 343 | } |
344 | 344 | $fontStr .= '</ul></div>'; |
345 | 345 | |
346 | 346 | $fontStr .= '<div class="btn-group">' |
347 | - . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'. \XoopsLocale::FONT .'"' |
|
347 | + . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'.\XoopsLocale::FONT.'"' |
|
348 | 348 | . ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' |
349 | 349 | . '<span class = "glyphicon glyphicon-font"></span><span class="caret"></span></button>' |
350 | 350 | . '<ul class="dropdown-menu">'; |
351 | 351 | //. _FONT . ' <span class="caret"></span></button><ul class="dropdown-menu">'; |
352 | 352 | foreach ($fontarray as $font) { |
353 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'font\', \'' . $font . '\', \'' |
|
354 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' . $font . '</a></li>'; |
|
353 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'font\', \''.$font.'\', \'' |
|
354 | + . $textarea_id.'\', \''.$hiddentext.'\');">'.$font.'</a></li>'; |
|
355 | 355 | } |
356 | 356 | $fontStr .= '</ul></div>'; |
357 | 357 | |
358 | 358 | $fontStr .= '<div class="btn-group">' |
359 | - . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'. \XoopsLocale::COLOR .'"' |
|
359 | + . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'.\XoopsLocale::COLOR.'"' |
|
360 | 360 | . ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' |
361 | 361 | . '<span class = "glyphicon glyphicon-text-color"></span><span class="caret"></span></button>' |
362 | 362 | . '<ul class="dropdown-menu">'; |
363 | 363 | //. _COLOR . ' <span class="caret"></span></button><ul class="dropdown-menu">'; |
364 | 364 | foreach ($colorArray as $color => $hex) { |
365 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'color\', \'' . $hex . '\', \'' |
|
366 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' |
|
367 | - . '<span style="color:#' . $hex . ';">' . $color .'</span></a></li>'; |
|
365 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'color\', \''.$hex.'\', \'' |
|
366 | + . $textarea_id.'\', \''.$hiddentext.'\');">' |
|
367 | + . '<span style="color:#'.$hex.';">'.$color.'</span></a></li>'; |
|
368 | 368 | } |
369 | 369 | $fontStr .= '</ul></div>'; |
370 | 370 | $fontStr .= '</div>'; |
371 | 371 | |
372 | 372 | //$styleStr = "<div class='row'><div class='col-md-12'>"; |
373 | 373 | $styleStr = "<div class='btn-group' role='group'>"; |
374 | - $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>"; |
|
375 | - $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>"; |
|
376 | - $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>'; |
|
377 | - $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>'; |
|
374 | + $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>"; |
|
375 | + $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>"; |
|
376 | + $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>'; |
|
377 | + $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>'; |
|
378 | 378 | $styleStr .= "</div>"; |
379 | 379 | |
380 | 380 | $alignStr = "<div class='btn-group' role='group'>"; |
381 | - $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>"; |
|
382 | - $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>"; |
|
383 | - $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>"; |
|
381 | + $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>"; |
|
382 | + $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>"; |
|
383 | + $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>"; |
|
384 | 384 | $alignStr .= "</div>"; |
385 | 385 | |
386 | 386 | $fontStr .= " {$styleStr} {$alignStr} \n"; |
387 | 387 | |
388 | 388 | $fontStr .= "<button type='button' class='btn btn-default btn-sm' onclick=\"XoopsCheckLength('" |
389 | - . $this->getName() . "', '" . @$this->configs['maxlength'] . "', '" |
|
390 | - . \XoopsLocale::F_CURRENT_TEXT_LENGTH . "', '" . \XoopsLocale::MAXIMUM_LENGTH . "');\" title='" |
|
391 | - . \XoopsLocale::CHECK_TEXT_LENGTH . "'><span class='fa fa-check-square-o' aria-hidden='true'></span></button>"; |
|
389 | + . $this->getName()."', '".@$this->configs['maxlength']."', '" |
|
390 | + . \XoopsLocale::F_CURRENT_TEXT_LENGTH."', '".\XoopsLocale::MAXIMUM_LENGTH."');\" title='" |
|
391 | + . \XoopsLocale::CHECK_TEXT_LENGTH."'><span class='fa fa-check-square-o' aria-hidden='true'></span></button>"; |
|
392 | 392 | $fontStr .= "</div></div>"; |
393 | 393 | |
394 | 394 | return $fontStr; |
@@ -405,24 +405,23 @@ discard block |
||
405 | 405 | $hiddentext = $this->hiddenText; |
406 | 406 | |
407 | 407 | $fontStr = "<script type=\"text/javascript\" language=\"JavaScript\">"; |
408 | - $fontStr .= "var _editor_dialog = ''" . "+ '<select class=\"span2\" id=\'{$textarea_id}Size\' onchange=\'xoopsSetElementAttribute(\"size\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\'>'"; |
|
409 | - $fontStr .= "+ '<option value=\'SIZE\'>" . \XoopsLocale::SIZE . "</option>'"; |
|
408 | + $fontStr .= "var _editor_dialog = ''"."+ '<select class=\"span2\" id=\'{$textarea_id}Size\' onchange=\'xoopsSetElementAttribute(\"size\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\'>'"; |
|
409 | + $fontStr .= "+ '<option value=\'SIZE\'>".\XoopsLocale::SIZE."</option>'"; |
|
410 | 410 | $localeFontSizes = \XoopsLocale::getFontSizes(); |
411 | 411 | foreach ($localeFontSizes as $_val => $_name) { |
412 | 412 | $fontStr .= " + '<option value=\'{$_val}\'>{$_name}</option>'"; |
413 | 413 | } |
414 | 414 | $fontStr .= " + '</select> '"; |
415 | 415 | $fontStr .= "+ '<select class=\"span2\" id=\'{$textarea_id}Font\' onchange=\'xoopsSetElementAttribute(\"font\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\'>'"; |
416 | - $fontStr .= "+ '<option value=\'FONT\'>" . \XoopsLocale::FONT . "</option>'"; |
|
416 | + $fontStr .= "+ '<option value=\'FONT\'>".\XoopsLocale::FONT."</option>'"; |
|
417 | 417 | $localeFonts = \XoopsLocale::getFonts(); |
418 | - $fontarray = !empty($localeFonts) ? $localeFonts : |
|
419 | - array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana", "Haettenschweiler"); |
|
418 | + $fontarray = !empty($localeFonts) ? $localeFonts : array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana", "Haettenschweiler"); |
|
420 | 419 | foreach ($fontarray as $font) { |
421 | 420 | $fontStr .= " + '<option value=\'{$font}\'>{$font}</option>'"; |
422 | 421 | } |
423 | 422 | $fontStr .= " + '</select> '"; |
424 | 423 | $fontStr .= "+ '<select class=\"span2\" id=\'{$textarea_id}Color\' onchange=\'xoopsSetElementAttribute(\"color\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\'>'"; |
425 | - $fontStr .= "+ '<option value=\'COLOR\'>" . \XoopsLocale::COLOR . "</option>';"; |
|
424 | + $fontStr .= "+ '<option value=\'COLOR\'>".\XoopsLocale::COLOR."</option>';"; |
|
426 | 425 | $fontStr .= "var _color_array = new Array('00', '33', '66', '99', 'CC', 'FF'); |
427 | 426 | for(var i = 0; i < _color_array.length; i ++) { |
428 | 427 | for(var j = 0; j < _color_array.length; j ++) { |
@@ -436,15 +435,15 @@ discard block |
||
436 | 435 | |
437 | 436 | $fontStr .= "document.write(_editor_dialog); </script>"; |
438 | 437 | |
439 | - $styleStr = "<img src='" . \XoopsBaseConfig::get('url') . "/images/bold.gif' alt='" . \XoopsLocale::BOLD . "' title='" . \XoopsLocale::BOLD . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeBold(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
440 | - $styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/italic.gif' alt='" . \XoopsLocale::ITALIC . "' title='" . \XoopsLocale::ITALIC . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeItalic(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
441 | - $styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/underline.gif' alt='" . \XoopsLocale::UNDERLINE . "' title='" . \XoopsLocale::UNDERLINE . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeUnderline(\"{$hiddentext}\", \"{$textarea_id}\");'/> "; |
|
442 | - $styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/linethrough.gif' alt='" . \XoopsLocale::LINE_THROUGH . "' title='" . \XoopsLocale::LINE_THROUGH . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLineThrough(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
438 | + $styleStr = "<img src='".\XoopsBaseConfig::get('url')."/images/bold.gif' alt='".\XoopsLocale::BOLD."' title='".\XoopsLocale::BOLD."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeBold(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
439 | + $styleStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/italic.gif' alt='".\XoopsLocale::ITALIC."' title='".\XoopsLocale::ITALIC."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeItalic(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
440 | + $styleStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/underline.gif' alt='".\XoopsLocale::UNDERLINE."' title='".\XoopsLocale::UNDERLINE."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeUnderline(\"{$hiddentext}\", \"{$textarea_id}\");'/> "; |
|
441 | + $styleStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/linethrough.gif' alt='".\XoopsLocale::LINE_THROUGH."' title='".\XoopsLocale::LINE_THROUGH."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLineThrough(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
443 | 442 | |
444 | - $alignStr = "<img src='" . \XoopsBaseConfig::get('url') . "/images/alignleft.gif' alt='" . \XoopsLocale::LEFT . "' title='" . \XoopsLocale::LEFT . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLeft(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
445 | - $alignStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/aligncenter.gif' alt='" . \XoopsLocale::CENTER . "' title='" . \XoopsLocale::CENTER . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeCenter(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
446 | - $alignStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/alignright.gif' alt='" . \XoopsLocale::RIGHT . "' title='" . \XoopsLocale::RIGHT . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeRight(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
447 | - $fontStr = $fontStr . "<br />\n{$styleStr} {$alignStr} \n"; |
|
443 | + $alignStr = "<img src='".\XoopsBaseConfig::get('url')."/images/alignleft.gif' alt='".\XoopsLocale::LEFT."' title='".\XoopsLocale::LEFT."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLeft(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
444 | + $alignStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/aligncenter.gif' alt='".\XoopsLocale::CENTER."' title='".\XoopsLocale::CENTER."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeCenter(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
445 | + $alignStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/alignright.gif' alt='".\XoopsLocale::RIGHT."' title='".\XoopsLocale::RIGHT."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeRight(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
446 | + $fontStr = $fontStr."<br />\n{$styleStr} {$alignStr} \n"; |
|
448 | 447 | return $fontStr; |
449 | 448 | } |
450 | 449 |
@@ -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 .= $element->xoopsCodeControls() . "<br />\n"; |
|
190 | + $ret .= $element->xoopsCodeControls()."<br />\n"; |
|
191 | 191 | // fonts |
192 | 192 | $ret .= $element->typographyControls(); |
193 | 193 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $element->set('class', 'form-control'); |
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; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | { |
230 | 230 | $element->add('class', 'form-control'); |
231 | 231 | $attributes = $element->renderAttributeString(); |
232 | - return '<input ' . $attributes . $element->getExtra() .' >'; |
|
232 | + return '<input '.$attributes.$element->getExtra().' >'; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -241,19 +241,19 @@ discard block |
||
241 | 241 | */ |
242 | 242 | protected function renderXoopsFormSelect(\Xoops\Form\Select $element):string |
243 | 243 | { |
244 | - $selected = (array) $element->getValue(); |
|
244 | + $selected = (array)$element->getValue(); |
|
245 | 245 | |
246 | 246 | $ele_options = $element->getOptions(); |
247 | 247 | |
248 | - $extra = ($element->getExtra() != '' ? " " . $element->getExtra() : ''); |
|
248 | + $extra = ($element->getExtra() != '' ? " ".$element->getExtra() : ''); |
|
249 | 249 | $element->add('class', 'form-control'); |
250 | 250 | $attributes = $element->renderAttributeString(); |
251 | - $ret = '<select ' . $attributes . $extra .' >' . "\n"; |
|
251 | + $ret = '<select '.$attributes.$extra.' >'."\n"; |
|
252 | 252 | |
253 | 253 | if (empty($ele_optgroup)) { |
254 | 254 | foreach ($ele_options as $value => $display) { |
255 | 255 | if (is_array($display)) { |
256 | - $ret .= '<optgroup label="' . $value . '">' . "\n"; |
|
256 | + $ret .= '<optgroup label="'.$value.'">'."\n"; |
|
257 | 257 | foreach ($display as $optvalue => $optdisplay) { |
258 | 258 | $ret .= $element->renderOption($optvalue, $optdisplay, $selected); |
259 | 259 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } |
263 | 263 | } |
264 | 264 | } |
265 | - $ret .= '</select>' . "\n"; |
|
265 | + $ret .= '</select>'."\n"; |
|
266 | 266 | |
267 | 267 | return $ret; |
268 | 268 | } |
@@ -279,11 +279,11 @@ discard block |
||
279 | 279 | $element->add('class', 'form-control'); |
280 | 280 | $dataList = $element->isDatalist(); |
281 | 281 | if (!empty($dataList)) { |
282 | - $element->add('list', 'list_' . $element->getName()); |
|
282 | + $element->add('list', 'list_'.$element->getName()); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | $attributes = $element->renderAttributeString(); |
286 | - return '<input ' . $attributes . ' ' . $element->getExtra() .' >'; |
|
286 | + return '<input '.$attributes.' '.$element->getExtra().' >'; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $element->suppressRender(['value']); |
299 | 299 | $element->add('class', 'form-control'); |
300 | 300 | $attributes = $element->renderAttributeString(); |
301 | - return '<textarea ' . $attributes . ' ' . $element->getExtra() .' >' |
|
302 | - . $element->getValue() . '</textarea>'; |
|
301 | + return '<textarea '.$attributes.' '.$element->getExtra().' >' |
|
302 | + . $element->getValue().'</textarea>'; |
|
303 | 303 | } |
304 | 304 | } |
@@ -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) { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | // the textarea box |
195 | 195 | $element->suppressRender(['value']); |
196 | - $element->set('class', 'form-control'); |
|
196 | + $element->set('class', 'form-control'); |
|
197 | 197 | $attributes = $element->renderAttributeString(); |
198 | 198 | |
199 | 199 | $ret .= '<textarea ' . $attributes . $extra . '>' . $element->getValue() . "</textarea>\n"; |
@@ -216,30 +216,30 @@ discard block |
||
216 | 216 | $js_loaded = true; |
217 | 217 | } |
218 | 218 | return $ret; |
219 | - } |
|
219 | + } |
|
220 | 220 | |
221 | - /** |
|
221 | + /** |
|
222 | 222 | * Render support for XoopsFormPassword |
223 | 223 | * |
224 | 224 | * @param XoopsFormPassword $element form element |
225 | 225 | * |
226 | 226 | * @return string rendered form element |
227 | 227 | */ |
228 | - protected function renderXoopsFormPassword(\Xoops\Form\Password $element):string |
|
228 | + protected function renderXoopsFormPassword(\Xoops\Form\Password $element):string |
|
229 | 229 | { |
230 | 230 | $element->add('class', 'form-control'); |
231 | - $attributes = $element->renderAttributeString(); |
|
231 | + $attributes = $element->renderAttributeString(); |
|
232 | 232 | return '<input ' . $attributes . $element->getExtra() .' >'; |
233 | - } |
|
233 | + } |
|
234 | 234 | |
235 | - /** |
|
235 | + /** |
|
236 | 236 | * Render support for XoopsFormSelect |
237 | 237 | * |
238 | 238 | * @param XoopsFormSelect $element form element |
239 | 239 | * |
240 | 240 | * @return string rendered form element |
241 | 241 | */ |
242 | - protected function renderXoopsFormSelect(\Xoops\Form\Select $element):string |
|
242 | + protected function renderXoopsFormSelect(\Xoops\Form\Select $element):string |
|
243 | 243 | { |
244 | 244 | $selected = (array) $element->getValue(); |
245 | 245 | |
@@ -265,16 +265,16 @@ discard block |
||
265 | 265 | $ret .= '</select>' . "\n"; |
266 | 266 | |
267 | 267 | return $ret; |
268 | - } |
|
268 | + } |
|
269 | 269 | |
270 | - /** |
|
270 | + /** |
|
271 | 271 | * Render support for XoopsFormText |
272 | 272 | * |
273 | 273 | * @param XoopsFormText $element form element |
274 | 274 | * |
275 | 275 | * @return string rendered form element |
276 | 276 | */ |
277 | - protected function renderXoopsFormText(\Xoops\Form\Text $element):string |
|
277 | + protected function renderXoopsFormText(\Xoops\Form\Text $element):string |
|
278 | 278 | { |
279 | 279 | $element->add('class', 'form-control'); |
280 | 280 | $dataList = $element->isDatalist(); |
@@ -284,21 +284,21 @@ discard block |
||
284 | 284 | |
285 | 285 | $attributes = $element->renderAttributeString(); |
286 | 286 | return '<input ' . $attributes . ' ' . $element->getExtra() .' >'; |
287 | - } |
|
287 | + } |
|
288 | 288 | |
289 | - /** |
|
289 | + /** |
|
290 | 290 | * Render support for XoopsFormTextArea |
291 | 291 | * |
292 | 292 | * @param XoopsFormTextArea $element form element |
293 | 293 | * |
294 | 294 | * @return string rendered form element |
295 | 295 | */ |
296 | - protected function renderXoopsFormTextArea(\Xoops\Form\TextArea $element):string |
|
296 | + protected function renderXoopsFormTextArea(\Xoops\Form\TextArea $element):string |
|
297 | 297 | { |
298 | 298 | $element->suppressRender(['value']); |
299 | - $element->add('class', 'form-control'); |
|
299 | + $element->add('class', 'form-control'); |
|
300 | 300 | $attributes = $element->renderAttributeString(); |
301 | 301 | return '<textarea ' . $attributes . ' ' . $element->getExtra() .' >' |
302 | 302 | . $element->getValue() . '</textarea>'; |
303 | - } |
|
303 | + } |
|
304 | 304 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * Service Mode constant - Multiple mode where all located services will be |
49 | 49 | * dispatched in priority order. |
50 | 50 | */ |
51 | - const MODE_MULTIPLE = 8; |
|
51 | + const MODE_MULTIPLE = 8; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Provider priorities |
@@ -247,12 +247,12 @@ discard block |
||
247 | 247 | } else { |
248 | 248 | $xoops = \Xoops::getInstance(); |
249 | 249 | $provider = new Provider($this, $service); |
250 | - $event = 'core.service.locate.' . $service; |
|
250 | + $event = 'core.service.locate.'.$service; |
|
251 | 251 | // locate service provider(s) |
252 | 252 | // In response to trigger message, the contract implementor should register() |
253 | 253 | $xoops->events()->triggerEvent($event, $provider); |
254 | 254 | // get reference to the list of providers and prioritize it. |
255 | - $registered=$provider->getRegistered(); |
|
255 | + $registered = $provider->getRegistered(); |
|
256 | 256 | if (count($registered)) { |
257 | 257 | $choices = $this->providerPrefs[$service] ?? []; |
258 | 258 | foreach ($registered as $p) { |
@@ -28,27 +28,27 @@ discard block |
||
28 | 28 | * Temporarily try and fix, but set up a (delayed) warning |
29 | 29 | */ |
30 | 30 | if (!class_exists('XoopsLoad', false)) { |
31 | - require_once dirname(__DIR__). '/class/XoopsBaseConfig.php'; |
|
31 | + require_once dirname(__DIR__).'/class/XoopsBaseConfig.php'; |
|
32 | 32 | XoopsBaseConfig::bootstrapTransition(); |
33 | 33 | $delayedWarning = 'Patch mainfile.php for XoopsBaseConfig'; |
34 | 34 | } |
35 | 35 | |
36 | 36 | global $xoops; |
37 | -$GLOBALS['xoops'] =& $xoops; |
|
37 | +$GLOBALS['xoops'] = & $xoops; |
|
38 | 38 | |
39 | 39 | //Legacy support |
40 | 40 | global $xoopsDB; |
41 | -$GLOBALS['xoopsDB'] =& $xoopsDB; |
|
41 | +$GLOBALS['xoopsDB'] = & $xoopsDB; |
|
42 | 42 | /** |
43 | 43 | * YOU SHOULD NEVER USE THE FOLLOWING TO CONSTANTS, THEY WILL BE REMOVED |
44 | 44 | */ |
45 | 45 | defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
46 | -defined('NWLINE')or define('NWLINE', "\n"); |
|
46 | +defined('NWLINE') or define('NWLINE', "\n"); |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Include files with definitions |
50 | 50 | */ |
51 | -include_once __DIR__ . '/defines.php'; |
|
51 | +include_once __DIR__.'/defines.php'; |
|
52 | 52 | // include_once __DIR__ . '/version.php'; |
53 | 53 | |
54 | 54 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | $xoops = Xoops::getInstance(); |
66 | 66 | |
67 | -$xoops->option =& $GLOBALS['xoopsOption']; |
|
67 | +$xoops->option = & $GLOBALS['xoopsOption']; |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * Create Instance Xoops\Core\Logger Object, the logger manager |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | //$xoops->cache()->delete($key); |
87 | 87 | $autoloadPrefixDirList = $xoops->cache()->cacheRead( |
88 | 88 | $key, |
89 | - function () use ($xoops) { |
|
89 | + function() use ($xoops) { |
|
90 | 90 | try { |
91 | 91 | $criteria = new CriteriaCompo(new Criteria('isactive', 1)); |
92 | 92 | $criteria->add(new Criteria('namespace', '', '!=')); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | /** @var XoopsObject $almod */ |
100 | 100 | foreach ($autoloadModules as $almod) { |
101 | 101 | $prefix = $almod->getVar('namespace'); |
102 | - $base_dir = $xoops->path('modules/' . $almod->getVar('dirname') . '/src'); |
|
102 | + $base_dir = $xoops->path('modules/'.$almod->getVar('dirname').'/src'); |
|
103 | 103 | $autoloadPrefixDirList[] = [$prefix, $base_dir]; |
104 | 104 | } |
105 | 105 | return $autoloadPrefixDirList; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * Requires functions and database loaded |
159 | 159 | */ |
160 | 160 | $xoops->getConfigs(); |
161 | -$xoopsConfig =& $xoops->config; |
|
161 | +$xoopsConfig = & $xoops->config; |
|
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Merge file and db configs. |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $xoops->addConfigs(include $file); |
168 | 168 | unset($file); |
169 | 169 | } else { |
170 | - trigger_error('File Path Error: ' . 'var/configs/system_configs.php' . ' does not exist.'); |
|
170 | + trigger_error('File Path Error: '.'var/configs/system_configs.php'.' does not exist.'); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $xoops->events()->triggerEvent('core.include.common.configs.success'); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $xFrameOptions = $xoopsConfig['xFrameOptions'] ?? 'sameorigin'; |
185 | 185 | $xoops->events()->triggerEvent('core.include.common.xframeoption'); |
186 | 186 | if (!headers_sent() && !empty($xFrameOptions)) { |
187 | - header('X-Frame-Options: ' .$xFrameOptions); |
|
187 | + header('X-Frame-Options: '.$xFrameOptions); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } else { |
266 | 266 | if (!$moduleperm_handler->checkRight('module_read', $xoops->module->getVar('mid'), FixedGroups::ANONYMOUS)) { |
267 | 267 | $xoops->redirect( |
268 | - $xoops_url . '/user.php?from=' . $xoops->module->getVar('dirname', 'n'), |
|
268 | + $xoops_url.'/user.php?from='.$xoops->module->getVar('dirname', 'n'), |
|
269 | 269 | 1, |
270 | 270 | XoopsLocale::E_NO_ACCESS_PERMISSION |
271 | 271 | ); |
@@ -291,10 +291,10 @@ discard block |
||
291 | 291 | |
292 | 292 | $xoopsTpl = $xoops->tpl(); |
293 | 293 | $xoTheme = null; |
294 | -$xoopsUser =& $xoops->user; |
|
295 | -$xoopsModule =& $xoops->module; |
|
296 | -$xoopsUserIsAdmin =& $xoops->userIsAdmin; |
|
297 | -$xoopsModuleConfig =& $xoops->moduleConfig; |
|
294 | +$xoopsUser = & $xoops->user; |
|
295 | +$xoopsModule = & $xoops->module; |
|
296 | +$xoopsUserIsAdmin = & $xoops->userIsAdmin; |
|
297 | +$xoopsModuleConfig = & $xoops->moduleConfig; |
|
298 | 298 | |
299 | 299 | //Creates 'system_modules_active' cache file if it has been deleted. |
300 | 300 | $xoops->getActiveModules(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | use XoopsModules\Publisher; |
35 | 35 | use XoopsModules\Publisher\Helper; |
36 | 36 | |
37 | -require_once dirname(__DIR__) . '/header.php'; |
|
37 | +require_once dirname(__DIR__).'/header.php'; |
|
38 | 38 | |
39 | 39 | $xoops = Xoops::getInstance(); |
40 | 40 | $xoops->disableErrorReporting(); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | //Checking permissions |
58 | 58 | if (!$helper->getConfig('perm_rating') || !$gpermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $module_id)) { |
59 | - $output = "unit_long$itemid|" . XoopsLocale::E_NO_ACCESS_PERMISSION . "\n"; |
|
59 | + $output = "unit_long$itemid|".XoopsLocale::E_NO_ACCESS_PERMISSION."\n"; |
|
60 | 60 | echo $output; |
61 | 61 | exit(); |
62 | 62 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $units = 5; |
66 | 66 | |
67 | 67 | if ($rating > 5 || $rating < 1) { |
68 | - $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_BAD . "\n"; |
|
68 | + $output = "unit_long$itemid|"._MD_PUBLISHER_VOTE_BAD."\n"; |
|
69 | 69 | echo $output; |
70 | 70 | exit(); |
71 | 71 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | if ($voted) { |
90 | - $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_ALREADY . "\n"; |
|
90 | + $output = "unit_long$itemid|"._MD_PUBLISHER_VOTE_ALREADY."\n"; |
|
91 | 91 | echo $output; |
92 | 92 | exit(); |
93 | 93 | } |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | // $new_back is what gets 'drawn' on your page after a successful 'AJAX/Javascript' vote |
112 | 112 | $new_back = []; |
113 | 113 | |
114 | -$new_back[] .= '<div class="publisher_unit-rating" style="width:' . $units * $rating_unitwidth . 'px;">'; |
|
115 | -$new_back[] .= '<div class="publisher_current-rating" style="width:' . @number_format($current_rating / $count, 2) * $rating_unitwidth . 'px;">' . _MD_PUBLISHER_VOTE_RATING . '</div>'; |
|
114 | +$new_back[] .= '<div class="publisher_unit-rating" style="width:'.$units * $rating_unitwidth.'px;">'; |
|
115 | +$new_back[] .= '<div class="publisher_current-rating" style="width:'.@number_format($current_rating / $count, 2) * $rating_unitwidth.'px;">'._MD_PUBLISHER_VOTE_RATING.'</div>'; |
|
116 | 116 | $new_back[] .= '<div class="publisher_r1-unit">1</div>'; |
117 | 117 | $new_back[] .= '<div class="publisher_r2-unit">2</div>'; |
118 | 118 | $new_back[] .= '<div class="publisher_r3-unit">3</div>'; |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | $new_back[] .= '<div class="publisher_r9-unit">9</div>'; |
125 | 125 | $new_back[] .= '<div class="publisher_r10-unit">10</div>'; |
126 | 126 | $new_back[] .= '</div>'; |
127 | -$new_back[] .= '<div class="publisher_voted">' . _MD_PUBLISHER_VOTE_RATING . ' <strong>' . @number_format($current_rating / $count, 2) . '</strong>/' . $units . ' (' . $count . ' ' . $tense . ')</div>'; |
|
128 | -$new_back[] .= '<div class="publisher_thanks">' . _MD_PUBLISHER_VOTE_THANKS . '</div>'; |
|
127 | +$new_back[] .= '<div class="publisher_voted">'._MD_PUBLISHER_VOTE_RATING.' <strong>'.@number_format($current_rating / $count, 2).'</strong>/'.$units.' ('.$count.' '.$tense.')</div>'; |
|
128 | +$new_back[] .= '<div class="publisher_thanks">'._MD_PUBLISHER_VOTE_THANKS.'</div>'; |
|
129 | 129 | |
130 | 130 | $allnewback = implode("\n", $new_back); |
131 | 131 |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | use XoopsModules\Publisher; |
30 | 30 | use XoopsModules\Publisher\Helper; |
31 | 31 | |
32 | -include dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; |
|
33 | -require_once __DIR__ . '/common.php'; |
|
32 | +include dirname(dirname(dirname(__DIR__))).'/mainfile.php'; |
|
33 | +require_once __DIR__.'/common.php'; |
|
34 | 34 | |
35 | 35 | $xoops = Xoops::getInstance(); |
36 | 36 | $xoops->disableErrorReporting(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $image = null; |
76 | 76 | if (false === $error) { |
77 | - $uploader = new XoopsMediaUploader(XoopsBaseConfig::get('uploads-path') . '/images', [ |
|
77 | + $uploader = new XoopsMediaUploader(XoopsBaseConfig::get('uploads-path').'/images', [ |
|
78 | 78 | 'image/gif', |
79 | 79 | 'image/jpeg', |
80 | 80 | 'image/pjpeg', |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | } |
109 | 109 | } else { |
110 | - $error = sprintf(_CO_PUBLISHER_FAILSAVEIMG, $filename) . '<br>' . implode('<br>', $uploader->getErrors(false)); |
|
110 | + $error = sprintf(_CO_PUBLISHER_FAILSAVEIMG, $filename).'<br>'.implode('<br>', $uploader->getErrors(false)); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 |