예제 #1
0
파일: backend.php 프로젝트: tareqy/Caracal
 /**
  * Constructor
  *
  * @return backend
  */
 protected function __construct()
 {
     global $section, $language;
     parent::__construct(__FILE__);
     // create events
     Events::register('backend', 'user-create');
     Events::register('backend', 'user-change');
     Events::register('backend', 'user-delete');
     Events::register('backend', 'user-password-change');
     // load CSS and JScript
     if (class_exists('head_tag') && $section == 'backend') {
         $head_tag = head_tag::getInstance();
         $collection = collection::getInstance();
         $collection->includeScript(collection::JQUERY);
         $collection->includeScript(collection::JQUERY_EVENT_DRAG);
         $collection->includeScript(collection::WINDOW_SYSTEM);
         if ($_SESSION['logged']) {
             $collection->includeScript(collection::JQUERY_EXTENSIONS);
             $collection->includeScript(collection::NOTEBOOK);
             $collection->includeScript(collection::SHOWDOWN);
             $collection->includeScript(collection::TOOLBAR);
         }
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/backend.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript'));
     }
     // add admin level menus
     if ($section == 'backend') {
         $system_menu = new backend_MenuItem($this->getLanguageConstant('menu_system'), url_GetFromFilePath($this->path . 'images/icons/16/system.svg'), 'javascript:void(0);', $level = 1);
         $system_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_modules'), url_GetFromFilePath($this->path . 'images/icons/16/modules.svg'), window_Open('system_modules', 610, $this->getLanguageConstant('title_modules'), true, false, backend_UrlMake($this->name, 'modules')), $level = 10));
         $system_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_users'), url_GetFromFilePath($this->path . 'images/icons/16/users.svg'), window_Open('system_users', 690, $this->getLanguageConstant('title_users_manager'), true, false, backend_UrlMake($this->name, 'users')), $level = 10));
         $system_menu->addSeparator(10);
         $system_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_change_password'), url_GetFromFilePath($this->path . 'images/icons/16/change_password.svg'), window_Open('change_password_window', 350, $this->getLanguageConstant('title_change_password'), true, false, backend_UrlMake($this->name, 'change_password')), $level = 1));
         $system_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_logout'), url_GetFromFilePath($this->path . 'images/icons/16/logout.svg'), window_Open('logout_window', 350, $this->getLanguageConstant('title_logout'), true, false, backend_UrlMake($this->name, 'logout')), $level = 1));
         $this->addMenu($this->name, $system_menu);
     }
 }
