$layout->blocks["top"][] = "fields"; $layout->skins["details"] = "empty"; $layout->blocks["top"][] = "details"; $page_layouts["calendar_table_edit"] = $layout; $layout->skinsparams = array(); $layout->skinsparams["empty"] = array("button" => "button1"); $layout->skinsparams["menu"] = array("button" => "button1"); $layout->skinsparams["hmenu"] = array("button" => "button1"); $layout->skinsparams["undermenu"] = array("button" => "button1"); $layout->skinsparams["fields"] = array("button" => "button1"); $layout->skinsparams["form"] = array("button" => "button1"); $layout->skinsparams["1"] = array("button" => "button1"); $layout->skinsparams["2"] = array("button" => "button1"); $layout->skinsparams["3"] = array("button" => "button1"); // parse control parameters $pageMode = EditPage::readEditModeFromRequest(); $xt = new Xtempl(); $id = postvalue("id"); $id = intval($id) == 0 ? 1 : $id; // $keys could not be set properly if editid params were no passed $keys = array(); $keys["dt"] = postvalue("editid1"); //array of params for classes $params = array(); $params["id"] = $id; $params["xt"] =& $xt; $params["keys"] = $keys; $params["mode"] = $pageMode; $params["pageType"] = PAGE_EDIT; $params["tName"] = $strTableName; $params["action"] = postvalue("a");
public static function processEditPageSecurity($table) { // user has necessary permissions if (Security::checkPagePermissions($table, "E")) { return true; } // display entered data. Give the user chance to relogin. Do nothing for now. if (postvalue("a") == "edited") { return true; } // page can not be displayed. Redirect or return error $pageMode = EditPage::readEditModeFromRequest(); // return error if the page is requested by AJAX if ($pageMode != EDIT_SIMPLE) { Security::sendPermissionError(); return false; } // The user is logged in but lacks necessary permissions // redirect to List page or Menu. if (isLogged() && !isLoggedAsGuest()) { Security::redirectToList($table); return false; } // Not logged in // redirect to Login // Save current URL in session $keyParams = array(); $i = 1; while (postvalue("editid" . $i)) { $keyParams[] = "editid" . $i . "=" . rawurlencode(postvalue("editid" . $i)); $i++; } $_SESSION["MyURL"] = $_SERVER["SCRIPT_NAME"] . "?" . implode("&", $keyParams); redirectToLogin(); return false; }