/** * Default constructor * * @return void */ public function __construct() { // set the module $this->setModule(SpoonFilter::getGetValue('module', null, '')); // set the action $this->setAction(SpoonFilter::getGetValue('action', null, '')); // set the language $this->setLanguage(SpoonFilter::getGetValue('language', null, '')); // create a new action $action = new FrontendAJAXAction($this->getAction(), $this->getModule()); // attempt to execute this action try { // execute the action $action->execute(); } catch (Exception $e) { // if we are debugging, we obviously want to see the exception if (SPOON_DEBUG) { throw $e; } // create fake action $fakeAction = new FrontendBaseAJAXAction('', ''); // output the exceptions-message as an error $fakeAction->output(FrontendBaseAJAXAction::ERROR, null, $e->getMessage()); } }
public function __construct() { // get vars $module = isset($_POST['fork']['module']) ? $_POST['fork']['module'] : ''; if ($module == '' && isset($_GET['module'])) { $module = $_GET['module']; } $action = isset($_POST['fork']['action']) ? $_POST['fork']['action'] : ''; if ($action == '' && isset($_GET['action'])) { $action = $_GET['action']; } $language = isset($_POST['fork']['language']) ? $_POST['fork']['language'] : ''; if ($language == '' && isset($_GET['language'])) { $language = $_GET['language']; } if ($language == '') { $language = SITE_DEFAULT_LANGUAGE; } // set the module $this->setModule($module); // set the action $this->setAction($action); // set the language $this->setLanguage($language); // create a new action $action = new FrontendAJAXAction($this->getAction(), $this->getModule()); try { // execute the action $action->execute(); } catch (Exception $e) { // if we are debugging, we obviously want to see the exception if (SPOON_DEBUG) { throw $e; } // create fake action $fakeAction = new FrontendBaseAJAXAction('', ''); // output the exceptions-message as an error $fakeAction->output(FrontendBaseAJAXAction::ERROR, null, $e->getMessage()); } }