public function __construct($module, $action = false, $switch = false) { $this->MODULE = $module; $this->ACTION = $action; $this->SWITCH = $switch; $this->assign('MODULE', $this->MODULE); $this->modulePath = "modules/"; $this->arrConfigVar = ClsNaanalApplication::getConfigVars($module); parent::__construct(); }
protected function processModuleInput(&$arrInputParam, $type = "get") { $retModule = ""; $retAction = ""; $retSwitch = ""; if (isset($arrInputParam["id"])) { $this->id = $arrInputParam["id"]; } if (file_exists("ClsConfig.php") && isset(ClsConfig::$URL_MODULE_PARAM)) { $this->urlModuleParam = ClsConfig::$URL_MODULE_PARAM; } if (file_exists("ClsConfig.php") && isset(ClsConfig::$URL_ACTION_PARAM)) { $this->urlActionParam = ClsConfig::$URL_ACTION_PARAM; } if (file_exists("ClsConfig.php") && isset(ClsConfig::$URL_SWITCH_PARAM)) { $this->urlSwitchParam = ClsConfig::$URL_SWITCH_PARAM; } if (isset($arrInputParam["rand"])) { $arrDecode = getModuleDecode($arrInputParam["rand"]); if (isset($arrDecode[$this->urlModuleParam])) { $this->module = $arrDecode[$this->urlModuleParam]; } if (isset($arrDecode[$this->urlActionParam])) { $this->action = $arrDecode[$this->urlActionParam]; } if (isset($arrDecode["switch"])) { $this->switch = $arrDecode[$this->urlSwitchParam]; } $this->isSubmit = true; } if (isset($arrInputParam[$this->urlModuleParam])) { $this->module = $arrInputParam[$this->urlModuleParam]; } else { } $urlActionParam = $this->urlActionParam; $arrConfigVar = ClsNaanalApplication::getConfigVars($this->module); if (isset($arrConfigVar["url_action_param"])) { $urlActionParam = $arrConfigVar["url_action_param"]; } if (isset($arrInputParam[$urlActionParam])) { $this->action = $arrInputParam[$urlActionParam]; } else { if ($this->id > 0) { if (isset($arrInputParam["issubmit"])) { $this->action = "update"; } else { $this->action = "edit"; } } else { if (isset($arrInputParam["issubmit"])) { $this->action = "insert"; } else { //$this->action="create"; } } } if (isset($arrInputParam["switch"])) { $this->switch = $arrInputParam["switch"]; } else { $this->switch = "default"; } $arrTrimParam = array("page", "action", "formodule"); foreach ($arrTrimParam as $data) { if (isset($arrInputParam[$data])) { if ($data == $this->urlModuleParam || $data == $this->urlActionParam || $data == $this->urlSwitchParam) { continue; } $arrInputParam[$data] = trim($arrInputParam[$data]); $this->otherVar[$data] = $arrInputParam[$data]; } } $requested_entry = _AuieoHook("{$type}_entry"); if ($requested_entry) { $entry = $requested_entry(); if (!is_null($entry)) { $this->entry = $entry; } } $requested_page = _AuieoHook("{$type}_page"); if ($requested_page) { $module = $requested_page(); if (!is_null($module)) { $this->module = $module; } } $requested_action = _AuieoHook("{$type}_action"); if ($requested_action) { $action = $requested_action(); if (!is_null($action)) { $this->action = $action; } } $requested_switch = _AuieoHook("{$type}_switch"); if ($requested_switch) { $switch = $requested_switch(); if (!is_null($switch)) { $this->switch = $switch; } } /** * If framework or application not installed, the user hook will be overridden */ if (!ClsNaanalApplication::isFrameworkInstalled() || !isApplicationInstalled()) { $this->module = "install"; } }
public function __construct($module, $action, $id = 0, $arrWhere = array(), $parentModuleID = 0) { $this->module = $module; $this->action = $action; $this->arrConfigVar = ClsNaanalApplication::getConfigVars($module); }