From cf41a3ce705fc57c8082d9688cb48d8133d07b8c Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 16 Jun 2016 11:49:22 +0200 Subject: * group view preference views --- app/frontend/controls/ViewPreference.php | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/frontend/controls/ViewPreference.php (limited to 'app/frontend/controls/ViewPreference.php') diff --git a/app/frontend/controls/ViewPreference.php b/app/frontend/controls/ViewPreference.php new file mode 100644 index 0000000..8e79951 --- /dev/null +++ b/app/frontend/controls/ViewPreference.php @@ -0,0 +1,38 @@ +getControlState('user'); + } + + public function setUserToChange(DbUser $user) { + if (!$this->Page->IsCallBack) { + if ($user->IsGuest) { + throw new TInvalidDataValueException( + Prado::localize( + 'Grouped view preference change impossible for guest user' + ) + ); + } + $this->setControlState('user', $user); + } + } + + public function savePreference($sender, $param) { + $this->getFacade()->setGroupedViewPreference( + $this->UserToChange, + $sender->Checked + ); + } + +} + +?> -- cgit v1.2.3