@@ -95,9 +95,9 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function renderEmojiSelector(Response $response, $identifier) |
| 97 | 97 | { |
| 98 | - $selector = '<button type="button" class="btn btn-default btn-sm" alt="' |
|
| 99 | - . \XoopsLocale::SMILIES . '" title="' . \XoopsLocale::SMILIES . '" onclick=\'openWithSelfMain("' |
|
| 100 | - . \XoopsBaseConfig::get('url') . '/modules/smilies/include/popup.php?target=' . $identifier |
|
| 98 | + $selector = '<button type="button" class="btn btn-default btn-sm" alt="' |
|
| 99 | + . \XoopsLocale::SMILIES.'" title="'.\XoopsLocale::SMILIES.'" onclick=\'openWithSelfMain("' |
|
| 100 | + . \XoopsBaseConfig::get('url').'/modules/smilies/include/popup.php?target='.$identifier |
|
| 101 | 101 | . '","smilies",300,650);\' onmouseover=\'style.cursor="hand"\'>' |
| 102 | 102 | . '<span class="fa fa-fw fa-smile-o" aria-hidden="true"></span></button>'; |
| 103 | 103 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $emoji['name'] = $smile['smiley_code']; |
| 121 | 121 | $emoji['description'] = $smile['smiley_emotion']; |
| 122 | 122 | $emoji['rendered'] = |
| 123 | - '<img src="' . $smile['smiley_url'] . '" alt="' . $smile['smiley_emotion'] . '" />'; |
|
| 123 | + '<img src="'.$smile['smiley_url'].'" alt="'.$smile['smiley_emotion'].'" />'; |
|
| 124 | 124 | $emojiList[] = $emoji; |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | public function add($name, $value) |
| 51 | 51 | { |
| 52 | 52 | if (is_scalar($value)) { |
| 53 | - $value = explode(' ', (string) $value); |
|
| 53 | + $value = explode(' ', (string)$value); |
|
| 54 | 54 | } |
| 55 | 55 | $values = $this->get($name, []); |
| 56 | 56 | if (is_scalar($values)) { |
| 57 | - $values = (array) $values; |
|
| 57 | + $values = (array)$values; |
|
| 58 | 58 | } |
| 59 | 59 | foreach ($value as $v) { |
| 60 | 60 | if (!in_array($v, $values)) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function suppressRender($names) |
| 80 | 80 | { |
| 81 | - $names = (array) $names; |
|
| 81 | + $names = (array)$names; |
|
| 82 | 82 | $this->suppressRenderAttributes = array_unique( |
| 83 | 83 | array_merge($this->suppressRenderAttributes, $names) |
| 84 | 84 | ); |
@@ -126,16 +126,16 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | if (is_array($value)) { |
| 128 | 128 | // arrays can be used for class attributes, space separated |
| 129 | - $set = '="' . htmlspecialchars(implode(' ', $value), ENT_QUOTES) .'"'; |
|
| 130 | - } elseif ($value===null) { |
|
| 129 | + $set = '="'.htmlspecialchars(implode(' ', $value), ENT_QUOTES).'"'; |
|
| 130 | + } elseif ($value === null) { |
|
| 131 | 131 | // null indicates attribute minimization (name only,) like autofocus or readonly |
| 132 | 132 | $set = ''; |
| 133 | 133 | } elseif (0 === strncmp($name, 'on', 2)) { |
| 134 | - $set = '="' . str_replace('&', '&', htmlspecialchars($value, ENT_COMPAT)) . '"'; |
|
| 134 | + $set = '="'.str_replace('&', '&', htmlspecialchars($value, ENT_COMPAT)).'"'; |
|
| 135 | 135 | } else { |
| 136 | - $set = '="' . htmlspecialchars($value, ENT_QUOTES) . '"'; |
|
| 136 | + $set = '="'.htmlspecialchars($value, ENT_QUOTES).'"'; |
|
| 137 | 137 | } |
| 138 | - $rendered .= htmlspecialchars($name, ENT_QUOTES) . $set . ' '; |
|
| 138 | + $rendered .= htmlspecialchars($name, ENT_QUOTES).$set.' '; |
|
| 139 | 139 | } |
| 140 | 140 | return $rendered; |
| 141 | 141 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function getNames() |
| 237 | 237 | { |
| 238 | - return array_keys((array) $this); |
|
| 238 | + return array_keys((array)$this); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | $likeSet = array(); |
| 313 | 313 | foreach ($this as $k => $v) { |
| 314 | - if (substr($k, 0, strlen($nameLike))==$nameLike) { |
|
| 315 | - $likeSet[$k]=$v; |
|
| 314 | + if (substr($k, 0, strlen($nameLike)) == $nameLike) { |
|
| 315 | + $likeSet[$k] = $v; |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | return $likeSet; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | protected static $defaultConfiguration = [ |
| 32 | 32 | 'enabled' => true, |
| 33 | - 'enable_youtube_entry' => true, // false to disable entry button in editor, existing content will still play |
|
| 33 | + 'enable_youtube_entry' => true, // false to disable entry button in editor, existing content will still play |
|
| 34 | 34 | 'template' => '<div class="embed-responsive %4$s"> |
| 35 | 35 | <iframe class="embed-responsive-item" width="%2$d" height="%3$d" src="https://www.youtube.com/embed/%1$s" frameborder="0" allowfullscreen></iframe> |
| 36 | 36 | </div>', |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | $this->shortcodes->addShortcode( |
| 101 | 101 | 'youtube', |
| 102 | - function ($attributes, $content, $tagName) { |
|
| 102 | + function($attributes, $content, $tagName) { |
|
| 103 | 103 | if (array_key_exists(0, $attributes) && '=' === substr($attributes[0], 0, 1)) { |
| 104 | 104 | $args = ltrim($attributes[0], '='); |
| 105 | 105 | list($width, $height) = explode(',', $args); |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | ]; |
| 113 | 113 | $cleanAttributes = $this->shortcodes->shortcodeAttributes($defaults, $attributes); |
| 114 | 114 | $url = $cleanAttributes['url']; |
| 115 | - $width = (int) $cleanAttributes['width']; |
|
| 116 | - $height = (int) $cleanAttributes['height']; |
|
| 115 | + $width = (int)$cleanAttributes['width']; |
|
| 116 | + $height = (int)$cleanAttributes['height']; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // from: http://stackoverflow.com/questions/2936467/parse-youtube-video-id-using-preg-match/6382259#6382259 |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | break; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - $aspectRatio = $width/$height; // 16x9 = 1.777777778, 4x3 = 1.333333333 |
|
| 140 | + $aspectRatio = $width / $height; // 16x9 = 1.777777778, 4x3 = 1.333333333 |
|
| 141 | 141 | $responsiveAspect = ($aspectRatio < 1.4) ? 'embed-responsive-4by3' : 'embed-responsive-16by9'; |
| 142 | 142 | if ($width < 17 && $height < 10) { |
| 143 | - $scale = (int) 640 / $width; |
|
| 143 | + $scale = (int)640 / $width; |
|
| 144 | 144 | $width = $width * $scale; |
| 145 | 145 | $height = $height * $scale; |
| 146 | 146 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | protected static $defaultConfiguration = [ |
| 32 | 32 | 'enabled' => false, |
| 33 | - 'enable_mms_entry' => false, // false to disable entry button in editor, existing content will still play |
|
| 33 | + 'enable_mms_entry' => false, // false to disable entry button in editor, existing content will still play |
|
| 34 | 34 | ]; |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $this->shortcodes->addShortcode( |
| 90 | 90 | 'mms', |
| 91 | - function ($attributes, $content, $tagName) { |
|
| 91 | + function($attributes, $content, $tagName) { |
|
| 92 | 92 | $args = ltrim($attributes[0], '='); |
| 93 | 93 | list($width, $height) = explode(',', $args); |
| 94 | 94 | $url = $content; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | 'template' => '<object type="application/x-shockwave-flash" data="%1$s" width="%2$d" height="%3$d"></object>', |
| 35 | 35 | 'fallback_width' => "320", |
| 36 | 36 | 'fallback_height' => "240", |
| 37 | - 'enable_flash_entry' => false, // false to disable entry button in editor, existing content will still play |
|
| 37 | + 'enable_flash_entry' => false, // false to disable entry button in editor, existing content will still play |
|
| 38 | 38 | ]; |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function registerExtensionProcessing() |
| 100 | 100 | { |
| 101 | - $function = function ($attributes, $content, $tagName) { |
|
| 101 | + $function = function($attributes, $content, $tagName) { |
|
| 102 | 102 | if (array_key_exists(0, $attributes) && '=' === substr($attributes[0], 0, 1)) { |
| 103 | 103 | $args = ltrim($attributes[0], '='); |
| 104 | 104 | list($width, $height) = explode(',', $args); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | protected static $defaultConfiguration = [ |
| 32 | 32 | 'enabled' => false, |
| 33 | - 'enable_wmp_entry' => false, // false to disable entry button in editor, existing content will still play |
|
| 33 | + 'enable_wmp_entry' => false, // false to disable entry button in editor, existing content will still play |
|
| 34 | 34 | ]; |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -86,18 +86,18 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | $this->shortcodes->addShortcode( |
| 88 | 88 | 'wmp', |
| 89 | - function ($attributes, $content, $tagName) { |
|
| 89 | + function($attributes, $content, $tagName) { |
|
| 90 | 90 | $args = ltrim($attributes[0], '='); |
| 91 | 91 | list($width, $height) = explode(',', $args); |
| 92 | 92 | $url = $content; |
| 93 | 93 | |
| 94 | 94 | $template = '<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"' |
| 95 | - . ' id="WindowsMediaPlayer" width="%2$s" height="%3$s">' . "\n" |
|
| 96 | - . '<param name="URL" value="%1$s">'. "\n" |
|
| 97 | - . '<param name="AutoStart" value="0">' . "\n" |
|
| 95 | + . ' id="WindowsMediaPlayer" width="%2$s" height="%3$s">'."\n" |
|
| 96 | + . '<param name="URL" value="%1$s">'."\n" |
|
| 97 | + . '<param name="AutoStart" value="0">'."\n" |
|
| 98 | 98 | . '<embed autostart="0" src="%1$s" type="video/x-ms-wmv" width="%2$s" height="%3$s"' |
| 99 | - . ' controls="ImageWindow" console="cons"> </embed>' . "\n" |
|
| 100 | - . '</object>' . "\n"; |
|
| 99 | + . ' controls="ImageWindow" console="cons"> </embed>'."\n" |
|
| 100 | + . '</object>'."\n"; |
|
| 101 | 101 | $newContent = sprintf($template, $url, $width, $height); |
| 102 | 102 | return $newContent; |
| 103 | 103 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | protected static $defaultConfiguration = [ |
| 32 | 32 | 'enabled' => false, |
| 33 | - 'enable_rtsp_entry' => false, // false to disable entry button in editor, existing content will still play |
|
| 33 | + 'enable_rtsp_entry' => false, // false to disable entry button in editor, existing content will still play |
|
| 34 | 34 | ]; |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $this->shortcodes->addShortcode( |
| 90 | 90 | 'rtsp', |
| 91 | - function ($attributes, $content, $tagName) { |
|
| 91 | + function($attributes, $content, $tagName) { |
|
| 92 | 92 | $args = ltrim($attributes[0], '='); |
| 93 | 93 | list($width, $height) = explode(',', $args); |
| 94 | 94 | $url = $content; |
@@ -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 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | } else { |
| 144 | 144 | list ($class, $path) = $this->htmlEditor; |
| 145 | - include_once \XoopsBaseConfig::get('root-path') . $path; |
|
| 145 | + include_once \XoopsBaseConfig::get('root-path').$path; |
|
| 146 | 146 | if (class_exists($class)) { |
| 147 | 147 | $this->htmlEditor = new $class($options); |
| 148 | 148 | } |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | $xoops = \Xoops::getInstance(); |
| 173 | 173 | |
| 174 | - $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : ''); |
|
| 174 | + $extra = ($this->getExtra() != '' ? " ".$this->getExtra() : ''); |
|
| 175 | 175 | $ret = ""; |
| 176 | 176 | // actions |
| 177 | - $ret .= $this->xoopsCodeControls() . "<br />\n"; |
|
| 177 | + $ret .= $this->xoopsCodeControls()."<br />\n"; |
|
| 178 | 178 | // fonts |
| 179 | 179 | $ret .= $this->typographyControls(); |
| 180 | 180 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $this->suppressRender(['value']); |
| 184 | 184 | $attributes = $this->renderAttributeString(); |
| 185 | 185 | |
| 186 | - $ret .= '<textarea ' . $attributes . $extra . '>' . $this->getValue() . "</textarea>\n"; |
|
| 186 | + $ret .= '<textarea '.$attributes.$extra.'>'.$this->getValue()."</textarea>\n"; |
|
| 187 | 187 | |
| 188 | 188 | if (empty($this->skipPreview)) { |
| 189 | 189 | if (!$xoops->theme()) { |
@@ -191,15 +191,15 @@ discard block |
||
| 191 | 191 | } else { |
| 192 | 192 | $xoops->theme()->addScript('media/xoops/image.js', array('type' => 'text/javascript')); |
| 193 | 193 | } |
| 194 | - $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() . "')\"" . " />"; |
|
| 195 | - $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>"; |
|
| 194 | + $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()."')\""." />"; |
|
| 195 | + $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>"; |
|
| 196 | 196 | } |
| 197 | 197 | // Load javascript |
| 198 | 198 | if (empty($js_loaded)) { |
| 199 | 199 | $javascript = (($this->js) |
| 200 | - ? '<script type="text/javascript">' . $this->js . '</script>' |
|
| 201 | - : '') . '<script type="text/javascript" src="' . \XoopsBaseConfig::get('url') . '/include/formdhtmltextarea.js"></script>'; |
|
| 202 | - $ret = $javascript . $ret; |
|
| 200 | + ? '<script type="text/javascript">'.$this->js.'</script>' |
|
| 201 | + : '').'<script type="text/javascript" src="'.\XoopsBaseConfig::get('url').'/include/formdhtmltextarea.js"></script>'; |
|
| 202 | + $ret = $javascript.$ret; |
|
| 203 | 203 | $js_loaded = true; |
| 204 | 204 | } |
| 205 | 205 | return $ret; |
@@ -218,24 +218,24 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | $code = ''; |
| 220 | 220 | $code .= '<div class="row"><div class="col-md-12">'; |
| 221 | - $code .= '<button type="button" class="btn btn-default btn-sm" alt="' . \XoopsLocale::URL |
|
| 222 | - . '" title="' . \XoopsLocale::URL . '" onclick="xoopsCodeUrl(\'' . $textarea_id . '\', \'' |
|
| 223 | - . $myts->escapeForJavascript(\XoopsLocale::ENTER_LINK_URL) . '\', \'' |
|
| 221 | + $code .= '<button type="button" class="btn btn-default btn-sm" alt="'.\XoopsLocale::URL |
|
| 222 | + . '" title="'.\XoopsLocale::URL.'" onclick="xoopsCodeUrl(\''.$textarea_id.'\', \'' |
|
| 223 | + . $myts->escapeForJavascript(\XoopsLocale::ENTER_LINK_URL).'\', \'' |
|
| 224 | 224 | . $myts->escapeForJavascript(\XoopsLocale::ENTER_WEBSITE_TITLE) |
| 225 | 225 | . '\')" onmouseover="style.cursor=\'hand\'">' |
| 226 | 226 | . '<span class="fa fa-fw fa-link" aria-hidden="true"></span></button>'; |
| 227 | - $code .= '<button type="button" class="btn btn-default btn-sm" alt="' . \XoopsLocale::EMAIL |
|
| 228 | - . '" title="' . \XoopsLocale::EMAIL . '" onclick="xoopsCodeEmail(\'' . $textarea_id . '\', \'' |
|
| 227 | + $code .= '<button type="button" class="btn btn-default btn-sm" alt="'.\XoopsLocale::EMAIL |
|
| 228 | + . '" title="'.\XoopsLocale::EMAIL.'" onclick="xoopsCodeEmail(\''.$textarea_id.'\', \'' |
|
| 229 | 229 | . $myts->escapeForJavascript(\XoopsLocale::ENTER_EMAIL) |
| 230 | 230 | . '\');" onmouseover="style.cursor=\'hand\'">' |
| 231 | 231 | . '<span class="fa fa-fw fa-envelope-o" aria-hidden="true"></span></button>'; |
| 232 | - $code .= '<button type="button" class="btn btn-default btn-sm" alt="' . \XoopsLocale::IMAGES |
|
| 233 | - . '" title="' . \XoopsLocale::IMAGES . '" onclick="xoopsCodeImg(\'' . $textarea_id . '\', \'' |
|
| 234 | - . $myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_URL) . '\', \'' |
|
| 235 | - . $myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_POSITION) . '\', \'' |
|
| 236 | - . $myts->escapeForJavascript(\XoopsLocale::IMAGE_POSITION_DESCRIPTION) . '\', \'' |
|
| 237 | - . $myts->escapeForJavascript(\XoopsLocale::E_ENTER_IMAGE_POSITION) . '\', \'' |
|
| 238 | - . $myts->escapeForJavascript(\XoopsLocale::WIDTH) . '\');" onmouseover="style.cursor=\'hand\'">' |
|
| 232 | + $code .= '<button type="button" class="btn btn-default btn-sm" alt="'.\XoopsLocale::IMAGES |
|
| 233 | + . '" title="'.\XoopsLocale::IMAGES.'" onclick="xoopsCodeImg(\''.$textarea_id.'\', \'' |
|
| 234 | + . $myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_URL).'\', \'' |
|
| 235 | + . $myts->escapeForJavascript(\XoopsLocale::ENTER_IMAGE_POSITION).'\', \'' |
|
| 236 | + . $myts->escapeForJavascript(\XoopsLocale::IMAGE_POSITION_DESCRIPTION).'\', \'' |
|
| 237 | + . $myts->escapeForJavascript(\XoopsLocale::E_ENTER_IMAGE_POSITION).'\', \'' |
|
| 238 | + . $myts->escapeForJavascript(\XoopsLocale::WIDTH).'\');" onmouseover="style.cursor=\'hand\'">' |
|
| 239 | 239 | . '<span class="fa fa-fw fa-file-image-o" aria-hidden="true"></span></button>'; |
| 240 | 240 | |
| 241 | 241 | $extensions = array_filter($myts->listExtensions()); |
@@ -248,14 +248,14 @@ discard block |
||
| 248 | 248 | $this->js .= $js; |
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | - $code .= '<button type="button" class="btn btn-default btn-sm" alt="' . \XoopsLocale::SOURCE_CODE . '" title="' |
|
| 252 | - . \XoopsLocale::SOURCE_CODE . '" onclick="xoopsCodeCode(\'' . $textarea_id . '\', \'' |
|
| 253 | - . $myts->escapeForJavascript(\XoopsLocale::ENTER_CODE) . '\');" onmouseover="style.cursor=\'hand\'">' |
|
| 251 | + $code .= '<button type="button" class="btn btn-default btn-sm" alt="'.\XoopsLocale::SOURCE_CODE.'" title="' |
|
| 252 | + . \XoopsLocale::SOURCE_CODE.'" onclick="xoopsCodeCode(\''.$textarea_id.'\', \'' |
|
| 253 | + . $myts->escapeForJavascript(\XoopsLocale::ENTER_CODE).'\');" onmouseover="style.cursor=\'hand\'">' |
|
| 254 | 254 | . '<span class="fa fa-fw fa-code" aria-hidden="true"></span></button>'; |
| 255 | 255 | |
| 256 | - $code .= '<button type="button" class="btn btn-default btn-sm" alt="' . \XoopsLocale::QUOTE . '" title="' |
|
| 257 | - . \XoopsLocale::QUOTE . '" onclick="xoopsCodeQuote(\'' . $textarea_id . '\', \'' |
|
| 258 | - . $myts->escapeForJavascript(\XoopsLocale::ENTER_QUOTE) . '\');" onmouseover="style.cursor=\'hand\'">' |
|
| 256 | + $code .= '<button type="button" class="btn btn-default btn-sm" alt="'.\XoopsLocale::QUOTE.'" title="' |
|
| 257 | + . \XoopsLocale::QUOTE.'" onclick="xoopsCodeQuote(\''.$textarea_id.'\', \'' |
|
| 258 | + . $myts->escapeForJavascript(\XoopsLocale::ENTER_QUOTE).'\');" onmouseover="style.cursor=\'hand\'">' |
|
| 259 | 259 | . '<span class="fa fa-fw fa-quote-right" aria-hidden="true"></span></button>'; |
| 260 | 260 | |
| 261 | 261 | $response = \Xoops::getInstance()->service('emoji')->renderEmojiSelector($this->getName()); |
@@ -299,63 +299,63 @@ 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 | $localeFontSizes = \XoopsLocale::getFontSizes(); |
| 307 | 307 | foreach ($localeFontSizes as $value => $name) { |
| 308 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'size\', \'' . $value . '\', \'' |
|
| 309 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' . $name . '</a></li>'; |
|
| 308 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'size\', \''.$value.'\', \'' |
|
| 309 | + . $textarea_id.'\', \''.$hiddentext.'\');">'.$name.'</a></li>'; |
|
| 310 | 310 | } |
| 311 | 311 | $fontStr .= '</ul></div>'; |
| 312 | 312 | |
| 313 | 313 | $fontStr .= '<div class="btn-group">' |
| 314 | - . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'. \XoopsLocale::FONT .'"' |
|
| 314 | + . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'.\XoopsLocale::FONT.'"' |
|
| 315 | 315 | . ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' |
| 316 | 316 | . '<span class = "glyphicon glyphicon-font"></span><span class="caret"></span></button>' |
| 317 | 317 | . '<ul class="dropdown-menu">'; |
| 318 | 318 | //. _FONT . ' <span class="caret"></span></button><ul class="dropdown-menu">'; |
| 319 | 319 | foreach ($fontarray as $font) { |
| 320 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'font\', \'' . $font . '\', \'' |
|
| 321 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' . $font . '</a></li>'; |
|
| 320 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'font\', \''.$font.'\', \'' |
|
| 321 | + . $textarea_id.'\', \''.$hiddentext.'\');">'.$font.'</a></li>'; |
|
| 322 | 322 | } |
| 323 | 323 | $fontStr .= '</ul></div>'; |
| 324 | 324 | |
| 325 | 325 | $fontStr .= '<div class="btn-group">' |
| 326 | - . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'. \XoopsLocale::COLOR .'"' |
|
| 326 | + . '<button type="button" class="btn btn-default btn-sm dropdown-toggle" title="'.\XoopsLocale::COLOR.'"' |
|
| 327 | 327 | . ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' |
| 328 | 328 | . '<span class = "glyphicon glyphicon-text-color"></span><span class="caret"></span></button>' |
| 329 | 329 | . '<ul class="dropdown-menu">'; |
| 330 | 330 | //. _COLOR . ' <span class="caret"></span></button><ul class="dropdown-menu">'; |
| 331 | 331 | foreach ($colorArray as $color => $hex) { |
| 332 | - $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'color\', \'' . $hex . '\', \'' |
|
| 333 | - . $textarea_id . '\', \'' . $hiddentext . '\');">' |
|
| 334 | - . '<span style="color:#' . $hex . ';">' . $color .'</span></a></li>'; |
|
| 332 | + $fontStr .= '<li><a href="javascript:xoopsSetElementAttribute(\'color\', \''.$hex.'\', \'' |
|
| 333 | + . $textarea_id.'\', \''.$hiddentext.'\');">' |
|
| 334 | + . '<span style="color:#'.$hex.';">'.$color.'</span></a></li>'; |
|
| 335 | 335 | } |
| 336 | 336 | $fontStr .= '</ul></div>'; |
| 337 | 337 | $fontStr .= '</div>'; |
| 338 | 338 | |
| 339 | 339 | //$styleStr = "<div class='row'><div class='col-md-12'>"; |
| 340 | 340 | $styleStr = "<div class='btn-group' role='group'>"; |
| 341 | - $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>"; |
|
| 342 | - $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>"; |
|
| 343 | - $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>'; |
|
| 344 | - $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 | + $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>"; |
|
| 342 | + $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>"; |
|
| 343 | + $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>'; |
|
| 344 | + $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>'; |
|
| 345 | 345 | $styleStr .= "</div>"; |
| 346 | 346 | |
| 347 | 347 | $alignStr = "<div class='btn-group' role='group'>"; |
| 348 | - $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>"; |
|
| 349 | - $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>"; |
|
| 350 | - $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>"; |
|
| 348 | + $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>"; |
|
| 349 | + $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>"; |
|
| 350 | + $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>"; |
|
| 351 | 351 | $alignStr .= "</div>"; |
| 352 | 352 | |
| 353 | 353 | $fontStr .= " {$styleStr} {$alignStr} \n"; |
| 354 | 354 | |
| 355 | 355 | $fontStr .= "<button type='button' class='btn btn-default btn-sm' onclick=\"XoopsCheckLength('" |
| 356 | - . $this->getName() . "', '" . @$this->configs['maxlength'] . "', '" |
|
| 357 | - . \XoopsLocale::F_CURRENT_TEXT_LENGTH . "', '" . \XoopsLocale::MAXIMUM_LENGTH . "');\" title='" |
|
| 358 | - . \XoopsLocale::CHECK_TEXT_LENGTH . "'><span class='fa fa-check-square-o' aria-hidden='true'></span></button>"; |
|
| 356 | + . $this->getName()."', '".@$this->configs['maxlength']."', '" |
|
| 357 | + . \XoopsLocale::F_CURRENT_TEXT_LENGTH."', '".\XoopsLocale::MAXIMUM_LENGTH."');\" title='" |
|
| 358 | + . \XoopsLocale::CHECK_TEXT_LENGTH."'><span class='fa fa-check-square-o' aria-hidden='true'></span></button>"; |
|
| 359 | 359 | $fontStr .= "</div></div>"; |
| 360 | 360 | |
| 361 | 361 | return $fontStr; |
@@ -372,24 +372,23 @@ discard block |
||
| 372 | 372 | $hiddentext = $this->hiddenText; |
| 373 | 373 | |
| 374 | 374 | $fontStr = "<script type=\"text/javascript\" language=\"JavaScript\">"; |
| 375 | - $fontStr .= "var _editor_dialog = ''" . "+ '<select class=\"span2\" id=\'{$textarea_id}Size\' onchange=\'xoopsSetElementAttribute(\"size\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\'>'"; |
|
| 376 | - $fontStr .= "+ '<option value=\'SIZE\'>" . \XoopsLocale::SIZE . "</option>'"; |
|
| 375 | + $fontStr .= "var _editor_dialog = ''"."+ '<select class=\"span2\" id=\'{$textarea_id}Size\' onchange=\'xoopsSetElementAttribute(\"size\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\'>'"; |
|
| 376 | + $fontStr .= "+ '<option value=\'SIZE\'>".\XoopsLocale::SIZE."</option>'"; |
|
| 377 | 377 | $localeFontSizes = \XoopsLocale::getFontSizes(); |
| 378 | 378 | foreach ($localeFontSizes as $_val => $_name) { |
| 379 | 379 | $fontStr .= " + '<option value=\'{$_val}\'>{$_name}</option>'"; |
| 380 | 380 | } |
| 381 | 381 | $fontStr .= " + '</select> '"; |
| 382 | 382 | $fontStr .= "+ '<select class=\"span2\" id=\'{$textarea_id}Font\' onchange=\'xoopsSetElementAttribute(\"font\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\'>'"; |
| 383 | - $fontStr .= "+ '<option value=\'FONT\'>" . \XoopsLocale::FONT . "</option>'"; |
|
| 383 | + $fontStr .= "+ '<option value=\'FONT\'>".\XoopsLocale::FONT."</option>'"; |
|
| 384 | 384 | $localeFonts = \XoopsLocale::getFonts(); |
| 385 | - $fontarray = !empty($localeFonts) ? $localeFonts : |
|
| 386 | - array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana", "Haettenschweiler"); |
|
| 385 | + $fontarray = !empty($localeFonts) ? $localeFonts : array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana", "Haettenschweiler"); |
|
| 387 | 386 | foreach ($fontarray as $font) { |
| 388 | 387 | $fontStr .= " + '<option value=\'{$font}\'>{$font}</option>'"; |
| 389 | 388 | } |
| 390 | 389 | $fontStr .= " + '</select> '"; |
| 391 | 390 | $fontStr .= "+ '<select class=\"span2\" id=\'{$textarea_id}Color\' onchange=\'xoopsSetElementAttribute(\"color\", this.options[this.selectedIndex].value, \"{$textarea_id}\", \"{$hiddentext}\");\'>'"; |
| 392 | - $fontStr .= "+ '<option value=\'COLOR\'>" . \XoopsLocale::COLOR . "</option>';"; |
|
| 391 | + $fontStr .= "+ '<option value=\'COLOR\'>".\XoopsLocale::COLOR."</option>';"; |
|
| 393 | 392 | $fontStr .= "var _color_array = new Array('00', '33', '66', '99', 'CC', 'FF'); |
| 394 | 393 | for(var i = 0; i < _color_array.length; i ++) { |
| 395 | 394 | for(var j = 0; j < _color_array.length; j ++) { |
@@ -403,15 +402,15 @@ discard block |
||
| 403 | 402 | |
| 404 | 403 | $fontStr .= "document.write(_editor_dialog); </script>"; |
| 405 | 404 | |
| 406 | - $styleStr = "<img src='" . \XoopsBaseConfig::get('url') . "/images/bold.gif' alt='" . \XoopsLocale::BOLD . "' title='" . \XoopsLocale::BOLD . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeBold(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 407 | - $styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/italic.gif' alt='" . \XoopsLocale::ITALIC . "' title='" . \XoopsLocale::ITALIC . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeItalic(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 408 | - $styleStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/underline.gif' alt='" . \XoopsLocale::UNDERLINE . "' title='" . \XoopsLocale::UNDERLINE . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeUnderline(\"{$hiddentext}\", \"{$textarea_id}\");'/> "; |
|
| 409 | - $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}\");' /> "; |
|
| 405 | + $styleStr = "<img src='".\XoopsBaseConfig::get('url')."/images/bold.gif' alt='".\XoopsLocale::BOLD."' title='".\XoopsLocale::BOLD."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeBold(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 406 | + $styleStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/italic.gif' alt='".\XoopsLocale::ITALIC."' title='".\XoopsLocale::ITALIC."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeItalic(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 407 | + $styleStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/underline.gif' alt='".\XoopsLocale::UNDERLINE."' title='".\XoopsLocale::UNDERLINE."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeUnderline(\"{$hiddentext}\", \"{$textarea_id}\");'/> "; |
|
| 408 | + $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}\");' /> "; |
|
| 410 | 409 | |
| 411 | - $alignStr = "<img src='" . \XoopsBaseConfig::get('url') . "/images/alignleft.gif' alt='" . \XoopsLocale::LEFT . "' title='" . \XoopsLocale::LEFT . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLeft(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 412 | - $alignStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/aligncenter.gif' alt='" . \XoopsLocale::CENTER . "' title='" . \XoopsLocale::CENTER . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeCenter(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 413 | - $alignStr .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/alignright.gif' alt='" . \XoopsLocale::RIGHT . "' title='" . \XoopsLocale::RIGHT . "' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeRight(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 414 | - $fontStr = $fontStr . "<br />\n{$styleStr} {$alignStr} \n"; |
|
| 410 | + $alignStr = "<img src='".\XoopsBaseConfig::get('url')."/images/alignleft.gif' alt='".\XoopsLocale::LEFT."' title='".\XoopsLocale::LEFT."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeLeft(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 411 | + $alignStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/aligncenter.gif' alt='".\XoopsLocale::CENTER."' title='".\XoopsLocale::CENTER."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeCenter(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 412 | + $alignStr .= "<img src='".\XoopsBaseConfig::get('url')."/images/alignright.gif' alt='".\XoopsLocale::RIGHT."' title='".\XoopsLocale::RIGHT."' onmouseover='style.cursor=\"hand\"' onclick='xoopsMakeRight(\"{$hiddentext}\", \"{$textarea_id}\");' /> "; |
|
| 413 | + $fontStr = $fontStr."<br />\n{$styleStr} {$alignStr} \n"; |
|
| 415 | 414 | return $fontStr; |
| 416 | 415 | } |
| 417 | 416 | |