Exemple #1
0
 public function __construct()
 {
     global $cookie;
     parent::__construct();
     $this->is_seller = $cookie->profile == (int) Configuration::get('AGILE_MS_PROFILE_ID');
     Shop::$id_shop_owner = $this->is_seller ? $cookie->id_employee : 0;
     if (Module::isInstalled('agilemultipleseller') and !isset($_GET['logout']) and $this->is_seller and (Tools::getValue("controller") == "" or Tools::getValue("controller") == "adminhome")) {
         $tid = Tab::getIdFromClassName('AdminProducts');
         $token = Tools::getAdminToken('AdminProducts' . intval($tid) . intval($cookie->id_employee));
         Tools::redirectAdmin("./index.php?controller=AdminProducts&token=" . $token);
     }
     if (Module::isInstalled('agilesellerlistoptions')) {
         require_once _PS_ROOT_DIR_ . '/modules/agilesellerlistoptions/agilesellerlistoptions.php';
         $aslo_module = new AgileSellerListOptions();
         $msg = $aslo_module->hookAgileAdminTop(null);
         if (!empty($msg)) {
             $this->displayWarning($msg);
         }
     }
     $tab = Tab::getInstanceFromClassName('AdminShopGroup');
     if (Module::isInstalled('agilemultipleshop')) {
         $tab->active = 1;
     } else {
         $tab->active = 0;
     }
     $tab->update();
 }