blob: 8e7995164e96ed3b8db8ce3e14935df239bbd2b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<?php
Prado::using('Application.web.FacadeTemplateControl');
Prado::using('Application.user.DbUser');
Prado::using('Application.facades.UserFacade');
Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
class ViewPreference extends FacadeTemplateControl {
public function getUserToChange() {
return $this->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
);
}
}
?>
|