/** * Override AdminController::initToolbar() method for add bouton "Import File" by stock file */ public function initToolbar() { $this->toolbar_btn['cloud-download icon-cloud-download'] = array('href' => $this->context->link->getModuleLink('now_product_type', 'readthedocumendation', array('type' => 'ideas')), 'desc' => $this->module->l('Exemple', 'AdminNowImportProductType')); $this->toolbar_btn['edit'] = array('href' => '#display_popin_settings', 'desc' => $this->module->l('Settings', 'AdminNowImportTipsAndIdeas')); if ($this->iStep == 1) { $this->toolbar_btn['import'] = array('href' => '#display_popin_import_file', 'desc' => $this->module->l('Import File', 'AdminNowImportTipsAndIdeas')); } elseif ($this->iStep == 2) { $this->toolbar_btn['analyse-data'] = array('href' => '#', 'desc' => $this->module->l('Analyse Data', 'AdminNowImportTipsAndIdeas')); $this->toolbar_btn['cancel'] = array('href' => $this->context->link->getAdminLink('AdminNowImportTipsAndIdeas', true), 'desc' => $this->module->l('Cancel', 'AdminNowImportTipsAndIdeas')); unset($this->toolbar_btn['edit']); } elseif ($this->iStep == 3) { $this->toolbar_btn['save-data'] = array('href' => '#', 'desc' => $this->module->l('Import Data', 'AdminNowImportTipsAndIdeas')); $sFilePath = Tools::getValue('file_path'); $this->toolbar_btn['back'] = array('href' => $this->context->link->getAdminLink('AdminNowImportTipsAndIdeas', true) . '&step=2&file_name=' . substr($sFilePath, strrpos($sFilePath, '/') + 1), 'desc' => $this->module->l('Return to step 2', 'AdminNowImportTipsAndIdeas')); $this->toolbar_btn['cancel'] = array('href' => $this->context->link->getAdminLink('AdminNowImportTipsAndIdeas', true), 'desc' => $this->module->l('Cancel', 'AdminNowImportTipsAndIdeas')); unset($this->toolbar_btn['edit']); } elseif ($this->iStep == 4) { $this->toolbar_btn['back'] = array('href' => $this->context->link->getAdminLink('AdminNowImportTipsAndIdeas', true), 'desc' => $this->module->l('Return to step 1', 'AdminNowImportTipsAndIdeas')); unset($this->toolbar_btn['edit']); } parent::initToolbar(); }