/** * 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 if (JFactory::getDocument()->getType() != 'html' && JFactory::getDocument()->getType() != 'feed') { return false; } if (!$this->isFrameworkEnabled()) { return false; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; if (nnProtect::isAdmin()) { 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 (!$this->isFrameworkEnabled()) { return false; } if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_snippets/models/list.php')) { return; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php'; if (nnProtect::isAdmin()) { return false; } if (nnProtect::isProtectedPage($this->_alias, 1)) { return false; } // Load component parameters require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $params = nnParameters::getInstance()->getComponentParams($this->_name); require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php'; $this->_helper = nnFrameworkHelper::getPluginHelper($this, $params); return $this->_helper; }
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; }
/** * 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; }
/** * check if page is an edit page */ public static function isEditPage() { $hash = md5('isEditPage'); if (nnCache::has($hash)) { return nnCache::get($hash); } $option = JFactory::getApplication()->input->get('option'); // always return false for these components if (in_array($option, array('com_rsevents', 'com_rseventspro'))) { return nnCache::set($hash, false); } $task = JFactory::getApplication()->input->get('task'); if (strpos($task, '.') !== false) { $task = explode('.', $task); $task = array_pop($task); } $view = JFactory::getApplication()->input->get('view'); if (strpos($view, '.') !== false) { $view = explode('.', $view); $view = array_pop($view); } $isedit = 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(); return nnCache::set($hash, $isedit); }