@@ -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 | } |
@@ -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 |