Пример #1
2
 protected function getInput()
 {
     if (!NNFrameworkFunctions::extensionInstalled('virtuemart')) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDBO();
     $group = $this->get('group', 'categories');
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'virtuemart_' . $group, $tables)) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
     }
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     if ($group == 'categories') {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
         return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
     }
     $attr = '';
     $attr .= ' size="' . (int) $size . '"';
     $attr .= $multiple ? ' multiple="multiple"' : '';
     return JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
 }
Пример #2
0
 function render(&$params)
 {
     jimport('joomla.filesystem.file');
     $app = JFactory::getApplication();
     $parameters = NNParameters::getInstance();
     $system_params = $parameters->getPluginParamValues('sourcerer');
     // Load plugin language
     $lang = JFactory::getLanguage();
     $lang->load('plg_editors-xtd_sourcerer', JPATH_ADMINISTRATOR);
     $language = 'en';
     foreach ($lang->getLocale() as $locale) {
         if (JFile::exists(JPATH_PLUGINS . '/editors-xtd/sourcerer/editarea/langs/' . $locale . '.js')) {
             $language = $locale;
             break;
         }
     }
     // Add scripts and styles
     JHtml::_('behavior.mootools');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php';
     $sversion = NoNumberVersions::getXMLVersion('sourcerer', 'editors-xtd', null, 1);
     $version = NoNumberVersions::getXMLVersion(null, null, null, 1);
     $document = JFactory::getDocument();
     $document->addScript(JURI::root(true) . '/plugins/editors-xtd/sourcerer/editarea/edit_area_full.js' . $sversion);
     $document->addScript(JURI::root(true) . '/plugins/editors-xtd/sourcerer/js/script.js' . $sversion);
     $script = "\n\t\t\teditAreaLoader.init({\n\t\t\t\tid: 'source',\t// id of the textarea to transform\n\t\t\t\tstart_highlight: true,\t// if start with highlight\n\t\t\t\tallow_resize: 'y',\n\t\t\t\tallow_toggle: false,\n\t\t\t\tword_wrap: true,\n\t\t\t\tlanguage: '" . $language . "',\n\t\t\t\tsyntax: 'php',\n\t\t\t\ttoolbar: 'fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, highlight, reset_highlight, word_wrap',\n\t\t\t\tsyntax_selection_allow: 'css,html,js,php'\n\t\t\t});\n\n\t\t\tvar sourcerer_syntax_word = '" . $system_params->syntax_word . "';\n\t\t\tvar sourcerer_editorname = '" . JRequest::getString('name', 'text') . "';\n\t\t\tvar sourcerer_default_addsourcetags = " . (int) $params->addsourcetags . ";\n\t\t\tvar sourcerer_root = '" . JURI::root(true) . "';\n\n\t\t\twindow.addEvent( 'domready', function() { sourcerer_init(); });\n\t\t";
     $document->addScriptDeclaration($script);
     $document->addStyleSheet(JURI::root(true) . '/plugins/system/nnframework/css/popup.css' . $version);
     $document->addStyleSheet(JURI::root(true) . '/plugins/editors-xtd/sourcerer/css/popup.css' . $sversion);
     $params->code = '';
     if ($params->use_example_code == 1 || $app->isAdmin() && $params->use_example_code == 2) {
         $params->code = $params->example_code;
     }
     echo $this->getHTML($params);
 }
Пример #3
0
 protected function getInput()
 {
     if (!NNFrameworkFunctions::extensionInstalled('mijoshop')) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_MIJOSHOP')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $group = $this->def('group', 'categories');
     $this->db = JFactory::getDBO();
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'mijoshop_' . ($group == 'products' ? 'product' : 'category'), $tables)) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_MIJOSHOP')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     require_once JPATH_ROOT . '/components/com_mijoshop/mijoshop/mijoshop.php';
     $this->store_id = (int) MijoShop::get('opencart')->get('config')->get('config_store_id');
     $this->language_id = (int) MijoShop::get('opencart')->get('config')->get('config_language_id');
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple');
     if ($group == 'categories') {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
         return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
     } else {
         $attr = '';
         $attr .= ' size="' . (int) $size . '"';
         $attr .= $multiple ? ' multiple="multiple"' : '';
         return JHtml::_('select.genericlist', $options, $this->name . '[]', trim($attr), 'value', 'text', $this->value, $this->id);
     }
 }
