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); }
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); } }
public function __construct($form = null) { $this->db = JFactory::getDbo(); $parameters = NNParameters::getInstance(); $params = $parameters->getPluginParams('nnframework'); $this->max_list_count = $params->max_list_count; }
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); } }
function modCacheCleaner() { // Load plugin parameters require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; $parameters = NNParameters::getInstance(); $this->params = $parameters->getPluginParams('cachecleaner'); }
/** * 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); }
/** * 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 . DS . 'system' . DS . $this->_name . DS . $this->_name . '.php')) { return; } // return if NoNumber! Elements plugin is not installed if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'nonumberelements.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 system plugin parameters require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php'; $parameters =& NNParameters::getParameters(); $system_params = JPluginHelper::getPlugin('system', $this->_name); $params = $parameters->getParams($system_params->params, JPATH_PLUGINS . DS . 'system' . DS . $this->_name . DS . $this->_name . '.xml'); // Include the Helper require_once JPATH_PLUGINS . DS . $this->_type . DS . $this->_name . DS . 'helper.php'; $class = get_class($this) . 'Helper'; $this->helper = new $class($params); return $this->helper->render($name); }
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'); }
public static function getInstance() { if (!self::$instance) { self::$instance = new NNFrameworkParameters(); } return self::$instance; }
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); }
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; }
function getPluginParamValues($name, $type = 'system') { jimport('joomla.plugin.plugin'); $plugin = JPluginHelper::getPlugin($type, $name); require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php'; $parameters =& NNParameters::getParameters(); return $parameters->getParams($plugin->params, JPATH_PLUGINS . DS . $type . DS . $name . DS . $name . '.xml'); }
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); }
/** * 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; }
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); }
/** * Function that gets the config settings * * @return Object */ protected function getConfig() { if (!isset($this->config)) { require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php'; $parameters =& NNParameters::getParameters(); $config = JComponentHelper::getParams('com_advancedmodules'); $this->config = $parameters->getParams($config->toObject(), JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'config.xml'); } return $this->config; }
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 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; }
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); }
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)); }
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_modalizer') || JRequest::getCmd('format') == 'raw' || JRequest::getCmd('option') == 'com_joomfishplus') { 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); $mainframe =& JFactory::getApplication(); // return if NoNumber! Elements plugin is not installed jimport('joomla.filesystem.file'); if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'nonumberelements.php')) { if ($mainframe->isAdmin() && JRequest::getCmd('option') !== 'com_login') { $msg = JText::_('MDL_NONUMBER_ELEMENTS_PLUGIN_NOT_INSTALLED'); $mq = $mainframe->getMessageQueue(); foreach ($mq as $m) { if ($m['message'] == $msg) { $msg = ''; break; } } if ($msg) { $mainframe->enqueueMessage($msg, 'error'); } } return; } // return if current page is an administrator page (and not acymailing) if ($mainframe->isAdmin() && JRequest::getCmd('option') != 'com_acymailing') { return; } $this->_pass = 1; // Load plugin parameters require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php'; $parameters =& NNParameters::getParameters(); $params = $parameters->getParams($this->params->_raw, JPATH_PLUGINS . DS . $this->_type . DS . $this->_name . '.xml'); // Include the Helper require_once JPATH_PLUGINS . DS . $this->_type . DS . $this->_name . DS . 'helper.php'; $class = get_class($this) . 'Helper'; $this->helper = new $class($params); }
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); } }
/** * 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; }
/** * 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); }
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); } }
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); }
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'); }
* * @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';
function outputHTML( &$params, &$rows, &$client, &$page, &$lists ) { $parameters =& NNParameters::getParameters(); $system_params = $parameters->getPluginParamValues( 'modulesanywhere' ); $tag = explode( ',', $system_params->module_tag ); $tag = trim( $tag['0'] ); $postag = explode( ',', $system_params->modulepos_tag ); $postag = trim( $postag['0'] ); JHTML::_( 'behavior.tooltip' ); // Add scripts and styles $document =& JFactory::getDocument(); $script = " function modulesanywhere_jInsertEditorText( id, modulepos ) { f = document.getElementById( 'adminForm' ); if ( modulepos ) { str = '{".$postag." '+id+'}'; } else { var style = f.style.options[f.style.selectedIndex].value.trim(); var showtitle = f.showtitle.options[f.showtitle.selectedIndex].value.trim(); str = '{".$tag." '+id; if ( style && style != '".$system_params->style."' ) { str += '|'+style; } if ( showtitle === '0' || showtitle === '1' ) { str += '|showtitle='+showtitle; } str += '}'; } if ( f.div_enable.checked ) { var float = f.div_float.options[f.div_float.selectedIndex].value.trim(); var params = new Array(); if( f.div_width.value.trim() ) { params[params.length] = 'width:'+f.div_width.value.trim(); } if( f.div_height.value.trim() ) { params[params.length] = 'height:'+f.div_height.value.trim(); } if( float ) { params[params.length] = 'float:'+float; } if( f.div_class.value.trim() ) { params[params.length] = 'class:'+f.div_class.value.trim(); } str = ( '{div '+params.join('|') ).trim()+'}'+str.trim()+'{/div}'; } window.parent.jInsertEditorText( str, '".JRequest::getVar( 'name' )."' ); window.parent.SqueezeBox.close(); } function toggleByCheckbox( id ) { el = document.getElementById( id ); div = document.getElementById( id+'_div' ); if ( el.checked ) { div.style.display = 'block'; } else { div.style.display = 'none'; } } window.addEvent('domready', function(){ toggleByCheckbox('div_enable'); }); "; $document->addScriptDeclaration( $script ); $document->addStyleSheet( JURI::root( true ).'/plugins/system/nnframework/css/popup.css' ); ?> <div style="margin: 0;"> <form action="" method="post" name="adminForm" id="adminForm"> <fieldset> <div style="float: left"> <h1><?php echo JText::_( 'MODULES_ANYWHERE' ); ?></h1> </div> <div style="float: right"> <div class="button2-left"> <div class="blank hasicon cancel"> <a rel="" onclick="window.parent.SqueezeBox.close();" href="javascript://" title="<?php echo JText::_( 'JCANCEL' ) ?>"><?php echo JText::_( 'Cancel' ) ?></a> </div> </div> </div> </fieldset> <p><?php echo html_entity_decode( JText::_( 'MA_CLICK_ON_ONE_OF_THE_MODULES_LINKS' ), ENT_COMPAT, 'UTF-8' ); ?></p> <table class="adminform" cellspacing="2" style="width:auto;float:left;margin-right:10px;"> <tr> <th> <?php echo JText::_( 'MA_MODULE_STYLE' ); ?>: </th> <td> <select name="style" class="inputbox"> <?php $style = JRequest::getCmd( 'style' ); if ( !$style ) { $style = $system_params->style; } ?> <option <?php echo ( ( $style == 'none' ) ? 'selected="selected" value=""' : 'value="none"' ); ?>><?php echo JText::_( 'MA_NO_WRAPPING' ); ?></option> <option <?php echo ( ( $style == 'table' ) ? 'selected="selected" value=""' : 'value="table"' ); ?>><?php echo JText::_( 'MA_TABLE' ); ?></option> <option <?php echo ( ( $style == 'horz' ) ? 'selected="selected" value=""' : 'value="horz"' ); ?>><?php echo JText::_( 'MA_HORZ' ); ?></option> <option <?php echo ( ( $style == 'xhtml' ) ? 'selected="selected" value=""' : 'value="xhtml"' ); ?>><?php echo JText::_( 'MA_XHTML' ); ?></option> <option <?php echo ( ( $style == 'rounded' ) ? 'selected="selected" value=""' : 'value="rounded"' ); ?>><?php echo JText::_( 'MA_ROUNDED' ); ?></option> </select> </td> </tr> <tr> <th> <span class="hasTip" title="<?php echo JText::_( 'COM_MODULES_FIELD_SHOWTITLE_LABEL' ).'::'.JText::_( 'COM_MODULES_FIELD_SHOWTITLE_DESC' ); ?>"> <?php echo JText::_( 'COM_MODULES_FIELD_SHOWTITLE_LABEL' ); ?>: </span> </th> <td> <select name="showtitle" class="inputbox"> <option value=""><?php echo JText::_( 'JDEFAULT' ); ?></option> <option value="0"><?php echo JText::_( 'JNO' ); ?></option> <option value="1"><?php echo JText::_( 'JYES' ); ?></option> </select> </td> </tr> </table> <table class="adminform" cellspacing="2" style="width:auto;float:left;"> <tr style="height:30px;"> <th> <label class="hasTip" title="<?php echo JText::_( 'MA_EMBED_IN_A_DIV' ).'::'.JText::_( 'MA_EMBED_IN_A_DIV_DESC' ); ?>"> <input type="checkbox" onclick="toggleByCheckbox('div_enable');" onchange="toggleByCheckbox('div_enable');" name="div_enable" id="div_enable" <?php echo ( $params->div_enable ) ? 'checked="checked"' : ''; ?> /> <?php echo JText::_( 'MA_EMBED_IN_A_DIV' ); ?> </label> <div id="div_enable_div" style="display:block;"> <table> <tr> <td> <label class="hasTip" title="<?php echo JText::_( 'NN_WIDTH' ).'::'.JText::_( 'MA_WIDTH_DESC' ); ?>"> <?php echo JText::_( 'NN_WIDTH' ); ?>: <input type="text" class="text_area" name="div_width" id="div_width" value="<?php echo $params->div_width; ?>" size="4" style="text-align: right;" /> </label> </td> <td> <label class="hasTip" title="<?php echo JText::_( 'NN_HEIGHT' ).'::'.JText::_( 'MA_HEIGHT_DESC' ); ?>"> <?php echo JText::_( 'NN_HEIGHT' ); ?>: <input type="text" class="text_area" name="div_height" id="div_height" value="<?php echo $params->div_height; ?>" size="4" style="text-align: right;" /> </label> </td> </tr> <tr> <td colspan="2"> <label class="hasTip" title="<?php echo JText::_( 'MA_ALIGNMENT' ).'::'.JText::_( 'MA_ALIGNMENT_DESC' ); ?>"> <?php echo JText::_( 'MA_ALIGNMENT' ); ?>: <select name="div_float" id="div_float" class="inputbox"> <option value=""<?php echo ( !$params->div_float ) ? 'selected="selected"' : ''; ?>> <?php echo JText::_( 'JNONE' ); ?></option> <option value="left"<?php echo ( $params->div_float == 'left' ) ? 'selected="selected"' : ''; ?>> <?php echo JText::_( 'JGLOBAL_LEFT' ); ?></option> <option value="right"<?php echo ( $params->div_float == 'right' ) ? 'selected="selected"' : ''; ?>> <?php echo JText::_( 'JGLOBAL_RIGHT' ); ?></option> </select> </label> </td> </tr> <tr> <td colspan="2"> <label class="hasTip" title="<?php echo JText::_( 'MA_DIV_CLASSNAME' ).'::'.JText::_( 'MA_DIV_CLASSNAME_DESC' ); ?>"> <?php echo JText::_( 'MA_DIV_CLASSNAME' ); ?>: <input type="text" class="text_area" name="div_class" id="div_class" value="<?php echo $params->div_class; ?>" /> </label> </td> </tr> </table> </div> </th> </tr> </table> <div style="clear:both;"></div> <table class="adminform" cellspacing="1"> <tbody> <tr> <td> <?php echo JText::_( 'Filter' ); ?>: <input type="text" name="search" id="search" value="<?php echo $lists['search'];?>" class="text_area" onchange="this.form.submit();" /> <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button> <button onclick=" document.getElementById( 'search' ).value=''; document.getElementById( 'filter_position' ).value='0'; document.getElementById( 'filter_type' ).value='0'; document.getElementById( 'filter_state' ).value=''; this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button> </td> <td style="text-align:right;"> <?php echo $lists['position']; echo $lists['type']; echo $lists['state']; ?> </td> </tr> </tbody> </table> <table class="adminlist" cellspacing="1"> <thead> <tr> <th nowrap="nowrap" width="1%"> <?php echo JHTML::_( 'grid.sort', 'ID', 'm.id', @$lists['order_Dir'], @$lists['order'] ); ?> </th> <th class="title"> <?php echo JHTML::_( 'grid.sort', 'Module Name', 'm.title', @$lists['order_Dir'], @$lists['order'] ); ?> </th> <th nowrap="nowrap" width="7%"> <?php echo JHTML::_( 'grid.sort', 'Position', 'm.position', @$lists['order_Dir'], @$lists['order'] ); ?> </th> <th nowrap="nowrap" width="7%"> <?php echo JHTML::_( 'grid.sort', 'Published', 'm.published', @$lists['order_Dir'], @$lists['order'] ); ?> </th> <th nowrap="nowrap" width="1%"> <?php echo JHTML::_( 'grid.sort', 'Order', 'm.ordering', @$lists['order_Dir'], @$lists['order'] ); ?> </th> <?php if ( $client->id == 0 ) { ?> <th nowrap="nowrap" width="7%"> <?php echo JHTML::_( 'grid.sort', 'Access', 'groupname', @$lists['order_Dir'], @$lists['order'] ); ?> </th> <?php } ?> <th nowrap="nowrap" width="5%"> <?php echo JHTML::_( 'grid.sort', 'Pages', 'pages', @$lists['order_Dir'], @$lists['order'] ); ?> </th> <th nowrap="nowrap" width="10%" class="title"> <?php echo JHTML::_( 'grid.sort', 'Type', 'm.module', @$lists['order_Dir'], @$lists['order'] ); ?> </th> </tr> </thead> <tfoot> <tr> <td colspan="<?php echo ( $client->id == 0 ) ? '8' : '7'; ?>"> <?php $pagination = str_replace( 'index.php?', 'plugins/editors-xtd/modulesanywhere/elements/modulesanywhere.page.php?name='.JRequest::getCmd( 'name', 'text' ).'&', $page->getListFooter() ); $pagination = str_replace( 'index.php', 'plugins/editors-xtd/modulesanywhere/elements/modulesanywhere.page.php?name='.JRequest::getCmd( 'name', 'text' ), $pagination ); echo $pagination; ?> </td> </tr> </tfoot> <tbody> <?php $k = 0; for ( $i = 0, $n = count( $rows ); $i < $n; $i++ ) { $row =& $rows[$i]; if ( $row->published ) { $img = 'tick_l.png'; $alt = JText::_( 'Published' ); } else { $img = 'publish_x_l.png'; $alt = JText::_( 'Unpublished' ); } ?> <tr class="<?php echo "row$k"; ?>"> <td align="right"> <?php echo '<label class="hasTip" title="'.JText::_( 'MA_USE_ID_IN_TAG' ).'::{module '.$row->id.'}"><a href="javascript://" onclick="modulesanywhere_jInsertEditorText( \''.$row->id.'\' )">'.$row->id.'</a></label>';?> </td> <td> <?php echo '<label class="hasTip" title="'.JText::_( 'MA_USE_TITLE_IN_TAG' ).'::{module '.htmlspecialchars( $row->title ).'}"><a href="javascript://" onclick="modulesanywhere_jInsertEditorText( \''.addslashes( htmlspecialchars( $row->title ) ).'\' )">'.htmlspecialchars( $row->title ).'</a></label>'; ?> </td> <td align="center"> <?php echo '<label class="hasTip" title="'.JText::_( 'MA_USE_MODULE_POSITION_TAG' ).'::{modulepos '.$row->position.'}"><a href="javascript://" onclick="modulesanywhere_jInsertEditorText( \''.$row->position.'\', 1 )">'.$row->position.'</a></label>'; ?> </td> <td style="text-align:center;"> <img src="<?php echo JURI::root( true ).'/plugins/system/nnframework/images/'.$img; ?>" width="16" height="16" border="0" alt="<?php echo $alt; ?>'" /> </td> <td align="center"> <?php echo $row->ordering; ?> </td> <?php if ( $client->id == 0 ) { ?> <td align="center"><?php echo JText::_( $row->groupname ); ?></td> <?php } ?> <td align="center"> <?php if ( is_null( $row->pages ) ) { echo JText::_( 'None' ); } else if ( $row->pages > 0 ) { echo JText::_( 'Varies' ); } else { echo JText::_( 'All' ); } ?> </td> <td> <?php echo $row->module ? $row->module : JText::_( 'User' ); ?> </td> </tr> <?php $k = 1 - $k; } ?> </tbody> </table> <input type="hidden" name="name" value="<?php echo JRequest::getCmd( 'name', 'text' ); ?>" /> <input type="hidden" name="client" value="<?php echo $client->id;?>" /> <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" /> </form> </div> <?php }
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]; }