name = 'stats_logistic'; $this->tab = 'analytics_stats'; $this->author = 'Antadis'; $this->version = '1.0'; parent::__construct(); $this->displayName = $this->l('Stats logistic'); $this->description = $this->l('Display stats of the employee'); } public function install() { return ( parent::install() and self::createTab(6, $this->name, $this->l('Stats logistic'), self::ADMIN_STATS_LOGISTIC_CLASS) ); } public function uninstall() { return ( parent::uninstall() and self::dropTable() and self::deleteTab(self::ADMIN_STATS_LOGISTIC_CLASS) ); } public static function createTab($id_parent, $module, $name, $class_name, $status=TRUE) { $tab = new Tab(); $tab->module = $module; foreach (Language::getLanguages(TRUE) as $languages) { $tab->name[$languages['id_lang']] = $name; } $tab->id_parent = $id_parent; $tab->class_name = $class_name; $tab->active = $status; $r = $tab->save(); if ($r === FALSE) return FALSE; return $tab->id; } public function getContent() { global $currentIndex; Tools::redirectAdmin($currentIndex.'&tab='.self::ADMIN_STATS_LOGISTIC_CLASS.'&token='.Tools::getAdminTokenLite(self::ADMIN_STATS_LOGISTIC_CLASS)); Tools::redirectAdmin($this->context->link->getAdminLink(self::ADMIN_STATS_LOGISTIC_CLASS)); } }