Пример #4
0
 protected function getInput()
 {
     if (!NNFrameworkFunctions::extensionInstalled('hikashop')) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_HIKASHOP')) . '</fieldset>';
     }
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDBO();
     $group = $this->get('group', 'categories');
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'hikashop_' . ($group == 'products' ? 'product' : 'category'), $tables)) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_HIKASHOP')) . '</fieldset>';
     }
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $options = $this->{'get' . $group}();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     switch ($group) {
         case 'categories':
             return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
         default:
             return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
     }
 }
Пример #5
0
 function modCacheCleaner()
 {
     // Load plugin parameters
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
     $parameters = NNParameters::getInstance();
     $this->params = $parameters->getPluginParams('cachecleaner');
 }
Пример #6
0
 public function __construct($form = null)
 {
     $this->db = JFactory::getDbo();
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
 }
Пример #7
0
 function modAddToMenu(&$params)
 {
     // Load plugin parameters
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
     $this->parameters = NNParameters::getInstance();
     $this->params = $this->parameters->getParams($params->toObject(), JPATH_ADMINISTRATOR . '/modules/mod_addtomenu/mod_addtomenu.xml');
 }
Пример #8
0
 /**
  * Display the button
  *
  * @return array A two element array of ( imageName, textToInsert )
  */
 function onDisplay($name)
 {
     jimport('joomla.filesystem.file');
     // return if system plugin is not installed
     if (!JFile::exists(JPATH_PLUGINS . '/system/' . $this->_name . '/' . $this->_name . '.php')) {
         return;
     }
     // return if NoNumber Framework plugin is not installed
     if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
         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);
     // 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);
     return $this->helper->render($name);
 }
Пример #9
0
 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;
 }
Пример #10
0
 function onAfterRoute()
 {
     $this->_pass = 0;
     // return if disabled via url
     // return if current page is raw format
     // return if current page is a joomfishplus page
     if (JRequest::getCmd('disable_sourcerer') || JRequest::getCmd('format') == 'raw' || JRequest::getCmd('option') == 'com_joomfishplus' || JRequest::getInt('nn_qp')) {
         return;
     }
     $app = JFactory::getApplication();
     // 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
     jimport('joomla.filesystem.file');
     if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
         if ($app->isAdmin() && JRequest::getCmd('option') !== 'com_login') {
             $msg = JText::_('SRC_NONUMBER_FRAMEWORK_NOT_INSTALLED');
             $msg .= ' ' . JText::sprintf('SRC_EXTENSION_CAN_NOT_FUNCTION', JText::_('SOURCERER'));
             $mq = $app->getMessageQueue();
             foreach ($mq as $m) {
                 if ($m['message'] == $msg) {
                     $msg = '';
                     break;
                 }
             }
             if ($msg) {
                 $app->enqueueMessage($msg, 'error');
             }
         }
         return;
     }
     // return if current page is an administrator page (and not acymailing)
     if ($app->isAdmin() && JRequest::getCmd('option') != 'com_acymailing') {
         return;
     }
     $this->_pass = 1;
     // 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_SITE, 'en-GB');
     }
     $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_SITE, null, 1);
     // Load plugin parameters
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams($this->_name, $this->_type, $this->params);
     // Include the Helper
     require_once JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/helper.php';
     $class = get_class($this) . 'Helper';
     $this->helper = new $class($params);
 }
Пример #11
0
 /**
  * Function that gets the config settings
  */
 protected function getConfig()
 {
     if (!isset($this->config)) {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
         $parameters = NNParameters::getInstance();
         $this->config = $parameters->getComponentParams('nonumbermanager');
     }
     return $this->config;
 }
Пример #12
0
 static function getPluginHelper(&$plugin, $params = null)
 {
     if (!$params) {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
         $params = NNParameters::getInstance()->getPluginParams($plugin->get('_name'));
     }
     require_once JPATH_PLUGINS . '/' . $plugin->get('_type') . '/' . $plugin->get('_name') . '/helper.php';
     $class = get_class($plugin) . 'Helper';
     return new $class($params);
 }
