当前位置: 首页>>代码示例>>PHP>>正文


PHP Pages::UrlFromId方法代码示例

本文整理汇总了PHP中Pages::UrlFromId方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::UrlFromId方法的具体用法?PHP Pages::UrlFromId怎么用?PHP Pages::UrlFromId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pages的用法示例。


在下文中一共展示了Pages::UrlFromId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSuccessfulValidateCallsRedirectToNormalPageWhenNoRequestedPage

 public function testSuccessfulValidateCallsRedirectToNormalPageWhenNoRequestedPage()
 {
     $userSession = new UserSession(1);
     $userSession->HomepageId = 2;
     $this->fakeServer->UserSession = $userSession;
     $this->auth->_ValidateResult = true;
     $this->presenter->Login();
     $this->assertEquals(Pages::UrlFromId(2), $this->page->_LastRedirect);
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:9,代码来源:LoginPresenterTests.php

示例2: testRedirectsToHomepageIfUserIsActive

 public function testRedirectsToHomepageIfUserIsActive()
 {
     $this->user->SetStatus(AccountStatus::ACTIVE);
     $this->user->ChangeDefaultHomePage(2);
     $this->postRegistration->HandleSelfRegistration($this->user, $this->page, $this->context);
     $this->assertTrue($this->fakeAuth->_LoginCalled);
     $this->assertEquals($this->user->EmailAddress(), $this->fakeAuth->_LastLogin);
     $this->assertFalse($this->fakeAuth->_LastLoginContext->GetData()->Persist);
     $this->assertEquals(Pages::UrlFromId(2), $this->page->_RedirectDestination);
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:10,代码来源:PostRegistrationTests.php

示例3: HandleSelfRegistration

 public function HandleSelfRegistration(User $user, IRegistrationPage $page, ILoginContext $loginContext)
 {
     if ($user->StatusId() == AccountStatus::ACTIVE) {
         Log::Debug('PostRegistration - Handling activate user %s', $user->EmailAddress());
         $this->authentication->Login($user->EmailAddress(), $loginContext);
         $page->Redirect(Pages::UrlFromId($user->Homepage()));
     } else {
         Log::Debug('PostRegistration - Handling pending user %s', $user->EmailAddress());
         $this->activation->Notify($user);
         $page->Redirect(Pages::ACTIVATION);
     }
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:12,代码来源:PostRegistration.php

示例4: testActivatesAccount

 public function testActivatesAccount()
 {
     $user = new FakeUser(12);
     $activationSuccess = new ActivationResult(true, $user);
     $this->accountActivation->_ActivationResult = $activationSuccess;
     $activationCode = uniqid();
     $this->page->expects($this->once())->method('GetActivationCode')->will($this->returnValue($activationCode));
     $this->page->expects($this->once())->method('Redirect')->with($this->equalTo(Pages::UrlFromId($user->Homepage())));
     $this->presenter->PageLoad();
     $this->assertEquals($activationCode, $this->accountActivation->_LastActivationCode);
     $this->assertTrue($this->auth->_LoginCalled);
     $this->assertEquals($user->EmailAddress(), $this->auth->_LastLogin);
     $this->assertEquals(new WebLoginContext(new LoginData(false, $user->Language())), $this->auth->_LastLoginContext);
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:14,代码来源:ActivationPresenterTests.php

示例5: PageLoad

 public function PageLoad()
 {
     $activationCode = $this->page->GetActivationCode();
     if (empty($activationCode)) {
         $this->page->ShowSent();
     } else {
         $activationResult = $this->accountActivation->Activate($activationCode);
         if ($activationResult->Activated()) {
             $user = $activationResult->User();
             $this->authentication->Login($user->EmailAddress(), new WebLoginContext(new LoginData(false, $user->Language())));
             $this->page->Redirect(Pages::UrlFromId($user->Homepage()));
         } else {
             $this->page->ShowError();
         }
     }
 }
开发者ID:ksdtech,项目名称:booked,代码行数:16,代码来源:ActivationPresenter.php

示例6: _Redirect

 private function _Redirect()
 {
     $redirect = $this->_page->GetResumeUrl();
     if (!empty($redirect)) {
         $this->_page->Redirect(html_entity_decode($redirect));
     } else {
         $defaultId = ServiceLocator::GetServer()->GetUserSession()->HomepageId;
         $url = Pages::UrlFromId($defaultId);
         $this->_page->Redirect(empty($url) ? Pages::UrlFromId(Pages::DEFAULT_HOMEPAGE_ID) : $url);
     }
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:11,代码来源:LoginPresenter.php

示例7: __construct

 protected function __construct($titleKey = '', $pageDepth = 0)
 {
     $this->SetSecurityHeaders();
     $this->path = str_repeat('../', $pageDepth);
     $this->server = ServiceLocator::GetServer();
     $resources = Resources::GetInstance();
     ExceptionHandler::SetExceptionHandler(new WebExceptionHandler(array($this, 'RedirectToError')));
     $this->smarty = new SmartyPage($resources, $this->path);
     $userSession = ServiceLocator::GetServer()->GetUserSession();
     $this->smarty->assign('Charset', $resources->Charset);
     $this->smarty->assign('CurrentLanguage', $resources->CurrentLanguage);
     $this->smarty->assign('HtmlLang', $resources->HtmlLang);
     $this->smarty->assign('HtmlTextDirection', $resources->TextDirection);
     $this->smarty->assign('Title', 'Booked - ' . $resources->GetString($titleKey));
     $this->smarty->assign('CalendarJSFile', $resources->CalendarLanguageFile);
     $this->smarty->assign('LoggedIn', $userSession->IsLoggedIn());
     $this->smarty->assign('Version', Configuration::VERSION);
     $this->smarty->assign('Path', $this->path);
     $this->smarty->assign('ScriptUrl', Configuration::Instance()->GetScriptUrl());
     $this->smarty->assign('UserName', !is_null($userSession) ? $userSession->FirstName : '');
     $this->smarty->assign('DisplayWelcome', $this->DisplayWelcome());
     $this->smarty->assign('UserId', $userSession->UserId);
     $this->smarty->assign('CanViewAdmin', $userSession->IsAdmin);
     $this->smarty->assign('CanViewGroupAdmin', $userSession->IsGroupAdmin);
     $this->smarty->assign('CanViewResourceAdmin', $userSession->IsResourceAdmin);
     $this->smarty->assign('CanViewScheduleAdmin', $userSession->IsScheduleAdmin);
     $this->smarty->assign('CanViewResponsibilities', !$userSession->IsAdmin && ($userSession->IsGroupAdmin || $userSession->IsResourceAdmin || $userSession->IsScheduleAdmin));
     $allowAllUsersToReports = Configuration::Instance()->GetSectionKey(ConfigSection::REPORTS, ConfigKeys::REPORTS_ALLOW_ALL, new BooleanConverter());
     $this->smarty->assign('CanViewReports', $allowAllUsersToReports || $userSession->IsAdmin || $userSession->IsGroupAdmin || $userSession->IsResourceAdmin || $userSession->IsScheduleAdmin);
     $timeout = Configuration::Instance()->GetKey(ConfigKeys::INACTIVITY_TIMEOUT);
     if (!empty($timeout)) {
         $this->smarty->assign('SessionTimeoutSeconds', max($timeout, 1) * 60);
     }
     $this->smarty->assign('ShouldLogout', $this->GetShouldAutoLogout());
     $this->smarty->assign('CssExtensionFile', Configuration::Instance()->GetKey(ConfigKeys::CSS_EXTENSION_FILE));
     $this->smarty->assign('UseLocalJquery', Configuration::Instance()->GetKey(ConfigKeys::USE_LOCAL_JQUERY, new BooleanConverter()));
     $this->smarty->assign('EnableConfigurationPage', Configuration::Instance()->GetSectionKey(ConfigSection::PAGES, ConfigKeys::PAGES_ENABLE_CONFIGURATION, new BooleanConverter()));
     $this->smarty->assign('ShowParticipation', !Configuration::Instance()->GetSectionKey(ConfigSection::RESERVATION, ConfigKeys::RESERVATION_PREVENT_PARTICIPATION, new BooleanConverter()));
     $this->smarty->assign('LogoUrl', 'booked.png');
     if (file_exists($this->path . 'img/custom-logo.png')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.png');
     }
     if (file_exists($this->path . 'img/custom-logo.gif')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.gif');
     }
     if (file_exists($this->path . 'img/custom-logo.jpg')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.jpg');
     }
     $this->smarty->assign('CssUrl', 'null-style.css');
     if (file_exists($this->path . 'css/custom-style.css')) {
         $this->smarty->assign('CssUrl', 'custom-style.css');
     }
     $logoUrl = Configuration::Instance()->GetKey(ConfigKeys::HOME_URL);
     if (empty($logoUrl)) {
         $logoUrl = $this->path . Pages::UrlFromId($userSession->HomepageId);
     }
     $this->smarty->assign('HomeUrl', $logoUrl);
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:58,代码来源:Page.php


注:本文中的Pages::UrlFromId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。