summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/php/controls/UpcomingEvents.php10
-rw-r--r--app/php/pages/Profile.page1
2 files changed, 10 insertions, 1 deletions
diff --git a/app/php/controls/UpcomingEvents.php b/app/php/controls/UpcomingEvents.php
index 27fa8c6..3b0869a 100644
--- a/app/php/controls/UpcomingEvents.php
+++ b/app/php/controls/UpcomingEvents.php
@@ -4,6 +4,14 @@ Prado::using('Application.facades.EventFacade');
class UpcomingEvents 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');
}
@@ -24,7 +32,7 @@ class UpcomingEvents extends TTemplateControl {
$utc = new DateTimeZone('UTC');
$dateFrom = new DateTime('now', $utc);
$dateTo = new DateTime('+7 days', $utc);
- return EventFacade::getInstance()->getTimeframeListForUser(
+ return $this->getFacade()->getTimeframeListForUser(
$user,
$dateFrom, $dateTo
);
diff --git a/app/php/pages/Profile.page b/app/php/pages/Profile.page
index d9c84c1..7bd6718 100644
--- a/app/php/pages/Profile.page
+++ b/app/php/pages/Profile.page
@@ -14,5 +14,6 @@
<br />
<com:UpcomingEvents>
<prop:UserToDisplay><%= $this->User %></prop:UserToDisplay>
+ <prop:Facade><%= EventFacade::getInstance() %></prop:Facade>
</com:UpcomingEvents>
</com:TContent>