Пример #13
0
 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;
 }
Пример #15
0
	protected function getInput()
	{
		if (!NNFrameworkFunctions::extensionInstalled('virtuemart'))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</label></fieldset>';
		}

		$this->params = $this->element->attributes();
		$this->db = JFactory::getDBO();

		$group = $this->get('group', 'categories');

		$tables = $this->db->getTableList();
		if (!in_array($this->db->getPrefix() . 'virtuemart_' . $group, $tables))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</label></fieldset>';
		}

		$parameters = NNParameters::getInstance();
		$params = $parameters->getPluginParams('nnframework');
		$this->max_list_count = $params->max_list_count;

		$query = $this->db->getQuery(true)
			->select('config')
			->from('#__virtuemart_configs')
			->where('virtuemart_config_id = 1');
		$this->db->setQuery($query);
		$config = $this->db->loadResult();
		$lang = substr($config, strpos($config, 'vmlang='));
		$lang = substr($lang, 0, strpos($lang, '|'));
		if (preg_match('#"([^"]*_[^"]*)"#', $lang, $lang))
		{
			$this->lang = $lang['1'];
		}
		else
		{
			$this->lang = 'en_gb';
		}

		if (!is_array($this->value))
		{
			$this->value = explode(',', $this->value);
		}

		$options = $this->{'get' . $group}();

		$size = (int) $this->get('size');
		$multiple = $this->get('multiple');

		require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';

		return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
	}
Пример #16
0
 static function getPluginHelper(&$plugin, $params = null)
 {
     $hash = md5('getPluginHelper_' . $plugin->get('_type') . '_' . $plugin->get('_name') . '_' . json_encode($params));
     if (NNCache::has($hash)) {
         return NNCache::get($hash);
     }
     if (!$params) {
         require_once __DIR__ . '/parameters.php';
         $params = NNParameters::getInstance()->getPluginParams($plugin->get('_name'));
     }
     require_once JPATH_PLUGINS . '/' . $plugin->get('_type') . '/' . $plugin->get('_name') . '/helper.php';
     $class = get_class($plugin) . 'Helper';
     return NNCache::set($hash, new $class($params));
 }
Пример #17
0
 /**
  * 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;
 }
Пример #18
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDbo();
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $group = $this->get('group', 'categories');
     $options = $this->{'get' . $group}();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     switch ($group) {
         case 'categories':
             return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
         default:
             return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
     }
 }
 /**
  * Display the button
  *
  * @return array A two element array of ( imageName, textToInsert )
  */
 function onDisplay($name)
 {
     jimport('joomla.filesystem.file');
     // return if system plugin is not installed
     if (!JFile::exists(JPATH_PLUGINS . '/system/' . $this->_name . '/' . $this->_name . '.php')) {
         return;
     }
     // return if NoNumber Framework plugin is not installed
     if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
         return;
     }
     // load the admin language file
     JFactory::getLanguage()->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR);
     // 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';
     $helper = new $class($params);
     return $helper->render($name);
 }
Пример #20
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $this->db = JFactory::getDbo();
     $parameters = NNParameters::getInstance();
     $params = $parameters->getPluginParams('nnframework');
     $this->max_list_count = $params->max_list_count;
     if (!is_array($this->value)) {
         $this->value = explode(',', $this->value);
     }
     $group = $this->get('group', 'categories');
     $options = $this->{'get' . $group}();
     $size = (int) $this->get('size');
     $multiple = $this->get('multiple');
     if ($group == 'categories') {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
         return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
     } else {
         $attr = '';
         $attr .= ' size="' . (int) $size . '"';
         $attr .= $multiple ? ' multiple="multiple"' : '';
         return JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
     }
 }
