@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @date 31.07.2013 |
13 | 13 | * @version 1.0.3 |
14 | 14 | */ |
15 | -include_once(MODX_BASE_PATH . 'assets/lib/APIHelpers.class.php'); |
|
15 | +include_once(MODX_BASE_PATH.'assets/lib/APIHelpers.class.php'); |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Class SummaryText |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | protected function beforeCut($resource, $splitter = '') |
128 | 128 | { |
129 | 129 | if ($splitter !== '') { |
130 | - $summary = str_replace('<p>' . $splitter . '</p>', $splitter, |
|
130 | + $summary = str_replace('<p>'.$splitter.'</p>', $splitter, |
|
131 | 131 | $resource); // For TinyMCE or if it isn't wrapped inside paragraph tags |
132 | 132 | $summary = explode($splitter, $summary, 2); |
133 | 133 | $this->_useCut = isset($summary[1]); |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | $tag = mb_substr($tag, 0, strpos($tag, ' '), 'UTF-8'); |
335 | 335 | } |
336 | 336 | if (!mb_stristr($tag, 'br', 'UTF-8') && !mb_stristr($tag, 'img', 'UTF-8') && !empty ($tag)) { |
337 | - $endTags .= '</' . $tag . '>'; |
|
337 | + $endTags .= '</'.$tag.'>'; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | - return $text . $endTags; |
|
342 | + return $text.$endTags; |
|
343 | 343 | } |
344 | 344 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | /** Ссылка на превью */ |
151 | 151 | public function getImage() |
152 | 152 | { |
153 | - return $this->getScheme() . $this->image; |
|
153 | + return $this->getScheme().$this->image; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** Ссылка на видео */ |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $url .= '&autoplay=1'; |
162 | 162 | } |
163 | 163 | |
164 | - return $this->getScheme() . $url; |
|
164 | + return $this->getScheme().$url; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** Название видео */ |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | protected function cleanLink() |
226 | 226 | { |
227 | 227 | if (!preg_match('/^(http|https)\:\/\//i', $this->link)) { |
228 | - $this->link = 'http://' . $this->link; |
|
228 | + $this->link = 'http://'.$this->link; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | if (!$this->link_parts = parse_url($this->link)) { |
@@ -303,9 +303,9 @@ discard block |
||
303 | 303 | |
304 | 304 | $this->hosting = self::YOUTUBE; |
305 | 305 | $this->id = $id; |
306 | - $this->image = 'img.youtube.com/vi/' . $id . '/0.jpg'; |
|
306 | + $this->image = 'img.youtube.com/vi/'.$id.'/0.jpg'; |
|
307 | 307 | /** @see https://developers.google.com/youtube/player_parameters */ |
308 | - $this->video = 'www.youtube.com/embed/' . $id . '?showinfo=0&modestbranding=1&rel=0'; |
|
308 | + $this->video = 'www.youtube.com/embed/'.$id.'?showinfo=0&modestbranding=1&rel=0'; |
|
309 | 309 | |
310 | 310 | if ($this->info) { |
311 | 311 | $this->getYoutubeInfo($id); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | $this->hosting = self::VIMEO; |
325 | 325 | $this->id = $id; |
326 | - $this->video = 'player.vimeo.com/video/' . $id . '?'; |
|
326 | + $this->video = 'player.vimeo.com/video/'.$id.'?'; |
|
327 | 327 | |
328 | 328 | if ($this->info) { |
329 | 329 | $this->getVimeoInfo($id); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | { |
338 | 338 | $this->hosting = self::RUTUBE; |
339 | 339 | $this->id = $id; |
340 | - $this->video = 'rutube.ru/video/embed/' . $id . '?'; |
|
340 | + $this->video = 'rutube.ru/video/embed/'.$id.'?'; |
|
341 | 341 | |
342 | 342 | if ($this->info) { |
343 | 343 | $this->getRutubeInfo($id); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | /** Парсинг XML от RUTUBE и определение превьюхи */ |
350 | 350 | protected function getRutubeInfo($id) |
351 | 351 | { |
352 | - if (@$xml = simplexml_load_file("http://rutube.ru/cgi-bin/xmlapi.cgi?rt_mode=movie&rt_movie_id=" . $id . "&utf=1")) { |
|
352 | + if (@$xml = simplexml_load_file("http://rutube.ru/cgi-bin/xmlapi.cgi?rt_mode=movie&rt_movie_id=".$id."&utf=1")) { |
|
353 | 353 | $this->title = (string)$xml->title; |
354 | 354 | $this->image = (string)$xml->thumbnail_url; |
355 | 355 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | /** Парсинг XML от VIMEO и определение превьюхи */ |
359 | 359 | protected function getVimeoInfo($id) |
360 | 360 | { |
361 | - if (@$xml = simplexml_load_file('http://vimeo.com/api/v2/video/' . $id . '.xml')) { |
|
361 | + if (@$xml = simplexml_load_file('http://vimeo.com/api/v2/video/'.$id.'.xml')) { |
|
362 | 362 | $this->title = (string)$xml->video->title; |
363 | 363 | $this->image = (string)$xml->video->thumbnail_large ?: $xml->video->thumbnail_medium; |
364 | 364 | } |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | /** Получение названия ролика */ |
368 | 368 | protected function getYoutubeInfo($id) |
369 | 369 | { |
370 | - if (@$xml = simplexml_load_file('http://gdata.youtube.com/feeds/api/videos/' . $id)) { |
|
370 | + if (@$xml = simplexml_load_file('http://gdata.youtube.com/feeds/api/videos/'.$id)) { |
|
371 | 371 | $this->title = (string)$xml->title; |
372 | 372 | } |
373 | 373 | } |
@@ -397,10 +397,10 @@ discard block |
||
397 | 397 | |
398 | 398 | $url = $this->getVideo($autoplay); |
399 | 399 | if (!empty($class)) { |
400 | - $class = ' class="' . $class . '"'; |
|
400 | + $class = ' class="'.$class.'"'; |
|
401 | 401 | } |
402 | 402 | |
403 | - return '<iframe src="' . $url . '" width="' . $width . '" height="' . $height . '" frameborder="0" allowfullscreen' . $class . '></iframe>'; |
|
403 | + return '<iframe src="'.$url.'" width="'.$width.'" height="'.$height.'" frameborder="0" allowfullscreen'.$class.'></iframe>'; |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | /** Прогоняем тест по видам URL */ |
@@ -413,10 +413,10 @@ discard block |
||
413 | 413 | foreach ($links as $link) { |
414 | 414 | $v = new static($link); |
415 | 415 | echo "<h1>$link</h1>\n" |
416 | - . "<h3>" . $v->getHosting() . "</h3>" |
|
417 | - . "<b>Видео:</b> " . $v->getVideo() . "<br />\n" |
|
418 | - . "<b>Название:</b> " . $v->getTitle() . "<br />\n" |
|
419 | - . "<b>Картинка:</b> " . $v->getImage() . "<hr />\n"; |
|
416 | + . "<h3>".$v->getHosting()."</h3>" |
|
417 | + . "<b>Видео:</b> ".$v->getVideo()."<br />\n" |
|
418 | + . "<b>Название:</b> ".$v->getTitle()."<br />\n" |
|
419 | + . "<b>Картинка:</b> ".$v->getImage()."<hr />\n"; |
|
420 | 420 | } |
421 | 421 | } |
422 | 422 | } |