@@ -191,18 +191,18 @@ discard block |
||
| 191 | 191 | $options = array_keys(Config::inst()->get(ShareThisSimpleProvider::class, 'casting', Config::UNINHERITED)); |
| 192 | 192 | $icons = $this->config()->get('icon_links'); |
| 193 | 193 | foreach ($options as $option) { |
| 194 | - if($option === 'PinterestLinkForSpecificImage') { |
|
| 194 | + if ($option === 'PinterestLinkForSpecificImage') { |
|
| 195 | 195 | continue; |
| 196 | 196 | } |
| 197 | 197 | $className = str_replace('ShareLink', '', (string) $option); |
| 198 | 198 | $className = strtolower($className); |
| 199 | 199 | $icon = ''; |
| 200 | - if(! empty($icons[$className])) { |
|
| 200 | + if (!empty($icons[$className])) { |
|
| 201 | 201 | $urlLink = $icons[$className]; |
| 202 | 202 | $url = ModuleResourceLoader::resourceURL($urlLink); |
| 203 | 203 | $icon = DBField::create_field('HTMLText', '<img src="'.$url.'" alt="'.$option.'" />'); |
| 204 | 204 | } |
| 205 | - $method = 'get' . $option; |
|
| 205 | + $method = 'get'.$option; |
|
| 206 | 206 | $arrayList->push( |
| 207 | 207 | ArrayData::create( |
| 208 | 208 | [ |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $this->getShareThisArray($customDescription); |
| 246 | 246 | |
| 247 | 247 | return '' !== $this->pageURL ? |
| 248 | - 'https://www.facebook.com/sharer/sharer.php?u=' . $this->pageURL . '&t=' . $this->title . '' |
|
| 248 | + 'https://www.facebook.com/sharer/sharer.php?u='.$this->pageURL.'&t='.$this->title.'' |
|
| 249 | 249 | : |
| 250 | 250 | ''; |
| 251 | 251 | } |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $this->getShareThisArray($customDescription); |
| 278 | 278 | |
| 279 | 279 | return '' !== $this->pageURL ? |
| 280 | - 'https://twitter.com/intent/tweet?source=' . $this->pageURL . '&text=' . $this->titleFull . '' . urlencode(': ') . $this->pageURL |
|
| 280 | + 'https://twitter.com/intent/tweet?source='.$this->pageURL.'&text='.$this->titleFull.''.urlencode(': ').$this->pageURL |
|
| 281 | 281 | : |
| 282 | 282 | ''; |
| 283 | 283 | } |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $this->getShareThisArray($customDescription); |
| 308 | 308 | |
| 309 | 309 | return '' !== $this->pageURL ? |
| 310 | - 'https://www.linkedin.com/shareArticle?mini=true&url=' . $this->pageURL . '&summary=' . $this->titleFull . '' |
|
| 310 | + 'https://www.linkedin.com/shareArticle?mini=true&url='.$this->pageURL.'&summary='.$this->titleFull.'' |
|
| 311 | 311 | : |
| 312 | 312 | ''; |
| 313 | 313 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $this->getShareThisArray($customDescription); |
| 338 | 338 | |
| 339 | 339 | return '' !== $this->pageURL ? |
| 340 | - 'http://www.tumblr.com/share/link?url=' . $this->pageURL . '&name=' . $this->title . '&description=' . $this->description . '' |
|
| 340 | + 'http://www.tumblr.com/share/link?url='.$this->pageURL.'&name='.$this->title.'&description='.$this->description.'' |
|
| 341 | 341 | : |
| 342 | 342 | ''; |
| 343 | 343 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | $this->getShareThisArray($customDescription); |
| 366 | 366 | |
| 367 | 367 | return '' !== $this->pageURL ? |
| 368 | - 'http://pinterest.com/pin/create/button/?url=' . $this->pageURL . '&description=' . $this->description . '&media=' . $this->media . '' |
|
| 368 | + 'http://pinterest.com/pin/create/button/?url='.$this->pageURL.'&description='.$this->description.'&media='.$this->media.'' |
|
| 369 | 369 | : |
| 370 | 370 | ''; |
| 371 | 371 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | { |
| 391 | 391 | $this->getShareThisArray($customDescription); |
| 392 | 392 | |
| 393 | - return '' !== $this->pageURL ? 'mailto:?subject=' . $this->title . '&body=' . $this->pageURL . '' : ''; |
|
| 393 | + return '' !== $this->pageURL ? 'mailto:?subject='.$this->title.'&body='.$this->pageURL.'' : ''; |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | /** |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | { |
| 416 | 416 | $this->getShareThisArray($customDescription); |
| 417 | 417 | |
| 418 | - return '' !== $this->pageURL ? 'http://reddit.com/submit?url=' . $this->pageURL . '&title=' . $this->title . '' : ''; |
|
| 418 | + return '' !== $this->pageURL ? 'http://reddit.com/submit?url='.$this->pageURL.'&title='.$this->title.'' : ''; |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | /** |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | */ |
| 424 | 424 | public function getShareThisArray(?string $customDescription = ''): array |
| 425 | 425 | { |
| 426 | - $cacheKey = $this->object->ID . '_' . preg_replace('#[^A-Za-z0-9]#', '_', $customDescription); |
|
| 426 | + $cacheKey = $this->object->ID.'_'.preg_replace('#[^A-Za-z0-9]#', '_', $customDescription); |
|
| 427 | 427 | if (!isset(self::$cacheGetShareThisArray[$cacheKey])) { |
| 428 | 428 | //1. link |
| 429 | 429 | $this->link = $this->shareThisLinkField(); |
@@ -437,8 +437,8 @@ discard block |
||
| 437 | 437 | $this->hashTags = $this->getValuesFromArrayToString('hashTagsArray', 'hash_tags', '#'); |
| 438 | 438 | $this->mentions = $this->getValuesFromArrayToString('mentionsArray', 'mentions'); |
| 439 | 439 | $this->vias = $this->getValuesFromArrayToString('viasArray', 'vias'); |
| 440 | - $this->titleFull = trim($this->mentions . ' ' . $this->title . ' ' . $this->hashTags . ' ' . $this->vias); |
|
| 441 | - $this->descriptionFull = trim($this->mentions . ' ' . $this->description . ' ' . $this->hashTags . ' ' . $this->vias); |
|
| 440 | + $this->titleFull = trim($this->mentions.' '.$this->title.' '.$this->hashTags.' '.$this->vias); |
|
| 441 | + $this->descriptionFull = trim($this->mentions.' '.$this->description.' '.$this->hashTags.' '.$this->vias); |
|
| 442 | 442 | |
| 443 | 443 | //return ... |
| 444 | 444 | self::$cacheGetShareThisArray[$cacheKey] = [ |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | $imageTitle = $useImageTitle ? $image->Title : $this->object->Title; |
| 482 | 482 | |
| 483 | 483 | return 'http://pinterest.com/pin/create/button/' |
| 484 | - . '?url=' . urlencode($this->object->AbsoluteLink()) . '&' |
|
| 485 | - . 'description=' . urlencode($imageTitle) . '&' |
|
| 486 | - . 'media=' . urlencode($image->AbsoluteLink()); |
|
| 484 | + . '?url='.urlencode($this->object->AbsoluteLink()).'&' |
|
| 485 | + . 'description='.urlencode($imageTitle).'&' |
|
| 486 | + . 'media='.urlencode($image->AbsoluteLink()); |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | $a = empty($this->{$variable}) ? $this->Config()->get($staticVariable) : $this->{$variable}; |
| 496 | 496 | $str = ''; |
| 497 | 497 | if (is_array($a) && count($a)) { |
| 498 | - $str = $prepender . implode(' ' . $prepender, $a); |
|
| 498 | + $str = $prepender.implode(' '.$prepender, $a); |
|
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | return trim($str); |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | if (is_array($imageMethods) && count($imageMethods)) { |
| 540 | 540 | foreach ($imageMethods as $imageMethod) { |
| 541 | 541 | if ($this->object->hasMethod($imageMethod)) { |
| 542 | - $imageField = $imageMethod . 'ID'; |
|
| 542 | + $imageField = $imageMethod.'ID'; |
|
| 543 | 543 | if ($this->{$imageField}) { |
| 544 | 544 | $image = $this->object->{$imageMethod}(); |
| 545 | 545 | if ($image && $image->exists()) { |