Пример #21
0
	protected function getInput()
	{
		if (!NNFrameworkFunctions::extensionInstalled('k2'))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_K2')) . '</label></fieldset>';
		}

		$this->params = $this->element->attributes();
		$this->db = JFactory::getDBO();

		$group = $this->get('group', 'categories');

		$tables = $this->db->getTableList();
		if (!in_array($this->db->getPrefix() . 'k2_' . $group, $tables))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_K2')) . '</label></fieldset>';
		}

		$parameters = NNParameters::getInstance();
		$params = $parameters->getPluginParams('nnframework');
		$this->max_list_count = $params->max_list_count;

		if (!is_array($this->value))
		{
			$this->value = explode(',', $this->value);
		}

		$options = $this->{'get' . $group}();

		$size = (int) $this->get('size');
		$multiple = $this->get('multiple');

		require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';

		return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
	}
Пример #22
0
 static function isCategoryList($context)
 {
     $hash = md5('isCategoryList_' . $context);
     if (NNCache::has($hash)) {
         return NNCache::get($hash);
     }
     // Return false if it is not a category page
     if ($context != 'com_content.category' || JFactory::getApplication()->input->get('view') != 'category') {
         return false;
     }
     // Return false if it is not a list layout
     if (JFactory::getApplication()->input->get('layout') && JFactory::getApplication()->input->get('layout') != 'list') {
         return false;
     }
     // Return true if it IS a list layout
     if (JFactory::getApplication()->input->get('layout') == 'list') {
         return true;
     }
     // Layout is empty, so check if default layout is list (default)
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
     $parameters = NNParameters::getInstance();
     $parameters = $parameters->getComponentParams('content');
     return NNCache::set($hash, $parameters->category_layout == '_:default');
 }
Пример #23
0
 function getMenuItemParams($id = 0)
 {
     $query = 'SELECT params' . ' FROM #__menu' . ' WHERE id = ' . (int) $id . ' LIMIT 1';
     $this->_db->setQuery($query);
     $params = $this->_db->loadResult();
     $parameters = NNParameters::getInstance();
     return $parameters->getParams($params);
 }
