1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | namespace Aurora\Modules\FilesTableviewWebclientPlugin; |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | class Module extends \Aurora\System\Module\AbstractWebclientModule |
20: | { |
21: | public function init() |
22: | { |
23: | } |
24: | |
25: | |
26: | |
27: | |
28: | |
29: | |
30: | public function GetSettings() |
31: | { |
32: | \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::Anonymous); |
33: | |
34: | $oUser = \Aurora\System\Api::getAuthenticatedUser(); |
35: | if (!empty($oUser) && $oUser->isNormalOrTenant()) { |
36: | return array( |
37: | 'EnableModule' => $oUser->{self::GetName().'::EnableModule'}, |
38: | 'EnablePreviewPane' => $oUser->{self::GetName().'::EnablePreviewPane'} |
39: | ); |
40: | } |
41: | |
42: | return null; |
43: | } |
44: | |
45: | |
46: | |
47: | |
48: | |
49: | |
50: | |
51: | public function UpdateSettings($EnableModule, $EnablePreviewPane) |
52: | { |
53: | \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::NormalUser); |
54: | |
55: | $iUserId = \Aurora\System\Api::getAuthenticatedUserId(); |
56: | if (0 < $iUserId) { |
57: | $oUser = \Aurora\Modules\Core\Module::Decorator()->GetUserUnchecked($iUserId); |
58: | $oUser->setExtendedProp(self::GetName().'::EnableModule', $EnableModule); |
59: | $oUser->setExtendedProp(self::GetName().'::EnablePreviewPane', $EnablePreviewPane); |
60: | \Aurora\Modules\Core\Module::Decorator()->UpdateUserObject($oUser); |
61: | } |
62: | return true; |
63: | } |
64: | } |
65: | |