')) { $cookie = Context::getContext()->cookie; } else { global $cookie; } global $currentIndex; // get default lang self::$iCurrentLang = $cookie->id_lang; // set module name $this->module = _OTPR_MODULE_SET_NAME; // Fix for translations before v1.4 if (version_compare(_PS_VERSION_, '1.4.0.1') == -1) { global $_LANGADM, $_MODULE; // set lang filename $sLangFile = _PS_MODULE_DIR_ . $this->module . '/' . Language::getIsoById(self::$iCurrentLang) . '.php'; // check lang file exists if (file_exists($sLangFile)) { // include php lang file require_once $sLangFile; foreach ($_MODULE as $nKey => $sValue) { if (Tools::substr(strip_tags($nKey), 0, 5) == 'Admin') { $_LANGADM[str_replace('_', '', strip_tags($nKey))] = $sValue; } } } } // construct parent::__construct(); self::$sBASE_URI = $currentIndex; } /** * display() method manages all data in Back Office of admin tab * * @return string */ public function display() { // include main class require_once(_OTPR_PATH_ROOT . 'ordertaxprofitreport.php'); // instantiate $oMainClass = new OrderTaxProfitReport(); // use case - display => search form / export => return HTML report or a downloadable CVS report $_REQUEST['sAction'] = (!Tools::getIsset('sAction') || (Tools::getIsset('sAction') && 'display' == Tools::getValue('sAction')))? 'display' : Tools::getValue('sAction'); $_REQUEST['sType'] = !Tools::getIsset('sType')? 'searchForm' : $_REQUEST['sType']; // set URI of admin tab $_REQUEST['sAdminTabURI'] = self::$sBASE_URI; echo ( $oMainClass->getContent() ); } /** * addCSS() method return always true because some other modules are hooked on adminBackofficeHeader and call addCSS() method. This method doesn't exist in the Admin context tab. * This prevent those modules do not execute functions which do not exists * * @return bool true */ public function addCSS() { // return true return true; } /** * addJS() method return always true because some other modules are hooked on adminBackofficeHeader and call addJS() method. This method doesn't exist in the Admin context tab. * This prevents those modules do not execute functions which doesn't exists * * @return bool true */ public function addJS() { // return true return true; } }