1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | namespace Aurora\Modules\FilesTableviewWebclientPlugin; |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | class Module extends \Aurora\System\Module\AbstractWebclientModule |
22: | { |
23: | public function init() {} |
24: | |
25: | |
26: | |
27: | |
28: | public static function getInstance() |
29: | { |
30: | return parent::getInstance(); |
31: | } |
32: | |
33: | |
34: | |
35: | |
36: | public static function Decorator() |
37: | { |
38: | return parent::Decorator(); |
39: | } |
40: | |
41: | |
42: | |
43: | |
44: | public function getModuleSettings() |
45: | { |
46: | return $this->oModuleSettings; |
47: | } |
48: | |
49: | |
50: | |
51: | |
52: | |
53: | |
54: | public function GetSettings() |
55: | { |
56: | \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::Anonymous); |
57: | |
58: | $oUser = \Aurora\System\Api::getAuthenticatedUser(); |
59: | if ($oUser && $oUser->isNormalOrTenant()) { |
60: | return array( |
61: | 'EnableModule' => $oUser->getExtendedProp(self::GetName() . '::EnableModule'), |
62: | 'EnablePreviewPane' => $oUser->getExtendedProp(self::GetName() . '::EnablePreviewPane') |
63: | ); |
64: | } |
65: | |
66: | return null; |
67: | } |
68: | |
69: | |
70: | |
71: | |
72: | |
73: | |
74: | |
75: | public function UpdateSettings($EnableModule, $EnablePreviewPane) |
76: | { |
77: | \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::NormalUser); |
78: | |
79: | $iUserId = \Aurora\System\Api::getAuthenticatedUserId(); |
80: | if (0 < $iUserId) { |
81: | $oUser = \Aurora\Modules\Core\Module::Decorator()->GetUserWithoutRoleCheck($iUserId); |
82: | $oUser->setExtendedProp(self::GetName() . '::EnableModule', $EnableModule); |
83: | $oUser->setExtendedProp(self::GetName() . '::EnablePreviewPane', $EnablePreviewPane); |
84: | \Aurora\Modules\Core\Module::Decorator()->UpdateUserObject($oUser); |
85: | } |
86: | return true; |
87: | } |
88: | } |
89: | |