本文整理汇总了PHP中QApplication::Redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP QApplication::Redirect方法的具体用法?PHP QApplication::Redirect怎么用?PHP QApplication::Redirect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QApplication
的用法示例。
在下文中一共展示了QApplication::Redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: btnOkay_Click
public function btnOkay_Click($strFormId, $strControlId, $strParameter)
{
$this->btnOkay->Enabled = true;
$blnNewTopic = false;
// Setup stuff if it's a NEW message being posted (either a NEW response or a NEW topic)
if (!$this->blnEditMode) {
// For NEW TOPIC in this Forum
if (!$this->mctMessage->Message->Topic) {
$objForum = Forum::Load($this->lstForum->SelectedValue);
$objNewTopic = $objForum->PostTopic(trim($this->txtTopicName->Text), trim($this->txtMessage->Text), QApplication::$Person);
QApplication::Redirect(sprintf('/forums/forum.php/%s/%s/', $objForum->Id, $objNewTopic->Id));
// Otherwise, it's a new POST in this TOPIC
} else {
$this->mctMessage->Message->PostDate = QDateTime::Now();
}
// Set the Reply Number for this New Message
$this->mctMessage->Message->ReplyNumber = $this->mctMessage->Message->Topic->GetNextReplyNumber();
}
// Save Everything Else
$this->mctMessage->SaveMessage();
$this->mctMessage->Message->RefreshCompiledHtml();
$this->mctMessage->SaveMessage();
// Refresh Stats and Stuff
$this->mctMessage->Message->Topic->RefreshStats();
$this->mctMessage->Message->Topic->RefreshSearchIndex();
$this->mctMessage->Message->TopicLink->RefreshStats();
// Send Alerts and Reset Read Flag on any NEW post
if (!$this->blnEditMode) {
$this->mctMessage->Message->SendAlerts();
$this->mctMessage->Message->Topic->UnassociateAllPeopleAsRead();
//Mark as read for poster
$this->mctMessage->Message->Topic->AssociatePersonAsRead(QApplication::$Person);
}
$this->ParentControl->CloseMessageDialog(true, !$this->blnEditMode);
}
示例2: Form_Create
protected function Form_Create()
{
parent::Form_Create();
if (!QApplication::HasPermissionForThisLang('Can export project', $this->objProject->ProjectId)) {
QApplication::Redirect(NarroLink::ProjectList());
}
$pnlDummy = new QPanel($this->pnlMainTab);
$arrHeaders[] = NarroLink::Project($this->objProject->ProjectId, t('Overview'));
if ($this->objProject instanceof NarroProject && QApplication::HasPermissionForThisLang('Can edit project', $this->objProject->ProjectId)) {
$pnlDummy = new QPanel($this->pnlMainTab);
$arrHeaders[] = NarroLink::ProjectEdit($this->objProject->ProjectId, t('Edit'));
}
$pnlDummy = new QPanel($this->pnlMainTab);
$arrHeaders[] = NarroLink::Translate($this->objProject->ProjectId, '', 0, '', 0, 0, 10, 0, 0, t('Translate'));
$pnlDummy = new QPanel($this->pnlMainTab);
$arrHeaders[] = NarroLink::Review($this->objProject->ProjectId, '', NarroReviewPanel::SHOW_NOT_APPROVED, '', 0, 0, 10, 0, 0, t('Review'));
$pnlDummy = new QPanel($this->pnlMainTab);
$arrHeaders[] = NarroLink::ProjectFileList($this->objProject->ProjectId, '', '', t('Files'));
$pnlDummy = new QPanel($this->pnlMainTab);
$arrHeaders[] = NarroLink::ProjectLanguages($this->objProject->ProjectId, t('Languages'));
if (QApplication::HasPermissionForThisLang('Can import project', $this->objProject->ProjectId)) {
$pnlDummy = new QPanel($this->pnlMainTab);
$arrHeaders[] = NarroLink::ProjectImport($this->objProject->ProjectId, t('Import'));
}
if (QApplication::HasPermissionForThisLang('Can export project', $this->objProject->ProjectId)) {
$this->pnlSelectedTab = new NarroProjectExportPanel($this->objProject, $this->pnlMainTab);
$arrHeaders[] = t('Export');
$this->pnlMainTab->Selected = count($arrHeaders) - 1;
}
$this->pnlMainTab->Headers = $arrHeaders;
}
示例3: Form_Create
protected function Form_Create()
{
parent::Form_Create();
if (QApplication::GetUserId() == NarroUser::ANONYMOUS_USER_ID) {
$strPassHash = QApplication::QueryString('h');
$strUsername = QApplication::QueryString('u');
if ($strPassHash && $strUsername) {
$objUser = NarroUser::LoadByUsernameAndPassword($strUsername, $strPassHash);
if ($objUser instanceof NarroUser) {
QApplication::$User = $objUser;
} else {
QApplication::Redirect('login.php');
}
} else {
QApplication::Redirect('login.php');
}
}
$this->lblMessage = new QLabel($this);
$this->lblMessage->HtmlEntities = false;
$this->txtPassword = new QTextBox($this);
$this->txtPassword->TextMode = QTextMode::Password;
$this->btnChangePassword = new QButton($this);
$this->btnChangePassword->PrimaryButton = true;
$this->btnChangePassword->Text = t('Change password');
$this->btnChangePassword->AddAction(new QClickEvent(), new QServerAction('btnChangePassword_Click'));
}
示例4: Form_Create
protected function Form_Create()
{
switch (QApplication::PathInfo(0)) {
case 'funds':
$this->dtgReport = new QDataGrid($this);
$this->dtgReport->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM->StewardshipFund->Name; ?>', 'Width=300px'));
$this->dtgReport->AddColumn(new QDataGridColumn('Account Number', '<?= $_ITEM->StewardshipFund->AccountNumber; ?>', 'Width=200px'));
$this->dtgReport->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=245px'));
$this->dtgReport->NoDataHtml = 'Changes only to members credited. (No changes to funding accounts or amounts)';
$this->dtgReport->SetDataBinder('dtgReport_Funds_Bind');
break;
case 'line_items':
$this->dtgReport = new QDataGrid($this);
$this->dtgReport->AddColumn(new QDataGridColumn('Person', '<?= $_ITEM->Person->Name; ?>', 'Width=200px'));
$this->dtgReport->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM->StewardshipFund->Name; ?>', 'Width=200px'));
$this->dtgReport->AddColumn(new QDataGridColumn('Description', '<?= $_ITEM->Description; ?>', 'Width=200px'));
$this->dtgReport->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=130px'));
$this->dtgReport->SetDataBinder('dtgReport_LineItems_Bind');
break;
default:
QApplication::Redirect('/stewardship/');
break;
}
$this->objBatch = StewardshipBatch::Load(QApplication::PathInfo(1));
if (!$this->objBatch) {
QApplication::Redirect('/stewardship/');
}
$this->objPost = StewardshipPost::LoadByStewardshipBatchIdPostNumber($this->objBatch->Id, QApplication::PathInfo(2));
if (!$this->objPost) {
QApplication::Redirect('/stewardship/');
}
}
示例5: btnLogin_Click
protected function btnLogin_Click($strFormId, $strControlId, $strParameter)
{
$objPerson = Person::LoadByUsername(trim(strtolower($this->txtUsername->Text)));
if (!$objPerson) {
$objPerson = Person::LoadByEmail(trim(strtolower($this->txtUsername->Text)));
}
if ($objPerson && $objPerson->IsPasswordValid($this->txtPassword->Text)) {
QApplication::LoginPerson($objPerson);
if ($this->chkRemember->Checked) {
QApplication::SetLoginTicketToCookie($objPerson);
}
// Redirect to the correct location
if ($objPerson->PasswordResetFlag) {
if (array_key_exists('strReferer', $_GET)) {
QApplication::Redirect('/profile/password.php?strReferer=' . urlencode($_GET['strReferer']));
} else {
QApplication::Redirect('/profile/password.php?strReferer=' . urlencode('/'));
}
} else {
if (array_key_exists('strReferer', $_GET)) {
QApplication::Redirect($_GET['strReferer']);
} else {
QApplication::Redirect('/');
}
}
}
// If we're here, either the username and/or password is not valid
$this->txtUsername->Warning = 'Invalid username or password';
$this->txtPassword->Text = null;
// Call Form_Validate() to do that blinking thing
$this->Form_Validate();
}
示例6: Form_Create
protected function Form_Create()
{
if (isset($_SESSION['User'])) {
$_SESSION['User'] = '';
}
QApplication::Redirect('index.php');
}
示例7: Form_Create
protected function Form_Create()
{
$this->objList = CommunicationList::LoadById(QApplication::PathInfo(0));
if (!$this->objList) {
QApplication::Redirect('/communications/');
}
$this->strPageTitle .= $this->objList->Name;
$this->dtgMembers = new QDataGrid($this);
$this->dtgMembers->UseAjax = true;
$this->dtgMembers->Paginator = new QPaginator($this->dtgMembers);
if ($this->objList->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) {
$this->dtgMembers->AddColumn(new QDataGridColumn('Edit', '<?= $_FORM->RenderEdit($_ITEM); ?>', 'HtmlEntities=false', 'Width=140px', 'FontSize=10px'));
}
$this->dtgMembers->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM[0]; ?>', 'Width=150px', 'SortByCommand=0,0', 'ReverseSortByCommand=0,1'));
$this->dtgMembers->AddColumn(new QDataGridColumn('Middle', '<?= $_ITEM[1]; ?>', 'Width=80px', 'SortByCommand=1,0', 'ReverseSortByCommand=1,1'));
$this->dtgMembers->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM[2]; ?>', 'Width=150px', 'SortByCommand=2,0', 'ReverseSortByCommand=2,1'));
$this->dtgMembers->AddColumn(new QDataGridColumn('Email', '<a href="mailto:<?= QApplication::HtmlEntities($_ITEM[3]); ?>"><?= QApplication::HtmlEntities($_ITEM[3]); ?></a>', 'HtmlEntities=false', 'Width=290px', 'SortByCommand=3,0', 'ReverseSortByCommand=3,1'));
$this->dtgMembers->AddColumn(new QDataGridColumn('Member?', '<?= $_ITEM[6]; ?>', 'Width=75px', 'SortByCommand=6,0', 'ReverseSortByCommand=6,1'));
if ($this->objList->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) {
$this->dtgMembers->SortColumnIndex = 3;
} else {
$this->dtgMembers->SortColumnIndex = 2;
}
$this->pxyUnsubscribeEntry = new QControlProxy($this);
$this->pxyUnsubscribeEntry->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to unsubscribe this person from the list?'));
$this->pxyUnsubscribeEntry->AddAction(new QClickEvent(), new QAjaxAction('pxyUnsubscribeEntry_Click'));
$this->pxyUnsubscribeEntry->AddAction(new QClickEvent(), new QTerminateAction());
$this->pxyUnsubscribePerson = new QControlProxy($this);
$this->pxyUnsubscribePerson->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to unsubscribe this person from the list?'));
$this->pxyUnsubscribePerson->AddAction(new QClickEvent(), new QAjaxAction('pxyUnsubscribePerson_Click'));
$this->pxyUnsubscribePerson->AddAction(new QClickEvent(), new QTerminateAction());
$this->dtgMembers->SetDataBinder('dtgMembers_Bind');
$this->SetupEmailMessageControls();
}
示例8: Form_Create
protected function Form_Create()
{
$this->objProvisionalPublicLogin = ProvisionalPublicLogin::Load(QApplication::PathInfo(0));
if (!$this->objProvisionalPublicLogin || $this->objProvisionalPublicLogin->UrlHash != QApplication::PathInfo(1)) {
QApplication::Redirect('/register/');
}
}
示例9: Form_Create
protected function Form_Create()
{
parent::Form_Create();
if (QApplication::GetUserId() == NarroUser::ANONYMOUS_USER_ID) {
QApplication::Redirect(NarroLink::ProjectList());
exit;
}
if (QApplication::GetUserId() != QApplication::QueryString('u') && QApplication::HasPermissionForThisLang('Can manage users', null)) {
$this->objUser = NarroUser::Load(QApplication::QueryString('u'));
}
if (!$this->objUser instanceof NarroUser) {
$this->objUser = QApplication::$User;
}
$this->pnlBreadcrumb->setElements(NarroLink::ProjectList(t('Projects')), NarroLink::UserList('', t('Users')), $this->objUser->RealName);
$this->pnlTab = new QTabs($this);
new QPanel($this->pnlTab);
$arrHeaders[] = NarroLink::UserProfile($this->objUser->UserId, t('Profile'));
if (QApplication::GetUserId() == $this->objUser->UserId || QApplication::HasPermissionForThisLang('Can manage users', null)) {
new QPanel($this->pnlTab);
$arrHeaders[] = NarroLink::UserPreferences($this->objUser->UserId, t('Preferences'));
}
new QPanel($this->pnlTab);
$arrHeaders[] = NarroLink::UserRole($this->objUser->UserId, t('Roles'));
if (QApplication::GetUserId() == $this->objUser->UserId || QApplication::HasPermissionForThisLang('Can manage users', null)) {
$this->pnlUser = new NarroUserEditPanel($this->objUser, $this->pnlTab);
$arrHeaders[] = NarroLink::UserEdit($this->objUser->UserId, t('Edit'));
$this->pnlTab->Selected = count($arrHeaders) - 1;
}
$this->pnlTab->Headers = $arrHeaders;
}
示例10: btnSubmitNote_Click
protected function btnSubmitNote_Click($strFormId, $strControlId, $strParameter)
{
//email success
$status = $this->SendMessage();
// return to prayer page
QApplication::Redirect('/prayer/complete_send_note.php/' . $status);
}
示例11: Form_Run
protected function Form_Run()
{
QApplication::$LoadedPage = 'Home';
if ($_SESSION['User'] == '') {
QApplication::Redirect('index.php');
}
}
示例12: btnOkay_Click
protected function btnOkay_Click($strFormId, $strControlId, $strParameter)
{
if (array_key_exists('strReferer', $_GET)) {
QApplication::Redirect('/login?strReferer=' . urlencode($_GET['strReferer']));
} else {
QApplication::Redirect('/login/');
}
}
示例13: pxyDelete_Click
public function pxyDelete_Click($strFormId, $strControlId, $strParameter)
{
QApplication::DisplayAlert(sprintf('Receipts for %s have been deleted.', $strParameter));
foreach ($this->GetFileArrayForYear($strParameter) as $strFile) {
unlink(RECEIPT_PDF_PATH . '/' . $strFile);
}
QApplication::Redirect('/stewardship/receipts/');
}
示例14: pxyDelete_Click
public function pxyDelete_Click($strFormId, $strControlId, $strParameter)
{
QApplication::DisplayAlert(sprintf('Reports for %s have been deleted.', $strParameter));
foreach ($this->GetFileArrayForYear($strParameter) as $strFile) {
unlink(STATISTICS_PDF_PATH . '/' . $strFile);
}
QApplication::Redirect('/stewardship/reports/giving_statistics.php');
}
示例15: Redirect
protected function Redirect()
{
$objConstant = QcodoConstant::Load(QApplication::PathInfo(0));
if ($objConstant) {
QApplication::Redirect('/index.php/' . $this->objConstant->QcodoClass->Name . '/Constants');
} else {
QApplication::Redirect('/index.php');
}
}