Rev 1267 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1267 | Rev 1293 | ||
---|---|---|---|
Line 63... | Line 63... | ||
63 | } |
63 | } |
64 | } |
64 | } |
65 | } |
65 | } |
66 | 66 | ||
67 | /** |
67 | /** |
68 | * @param string $actionID |
- | |
69 | * @param array $params |
68 | * @param array $params |
70 | * @return array |
69 | * @return array |
71 | * @throws OIDplusException |
70 | * @throws OIDplusException |
72 | */ |
71 | */ |
73 | public function action(string $actionID, array $params): array { |
72 | private function action_Update(array $params): array { |
74 | if ($actionID == 'color_update') { |
- | |
75 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
73 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
76 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null, 401); |
74 | throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null, 401); |
77 | } |
75 | } |
- | 76 | ||
- | 77 | _CheckParamExists($params, 'hue_shift'); |
|
- | 78 | _CheckParamExists($params, 'sat_shift'); |
|
- | 79 | _CheckParamExists($params, 'val_shift'); |
|
- | 80 | _CheckParamExists($params, 'invcolors'); |
|
- | 81 | _CheckParamExists($params, 'theme'); |
|
- | 82 | ||
- | 83 | OIDplus::config()->setValue('color_hue_shift', $params['hue_shift']); |
|
- | 84 | OIDplus::config()->setValue('color_sat_shift', $params['sat_shift']); |
|
- | 85 | OIDplus::config()->setValue('color_val_shift', $params['val_shift']); |
|
- | 86 | OIDplus::config()->setValue('color_invert', $params['invcolors']); |
|
- | 87 | OIDplus::config()->setValue('design', $params['theme']); |
|
78 | 88 | ||
79 | _CheckParamExists($params, 'hue_shift'); |
- | |
80 | _CheckParamExists($params, 'sat_shift'); |
- | |
81 | _CheckParamExists($params, 'val_shift'); |
- | |
82 | _CheckParamExists($params, 'invcolors'); |
- | |
83 | _CheckParamExists($params, 'theme'); |
- | |
84 | - | ||
85 | OIDplus::config()->setValue('color_hue_shift', $params['hue_shift']); |
- | |
86 | OIDplus::config()->setValue('color_sat_shift', $params['sat_shift']); |
- | |
87 | OIDplus::config()->setValue('color_val_shift', $params['val_shift']); |
- | |
88 | OIDplus::config()->setValue('color_invert', $params['invcolors']); |
- | |
89 | OIDplus::config()->setValue('design', $params['theme']); |
89 | OIDplus::logger()->log("V2:[OK/INFO]A", "Changed system color theme"); |
90 | 90 | ||
91 | OIDplus::logger()->log("V2:[OK/INFO]A", "Changed system color theme"); |
91 | return array("status" => 0); |
- | 92 | } |
|
92 | 93 | ||
- | 94 | /** |
|
- | 95 | * @param string $actionID |
|
- | 96 | * @param array $params |
|
- | 97 | * @return array |
|
- | 98 | * @throws OIDplusException |
|
- | 99 | */ |
|
- | 100 | public function action(string $actionID, array $params): array { |
|
- | 101 | if ($actionID == 'color_update') { |
|
93 | return array("status" => 0); |
102 | return $this->action_Update($params); |
94 | } else { |
103 | } else { |
95 | return parent::action($actionID, $params); |
104 | return parent::action($actionID, $params); |
96 | } |
105 | } |
97 | } |
106 | } |
98 | 107 |