Conf= $config; //include dirname(__DIR__).'/phpwf/plugins/class.mysql.php'; if(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'){ $this->http = 'https'; } else{ $this->http = 'http'; } //$this->Secure = new Secure($this); // empty $_GET, and $_POST so you // have to need the secure layer always if(WithGUI()){ $this->Tpl = new TemplateParser($this); $this->FormHandler = new FormHandler($this); $this->Table = new Table($this); $this->Widget = new WidgetAPI($this); $this->PageBuilder = new PageBuilder($this); $this->Page = new Page($this); $this->ObjAPI = new ObjectAPI($this); $this->WFM = new WFMonitor($this); $this->ModuleScriptCache = new ModuleScriptCache(); } //$this->YUI = new YUI($this); //$this->User = new User($this); //$this->acl = new Acl($this); //$this->WF = new phpWFAPI($this); //$this->String = new WawiString(); $this->BuildNavigation = true; $this->PopupJS = false; //$this->DB = new DB($this->Conf->WFdbhost,$this->Conf->WFdbname,$this->Conf->WFdbuser,$this->Conf->WFdbpass,$this); if(WithGUI()){ $this->Tpl->ReadTemplatesFromPath(__DIR__ . '/widgets/templates/'); $this->Tpl->Set('LAYOUTFIXMARKERCLASS', 'layoutfix'); } } public function __destruct() { //$this->DB->Close(); } public function ActionHandlerInit($caller) { $this->caller = $caller; } public function ActionHandler($command,$function) { $this->ActionHandlerList[$command]=$function; } public function DefaultActionHandler($command) { $this->ActionHandlerDefault=$command; } public function ActionHandlerListen($app) { $fkt = ''; $action = $app->Secure->GetGET('action'); $module = $app->Secure->GetGET('module'); if(!empty($this->ActionHandlerList)) { $app->erp->addActionHandler($module, $this->ActionHandlerList); } if(!empty($action)) { if(!empty($this->ActionHandlerList[$action])) { $fkt = $this->ActionHandlerList[$action]; } } else { if(empty($this->ActionHandlerDefault) && isset($this->ActionHandlerList['list'])) { if(empty($action)) { $app->Secure->GET['action'] = 'list'; } $this->ActionHandlerDefault = 'list'; } if(!empty($this->ActionHandlerDefault)) { $fkt = $this->ActionHandlerList[$this->ActionHandlerDefault]; } } if(!empty($fkt)){ $callhooks = empty($this->NoHooks) || !in_array($action,$this->NoHooks); if($callhooks){ $app->erp->RunHook($module . '_' . $action . '_before'); } $response = @$this->caller->$fkt(); if($callhooks){ $app->erp->RunHook($module . '_' . $action . '_after'); } if($response instanceof JsonResponse) { $response->send(); $this->ExitXentral(); } if($response instanceof RedirectResponse) { $response->send(); $this->ExitXentral(); } } } public function DisableLayoutFix() { if(WithGUI()){ $this->Tpl->Set('LAYOUTFIXMARKERCLASS', ''); } } }