name = 'statshome'; $this->tab = 'Stats'; $this->version = 1.0; $ru = dirname($_SERVER['REQUEST_URI'].'a'); $this->_adminPath = substr($ru, strrpos($ru, '/')); parent::__construct(); $this->displayName = $this->l('Condensed stats for the Back Office homepage'); $this->description = $this->l('Display a small block of statistics on the Back Office homepage'); } public function install() { return (parent::install() AND $this->registerHook('backOfficeHome')); } private function _postProcess() { include_once(dirname(__FILE__).'/../..'.$this->_adminPath.'/tabs/AdminStats.php'); $calendarTab = new AdminStats(); $calendarTab->postProcess(); } public function hookBackOfficeHome($params) { global $cookie; $this->_postProcess(); $currency = Currency::getCurrency(intval(Configuration::get('PS_CURRENCY_DEFAULT'))); $results = $this->getResults(); $employee = new Employee(intval($cookie->id_employee)); $id_tab_stats = Tab::getIdFromClassName('AdminStats'); $access = Profile::getProfileAccess($employee->id_profile, $id_tab_stats); if (!$access['view']) return ''; $this->_html = '