@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - /** |
|
70 | - * defaultRender - Generates default output for the element. |
|
71 | - * |
|
72 | - * This method is abstract and must be overwritten by the child classes. |
|
73 | - * |
|
74 | - * @return string |
|
75 | - */ |
|
69 | + /** |
|
70 | + * defaultRender - Generates default output for the element. |
|
71 | + * |
|
72 | + * This method is abstract and must be overwritten by the child classes. |
|
73 | + * |
|
74 | + * @return string |
|
75 | + */ |
|
76 | 76 | abstract public function defaultRender(); |
77 | 77 | |
78 | 78 | /** |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | * @return string |
82 | 82 | */ |
83 | 83 | public function render(){ |
84 | - $xoops = \Xoops::getInstance(); |
|
85 | - return $xoops->theme()->renderer($this); |
|
86 | - } |
|
84 | + $xoops = \Xoops::getInstance(); |
|
85 | + return $xoops->theme()->renderer($this); |
|
86 | + } |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * render attributes as a string to include in HTML output |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return string |
82 | 82 | */ |
83 | - public function render(){ |
|
83 | + public function render() { |
|
84 | 84 | $xoops = \Xoops::getInstance(); |
85 | 85 | return $xoops->theme()->renderer($this); |
86 | 86 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | if (!$this->has('id')) { |
103 | 103 | $id = $this->get('name'); |
104 | 104 | if (substr($id, -2) === '[]') { |
105 | - $id = substr($id, 0, strlen($id)-2); |
|
105 | + $id = substr($id, 0, strlen($id) - 2); |
|
106 | 106 | } |
107 | 107 | $this->set('id', $id); |
108 | 108 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function getName() |
162 | 162 | { |
163 | - return (string) $this->get('name'); |
|
163 | + return (string)$this->get('name'); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function getAccessKey() |
184 | 184 | { |
185 | - return (string) $this->get('accesskey'); |
|
185 | + return (string)$this->get('accesskey'); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | if (!empty($access) && (false !== ($pos = strpos($str, $access)))) { |
199 | 199 | return htmlspecialchars(substr($str, 0, $pos), ENT_QUOTES) |
200 | 200 | . '<span style="text-decoration: underline;">' |
201 | - . htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES) . '</span>' |
|
201 | + . htmlspecialchars(substr($str, $pos, 1), ENT_QUOTES).'</span>' |
|
202 | 202 | . htmlspecialchars(substr($str, $pos + 1), ENT_QUOTES); |
203 | 203 | } |
204 | 204 | return htmlspecialchars($str, ENT_QUOTES); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function setClass($class) |
215 | 215 | { |
216 | - $this->add('class', (string) $class); |
|
216 | + $this->add('class', (string)$class); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function getPattern() |
253 | 253 | { |
254 | - return (string) $this->get('pattern', ''); |
|
254 | + return (string)$this->get('pattern', ''); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function getPatternDescription() |
263 | 263 | { |
264 | - return (string) $this->get(':pattern_description', ''); |
|
264 | + return (string)$this->get(':pattern_description', ''); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /** |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | if (!$this->isDatalist()) { |
287 | 287 | return ''; |
288 | 288 | } |
289 | - $ret = "\n" . '<datalist id="list_' . $this->getName() . '">' . "\n"; |
|
289 | + $ret = "\n".'<datalist id="list_'.$this->getName().'">'."\n"; |
|
290 | 290 | foreach ($this->get('datalist') as $datalist) { |
291 | - $ret .= '<option value="' . htmlspecialchars($datalist, ENT_QUOTES) . '">' . "\n"; |
|
291 | + $ret .= '<option value="'.htmlspecialchars($datalist, ENT_QUOTES).'">'."\n"; |
|
292 | 292 | } |
293 | - $ret .= '</datalist>' . "\n"; |
|
293 | + $ret .= '</datalist>'."\n"; |
|
294 | 294 | return $ret; |
295 | 295 | } |
296 | 296 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | } else { |
352 | 352 | if ($this->has(':pattern_description')) { |
353 | 353 | return htmlspecialchars( |
354 | - strip_tags($this->get('caption') . ' - ' . $this->get(':pattern_description')), |
|
354 | + strip_tags($this->get('caption').' - '.$this->get(':pattern_description')), |
|
355 | 355 | ENT_QUOTES |
356 | 356 | ); |
357 | 357 | } else { |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | $class = $this->get('class'); |
537 | 537 | if ($class) { |
538 | 538 | $length = strlen($pattern); |
539 | - foreach ((array) $class as $i => $value) { |
|
539 | + foreach ((array)$class as $i => $value) { |
|
540 | 540 | if (0 === strncmp($value, $pattern, $length)) { |
541 | 541 | return $i; |
542 | 542 | } |
@@ -27,6 +27,6 @@ |
||
27 | 27 | * |
28 | 28 | * @return string rendered form element |
29 | 29 | */ |
30 | - public function render(\Xoops\Form\Element $element):string; |
|
30 | + public function render(\Xoops\Form\Element $element):string; |
|
31 | 31 | |
32 | 32 | } |
@@ -52,6 +52,6 @@ |
||
52 | 52 | public function defaultRender() |
53 | 53 | { |
54 | 54 | $attributes = $this->renderAttributeString(); |
55 | - return '<input ' . $attributes . $this->getExtra() .' >' . "\n"; |
|
55 | + return '<input '.$attributes.$this->getExtra().' >'."\n"; |
|
56 | 56 | } |
57 | 57 | } |
@@ -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 | } |