Example #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);
 }
Example #2
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);
     }
 }
Example #3
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     if (!NNFrameworkFunctions::extensionInstalled('flexicontent')) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</fieldset>';
     }
     $group = $this->def('group', 'categories');
     $this->db = JFactory::getDBO();
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'flexicontent_' . $group, $tables)) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</fieldset>';
     }
     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);
     }
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     if (!NNFrameworkFunctions::extensionInstalled('virtuemart')) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
     }
     $group = $this->def('group', 'categories');
     $this->db = JFactory::getDBO();
     $tables = $this->db->getTableList();
     if (!in_array($this->db->getPrefix() . 'virtuemart_' . $group, $tables)) {
         return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
     }
     $query = $this->db->getQuery(true);
     $query->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->def('size');
     $multiple = $this->def('multiple');
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
Example #5
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);
     }
 }
Example #6
0
	protected function getInput()
	{
		if (!NNFrameworkFunctions::extensionInstalled('flexicontent'))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</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() . 'flexicontent_' . $group, $tables))
		{
			return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</label></fieldset>';
		}

		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);
	}
Example #7
0
 function __construct()
 {
     $this->db = JFactory::getDBO();
     $this->date = JFactory::getDate();
     $tz = new DateTimeZone(JFactory::getApplication()->getCfg('offset'));
     $this->date->setTimeZone($tz);
     $this->has = array();
     $this->has['flexicontent'] = NNFrameworkFunctions::extensionInstalled('flexicontent');
     $this->has['k2'] = NNFrameworkFunctions::extensionInstalled('k2');
     $this->has['zoo'] = NNFrameworkFunctions::extensionInstalled('zoo');
     $this->has['akeebasubs'] = NNFrameworkFunctions::extensionInstalled('akeebasubs');
     $this->has['hikashop'] = NNFrameworkFunctions::extensionInstalled('hikashop');
     $this->has['redshop'] = NNFrameworkFunctions::extensionInstalled('redshop');
     $this->has['virtuemart'] = NNFrameworkFunctions::extensionInstalled('virtuemart');
     $this->types = array('Menu', 'HomePage', 'DateTime_Date', 'DateTime_Seasons', 'DateTime_Months', 'DateTime_Days', 'DateTime_Time', 'Users_UserGroupLevels', 'Users_Users', 'Languages', 'IPs', 'Geo_Continents', 'Geo_Countries', 'Geo_Regions', 'Templates', 'URLs', 'Agents_OS', 'Agents_Browsers', 'Components', 'Content_PageTypes', 'Content_Categories', 'Content_Articles', 'FlexiContent_PageTypes', 'FlexiContent_Tags', 'FlexiContent_Types', 'K2_PageTypes', 'K2_Categories', 'K2_Tags', 'K2_Items', 'ZOO_PageTypes', 'ZOO_Categories', 'ZOO_Items', 'AkeebaSubs_PageTypes', 'AkeebaSubs_Levels', 'HikaShop_PageTypes', 'HikaShop_Categories', 'HikaShop_Products', 'RedShop_PageTypes', 'RedShop_Categories', 'RedShop_Products', 'VirtueMart_PageTypes', 'VirtueMart_Categories', 'VirtueMart_Products', 'PHP');
     $this->setIdNames();
     $this->classes = array();
 }
Example #8
0
 public function missingFilesOrTables($tables = array('categories', 'items'), $component = '', $table_prefix = '')
 {
     $component = $component ?: $this->type;
     if (!NNFrameworkFunctions::extensionInstalled(strtolower($component))) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_' . strtoupper($component))) . '</fieldset>';
     }
     $group = $this->getGroup();
     if (!in_array($group, $tables) && !in_array($group, array_keys($tables))) {
         // no need to check database table for this group
         return false;
     }
     $table_list = $this->db->getTableList();
     $table = isset($tables[$group]) ? $tables[$group] : $group;
     $table = $this->db->getPrefix() . strtolower($table_prefix ?: $component) . '_' . $table;
     if (in_array($table, $table_list)) {
         // database table exists, so no error
         return false;
     }
     return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_' . strtoupper($component))) . '</fieldset>';
 }
Example #9
0
 public function __construct()
 {
     $this->db = JFactory::getDbo();
     $this->has = array();
     $this->has['easyblog'] = NNFrameworkFunctions::extensionInstalled('easyblog');
     $this->has['flexicontent'] = NNFrameworkFunctions::extensionInstalled('flexicontent');
     $this->has['form2content'] = NNFrameworkFunctions::extensionInstalled('form2content');
     $this->has['k2'] = NNFrameworkFunctions::extensionInstalled('k2');
     $this->has['zoo'] = NNFrameworkFunctions::extensionInstalled('zoo');
     $this->has['akeebasubs'] = NNFrameworkFunctions::extensionInstalled('akeebasubs');
     $this->has['hikashop'] = NNFrameworkFunctions::extensionInstalled('hikashop');
     $this->has['mijoshop'] = NNFrameworkFunctions::extensionInstalled('mijoshop');
     $this->has['redshop'] = NNFrameworkFunctions::extensionInstalled('redshop');
     $this->has['virtuemart'] = NNFrameworkFunctions::extensionInstalled('virtuemart');
     $this->has['cookieconfirm'] = NNFrameworkFunctions::extensionInstalled('cookieconfirm');
     $this->types = array('menuitems' => 'Menu', 'homepage' => 'HomePage', 'date' => 'DateTime.Date', 'seasons' => 'DateTime.Seasons', 'months' => 'DateTime.Months', 'days' => 'DateTime.Days', 'time' => 'DateTime.Time', 'usergrouplevels' => 'Users.UserGroupLevels', 'users' => 'Users.Users', 'languages' => 'Languages', 'ips' => 'IPs', 'geocontinents' => 'Geo.Continents', 'geocountries' => 'Geo.Countries', 'georegions' => 'Geo.Regions', 'geopostalcodes' => 'Geo.Postalcodes', 'templates' => 'Templates', 'urls' => 'URLs', 'os' => 'Agents.OS', 'browsers' => 'Agents.Browsers', 'components' => 'Components', 'tags' => 'Tags', 'contentpagetypes' => 'Content.PageTypes', 'cats' => 'Content.Categories', 'articles' => 'Content.Articles', 'easyblogpagetypes' => 'EasyBlog.PageTypes', 'easyblogcats' => 'EasyBlog.Categories', 'easyblogtags' => 'EasyBlog.Tags', 'easyblogitems' => 'EasyBlog.Items', 'flexicontentpagetypes' => 'FlexiContent.PageTypes', 'flexicontenttags' => 'FlexiContent.Tags', 'flexicontenttypes' => 'FlexiContent.Types', 'form2contentprojects' => 'Form2Content.Projects', 'k2pagetypes' => 'K2.PageTypes', 'k2cats' => 'K2.Categories', 'k2tags' => 'K2.Tags', 'k2items' => 'K2.Items', 'zoopagetypes' => 'Zoo.PageTypes', 'zoocats' => 'Zoo.Categories', 'zooitems' => 'Zoo.Items', 'akeebasubspagetypes' => 'AkeebaSubs.PageTypes', 'akeebasubslevels' => 'AkeebaSubs.Levels', 'hikashoppagetypes' => 'HikaShop.PageTypes', 'hikashopcats' => 'HikaShop.Categories', 'hikashopproducts' => 'HikaShop.Products', 'mijoshoppagetypes' => 'MijoShop.PageTypes', 'mijoshopcats' => 'MijoShop.Categories', 'mijoshopproducts' => 'MijoShop.Products', 'redshoppagetypes' => 'RedShop.PageTypes', 'redshopcats' => 'RedShop.Categories', 'redshopproducts' => 'RedShop.Products', 'virtuemartpagetypes' => 'VirtueMart.PageTypes', 'virtuemartcats' => 'VirtueMart.Categories', 'virtuemartproducts' => 'VirtueMart.Products', 'cookieconfirm' => 'CookieConfirm', 'php' => 'PHP');
     $this->thirdparty = array('EasyBlog', 'FlexiContent', 'Form2Content', 'K2', 'Zoo', 'AkeebaSubs', 'HikaShop', 'MijoShop', 'RedShop', 'VirtueMart', 'CookieConfirm');
     $this->nonarray = array('PHP');
     $this->setIdNames();
     $this->classes = array();
 }
