public static function render($name, $check_pro = false) { if (!$name) { return ''; } require_once __DIR__ . '/functions.php'; $alias = RLFunctions::getAliasByName($name); $name = RLFunctions::getNameByAlias($name); if ($check_pro && self::isPro($alias)) { return ''; } require_once __DIR__ . '/text.php'; return '<div class="alert rl_licence">' . JText::sprintf('RL_IS_FREE_VERSION', $name) . '<br>' . JText::_('RL_FOR_MORE_GO_PRO') . '<br>' . '<a href="https://www.regularlabs.com/purchase?ext=' . $alias . '" target="_blank" class="btn btn-small btn-primary">' . ' <span class="icon-basket"></span>' . RLText::html_entity_decoder(JText::_('RL_GO_PRO')) . '</a>' . '</div>'; }
public static function render($alias) { if (!$alias) { return ''; } $name = RLFunctions::getNameByAlias($alias); $alias = RLFunctions::getAliasByName($alias); if (!($version = self::getXMLVersion($alias))) { return ''; } JHtml::_('jquery.framework'); RLFunctions::script('regularlabs/script.min.js'); $url = 'download.regularlabs.com/extensions.xml?j=3&e=' . $alias; $script = "\n\t\t\tjQuery(document).ready(function() {\n\t\t\t\tRegularLabsScripts.loadajax(\n\t\t\t\t\t'" . $url . "',\n\t\t\t\t\t'RegularLabsScripts.displayVersion( data, \"" . $alias . "\", \"" . str_replace(array('FREE', 'PRO'), '', $version) . "\" )',\n\t\t\t\t\t'RegularLabsScripts.displayVersion( \"\" )',\n\t\t\t\t\tnull, null, null, (60 * 60)\n\t\t\t\t);\n\t\t\t});\n\t\t"; JFactory::getDocument()->addScriptDeclaration($script); return '<div class="alert alert-success" style="display:none;" id="regularlabs_version_' . $alias . '">' . self::getMessageText($alias, $name, $version) . '</div>'; }