Created
December 8, 2016 09:12
-
-
Save CB9TOIIIA/2ca1125a6f2b65fd5761dd2fff930b3f to your computer and use it in GitHub Desktop.
Костыль link Zoo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// init lightbox | |
if (!empty($rel)) { | |
$rel = 'data-lightbox="' . $rel .'"'; | |
$this->app->document->addScript('assets:js/lightbox.js'); | |
$this->app->document->addStylesheet('assets:css/lightbox.css'); | |
$this->app->document->addScriptDeclaration("jQuery(function($) { $('[data-lightbox]').lightbox(); });"); | |
} | |
$simpletext = str_replace('http://','',$this->get('value', '')); | |
preg_match('/\./',$this->get('value', ''),$match); | |
if (!empty($match[0])) { | |
echo '<a target="_blank" rel="nofollow" href="'.JRoute::_($this->get('value', '')).'" title="'.$this->getTitle().'" '. $rel .'>'.$this->getText().'</a>'; | |
} | |
else { | |
echo $simpletext; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment