function display($tpl = null) { jimport('joomla.filesystem.file'); $db = JFactory::getDBO(); $db_version = $db->getVersion(); $php_version = phpversion(); if (isset($_SERVER['SERVER_SOFTWARE'])) { $server = $_SERVER['SERVER_SOFTWARE']; } else { if ($sf = getenv('SERVER_SOFTWARE')) { $server = $sf; } else { $server = JText::_('K2MART_N_A'); } } $gd_check = extension_loaded('gd'); $curl_check = extension_loaded('curl'); $k2_check = JFile::exists(JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'k2.php'); $virtuemart_check = JFile::exists(JPATH_SITE . DS . 'components' . DS . 'com_virtuemart' . DS . 'virtuemart.php'); $this->assignRef('server', $server); $this->assignRef('php_version', $php_version); $this->assignRef('db_version', $db_version); $this->assignRef('gd_check', $gd_check); $this->assignRef('curl_check', $curl_check); $this->assignRef('k2_check', $k2_check); $this->assignRef('virtuemart_check', $virtuemart_check); $this->loadHelper('html'); K2martHTMLHelper::title('K2MART_INFORMATION'); K2martHTMLHelper::toolbar(); K2martHTMLHelper::subMenu(); parent::display($tpl); }
function display($tpl = null) { jimport('joomla.html.pane'); $pane = JPane::getInstance('Tabs'); $this->assignRef('pane', $pane); $model = $this->getModel(); $numOfK2Items = $model->countK2Items(); $this->assignRef('numOfK2Items', $numOfK2Items); $numOfVmProducts = $model->countVmProducts(); $this->assignRef('numOfVmProducts', $numOfVmProducts); $numOfK2martProducts = $model->countK2martProducts(); $this->assignRef('numOfK2martProducts', $numOfK2martProducts); $module = JModuleHelper::getModule('mod_k2mart'); $params = new JRegistry(); $params->loadString($module->params); $params->set('modLogo', "0"); $params->set('modCSSStyling', "1"); $module->params = $params->toString(); $charts = JModuleHelper::renderModule($module); $this->assignRef('charts', $charts); $document = JFactory::getDocument(); $document->addCustomTag('<!--[if lte IE 7]><link href="' . JURI::base() . 'components/com_k2mart/css/style_ie7.css" rel="stylesheet" type="text/css" /><![endif]-->'); $this->loadHelper('html'); K2martHTMLHelper::title('K2MART_DASHBOARD'); K2martHTMLHelper::toolbar(); K2martHTMLHelper::subMenu(); parent::display($tpl); }
function display($tpl = null) { JHTML::_('behavior.keepalive'); require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2' . DS . 'models' . DS . 'categories.php'; $model = new K2ModelCategories(); $categories = $model->categoriesTree(NULL, false, false); $options = array(); $options[] = JHTML::_('select.optgroup', JText::_('K2MART_CREATE_NEW_K2_CATEGORY')); $options[] = JHTML::_('select.option', 0, JText::_('K2MART_TYPE_CATEGORY_NAME')); $options[] = JHTML::_('select.optgroup', JText::_('K2MART_USE_EXISTING_K2_CATEGORY')); foreach ($categories as $category) { $options[] = JHTML::_('select.option', $category->value, $category->text); } $lists['category'] = JHTML::_('select.genericlist', $options, 'catid', 'class="inputbox"', 'value', 'text', 0); $vmLanguages = vmConfig::get('active_languages', array()); if (count($vmLanguages) > 1) { jimport('joomla.language.helper'); $languages = JLanguageHelper::createLanguageList(NULL, constant('JPATH_SITE'), true); foreach ($languages as $key => &$language) { if (!in_array($language['value'], $vmLanguages)) { unset($languages[$key]); } } $lists['language'] = JHTML::_('select.genericlist', $languages, 'vmlang', '', 'value', 'text', NULL, 'vmlang'); } $this->assignRef('lists', $lists); $this->loadHelper('html'); K2martHTMLHelper::title('K2MART_VIRTUEMART_MIGRATOR'); K2martHTMLHelper::toolbar(); K2martHTMLHelper::subMenu(); parent::display($tpl); }
function prepare(&$products) { // Get user $user = JFactory::getUser(); // Get null date $db = JFactory::getDBO(); $nullDate = $db->getNullDate(); // Get trash state $mainframe = JFactory::getApplication(); $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); $trash = $mainframe->getUserStateFromRequest("{$option}.{$view}.trash", 'trash', -1, 'int'); // Require Virtuemart classes for price display require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php'; require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'currencydisplay.php'; $currency = CurrencyDisplay::getInstance(); // Cast the input to array if (!is_array($products)) { $rows = array($products); } else { $rows = $products; } // Prepare the products foreach ($rows as $key => $product) { $product->parity = $key % 2; $product->key = $key + 1; $product->checkout = JHTML::_('grid.checkedout', $product, $key); $product->price = $currency->priceDisplay($product->price, (int) $product->currency, true); $product->featuredToggler = K2martHTMLHelper::stateToggler($product, $key, 'featured', array('K2MART_FEATURED', 'K2MART_NOT_FEATURED'), array('K2MART_REMOVE_FEATURED_FLAG', 'K2MART_FLAG_AS_FEATURED')); $product->publishedToggler = K2martHTMLHelper::stateToggler($product, $key, 'published', array('K2MART_PUBLISHED', 'K2MART_UNPUBLISHED'), array('K2MART_UNPUBLISH', 'K2MART_PUBLISH')); if (JTable::isCheckedOut($user->get('id'), $product->checked_out) || $trash == 1) { $product->link = false; $product->featuredToggler = strip_tags($product->featuredToggler, '<img>'); $product->publishedToggler = strip_tags($product->publishedToggler, '<img>'); } else { $product->link = JRoute::_('index.php?option=com_k2&view=item&cid=' . $product->id); } $product->categoryLink = JRoute::_('index.php?option=com_k2&view=category&cid=' . $product->catid); if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $product->id) . '_XL.jpg')) { $product->image = JURI::root(true) . '/media/k2/items/cache/' . md5("Image" . $product->id) . '_XL.jpg'; } else { $product->image = false; } $product->created = JHTML::_('date', $product->created); $product->modified = $product->modified == $nullDate ? JText::_('K2MART_NEVER') : JHTML::_('date', $product->modified); } }
function onK2BeforeViewDisplay() { if ($this->getProcessFlag()) { $mainframe = JFactory::getApplication(); $params = JComponentHelper::getParams('com_k2mart'); $filters = array(); $ordering = JRequest::getVar('k2martOrdering', 'name'); $orderingDir = JRequest::getVar('k2martOrderingDir', 'asc'); $categories = JRequest::getVar('k2martCategories'); $manufacturers = JRequest::getVar('k2martManufacturers'); if ($params->get('sortingFilter')) { $options = array(); $options[] = JHTML::_('select.option', 'name', JText::_('K2MART_NAME')); $options[] = JHTML::_('select.option', 'sku', JText::_('K2MART_SKU')); $options[] = JHTML::_('select.option', 'price', JText::_('K2MART_PRICE')); $options[] = JHTML::_('select.option', 'sales', JText::_('K2MART_SALES')); $options[] = JHTML::_('select.option', 'hits', JText::_('K2MART_HITS')); $options[] = JHTML::_('select.option', 'date', JText::_('K2MART_DATE')); $filters['k2martOrdering'] = JHTML::_('select.genericlist', $options, 'k2martOrdering', 'class="k2martFilter"', 'value', 'text', $ordering); $options = array(); $options[] = JHTML::_('select.option', 'asc', JText::_('K2MART_ASCENDING')); $options[] = JHTML::_('select.option', 'desc', JText::_('K2MART_DESCENDING')); $filters['k2martOrderingDir'] = JHTML::_('select.genericlist', $options, 'k2martOrderingDir', 'class="k2martFilter"', 'value', 'text', $orderingDir); } else { $filters['k2martOrdering'] = false; } if ($params->get('manufacturersFilter')) { require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2mart' . DS . 'helpers' . DS . 'html.php'; $filters['k2martManufacturers'] = K2martHTMLHelper::getManufacturerFilter('k2martManufacturers[]', $manufacturers, 'class="k2martFilter" multiple="multiple" data-placeholder="' . JText::_('K2MART_CLICK_TO_SELECT_MANUFACTURERS') . '"'); } else { $filters['k2martManufacturers'] = false; } if ($params->get('categoriesFilter') && count($this->categories) > 1) { require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2mart' . DS . 'helpers' . DS . 'html.php'; $filters['k2martCategories'] = K2martHTMLHelper::getCategoryFilter('k2martCategories[]', $categories, 'class="k2martFilter" multiple="multiple" data-placeholder="' . JText::_('K2MART_CLICK_TO_SELECT_CATEGORIES') . '"', $this->categories); } else { $filters['k2martCategories'] = false; } //Render ob_start(); include $this->getLayoutPath('filters'); $contents = ob_get_clean(); echo $contents; } }