Example #10
0
 */
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
$this->config->show_assignto_groupusers = (int) ($this->config->show_assignto_usergrouplevels || $this->config->show_assignto_users);
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
$this->config->show_assignto_easyblog = (int) ($this->config->show_assignto_easyblog && NNFrameworkFunctions::extensionInstalled('easyblog'));
$this->config->show_assignto_flexicontent = (int) ($this->config->show_assignto_flexicontent && NNFrameworkFunctions::extensionInstalled('flexicontent'));
$this->config->show_assignto_form2content = (int) ($this->config->show_assignto_form2content && NNFrameworkFunctions::extensionInstalled('form2content'));
$this->config->show_assignto_k2 = (int) ($this->config->show_assignto_k2 && NNFrameworkFunctions::extensionInstalled('k2'));
$this->config->show_assignto_zoo = (int) ($this->config->show_assignto_zoo && NNFrameworkFunctions::extensionInstalled('zoo'));
$this->config->show_assignto_akeebasubs = (int) ($this->config->show_assignto_akeebasubs && NNFrameworkFunctions::extensionInstalled('akeebasubs'));
$this->config->show_assignto_hikashop = (int) ($this->config->show_assignto_hikashop && NNFrameworkFunctions::extensionInstalled('hikashop'));
$this->config->show_assignto_mijoshop = (int) ($this->config->show_assignto_mijoshop && NNFrameworkFunctions::extensionInstalled('mijoshop'));
$this->config->show_assignto_redshop = (int) ($this->config->show_assignto_redshop && NNFrameworkFunctions::extensionInstalled('redshop'));
$this->config->show_assignto_virtuemart = (int) ($this->config->show_assignto_virtuemart && NNFrameworkFunctions::extensionInstalled('virtuemart'));
$this->config->show_assignto_cookieconfirm = (int) ($this->config->show_assignto_cookieconfirm && NNFrameworkFunctions::extensionInstalled('cookieconfirm'));
$assignments = array('menuitems', 'homepage', 'date', 'groupusers', 'languages', 'ips', 'geo', 'templates', 'urls', 'os', 'browsers', 'components', 'tags', 'content', 'easyblog', 'flexicontent', 'form2content', 'k2', 'zoo', 'akeebasubs', 'hikashop', 'mijoshop', 'redshop', 'virtuemart', 'cookieconfirm', 'php');
foreach ($assignments as $i => $ass) {
    if ($ass != 'menuitems' && (!isset($this->config->{'show_assignto_' . $ass}) || !$this->config->{'show_assignto_' . $ass})) {
        unset($assignments[$i]);
    }
}
$html = array();
$html[] = $this->render($this->assignments, 'assignments');
$html[] = $this->render($this->assignments, 'mirror_module');
$html[] = '<div class="clear"></div>';
$html[] = '<div id="' . rand(1000000, 9999999) . '___mirror_module.0" class="nntoggler">';
if (count($assignments) > 1) {
    $html[] = $this->render($this->assignments, 'match_method');
    $html[] = $this->render($this->assignments, 'show_assignments');
} else {
Example #11
0
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $is_installed = NNFrameworkFunctions::extensionInstalled($this->get('extension'), $this->get('extension_type'), $this->get('folder'));
     return '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="' . (int) $is_installed . '" />';
 }