*/ defined('_JEXEC') or die; $user = JFactory::getUser(); if ($user->get('guest') || !$user->authorise('core.edit', 'com_content') && !$user->authorise('core.create', 'com_content')) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); } require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $parameters = NNParameters::getInstance(); $params = $parameters->getPluginParams('sourcerer'); if (JFactory::getApplication()->isSite()) { if (!$params->enable_frontend) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); } } $class = new PlgButtonSourcererPopup($params); $class->render(); class PlgButtonSourcererPopup { var $params = null; function __construct(&$params) { $this->params = $params; } function render() { jimport('joomla.filesystem.file'); // Load plugin language require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php'; NNFrameworkFunctions::loadLanguage('plg_system_nnframework'); NNFrameworkFunctions::loadLanguage('plg_editors-xtd_sourcerer'); NNFrameworkFunctions::loadLanguage('plg_system_sourcerer');
*/ defined('_JEXEC') or die; $user = JFactory::getUser(); if ($user->get('guest') || !$user->authorise('core.edit', 'com_content') && !$user->authorise('core.create', 'com_content')) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); } require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $parameters = NNParameters::getInstance(); $params = $parameters->getPluginParams('sourcerer'); if (JFactory::getApplication()->isSite()) { if (!$params->enable_frontend) { JError::raiseError(403, JText::_("ALERTNOTAUTH")); } } $class = new PlgButtonSourcererPopup(); $class->render($params); class PlgButtonSourcererPopup { function render(&$params) { jimport('joomla.filesystem.file'); // Load plugin language require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php'; NNFrameworkFunctions::loadLanguage('plg_system_nnframework'); NNFrameworkFunctions::loadLanguage('plg_editors-xtd_sourcerer'); NNFrameworkFunctions::loadLanguage('plg_system_sourcerer'); JHtml::stylesheet('nnframework/style.min.css', false, true); NNFrameworkFunctions::addScriptVersion(JUri::root(true) . '/media/nnframework/js/script.min.js'); JFactory::getDocument()->addStyleSheet('//code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css'); JFactory::getDocument()->addScript('//code.jquery.com/ui/1.9.2/jquery-ui.js'); $script = "\n\t\t\tvar sourcerer_syntax_word = '" . $params->syntax_word . "';\n\t\t\tvar sourcerer_editorname = '" . JFactory::getApplication()->input->getString('name', 'text') . "';\n\t\t\tvar sourcerer_default_addsourcetags = " . (int) $params->addsourcetags . ";\n\t\t\tvar sourcerer_root = '" . JUri::root(true) . "';\n\t\t";