protected function renderSubmenu() { $views = array('cpanel', 'K2STORE_MAINMENU_SALES' => array('orders', 'coupons'), 'K2STORE_MAINMENU_CATALOG' => array('products', 'options', 'customers'), 'K2STORE_MAINMENU_LOCALISATION' => array('countries', 'zones', 'geozones', 'taxrates', 'taxprofiles', 'lengths', 'weights', 'orderstatuses'), 'K2STORE_MAINMENU_SETUP' => array('storeprofiles', 'currencies', 'shipping', 'payment', 'fields'), 'report'); //show product attribute migration menu only for the upgraded users require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/version.php'; if (K2StoreVersion::getPreviousVersion() == '2.0.2' && K2STORE_ATTRIBUTES_MIGRATED == false) { $views['K2STORE_MAINMENU_TOOLS'] = array('migrate'); } foreach ($views as $label => $view) { if (!is_array($view)) { $this->addSubmenuLink($view); } else { $label = JText::_($label); $this->appendLink($label, '', false); foreach ($view as $v) { $this->addSubmenuLink($v, $label); } } } }
function display($tpl = null) { $app = JFactory::getApplication(); $option = 'com_k2store'; $model = $this->getModel(); //is it ok to migrate if (!$model->canMigrate() || K2StoreVersion::getPreviousVersion() != '3.0.3' || K2STORE_ATTRIBUTES_MIGRATED == 1) { $msg = JText::_('K2STORE_MIGRATE_CURRENT_VERSION'); $app->redirect('index.php?option=com_k2store&view=cpanel', $msg); } $db = JFactory::getDBO(); $params = JComponentHelper::getParams('com_k2store'); // Get data from the model $items = $this->get('Data'); $total = count($items); $this->assignRef('items', $items); $this->assignRef('total', $total); $this->addToolBar(); $toolbar = new K2StoreToolBar(); $toolbar->renderLinkbar(); parent::display($tpl); }