Пример #24
0
 *
 * @package         Modules Anywhere
 * @version         4.1.0
 *
 * @author          Peter van Westen <*****@*****.**>
 * @link            http://www.nonumber.nl
 * @copyright       Copyright © 2015 NoNumber All Rights Reserved
 * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */
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('modulesanywhere');
if (JFactory::getApplication()->isSite()) {
    if (!$params->enable_frontend) {
        JError::raiseError(403, JText::_("ALERTNOTAUTH"));
    }
}
$class = new PlgButtonModulesAnywherePopup();
$class->render($params);
class PlgButtonModulesAnywherePopup
{
    function render(&$params)
    {
        $app = JFactory::getApplication();
        // load the admin language file
        require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
Пример #25
0
 function getMenuItemParams($id = 0)
 {
     $hash = 'MenuItemParams_' . $id;
     if (!isset($this->cache[$hash])) {
         $this->q->clear()->select('m.params')->from('#__menu AS m')->where('m.id = ' . (int) $id);
         $this->db->setQuery($this->q);
         $params = $this->db->loadResult();
         $parameters = NNParameters::getInstance();
         $this->cache[$hash] = $parameters->getParams($params);
     }
     return $this->cache[$hash];
 }
 private function getConfig()
 {
     static $instance;
     if (!is_object($instance)) {
         require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
         $parameters = NNParameters::getInstance();
         $instance = $parameters->getComponentParams('advancedmodules');
     }
     return $instance;
 }
Пример #27
0
 function getMenuItemParams($id = 0)
 {
     $query = $this->db->getQuery(true);
     $query->select('m.params')->from('#__menu AS m')->where('m.id = ' . (int) $id);
     $this->db->setQuery($query);
     $params = $this->db->loadResult();
     $parameters = NNParameters::getInstance();
     return $parameters->getParams($params);
 }
Пример #28
0
    static function selectlist(&$options, $name, $value, $id, $size = 0, $multiple = 0, $simple = 0)
    {
        if (empty($options)) {
            return '<fieldset class="radio">' . JText::_('NN_NO_ITEMS_FOUND') . '</fieldset>';
        }
        require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
        $parameters = NNParameters::getInstance();
        $params = $parameters->getPluginParams('nnframework');
        if (!is_array($value)) {
            $value = explode(',', $value);
        }
        $count = 0;
        if ($options != -1) {
            foreach ($options as $option) {
                $count++;
                if (isset($option->links)) {
                    $count += count($option->links);
                }
                if ($count > $params->max_list_count) {
                    break;
                }
            }
        }
        if ($options == -1 || $count > $params->max_list_count) {
            if (is_array($value)) {
                $value = implode(',', $value);
            }
            if (!$value) {
                $input = '<textarea name="' . $name . '" id="' . $id . '" cols="40" rows="5" />' . $value . '</textarea>';
            } else {
                $input = '<input type="text" name="' . $name . '" id="' . $id . '" value="' . $value . '" size="60" />';
            }
            return '<fieldset class="radio"><label for="' . $id . '">' . JText::_('NN_ITEM_IDS') . ':</label>' . $input . '</fieldset>';
        }
        $size = $size ? $size : 300;
        if (!$multiple) {
            $first_level = isset($options['0']->level) ? $options['0']->level : 0;
            foreach ($options as &$option) {
                if (!isset($option->level)) {
                    continue;
                }
                $repeat = $option->level - $first_level > 0 ? $option->level - $first_level : 0;
                $option->text = str_repeat(' - ', $repeat) . $option->text;
            }
            $html = JHtml::_('select.genericlist', $options, $name, 'class="inputbox"', 'value', 'text', $value);
            return preg_replace('#>((?:\\s*-\\s*)*)\\[\\[\\:(.*?)\\:\\]\\]#si', ' style="\\2">\\1', $html);
        }
        if ($simple) {
            $attr = '';
            $attr .= ' size="' . (int) $size . '"';
            $attr .= $multiple ? ' multiple="multiple"' : '';
            return JHtml::_('select.genericlist', $options, $name, trim($attr), 'value', 'text', $value, $id);
        }
        JHtml::stylesheet('nnframework/multiselect.min.css', false, true);
        JFactory::getDocument()->addScriptVersion(JURI::root(true) . '/media/nnframework/js/multiselect.min.js');
        $html = array();
        $html[] = '<div class="well well-small nn_multiselect" id="' . $id . '">';
        $html[] = '
			<div class="form-inline nn_multiselect-controls">
				<span class="small">' . JText::_('JSELECT') . ':
					<a class="nn_multiselect-checkall" href="javascript://">' . JText::_('JALL') . '</a>,
					<a class="nn_multiselect-uncheckall" href="javascript://">' . JText::_('JNONE') . '</a>,
					<a class="nn_multiselect-toggleall" href="javascript://">' . JText::_('NN_TOGGLE') . '</a>
				</span>
				<span class="width-20">|</span>
				<span class="small">' . JText::_('NN_EXPAND') . ':
					<a class="nn_multiselect-expandall" href="javascript://">' . JText::_('JALL') . '</a>,
					<a class="nn_multiselect-collapseall" href="javascript://">' . JText::_('JNONE') . '</a>
				</span>
				<span class="width-20">|</span>
				<span class="small">' . JText::_('JSHOW') . ':
					<a class="nn_multiselect-showall" href="javascript://">' . JText::_('JALL') . '</a>,
					<a class="nn_multiselect-showselected" href="javascript://">' . JText::_('NN_SELECTED') . '</a>
				</span>
				<span class="nn_multiselect-maxmin">
				<span class="width-20">|</span>
				<span class="small">
					<a class="nn_multiselect-maximize" href="javascript://">' . JText::_('NN_MAXIMIZE') . '</a>
					<a class="nn_multiselect-minimize" style="display:none;" href="javascript://">' . JText::_('NN_MINIMIZE') . '</a>
				</span>
				</span>
				<input type="text" name=""nn_multiselect-filter" class="nn_multiselect-filter input-medium search-query pull-right" size="16"
					autocomplete="off" placeholder="' . JText::_('JSEARCH_FILTER') . '" aria-invalid="false" tabindex="-1">
			</div>

			<div class="clearfix"></div>

			<hr class="hr-condensed" />';
        $o = array();
        foreach ($options as $option) {
            $option->level = isset($option->level) ? $option->level : 0;
            $o[] = $option;
            if (isset($option->links)) {
                foreach ($option->links as $link) {
                    $link->level = $option->level + (isset($link->level) ? $link->level : 1);
                    $o[] = $link;
                }
            }
        }
        $html[] = '<ul class="nn_multiselect-ul" style="max-height:' . (int) $size . 'px;overflow-x: hidden;">';
        $prevlevel = 0;
        foreach ($o as $i => $option) {
            if ($prevlevel < $option->level) {
                // correct wrong level indentations
                $option->level = $prevlevel + 1;
                $html[] = '<ul class="nn_multiselect-sub">';
            } else {
                if ($prevlevel > $option->level) {
                    $html[] = str_repeat('</li></ul>', $prevlevel - $option->level);
                } else {
                    if ($i) {
                        $html[] = '</li>';
                    }
                }
            }
            $labelclass = trim('pull-left ' . (isset($option->labelclass) ? $option->labelclass : ''));
            $html[] = '<li>';
            $item = '<div class="' . trim('nn_multiselect-item pull-left ' . (isset($option->class) ? $option->class : '')) . '">';
            if (isset($option->title)) {
                $labelclass .= ' nav-header';
            }
            if (isset($option->title) && (!isset($option->value) || !$option->value)) {
                $item .= '<label class="' . $labelclass . '">' . $option->title . '</label>';
            } else {
                $selected = in_array($option->value, $value) ? ' checked="checked"' : '';
                $disabled = isset($option->disable) && $option->disable ? ' readonly="readonly" style="visibility:hidden"' : '';
                $item .= '<input type="checkbox" class="pull-left" name="' . $name . '" id="' . $id . $option->value . '" value="' . $option->value . '"' . $selected . $disabled . ' />
					<label for="' . $id . $option->value . '" class="' . $labelclass . '">' . $option->text . '</label>';
            }
            $item .= '</div>';
            $html[] = $item;
            if (!isset($o[$i + 1]) && $option->level > 0) {
                $html[] = str_repeat('</li></ul>', (int) $option->level);
            }
            $prevlevel = $option->level;
        }
        $html[] = '</ul>';
        $html[] = '
			<div style="display:none;" class="nn_multiselect-menu-block">
				<div class="pull-left nav-hover nn_multiselect-menu">
					<div class="btn-group">
						<a href="#" data-toggle="dropdown" class="dropdown-toggle btn btn-micro">
							<span class="caret"></span>
						</a>
						<ul class="dropdown-menu">
							<li class="nav-header">' . JText::_('COM_MODULES_SUBITEMS') . '</li>
							<li class="divider"></li>
							<li class=""><a class="checkall" href="javascript://"><span class="icon-checkbox"></span> ' . JText::_('JSELECT') . '</a>
							</li>
							<li><a class="uncheckall" href="javascript://"><span class="icon-checkbox-unchecked"></span> ' . JText::_('COM_MODULES_DESELECT') . '</a>
							</li>
							<div class="nn_multiselect-menu-expand">
								<li class="divider"></li>
								<li><a class="expandall" href="javascript://"><span class="icon-plus"></span> ' . JText::_('NN_EXPAND') . '</a></li>
								<li><a class="collapseall" href="javascript://"><span class="icon-minus"></span> ' . JText::_('NN_COLLAPSE') . '</a></li>
							</div>
						</ul>
					</div>
				</div>
			</div>';
        $html[] = '</div>';
        $html = implode('', $html);
        return preg_replace('#>\\[\\[\\:(.*?)\\:\\]\\]#si', ' style="\\1">', $html);
    }
Пример #29
0
	private static function initSourcererTag()
	{
		if (self::$sourcerer_tag === 0)
		{
			return false;
		}

		require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
		$params = NNParameters::getInstance()->getPluginParams('sourcerer');
		self::$sourcerer_tag = isset($params->syntax_word) ? $params->syntax_word : 0;

		return true;
	}
Пример #30
0
 /**
  * Function that gets the config settings
  *
  * @return    Object
  */
 private function getConfig()
 {
     if (isset($this->config)) {
         return $this->config;
     }
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
     $parameters = NNParameters::getInstance();
     $this->config = $parameters->getComponentParams('advancedmodules');
     return $this->config;
 }