summaryrefslogtreecommitdiff
path: root/app/php/controls/UserSelection.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/php/controls/UserSelection.php')
-rw-r--r--app/php/controls/UserSelection.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/app/php/controls/UserSelection.php b/app/php/controls/UserSelection.php
new file mode 100644
index 0000000..6ae68e4
--- /dev/null
+++ b/app/php/controls/UserSelection.php
@@ -0,0 +1,39 @@
+<?php
+
+Prado::using('Application.facades.CalendarFacade');
+
+class UserSelection extends TTemplateControl {
+
+ public function getUserToDisplay() {
+ return $this->getControlState('user');
+ }
+
+ public function setUserToDisplay($user) {
+ $this->setControlState('user', $user);
+ }
+
+ public function onPreRender($param) {
+ parent::onPreRender($param);
+ $this->Categories->setDataSource(
+ $this->_getUserSelection($this->UserToDisplay)
+ );
+ $this->Categories->dataBind();
+ }
+
+ public function categoryDataBind($sender, $param) {
+ $param->Item->Calendars->setDataSource($param->Item->Data->Calendars);
+ $param->Item->Calendars->dataBind();
+ }
+
+ public function removeFromSelection($sender, $param) {
+ if (!$this->UserToDisplay->IsGuest) {
+ }
+ }
+
+ private function _getUserSelection(DbUser $user) {
+ return CalendarFacade::getInstance()->getPreferenceList($user);
+ }
+
+}
+
+?>