function onAfterRoute() { $this->_pass = 0; jimport('joomla.filesystem.file'); if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) { require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; // return if page should be protected if (NNProtect::isProtectedPage('tooltips', 1)) { return; } } // load the admin language file $lang = JFactory::getLanguage(); if ($lang->getTag() != 'en-GB') { // Loads English language file as fallback (for undefined stuff in other language file) $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, 'en-GB'); } $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, null, 1); // return if NoNumber Framework plugin is not installed if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) { if (JFactory::getApplication()->isAdmin() && JFactory::getApplication()->input->get('option') != 'com_login') { $msg = JText::_('TT_NONUMBER_FRAMEWORK_NOT_INSTALLED') . ' ' . JText::sprintf('TT_EXTENSION_CAN_NOT_FUNCTION', JText::_('TOOLTIPS')); $mq = JFactory::getApplication()->getMessageQueue(); foreach ($mq as $m) { if ($m['message'] == $msg) { $msg = ''; break; } } if ($msg) { JFactory::getApplication()->enqueueMessage($msg, 'error'); } } return; } // Load plugin parameters require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $parameters = NNParameters::getInstance(); $params = $parameters->getPluginParams($this->_name); // allow in admin? if (!$params->enable_admin || JFactory::getApplication()->input->get('option') == 'com_plugins') { if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) { require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; // return if current page is an admin page if (NNProtect::isAdmin()) { return; } } else { if (JFactory::getApplication()->isAdmin()) { return; } } } // Include the Helper require_once JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/helper.php'; $class = get_class($this) . 'Helper'; $this->helper = new $class($params); $this->_pass = 1; }
public function onAfterRoute() { $this->_pass = 0; jimport('joomla.filesystem.file'); if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) { require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; // return if page should be protected if (NNProtect::isProtectedPage('', 1)) { return; } } // load the admin language file require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php'; NNFrameworkFunctions::loadLanguage('plg_' . $this->_type . '_' . $this->_name); // return if NoNumber Framework plugin is not installed if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) { if (JFactory::getApplication()->isAdmin() && JFactory::getApplication()->input->get('option') != 'com_login') { $msg = JText::_('SRC_NONUMBER_FRAMEWORK_NOT_INSTALLED') . ' ' . JText::sprintf('SRC_EXTENSION_CAN_NOT_FUNCTION', JText::_('SOURCERER')); $mq = JFactory::getApplication()->getMessageQueue(); foreach ($mq as $m) { if ($m['message'] == $msg) { $msg = ''; break; } } if ($msg) { JFactory::getApplication()->enqueueMessage($msg, 'error'); } } return; } if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) { require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; // return if current page is an admin page if (NNProtect::isAdmin()) { return; } } else { if (JFactory::getApplication()->isAdmin()) { return; } } // load the site language file require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php'; NNFrameworkFunctions::loadLanguage('plg_' . $this->_type . '_' . $this->_name, JPATH_SITE); // Load plugin parameters require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $parameters = NNParameters::getInstance(); $params = $parameters->getPluginParams($this->_name); // Include the Helper require_once JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/helper.php'; $class = get_class($this) . 'Helper'; $this->_helper = new $class($params); $this->_pass = 1; }
function onAfterRoute() { $this->_pass = 0; // Don't do anything on json/ajax calls if (in_array(JFactory::getApplication()->input->get('type'), array('json', 'ajax'))) { return; } jimport('joomla.filesystem.file'); if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) { require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; // return if page should be protected if (NNProtect::isProtectedPage('emailprotector', 1)) { return; } } // load the admin language file JFactory::getLanguage()->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR); // return if NoNumber Framework plugin is not installed if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) { if (JFactory::getApplication()->isAdmin() && JFactory::getApplication()->input->get('option') != 'com_login') { $msg = JText::_('EP_NONUMBER_FRAMEWORK_NOT_INSTALLED') . ' ' . JText::sprintf('EP_EXTENSION_CAN_NOT_FUNCTION', JText::_('EMAIL_PROTECTOR')); $mq = JFactory::getApplication()->getMessageQueue(); foreach ($mq as $m) { if ($m['message'] == $msg) { $msg = ''; break; } } if ($msg) { JFactory::getApplication()->enqueueMessage($msg, 'error'); } } return; } if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) { require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; // return if current page is an admin page if (NNProtect::isAdmin()) { return; } } else { if (JFactory::getApplication()->isAdmin()) { return; } } // Load plugin parameters require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $parameters = NNParameters::getInstance(); $params = $parameters->getPluginParams($this->_name); // Include the Helper require_once JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/helper.php'; $class = get_class($this) . 'Helper'; $this->helper = new $class($params); $this->_pass = 1; }
public static function isEditPage() { $option = JFactory::getApplication()->input->get('option'); // always return false for these components if (in_array($option, array('com_rsevents', 'com_rseventspro'))) { return 0; } $task = JFactory::getApplication()->input->get('task'); $view = JFactory::getApplication()->input->get('view'); if (!(strpos($task, '.') === false)) { $task = explode('.', $task); $task = array_pop($task); } if (!(strpos($view, '.') === false)) { $view = explode('.', $view); $view = array_pop($view); } return in_array($task, array('edit', 'form', 'submission')) || in_array($view, array('edit', 'form')) || in_array(JFactory::getApplication()->input->get('do'), array('edit', 'form')) || in_array(JFactory::getApplication()->input->get('layout'), array('edit', 'form', 'write')) || in_array(JFactory::getApplication()->input->get('option'), array('com_contentsubmit', 'com_cckjseblod')) || NNProtect::isAdmin(); }
/** * Create the helper object * * @return object The plugins helper object */ private function getHelper() { // Already initialized, so return if ($this->_init) { return $this->_helper; } $this->_init = true; if (!$this->isFrameworkEnabled()) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; if (NNProtect::isAdmin()) { return false; } if (NNProtect::isProtectedPage($this->_alias, 1)) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php'; $this->_helper = NNFrameworkHelper::getPluginHelper($this); return $this->_helper; }
/** * Create the helper object * * @return object The plugins helper object */ private function getHelper() { // Already initialized, so return if ($this->_init) { return $this->_helper; } $this->_init = true; // only in html or raw (for ajax save order stuff) if (!in_array(JFactory::getDocument()->getType(), array('html', 'raw'))) { return false; } if (!$this->isFrameworkEnabled()) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; if (NNProtect::isProtectedPage($this->_alias)) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php'; $this->_helper = NNFrameworkHelper::getPluginHelper($this); return $this->_helper; }
/** * Create the helper object * * @return object The plugins helper object */ private function getHelper() { // Already initialized, so return if ($this->_init) { return $this->_helper; } $this->_init = true; if (!$this->isFrameworkEnabled()) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; if (!NNProtect::isSystemPluginInstalled($this->_alias)) { return false; } // Load plugin parameters require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $parameters = NNParameters::getInstance(); $params = $parameters->getPluginParams($this->_name); require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php'; $this->_helper = NNFrameworkHelper::getPluginHelper($this, $params); return $this->_helper; }
public function replaceTags(&$string, $area = 'article') { if (!is_string($string) || $string == '') { return; } if (strpos($string, '{' . $this->params->article_tag) === false) { return; } // allow in component? if (($area == 'component' || $area == 'article' && JFactory::getApplication()->input->get('option') == 'com_content') && in_array(JFactory::getApplication()->input->get('option'), $this->params->disabled_components)) { $this->helpers->get('protect')->protect($string); $this->helpers->get('process')->removeAll($string, $area); NNProtect::unprotect($string); return; } $this->helpers->get('protect')->protect($string); $this->params->message = ''; // COMPONENT if (JFactory::getDocument()->getType() == 'feed') { $s = '#(<item[^>]*>)#s'; $string = preg_replace($s, '\\1<!-- START: AA_COMPONENT -->', $string); $string = str_replace('</item>', '<!-- END: AA_COMPONENT --></item>', $string); } if (strpos($string, '<!-- START: AA_COMPONENT -->') === false) { $this->helpers->get('tag')->tagArea($string, 'component'); } $components = $this->helpers->get('tag')->getAreaByType($string, 'component'); foreach ($components as $component) { if (strpos($string, $component['0']) === false) { continue; } $this->helpers->get('process')->processArticles($component['1'], 'components'); $string = str_replace($component['0'], $component['1'], $string); } // EVERYWHERE $this->helpers->get('process')->processArticles($string, 'other'); NNProtect::unprotect($string); }
/** * Create the helper object * * @return object The plugins helper object */ private function getHelper() { // Already initialized, so return if ($this->_init) { return $this->_helper; } $this->_init = true; if (JFactory::getDocument()->getType() != 'html') { return false; } if (!$this->isFrameworkEnabled()) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; if (!NNProtect::isComponentInstalled($this->_alias)) { return false; } if (NNProtect::isProtectedPage($this->_alias)) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php'; $this->_helper = NNFrameworkHelper::getPluginHelper($this); return $this->_helper; }
/** * Create the helper object * * @return object The plugins helper object */ private function getHelper() { // Already initialized, so return if ($this->_init) { return $this->_helper; } $this->_init = true; if (JFactory::getApplication()->input->getWord('format') == 'feed' || JFactory::getApplication()->input->getWord('type') == 'rss' || JFactory::getApplication()->input->getWord('type') == 'atom') { return false; } if (!$this->isFrameworkEnabled()) { return false; } jimport('joomla.filesystem.file'); if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_advancedmodules/advancedmodules.php')) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; if (!NNProtect::isComponentInstalled($this->_alias)) { return false; } if (NNProtect::isProtectedPage($this->_alias)) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $params = NNParameters::getInstance()->getComponentParams('advancedmodules'); require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php'; $this->_helper = NNFrameworkHelper::getPluginHelper($this, $params); return $this->_helper; }
function unprotectTags(&$str) { NNProtect::unprotectTags($str, $this->params->protected_tags); }
/** * Just in case you can't figure the method name out: this cleans the left-over junk */ function cleanLeftoverJunk(&$str) { NNProtect::removeInlineComments($str, 'Tooltips'); }
function protect(&$str) { NNProtect::protectFields($str); NNProtect::protectSourcerer($str); }
/** * replace any protected tags to original */ public static function unprotectForm(&$str, $tags = array(), $protected = array()) { // Protect entire form if (empty($tags)) { NNProtect::unprotect($str); return; } NNProtect::unprotectTags($str, $tags, $protected); }
static function unprotectForm(&$string, $tags = array(), $protected = array()) { require_once __DIR__ . '/protect.php'; NNProtect::unprotectForm($string, $tags, $protected); }
function unprotect(&$str) { NNProtect::unprotectForm($str, array($this->src_params->syntax_start, $this->src_params->syntax_start_0, $this->src_params->syntax_end)); }
function unprotect(&$str) { NNProtect::unprotectForm($str, array('{' . $this->params->module_tag, '{' . $this->params->modulepos_tag, '{loadposition')); }
/** * replace any protected tags to original */ public static function unprotectForm(&$str, $tags = array(), $protected = array()) { NNProtect::unprotectTags($str, $tags, $protected); }
function unprotectTags(&$string) { NNProtect::unprotectTags($string, $this->src_params->protected_tags); }