Exemple #1
0
 /**
  * Get pages static
  *
  * @return array
  */
 public static function getPagesStatic()
 {
     $list = parent::getPagesStatic();
     $list[static::PAGE_VOLUME_DISCOUNTS] = array('name' => static::t('Volume discounts'), 'tpl' => 'modules/CDev/VolumeDiscounts/discounts/body.tpl', 'permission' => 'manage volume discounts');
     return $list;
 }
Exemple #2
0
 /**
  * Get pages static
  *
  * @return array
  */
 public static function getPagesStatic()
 {
     $list = parent::getPagesStatic();
     $list[static::PAGE_CLOUD_SEARCH_DASHBOARD] = array('name' => static::t('CloudSearch'), 'tpl' => 'modules/QSL/CloudSearch/promotions_menu_body.tpl');
     return $list;
 }
Exemple #3
0
 /**
  * Get pages static
  *
  * @return array
  */
 public static function getPagesStatic()
 {
     $list = parent::getPagesStatic();
     $list[static::PAGE_COUPONS] = array('name' => static::t('Coupons'), 'tpl' => 'modules/CDev/Coupons/coupons/body.tpl', 'permission' => 'manage coupons');
     return $list;
 }
Exemple #4
0
 /**
  * Define items
  *
  * @return array
  */
 protected function defineItems()
 {
     $items = array('sales' => array(static::ITEM_TITLE => static::t('Orders'), static::ITEM_ICON_SVG => 'images/orders.svg', static::ITEM_WEIGHT => 100, static::ITEM_TARGET => 'order_list', static::ITEM_LABEL_LINK => $this->buildURL('recent_orders'), static::ITEM_LABEL_TITLE => static::t('Recent orders'), static::ITEM_CHILDREN => array('order_list' => array(static::ITEM_TITLE => static::t('Orders list'), static::ITEM_TARGET => 'order_list', static::ITEM_PERMISSION => 'manage orders', static::ITEM_WEIGHT => 100), 'orders_stats' => array(static::ITEM_TITLE => static::t('Statistics'), static::ITEM_TARGET => 'orders_stats', static::ITEM_PERMISSION => 'manage orders', static::ITEM_WEIGHT => 200), 'payment_transactions' => array(static::ITEM_TITLE => static::t('Payment transactions'), static::ITEM_TARGET => 'payment_transactions', static::ITEM_PERMISSION => 'manage orders', static::ITEM_WEIGHT => 300))), 'catalog' => array(static::ITEM_TITLE => static::t('Catalog'), static::ITEM_ICON_SVG => 'images/fa-tags.svg', static::ITEM_TARGET => 'product_list', static::ITEM_WEIGHT => 200, static::ITEM_CHILDREN => array('product_list' => array(static::ITEM_TITLE => static::t('Products'), static::ITEM_TARGET => 'product_list', static::ITEM_PERMISSION => 'manage catalog', static::ITEM_WEIGHT => 200), 'categories' => array(static::ITEM_TITLE => static::t('Categories'), static::ITEM_TARGET => 'categories', static::ITEM_PERMISSION => 'manage catalog', static::ITEM_WEIGHT => 300), 'front_page' => array(static::ITEM_TITLE => static::t('Front page'), static::ITEM_TARGET => 'front_page', static::ITEM_PERMISSION => 'manage catalog', static::ITEM_WEIGHT => 350), 'product_classes' => array(static::ITEM_TITLE => static::t('Classes & attributes'), static::ITEM_TARGET => 'product_classes', static::ITEM_PERMISSION => 'manage catalog', static::ITEM_WEIGHT => 400), 'import' => array(static::ITEM_TITLE => static::t('Import'), static::ITEM_TARGET => 'import', static::ITEM_PERMISSION => 'manage import', static::ITEM_ICON_SVG => 'images/import.svg', static::ITEM_WEIGHT => 500), 'export' => array(static::ITEM_TITLE => static::t('Export'), static::ITEM_TARGET => 'export', static::ITEM_PERMISSION => 'manage export', static::ITEM_ICON_SVG => 'images/export.svg', static::ITEM_WEIGHT => 600))), 'promotions' => array(static::ITEM_TITLE => static::t('Promotions'), static::ITEM_ICON_SVG => 'images/fa-gift.svg', static::ITEM_WEIGHT => 300, static::ITEM_TARGET => 'promotions', static::ITEM_CHILDREN => array()), 'users' => array(static::ITEM_TITLE => static::t('Users'), static::ITEM_ICON_SVG => 'images/fa-users.svg', static::ITEM_WEIGHT => 400, static::ITEM_TARGET => 'profile_list', static::ITEM_CHILDREN => array('profile_list' => array(static::ITEM_TITLE => static::t('Users'), static::ITEM_TARGET => 'profile_list', static::ITEM_PERMISSION => 'manage users', static::ITEM_WEIGHT => 100), 'memberships' => array(static::ITEM_TITLE => static::t('Membership levels'), static::ITEM_TARGET => 'memberships', static::ITEM_PERMISSION => 'manage users', static::ITEM_WEIGHT => 200))), 'extensions' => array(static::ITEM_TITLE => static::t('Modules'), static::ITEM_ICON_SVG => 'images/fa-puzzle-piece.svg', static::ITEM_WEIGHT => 600, static::ITEM_TARGET => 'addons_list_installed'), 'store_setup' => array(static::ITEM_TITLE => static::t('Store setup'), static::ITEM_ICON_SVG => 'images/fa-info-circle.svg', static::ITEM_WEIGHT => 700, static::ITEM_TARGET => 'settings', static::ITEM_CHILDREN => array('store_info' => array(static::ITEM_TITLE => static::t('Store info'), static::ITEM_TARGET => 'settings', static::ITEM_EXTRA => array('page' => 'Company'), static::ITEM_WEIGHT => 100), 'general' => array(static::ITEM_TITLE => static::t('Cart & checkout'), static::ITEM_TARGET => 'general_settings', static::ITEM_WEIGHT => 200), 'payment_settings' => array(static::ITEM_TITLE => static::t('Payments'), static::ITEM_TARGET => 'payment_settings', static::ITEM_WEIGHT => 300), 'countries' => array(static::ITEM_TITLE => static::t('Countries, states and zones'), static::ITEM_TARGET => 'countries', static::ITEM_WEIGHT => 400), 'shipping_methods' => array(static::ITEM_TITLE => static::t('Shipping'), static::ITEM_TARGET => 'shipping_methods', static::ITEM_WEIGHT => 500), 'tax_classes' => array(static::ITEM_TITLE => static::t('Taxes'), static::ITEM_TARGET => 'tax_classes', static::ITEM_WEIGHT => 600), 'localization' => array(static::ITEM_TITLE => static::t('Localization'), static::ITEM_TARGET => 'units_formats', static::ITEM_WEIGHT => 700), 'translations' => array(static::ITEM_TITLE => static::t('Translations'), static::ITEM_TARGET => 'languages', static::ITEM_WEIGHT => 800), 'notifications' => array(static::ITEM_TITLE => static::t('Email notifications'), static::ITEM_TARGET => 'notifications', static::ITEM_WEIGHT => 900))), 'css_js' => array(static::ITEM_TITLE => static::t('Look & Feel'), static::ITEM_ICON_SVG => 'images/fa-picture-o.svg', static::ITEM_TARGET => 'layout', static::ITEM_WEIGHT => 800), 'system_settings' => array(static::ITEM_TITLE => static::t('System settings'), static::ITEM_ICON_SVG => 'images/fa-cog.svg', static::ITEM_WEIGHT => 900, static::ITEM_TARGET => 'db_backup', static::ITEM_CHILDREN => array('db_backup' => array(static::ITEM_TITLE => static::t('Backup & Restore'), static::ITEM_TARGET => 'db_backup', static::ITEM_WEIGHT => 100), 'rebuild_cache' => array(static::ITEM_TITLE => static::t('Cache management'), static::ITEM_TARGET => 'cache_management', static::ITEM_CLASS => 'rebuild-cache', static::ITEM_WEIGHT => 300), 'environment' => array(static::ITEM_TITLE => static::t('Environment'), static::ITEM_TARGET => 'settings', static::ITEM_EXTRA => array('page' => 'Environment'), static::ITEM_WEIGHT => 400), 'view_log_file' => array(static::ITEM_TITLE => static::t('View system logs'), static::ITEM_TARGET => 'upgrade', static::ITEM_EXTRA => array('action' => 'view_log_file'), static::ITEM_WEIGHT => 500, static::ITEM_BLANK_PAGE => true), 'email_settings' => array(static::ITEM_TITLE => static::t('Email settings'), static::ITEM_TARGET => 'settings', static::ITEM_EXTRA => array('page' => 'Email'), static::ITEM_WEIGHT => 600), 'safe_mode' => array(static::ITEM_TITLE => static::t('Safe mode'), static::ITEM_TARGET => 'safe_mode', static::ITEM_WEIGHT => 700), 'remove_daa' => array(static::ITEM_TITLE => static::t('Remove data'), static::ITEM_TARGET => 'remove_data', static::ITEM_WEIGHT => 750), 'security_settings' => array(static::ITEM_TITLE => static::t('HTTPS settings'), static::ITEM_TARGET => 'https_settings', static::ITEM_WEIGHT => 800))));
     // Check if cloned products exists and add menu item
     // TODO: need to be reviewed - search should not be used on each load of admin interface pages
     $cnd = new \XLite\Core\CommonCell();
     $cnd->{\XLite\Model\Repo\Product::P_SUBSTRING} = '[ clone ]';
     $cnd->{\XLite\Model\Repo\Product::P_BY_TITLE} = 'Y';
     if (0 < \XLite\Core\Database::getRepo('\\XLite\\Model\\Product')->search($cnd, true)) {
         $items['catalog'][static::ITEM_CHILDREN]['clone_products'] = array(static::ITEM_TITLE => static::t('Cloned products'), static::ITEM_TARGET => 'cloned_products', static::ITEM_PERMISSION => 'manage catalog', static::ITEM_WEIGHT => 220);
     }
     $pagesStatic = \XLite\Controller\Admin\Promotions::getPagesStatic();
     if ($pagesStatic) {
         foreach ($pagesStatic as $k => $v) {
             $items['promotions'][static::ITEM_CHILDREN][$k] = array(static::ITEM_TITLE => $v['name'], static::ITEM_TARGET => 'promotions', static::ITEM_EXTRA => array('page' => $k), static::ITEM_PERMISSION => !empty($v['permission']) ? $v['permission'] : null);
             $items['promotions'][static::ITEM_EXTRA] = array('page' => $k);
         }
     }
     // Orders label
     $list = new \XLite\View\ItemsList\Model\Order\Admin\Recent();
     $count = $list->getItemsCountPublic();
     if ($count) {
         $items['sales'][static::ITEM_LABEL] = $count;
     }
     return $items;
 }
Exemple #5
0
 /**
  * Check if widget is visible
  *
  * @return boolean
  */
 protected function isVisible()
 {
     return parent::isVisible() && \XLite\Controller\Admin\Promotions::getPagesStatic();
 }