本文整理汇总了PHP中PluginManager::Instance方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::Instance方法的具体用法?PHP PluginManager::Instance怎么用?PHP PluginManager::Instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::Instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$this->presenter = new ManageReservationsPresenter($this, new GroupAdminManageReservationsService(new ReservationViewRepository(), new UserRepository(), new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization())), new ScheduleRepository(), new ResourceRepository(), new AttributeService(new AttributeRepository()), new UserPreferenceRepository());
$this->SetCanUpdateResourceStatus(false);
$this->SetPageId('manage-reservations-group-admin');
}
示例2: __construct
/**
* @param IReservationViewRepository $reservationViewRepository
* @param IReservationAuthorization $authorization
* @param IReservationHandler $reservationHandler
* @param IUpdateReservationPersistenceService $persistenceService
*/
public function __construct(IReservationViewRepository $reservationViewRepository, $authorization = null, $reservationHandler = null, $persistenceService = null)
{
$this->reservationViewRepository = $reservationViewRepository;
$this->reservationAuthorization = $authorization == null ? new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization()) : $authorization;
$this->persistenceService = $persistenceService == null ? new UpdateReservationPersistenceService(new ReservationRepository()) : $persistenceService;
$this->reservationHandler = $reservationHandler == null ? ReservationHandler::Create(ReservationAction::Update, $this->persistenceService, ServiceLocator::GetServer()->GetUserSession()) : $reservationHandler;
}
示例3: __construct
/**
*
* @param $reservationAuthorization IReservationAuthorization
*/
public function __construct($reservationAuthorization = null)
{
$this->reservationAuthorization = $reservationAuthorization;
if (is_null($this->reservationAuthorization)) {
$this->reservationAuthorization = new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization());
}
}
示例4: __construct
public function __construct()
{
parent::__construct();
$userRepository = new UserRepository();
$this->presenter = new ManageReservationsPresenter($this, new ScheduleAdminManageReservationsService(new ReservationViewRepository(), $userRepository, new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization())), new ScheduleAdminScheduleRepository($userRepository, ServiceLocator::GetServer()->GetUserSession()), new ResourceAdminResourceRepository($userRepository, ServiceLocator::GetServer()->GetUserSession()), new AttributeService(new AttributeRepository()), new UserPreferenceRepository());
$this->SetPageId('manage-reservations-schedule-admin');
}
示例5: SetAuthentication
/**
* @param IWebAuthentication $authentication
*/
private function SetAuthentication($authentication)
{
if (is_null($authentication)) {
$this->authentication = new WebAuthentication(PluginManager::Instance()->LoadAuthentication(), ServiceLocator::GetServer());
} else {
$this->authentication = $authentication;
}
}
示例6: __construct
public function __construct()
{
$authorization = new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization());
$service = new CalendarSubscriptionService(new UserRepository(), new ResourceRepository(), new ScheduleRepository());
$subscriptionValidator = new CalendarSubscriptionValidator($this, $service);
$this->presenter = new CalendarSubscriptionPresenter($this, new ReservationViewRepository(), $subscriptionValidator, $service, new PrivacyFilter($authorization));
parent::__construct('', 1);
}
示例7: Approve
/**
* @param IReservationApprovalPage $approvePage
* @param UserSession $userSession
* @return ReservationApprovalPresenter
*/
public function Approve(IReservationApprovalPage $approvePage, UserSession $userSession)
{
$persistenceFactory = new ReservationPersistenceFactory();
$approveAction = ReservationAction::Approve;
$handler = ReservationHandler::Create($approveAction, $persistenceFactory->Create($approveAction), $userSession);
$auth = new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization());
return new ReservationApprovalPresenter($approvePage, $persistenceFactory->Create($approveAction), $handler, $auth, $userSession);
}
示例8: __construct
public function __construct()
{
parent::__construct('MyCalendar', 0);
$userRepository = new UserRepository();
$subscriptionService = new CalendarSubscriptionService($userRepository, new ResourceRepository(), new ScheduleRepository());
$resourceRepository = new ResourceRepository();
$resourceService = new ResourceService($resourceRepository, PluginManager::Instance()->LoadPermission(), new AttributeService(new AttributeRepository()), $userRepository);
$this->presenter = new PersonalCalendarPresenter($this, new ReservationViewRepository(), new CalendarFactory(), $subscriptionService, $userRepository, $resourceService, new ScheduleRepository());
}
示例9: __construct
public function __construct()
{
parent::__construct('ResourceCalendar');
$resourceRepository = new ResourceRepository();
$scheduleRepository = new ScheduleRepository();
$userRepository = new UserRepository();
$resourceService = new ResourceService($resourceRepository, PluginManager::Instance()->LoadPermission(), new AttributeService(new AttributeRepository()), $userRepository);
$subscriptionService = new CalendarSubscriptionService($userRepository, $resourceRepository, $scheduleRepository);
$privacyFilter = new PrivacyFilter(new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization()));
$this->_presenter = new CalendarPresenter($this, new CalendarFactory(), new ReservationViewRepository(), $scheduleRepository, $resourceService, $subscriptionService, $privacyFilter);
}
示例10: PageLoad
public function PageLoad()
{
if (Configuration::Instance()->GetKey(ConfigKeys::DISABLE_PASSWORD_RESET, new BooleanConverter()) || !PluginManager::Instance()->LoadAuthentication()->ShowForgotPasswordPrompt()) {
$this->_page->SetEnabled(false);
return;
}
if ($this->_page->ResetClicked()) {
$this->SendRandomPassword();
$this->_page->ShowResetEmailSent(true);
}
}
示例11: __construct
public function __construct($user = null, $privacyFilter = null, $attributeRepository = null)
{
$this->user = $user;
if ($this->user == null) {
$this->user = ServiceLocator::GetServer()->GetUserSession();
}
$this->privacyFilter = $privacyFilter;
if ($this->privacyFilter == null) {
$this->privacyFilter = new PrivacyFilter(new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization()));
}
$this->attributeRepository = $attributeRepository;
if ($this->attributeRepository == null) {
$this->attributeRepository = new AttributeRepository();
}
}
示例12: PageLoad
public function PageLoad()
{
$this->page->SetAllowedActions(PluginManager::Instance()->LoadAuthentication());
if ($this->page->ResettingPassword()) {
$this->LoadValidators();
if ($this->page->IsValid()) {
$user = $this->GetUser();
$password = $this->page->GetPassword();
$encrypted = $this->passwordEncryption->EncryptPassword($password);
$user->ChangePassword($encrypted->EncryptedPassword(), $encrypted->Salt());
$this->userRepository->Update($user);
$this->page->ShowResetPasswordSuccess(true);
}
}
}
示例13: PageLoad
public function PageLoad()
{
try {
$reservationAction = ReservationAction::Approve;
$factory = new ReservationPersistenceFactory();
$persistenceService = $factory->Create($reservationAction);
$handler = ReservationHandler::Create($reservationAction, $persistenceService, ServiceLocator::GetServer()->GetUserSession());
$auth = new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization());
$presenter = new ReservationApprovalPresenter($this, $persistenceService, $handler, $auth, ServiceLocator::GetServer()->GetUserSession());
$presenter->PageLoad();
} catch (Exception $ex) {
Log::Error('ReservationApprovalPage - Critical error saving reservation: %s', $ex);
$this->Display('Ajax/reservation/reservation_error.tpl');
}
}
示例14: PageLoad
public function PageLoad()
{
$userSession = ServiceLocator::GetServer()->GetUserSession();
Log::Debug('ProfilePresenter loading user %s', $userSession->UserId);
$user = $this->userRepository->LoadById($userSession->UserId);
$this->page->SetUsername($user->Username());
$this->page->SetFirstName($user->FirstName());
$this->page->SetLastName($user->LastName());
$this->page->SetEmail($user->EmailAddress());
$this->page->SetTimezone($user->Timezone());
$this->page->SetHomepage($user->Homepage());
$this->page->SetPhone($user->GetAttribute(UserAttribute::Phone));
$this->page->SetOrganization($user->GetAttribute(UserAttribute::Organization));
$this->page->SetPosition($user->GetAttribute(UserAttribute::Position));
$userId = $userSession->UserId;
$attributes = $this->attributeService->GetAttributes(CustomAttributeCategory::USER, $userId);
$this->page->SetAttributes($attributes->GetAttributes($userId));
$this->PopulateTimezones();
$this->PopulateHomepages();
$this->page->SetAllowedActions(PluginManager::Instance()->LoadAuthentication());
}
示例15: __construct
public function __construct()
{
parent::__construct('AccountActivation');
$userRepo = new UserRepository();
$this->_presenter = new ActivationPresenter($this, new AccountActivation($userRepo, $userRepo), new WebAuthentication(PluginManager::Instance()->LoadAuthentication()));
}