public function initContent()
 {
     $this->context->smarty->assign(array('agilemultipleseller_isinstalled' => Module::isInstalled('agilemultipleseller') ? 1 : 0, 'agilesellerlistoptions_isinstalled' => Module::isInstalled('agilesellerlistoptions') ? 1 : 0, 'id_first_available_category' => AgileHelper::GetFirstAvailableCategory()));
     if (Module::isInstalled('agilemultipleseller')) {
         require_once _PS_ROOT_DIR_ . '/modules/agilemultipleseller/agilemultipleseller.php';
         require_once _PS_ROOT_DIR_ . '/modules/agilemultipleseller/SellerInfo.php';
         $this->context->smarty->assign(array('agilemultipleseller_hook' => _PS_ROOT_DIR_ . "/modules/agilemultipleseller/views/templates/hook/", 'is_seller' => $this->is_seller, 'id_seller' => AgileSellerManager::getObjectOwnerID($this->table, Tools::getValue('id_' . $this->table)), 'sellers' => $this->is_seller ? null : AgileSellerManager::getSellersNV(true, $this->l('Public in store')), 'approveal_required' => intval(Configuration::get('AGILE_MS_PRODUCT_APPROVAL')), 'approved' => AgileMultipleSeller::is_list_approved(intval(Tools::getValue('id_product'))), 'ajx_category_url' => AgileMultipleSeller::get_agile_ajax_categories_url()));
     }
     if (Module::isInstalled('agilesellerlistoptions')) {
         require_once _PS_ROOT_DIR_ . '/modules/agilesellerlistoptions/agilesellerlistoptions.php';
         $aslo_module = new AgileSellerListOptions();
         $this->context->smarty->assign(array('agilesellerlistoptions_hook' => _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/views/templates/hook/", 'HOOK_PRODYCT_LIST_OPTIONS' => $aslo_module->hookAgileAdminProductsFormTop(array('for_front' => 0, 'id_product' => Tools::getValue('id_' . $this->table)), $this->is_seller)));
     }
     parent::initContent();
 }
 public function initContent($token = null)
 {
     if ($this->display == 'edit' || $this->display == 'add') {
         $this->fields_form = array();
         if (substr($this->tab_display, 0, 6) == 'Module') {
             $this->tab_display_module = strtolower(substr($this->tab_display, 6, Tools::strlen($this->tab_display) - 6));
             $this->tab_display = 'Modules';
         }
         if (method_exists($this, 'initForm' . $this->tab_display)) {
             $this->tpl_form = strtolower($this->tab_display) . '.tpl';
         }
         if ($this->ajax) {
             $this->content_only = true;
         } else {
             $product_tabs = array();
             if (!method_exists($this, 'initForm' . $this->tab_display)) {
                 $this->tab_display = $this->default_tab;
             }
             $advanced_stock_management_active = Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT');
             foreach ($this->available_tabs as $product_tab => $value) {
                 if ($advanced_stock_management_active == 0 && $product_tab == 'Warehouses') {
                     continue;
                 }
                 $product_tabs[$product_tab] = array('id' => $product_tab, 'selected' => strtolower($product_tab) == strtolower($this->tab_display) || isset($this->tab_display_module) && 'module' . $this->tab_display_module == Tools::strtolower($product_tab), 'name' => $this->available_tabs_lang[$product_tab], 'href' => $this->context->link->getAdminLink('AdminProducts') . '&id_product=' . (int) Tools::getValue('id_product') . '&action=' . $product_tab);
             }
             $this->tpl_form_vars['product_tabs'] = $product_tabs;
         }
     } else {
         if ($id_category = (int) $this->id_current_category) {
             self::$currentIndex .= '&id_category=' . (int) $this->id_current_category;
         }
         if (!$id_category) {
             $this->_defaultOrderBy = $this->identifier;
             if ($this->context->cookie->{$this->table . 'Orderby'} == 'position') {
                 unset($this->context->cookie->{$this->table . 'Orderby'});
                 unset($this->context->cookie->{$this->table . 'Orderway'});
             }
         }
         if (!$id_category) {
             $id_category = Configuration::get('PS_ROOT_CATEGORY');
         }
         $this->tpl_list_vars['is_category_filter'] = (bool) $this->id_current_category;
         $tree = new HelperTreeCategories('categories-tree', $this->l('Filter by category'));
         $tree->setAttribute('is_category_filter', (bool) $this->id_current_category)->setAttribute('base_url', preg_replace('#&id_category=[0-9]*#', '', self::$currentIndex) . '&token=' . $this->token)->setInputName('id-category')->setSelectedCategories(array((int) $id_category));
         $this->tpl_list_vars['category_tree'] = $tree->render();
         $this->tpl_list_vars['base_url'] = preg_replace('#&id_category=[0-9]*#', '', self::$currentIndex) . '&token=' . $this->token;
     }
     $this->tpl_form_vars['vat_number'] = file_exists(_PS_MODULE_DIR_ . 'vatnumber/ajax.php');
     parent::initContent();
 }
 public function initContent($token = null)
 {
     $pproperties = new PProperties();
     foreach ($pproperties->getTranslations('AdminProducts') as $key => $value) {
         $this->tpl_form_vars[$key] = $value;
     }
     if ($this->display == 'edit' || $this->display == 'add') {
         Product::$amend = false;
     } elseif ($this->tabAccess['edit'] === '1') {
         if (!is_array($this->bulk_actions)) {
             $this->bulk_actions = array();
         }
         $this->bulk_actions['manageTemplatesDivider'] = array('text' => 'divider');
         $this->bulk_actions['manageTemplates'] = array('text' => $this->l('Manage templates'), 'icon' => 'icon-template');
     }
     parent::initContent($token);
 }