本文整理匯總了PHP中EditPage::readEditModeFromRequest方法的典型用法代碼示例。如果您正苦於以下問題:PHP EditPage::readEditModeFromRequest方法的具體用法?PHP EditPage::readEditModeFromRequest怎麽用?PHP EditPage::readEditModeFromRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類EditPage
的用法示例。
在下文中一共展示了EditPage::readEditModeFromRequest方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$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");
示例2: processEditPageSecurity
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;
}