本文整理汇总了PHP中HTTP::ReloadCurrentURL方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTP::ReloadCurrentURL方法的具体用法?PHP HTTP::ReloadCurrentURL怎么用?PHP HTTP::ReloadCurrentURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTP
的用法示例。
在下文中一共展示了HTTP::ReloadCurrentURL方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: LoginAction
function LoginAction()
{
// Validate login
$where = array("login = '" . $_POST['login'] . "'", "password = '" . $_POST['password'] . "'");
if ($userInfo = Query::SingleRow($this->name, $where)) {
// Login succeeded; create cookie and reload this page
$_JAM->user->Login($userInfo['id']);
HTTP::ReloadCurrentURL();
} else {
// Login failed
}
}
示例2: Connect
function Connect()
{
global $_JAM;
// Check whether user has submitted the login form
if ($_POST['connect']) {
// Validate login
$where = array("login = '" . $_POST['login'] . "'", "password = '" . $_POST['password'] . "'");
if ($userInfo = Query::SingleRow('users', $where)) {
// Login succeeded; create cookie and reload this page
$this->Login($userInfo['id']);
HTTP::ReloadCurrentURL();
return true;
} else {
print e('p', array('class' => 'error'), $_JAM->strings['admin']['incorrectLogin']);
}
}
// Display form if login was incorrect or user has not yet submitted the form
$form = new Form();
$form->Open();
print $form->Field('login', 40, $_JAM->strings['admin']['login']);
print $form->Password('password', 40, $_JAM->strings['admin']['password']);
print $form->Submit('connect', $_JAM->strings['admin']['connect']);
$form->Close();
}
示例3: RevertAction
function RevertAction($module)
{
if ($_POST['revert']) {
// Revert to specific version
if ($module->Revert($_POST['revertID'])) {
HTTP::ReloadCurrentURL('?a=edit&id=' . $_POST['master']);
}
} else {
// Cancel; go back to item form
HTTP::ReloadCurrentURL('?a=edit&id=' . $_POST['master']);
}
}
示例4: ProcessData
//.........这里部分代码省略.........
}
// Keep ID of inserted item for path
$insertID = Database::GetLastInsertID();
}
} else {
// Special update for tables with multiple versions support
// Set item as current
$insertData['current'] = true;
// If we already have a creation date and one wasn't specified, use that
if (!$insertData['created'] && $this->item['created']) {
$insertData['created'] = $this->item['created'];
}
if (!Database::Insert($this->name, $insertData)) {
trigger_error("Couldn't insert into module " . $this->name, E_USER_ERROR);
} else {
// Keep ID of inserted item for path
$insertID = Database::GetLastInsertID();
// $this->postData now represents actual data
$this->LoadData($this->postData);
// Disable all other items with the same master
if ($insertData['master']) {
$updateParams['current'] = false;
$whereArray = array(array('master = ' . $insertData['master'], 'id = ' . $insertData['master']), 'id != ' . $insertID);
$where = Database::GetWhereString($whereArray);
if (!Database::Update($this->name, $updateParams, $where)) {
trigger_error("Couldn't update module " . $this->name, E_USER_ERROR);
return false;
}
}
}
}
} else {
// FIXME: Kuldgy. Added to make translations work.
$insertID = $_GET['item'];
}
// Insert localized data
if ($localizedData) {
$tableName = $this->name . '_localized';
$localizedData['item'] = $insertID;
$localizedData['language'] = $this->postData['language'];
$where = array('item = ' . $insertID, "language = '" . $localizedData['language'] . "'");
if (Database::Update($tableName, $localizedData, $where)) {
// Insert if no rows were affected
if (Database::GetModifiedRows() == 0) {
if (Database::Insert($tableName, $localizedData)) {
$success = true;
} else {
trigger_error("Couldn't insert localized data for module " . $this->name, E_USER_ERROR);
}
} else {
$success = true;
}
// Put data into module object to reflect changes in the database
if ($success) {
$this->LoadData($localizedData);
}
} else {
trigger_error("Couldn't update localized data for module " . $this->name, E_USER_ERROR);
return false;
}
}
if ($insertID) {
// Update path
$this->UpdatePath($insertID);
// Get ID for this item
$id = $_POST['master'] ? $_POST['master'] : $insertID;
// Delete previous many-to-many relationships
$where = array('frommodule = ' . $this->moduleID, 'fromid = ' . $insertID);
if (!Database::DeleteFrom('_relationships', $where)) {
trigger_error("Couldn't delete previous many-to-many relationships for module " . $this->name, E_USER_ERROR);
}
foreach ($this->schema as $name => $info) {
switch ($info['type']) {
case 'multi':
// Insert many-to-many relationships
foreach ($this->postData[$name] as $targetID) {
// Insert each item into _relationships table
$targetModuleName = $info['relatedModule'];
$targetModuleID = array_search($targetModuleName, $_JAM->installedModules);
$params = array('frommodule' => $this->moduleID, 'fromid' => $insertID, 'tomodule' => $targetModuleID, 'toid' => $targetID);
if (!Database::Insert('_relationships', $params)) {
trigger_error("Couldn't insert many-to-many relationship for module " . $this->name, E_USER_ERROR);
}
}
break;
}
}
}
if (method_exists($this, 'PostProcessData')) {
$this->PostProcessData($insertID);
}
// Check whether we need to redirect to a specific anchor
$anchor = $this->config['redirectToAnchor'][$this->parentModule->name];
// Reload page
if ($_JAM->rootModuleName == 'admin' || !$this->config['postSubmitRedirect']) {
HTTP::ReloadCurrentURL('?m=updated' . ($anchor ? '#' . $anchor : ''));
} else {
HTTP::RedirectLocal($this->config['postSubmitRedirect']);
}
}