$configs Key-value pairs of the preferences * * @return DataResponse, array{}> * * 200: Preferences updated successfully * 400: Preference invalid */ #[NoAdminRequired] public function setMultiplePreferences(string $appId, array $configs): DataResponse { $userId = $this->userSession->getUser()->getUID(); foreach ($configs as $configKey => $configValue) { $event = new BeforePreferenceSetEvent( $userId, $appId, $configKey, $configValue ); $this->eventDispatcher->dispatchTyped($event); if (!$event->isValid()) { // No listener validated that the preference can be set (to this value) return new DataResponse([], Http::STATUS_BAD_REQUEST); } } foreach ($configs as $configKey => $configValue) { $this->config->setUserValue( $userId, $appId, $configKey, $configValue ); } return new DataResponse(); } /** * @NoSubAdminRequired * * Update a preference value of an app * * @param string $appId ID of the app * @param string $configKey Key of the preference * @param string $configValue New value * @return DataResponse, array{}> * * 200: Preference updated successfully * 400: Preference invalid */ #[NoAdminRequired] public function setPreference(string $appId, string $configKey, string $configValue): DataResponse { $userId = $this->userSession->getUser()->getUID(); $event = new BeforePreferenceSetEvent( $userId, $appId, $configKey, $configValue ); $this->eventDispatcher->dispatchTyped($event); if (!$event->isValid()) { // No listener validated that the preference can be set (to this value) return new DataResponse([], Http::STATUS_BAD_REQUEST); } $this->config->setUserValue( $userId, $appId, $configKey, $configValue ); return new DataResponse(); } /** * @NoSubAdminRequired * * Delete multiple preferences for an app * * @param string $appId ID of the app * @param list $configKeys Keys to delete * * @return DataResponse, array{}> * * 200: Preferences deleted successfully * 400: Preference invalid */ #[NoAdminRequired] public function deleteMultiplePreference(string $appId, array $configKeys): DataResponse { $userId = $this->userSession->getUser()->getUID(); foreach ($configKeys as $configKey) { $event = new BeforePreferenceDeletedEvent( $userId, $appId, $configKey ); $this->eventDispatcher->dispatchTyped($event); if (!$event->isValid()) { // No listener validated that the preference can be deleted return new DataResponse([], Http::STATUS_BAD_REQUEST); } } foreach ($configKeys as $configKey) { $this->config->deleteUserValue( $userId, $appId, $configKey ); } return new DataResponse(); } /** * @NoSubAdminRequired * * Delete a preference for an app * * @param string $appId ID of the app * @param string $configKey Key to delete * @return DataResponse, array{}> * * 200: Preference deleted successfully * 400: Preference invalid */ #[NoAdminRequired] public function deletePreference(string $appId, string $configKey): DataResponse { $userId = $this->userSession->getUser()->getUID(); $event = new BeforePreferenceDeletedEvent( $userId, $appId, $configKey ); $this->eventDispatcher->dispatchTyped($event); if (!$event->isValid()) { // No listener validated that the preference can be deleted return new DataResponse([], Http::STATUS_BAD_REQUEST); } $this->config->deleteUserValue( $userId, $appId, $configKey ); return new DataResponse(); } } -0'>release-0-13-0 Apache XML Graphics FOP: https://github.com/apache/xmlgraphics-fopwww-data
aboutsummaryrefslogtreecommitdiffstats
blob: 242f5f25ef1c6b700442094f1a0701131748a38f (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