예제 #2
0
파일: shop.php 프로젝트: tareqy/Caracal
 /**
  * Constructor
  */
 protected function __construct()
 {
     global $section;
     parent::__construct(__FILE__);
     // create methods storage
     $this->payment_methods = array();
     $this->delivery_methods = array();
     // create events
     Events::register('shop', 'shopping-cart-changed');
     Events::register('shop', 'before-checkout');
     Events::register('shop', 'transaction-completed');
     Events::register('shop', 'transaction-canceled');
     // register recurring events
     foreach (RecurringPayment::$signals as $status => $signal_name) {
         Events::register('shop', $signal_name);
     }
     // load module style and scripts
     if (class_exists('head_tag') && $section != 'backend') {
         $head_tag = head_tag::getInstance();
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/checkout.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
         $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/shopping_cart.css'), 'rel' => 'stylesheet', 'type' => 'text/css'));
         $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/shopping_cart.js'), 'type' => 'text/javascript'));
     }
     // register backend
     if (class_exists('backend') && $section == 'backend') {
         $head_tag = head_tag::getInstance();
         $backend = backend::getInstance();
         if (class_exists('head_tag')) {
             $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/multiple_images.js'), 'type' => 'text/javascript'));
             $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript'));
         }
         $shop_menu = new backend_MenuItem($this->getLanguageConstant('menu_shop'), url_GetFromFilePath($this->path . 'images/icon.svg'), 'javascript:void(0);', 5);
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_items'), url_GetFromFilePath($this->path . 'images/items.svg'), window_Open('shop_items', 580, $this->getLanguageConstant('title_manage_items'), true, true, backend_UrlMake($this->name, 'items')), 5));
         $recurring_plans_menu = new backend_MenuItem($this->getLanguageConstant('menu_recurring_plans'), url_GetFromFilePath($this->path . 'images/recurring_plans.svg'), 'javascript: void(0);', 5);
         $shop_menu->addChild('shop_recurring_plans', $recurring_plans_menu);
         $shop_menu->addSeparator(5);
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_categories'), url_GetFromFilePath($this->path . 'images/categories.svg'), window_Open('shop_categories', 490, $this->getLanguageConstant('title_manage_categories'), true, true, backend_UrlMake($this->name, 'categories')), 5));
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_item_sizes'), url_GetFromFilePath($this->path . 'images/item_sizes.svg'), window_Open('shop_item_sizes', 400, $this->getLanguageConstant('title_manage_item_sizes'), true, true, backend_UrlMake($this->name, 'sizes')), 5));
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_manufacturers'), url_GetFromFilePath($this->path . 'images/manufacturers.svg'), window_Open('shop_manufacturers', 400, $this->getLanguageConstant('title_manufacturers'), true, true, backend_UrlMake($this->name, 'manufacturers')), 5));
         // delivery methods menu
         $delivery_menu = new backend_MenuItem($this->getLanguageConstant('menu_delivery_methods'), url_GetFromFilePath($this->path . 'images/delivery.svg'), 'javascript: void(0);', 5);
         $shop_menu->addChild('shop_delivery_methods', $delivery_menu);
         $shop_menu->addSeparator(5);
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_special_offers'), url_GetFromFilePath($this->path . 'images/special_offers.svg'), window_Open('shop_special_offers', 490, $this->getLanguageConstant('title_special_offers'), true, true, backend_UrlMake($this->name, 'special_offers')), 5));
         $shop_menu->addSeparator(5);
         // payment methods menu
         $methods_menu = new backend_MenuItem($this->getLanguageConstant('menu_payment_methods'), url_GetFromFilePath($this->path . 'images/payment_methods.svg'), 'javascript: void(0);', 5);
         $shop_menu->addChild('shop_payment_methods', $methods_menu);
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_currencies'), url_GetFromFilePath($this->path . 'images/currencies.svg'), window_Open('shop_currencies', 350, $this->getLanguageConstant('title_currencies'), true, true, backend_UrlMake($this->name, 'currencies')), 5));
         $shop_menu->addSeparator(5);
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_transactions'), url_GetFromFilePath($this->path . 'images/transactions.svg'), window_Open('shop_transactions', 590, $this->getLanguageConstant('title_transactions'), true, true, backend_UrlMake($this->name, 'transactions')), 5));
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_warehouses'), url_GetFromFilePath($this->path . 'images/warehouse.svg'), window_Open('shop_warehouses', 490, $this->getLanguageConstant('title_warehouses'), true, true, backend_UrlMake($this->name, 'warehouses')), 5));
         $shop_menu->addChild(null, new backend_MenuItem($this->getLanguageConstant('menu_stocks'), url_GetFromFilePath($this->path . 'images/stock.svg'), window_Open('shop_stocks', 490, $this->getLanguageConstant('title_stocks'), true, true, backend_UrlMake($this->name, 'stocks')), 5));
         $shop_menu->addSeparator(5);
         $shop_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_settings'), url_GetFromFilePath($this->path . 'images/settings.svg'), window_Open('shop_settings', 400, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings')), $level = 5));
         $backend->addMenu($this->name, $shop_menu);
     }
     // register search
     if (class_exists('search')) {
         $search = search::getInstance();
         $search->registerModule('shop', $this);
     }
 }