protected function renderSubmenu() { $views = array('cpanel', 'J2STORE_MAINMENU_SALES' => array(array('name' => 'orders', 'icon' => 'fa fa-list-alt'), array('name' => 'coupons', 'icon' => 'fa fa-scissors')), 'J2STORE_MAINMENU_CATALOG' => array(array('name' => 'products', 'icon' => 'fa fa-tags'), array('name' => 'options', 'icon' => 'fa fa-list-ol')), 'J2STORE_MAINMENU_DESIGN' => array(array('name' => 'layouts', 'icon' => 'fa fa-desktop')), 'J2STORE_MAINMENU_LOCALISATION' => array(array('name' => 'countries', 'icon' => 'fa fa-globe'), array('name' => 'zones', 'icon' => 'fa fa-flag'), array('name' => 'geozones', 'icon' => 'fa fa-pie-chart'), array('name' => 'taxrates', 'icon' => 'fa fa-calculator'), array('name' => 'taxprofiles', 'icon' => 'fa fa-sitemap'), array('name' => 'lengths', 'icon' => 'fa fa-arrows-v'), array('name' => 'weights', 'icon' => 'fa fa-arrows-h'), array('name' => 'orderstatuses', 'icon' => 'fa fa-check-square')), 'J2STORE_MAINMENU_SETUP' => array(array('name' => 'storeprofiles', 'icon' => 'fa fa-edit'), array('name' => 'currencies', 'icon' => 'fa fa-usd'), array('name' => 'shipping', 'icon' => 'fa fa-truck'), array('name' => 'payment', 'icon' => 'fa fa-credit-card'), array('name' => 'emailtemplates', 'icon' => 'fa fa-envelope'), array('name' => 'fields', 'icon' => 'fa fa-cog')), 'J2STORE_MAINMENU_REPORTS' => array(array('name' => 'report', 'icon' => 'fa fa-signal'))); //show product attribute migration menu only for the upgraded users require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/version.php'; if (J2StoreVersion::getPreviousVersion() == '2.0.2' && J2STORE_ATTRIBUTES_MIGRATED == false) { $views['J2STORE_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['name'], $label, $v['icon']); } } } }
function display($tpl = null) { $app = JFactory::getApplication(); $option = 'com_j2store'; $model = $this->getModel(); //is it ok to migrate if (!$model->canMigrate() || J2StoreVersion::getPreviousVersion() != '2.0.2' || J2STORE_ATTRIBUTES_MIGRATED == 1) { $msg = JText::_('J2STORE_MIGRATE_CURRENT_VERSION'); $app->redirect('index.php?option=com_j2store&view=cpanel', $msg); } $db = JFactory::getDBO(); $params = JComponentHelper::getParams('com_j2store'); // Get data from the model $items = $this->get('Data'); $total = count($items); $this->assignRef('items', $items); $this->assignRef('total', $total); $this->addToolBar(); $toolbar = new J2StoreToolBar(); $toolbar->renderLinkbar(); parent::display($tpl); }
JHTML::_('behavior.tooltip'); jimport('joomla.application.component.controller'); $app = JFactory::getApplication(); //j3 compatibility if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } JLoader::register('J2StoreController', JPATH_ADMINISTRATOR . '/components/com_j2store/controllers/controller.php'); JLoader::register('J2StoreView', JPATH_ADMINISTRATOR . '/components/com_j2store/views/view.php'); JLoader::register('J2StoreModel', JPATH_ADMINISTRATOR . '/components/com_j2store/models/model.php'); require_once JPATH_SITE . '/components/com_j2store/helpers/utilities.php'; require_once JPATH_ADMINISTRATOR . '/components/com_j2store/library/base.php'; require_once JPATH_ADMINISTRATOR . '/components/com_j2store/helpers/toolbar.php'; require_once JPATH_ADMINISTRATOR . '/components/com_j2store/helpers/version.php'; require_once JPATH_ADMINISTRATOR . '/components/com_j2store/helpers/strapper.php'; $version = new J2StoreVersion(); $version->load_version_defines(); J2StoreStrapper::addJS(); J2StoreStrapper::addCSS(); //handle live update require_once JPATH_ADMINISTRATOR . '/components/com_j2store/liveupdate/liveupdate.php'; if ($app->input->getCmd('view', '') == 'liveupdate') { LiveUpdate::handleRequest(); return; } /* * Make sure the user is authorized to view this page */ $controller = $app->input->getWord('view', 'cpanel'); if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_j2store/controllers/' . $controller . '.php') && $controller != 'countries' && $controller != 'zones' && $controller != 'country' && $controller != 'zone' && $controller != 'taxprofiles' && $controller != 'taxprofile' && $controller != 'taxrates' && $controller != 'taxrate' && $controller != 'geozones' && $controller != 'geozone' && $controller != 'geozonerules' && $controller != 'geozonerule' && $controller != 'storeprofiles' && $controller != 'storeprofile' && $controller != 'lengths' && $controller != 'length' && $controller != 'weights' && $controller != 'weight' && $controller != 'currencies' && $controller != 'currency' && $controller != 'emailtemplates' && $controller != 'emailtemplate' && $controller != 'orderstatuses' && $controller != 'orderstatus' && $controller != 'layouts' && $controller != 'layout') { require_once JPATH_ADMINISTRATOR . '/components/com_j2store/controllers/' . $controller . '.php';
<br /> <a class="btn btn-info" href="http://www.j2store.org/blog/28-migrate-j2store-from-2-0-2-to-2-5.html" target="_blank"><?php echo JText::_('J2STORE_QUICK_TIPS_READ_MORE'); ?> </a> <a class="btn btn-success" href="http://www.j2store.org/blog/28-migrate-j2store-from-2-0-2-to-2-5.html" target="_blank"><?php echo JText::_('J2STORE_QUICK_TIPS_WATCH_VIDEO'); ?> </a> </div> <?php } ?> <?php if (J2StoreVersion::getPreviousVersion() == '2.0.2' && J2STORE_ATTRIBUTES_MIGRATED == false) { ?> <div class="alert alert-block alert-danger"> <strong> <?php echo JText::_('J2STORE_ATTRIBUTE_MIGRATION_ALERT'); ?> </strong> </div> <div class="alert alert-info"> <strong> <?php echo JText::_('J2STORE_MIGRATE_ATTRIBUTES_CPANEL_INFO'); ?> </strong> </div>