diff options
-rw-r--r-- | app/php/controls/UserSelection.php | 12 | ||||
-rw-r--r-- | app/php/pages/Profile.page | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/app/php/controls/UserSelection.php b/app/php/controls/UserSelection.php index d888a2d..3e2def1 100644 --- a/app/php/controls/UserSelection.php +++ b/app/php/controls/UserSelection.php @@ -4,6 +4,14 @@ Prado::using('Application.facades.CalendarFacade'); class UserSelection extends TTemplateControl { + public function setFacade(Facade $facade) { + $this->setViewState('Facade', $facade); + } + + public function getFacade() { + return $this->getViewState('Facade'); + } + public function getUserToDisplay() { return $this->getControlState('user'); } @@ -27,7 +35,7 @@ class UserSelection extends TTemplateControl { public function removeFromSelection($sender, $param) { if (!$this->UserToDisplay->IsGuest) { - return CalendarFacade::getInstance()->removeFromPreference( + return $this->getFacade()->removeFromPreference( $this->UserToDisplay, $param->CommandParameter ); @@ -35,7 +43,7 @@ class UserSelection extends TTemplateControl { } private function _getUserSelection(DbUser $user) { - return CalendarFacade::getInstance()->getPreferenceList($user); + return $this->getFacade()->getPreferenceList($user); } } diff --git a/app/php/pages/Profile.page b/app/php/pages/Profile.page index 1b11977..d9c84c1 100644 --- a/app/php/pages/Profile.page +++ b/app/php/pages/Profile.page @@ -9,6 +9,7 @@ <br /> <com:UserSelection> <prop:UserToDisplay><%= $this->User %></prop:UserToDisplay> + <prop:Facade><%= CalendarFacade::getInstance() %></prop:Facade> </com:UserSelection> <br /> <com:UpcomingEvents> |