/** * constructor.. */ function __construct() { global $gJConfig; $this->_charset = $gJConfig->charset; $this->content = new jTpl(); parent::__construct(); }
/** * main method : launch the execution of the action. * * This method should be called in a entry point. * * @param jRequest $request the request object. It is required if a descendant of jCoordinator did not called setRequest before */ public function process($request = null) { try { if ($request) { $this->setRequest($request); } jSession::start(); $ctrl = $this->getController($this->action); } catch (jException $e) { $config = jApp::config(); if ($config->urlengine['notfoundAct'] == '') { throw $e; } if (!jSession::isStarted()) { jSession::start(); } try { $this->action = new jSelectorAct($config->urlengine['notfoundAct']); $ctrl = $this->getController($this->action); } catch (jException $e2) { throw $e; } } jApp::pushCurrentModule($this->moduleName); if (count($this->plugins)) { $pluginparams = array(); if (isset($ctrl->pluginParams['*'])) { $pluginparams = $ctrl->pluginParams['*']; } if (isset($ctrl->pluginParams[$this->action->method])) { $pluginparams = array_merge($pluginparams, $ctrl->pluginParams[$this->action->method]); } foreach ($this->plugins as $name => $obj) { $result = $this->plugins[$name]->beforeAction($pluginparams); if ($result) { $this->action = $result; jApp::popCurrentModule(); jApp::pushCurrentModule($result->module); $this->moduleName = $result->module; $this->actionName = $result->resource; $ctrl = $this->getController($this->action); break; } } } $this->response = $ctrl->{$this->action->method}(); if ($this->response == null) { throw new jException('jelix~errors.response.missing', $this->action->toString()); } foreach ($this->plugins as $name => $obj) { $this->plugins[$name]->beforeOutput(); } $this->response->output(); foreach ($this->plugins as $name => $obj) { $this->plugins[$name]->afterProcess(); } jApp::popCurrentModule(); jSession::end(); }
/** * Class constructor */ function __construct() { global $gJConfig; $this->charset = $gJConfig->charset; list($lang, $country) = explode('_', $gJConfig->locale); $this->lang = $lang; parent::__construct(); }
function __construct() { $this->_charset = jApp::config()->charset; $this->_lang = jApp::config()->locale; $plugins = jApp::config()->jResponseHtml['plugins']; if ($plugins) { $plugins = preg_split('/ *, */', $plugins); foreach ($plugins as $name) { if (!$name) { continue; } $plugin = jApp::loadPlugin($name, 'htmlresponse', '.htmlresponse.php', $name . 'HTMLResponsePlugin', $this); if ($plugin) { $this->plugins[$name] = $plugin; } } } parent::__construct(); }
/** * constructor; * setup the charset, the lang */ function __construct() { $this->_charset = jApp::config()->charset; $this->_lang = jApp::config()->locale; // load plugins $plugins = jApp::config()->jResponseHtml['plugins']; if ($plugins) { $plugins = preg_split('/ *, */', $plugins); foreach ($plugins as $name) { if (!$name) { continue; } $plugin = jApp::loadPlugin($name, 'htmlresponse', '.htmlresponse.php', $name . 'HTMLResponsePlugin', $this); if ($plugin) { $this->plugins[$name] = $plugin; } // do nothing if the plugin does not exist, we could be already into the error handle } } parent::__construct(); }
/** * Class constructor * * @return void */ public function __construct() { $this->content = new jTpl(); $this->contentTpl = 'jelix~sitemap'; parent::__construct(); }
/** * constructor */ function __construct() { $this->content = new jZipCreator(); parent::__construct(); }
/** * main method : launch the execution of the action. * * This method should be called in a entry point. * @param jRequest $request the request object */ public function process($request) { global $gJConfig; $this->request = $request; // let's log messages appeared during init foreach ($this->initErrorMessages as $msg) { jLog::log($msg, $msg->getCategory()); } $this->request->init(); jSession::start(); $this->moduleName = $request->getParam('module'); $this->actionName = $request->getParam('action'); if (empty($this->moduleName)) { $this->moduleName = $gJConfig->startModule; } if (empty($this->actionName)) { if ($this->moduleName == $gJConfig->startModule) { $this->actionName = $gJConfig->startAction; } else { $this->actionName = 'default:index'; } } jContext::push($this->moduleName); try { $this->action = new jSelectorActFast($this->request->type, $this->moduleName, $this->actionName); if ($gJConfig->modules[$this->moduleName . '.access'] < 2) { throw new jException('jelix~errors.module.untrusted', $this->moduleName); } $ctrl = $this->getController($this->action); } catch (jException $e) { if ($gJConfig->urlengine['notfoundAct'] == '') { throw $e; } try { $this->action = new jSelectorAct($gJConfig->urlengine['notfoundAct']); $ctrl = $this->getController($this->action); } catch (jException $e2) { throw $e; } } if (count($this->plugins)) { $pluginparams = array(); if (isset($ctrl->pluginParams['*'])) { $pluginparams = $ctrl->pluginParams['*']; } if (isset($ctrl->pluginParams[$this->action->method])) { $pluginparams = array_merge($pluginparams, $ctrl->pluginParams[$this->action->method]); } foreach ($this->plugins as $name => $obj) { $result = $this->plugins[$name]->beforeAction($pluginparams); if ($result) { $this->action = $result; jContext::pop(); jContext::push($result->module); $this->moduleName = $result->module; $this->actionName = $result->resource; $ctrl = $this->getController($this->action); break; } } } $this->response = $ctrl->{$this->action->method}(); if ($this->response == null) { throw new jException('jelix~errors.response.missing', $this->action->toString()); } foreach ($this->plugins as $name => $obj) { $this->plugins[$name]->beforeOutput(); } $this->response->output(); foreach ($this->plugins as $name => $obj) { $this->plugins[$name]->afterProcess(); } jContext::pop(); jSession::end(); }
/** * constructor */ function __construct() { $this->body = new jTpl(); parent::__construct(); }
/** * constructor; * setup the template engine */ function __construct() { $this->cachePath = JELIX_APP_TEMP_PATH . 'responseLatexToPdf/'; $this->body = new jTpl(); parent::__construct(); }
function __construct() { $this->cachePath = jApp::tempPath('responseLatexToPdf/'); $this->body = new jTpl(); parent::__construct(); }
/** * constructor; * setup the charset, the lang, the template engine */ function __construct() { global $gJConfig; $this->_charset = $gJConfig->charset; $this->_lang = $gJConfig->locale; $this->body = new jTpl(); parent::__construct(); }
/** * Store an error/warning/notice message. * @param string $type error type : 'error', 'warning', 'notice' * @param integer $code error code * @param string $message error message * @param string $file the file name where the error appear * @param integer $line the line number where the error appear * @return boolean true= the process should stop now, false = the error manager do its job */ protected function addErrorMsg($type, $code, $message, $file, $line) { $this->errorMessages[] = array($type, $code, $message, $file, $line); return !$this->response->acceptSeveralErrors(); }
function __construct() { $this->charset = jApp::config()->charset; $this->lang = jLocale::getCurrentLang(); parent::__construct(); }
/** * constructor.. */ function __construct() { $this->_charset = jApp::config()->charset; $this->content = new jTpl(); parent::__construct(); }