@@ -40,196 +40,196 @@ |
||
40 | 40 | */ |
41 | 41 | class Defaults { |
42 | 42 | |
43 | - /** |
|
44 | - * \OC_Defaults instance to retrieve the defaults |
|
45 | - * @since 6.0.0 |
|
46 | - */ |
|
47 | - private $defaults; |
|
48 | - |
|
49 | - /** |
|
50 | - * creates a \OC_Defaults instance which is used in all methods to retrieve the |
|
51 | - * actual defaults |
|
52 | - * @since 6.0.0 |
|
53 | - */ |
|
54 | - public function __construct(\OC_Defaults $defaults = null) { |
|
55 | - if ($defaults === null) { |
|
56 | - $defaults = \OC::$server->getThemingDefaults(); |
|
57 | - } |
|
58 | - $this->defaults = $defaults; |
|
59 | - } |
|
60 | - |
|
61 | - /** |
|
62 | - * get base URL for the organisation behind your ownCloud instance |
|
63 | - * @return string |
|
64 | - * @since 6.0.0 |
|
65 | - */ |
|
66 | - public function getBaseUrl(): string { |
|
67 | - return $this->defaults->getBaseUrl(); |
|
68 | - } |
|
69 | - |
|
70 | - /** |
|
71 | - * link to the desktop sync client |
|
72 | - * @return string |
|
73 | - * @since 6.0.0 |
|
74 | - */ |
|
75 | - public function getSyncClientUrl(): string { |
|
76 | - return $this->defaults->getSyncClientUrl(); |
|
77 | - } |
|
78 | - |
|
79 | - /** |
|
80 | - * link to the iOS client |
|
81 | - * @return string |
|
82 | - * @since 8.0.0 |
|
83 | - */ |
|
84 | - public function getiOSClientUrl(): string { |
|
85 | - return $this->defaults->getiOSClientUrl(); |
|
86 | - } |
|
87 | - |
|
88 | - /** |
|
89 | - * link to the Android client |
|
90 | - * @return string |
|
91 | - * @since 8.0.0 |
|
92 | - */ |
|
93 | - public function getAndroidClientUrl(): string { |
|
94 | - return $this->defaults->getAndroidClientUrl(); |
|
95 | - } |
|
96 | - |
|
97 | - /** |
|
98 | - * link to the Android client on F-Droid |
|
99 | - * @return string |
|
100 | - * @since 23.0.0 |
|
101 | - */ |
|
102 | - public function getFDroidClientUrl() { |
|
103 | - return $this->defaults->getFDroidClientUrl(); |
|
104 | - } |
|
105 | - |
|
106 | - /** |
|
107 | - * base URL to the documentation of your ownCloud instance |
|
108 | - * @return string |
|
109 | - * @since 6.0.0 |
|
110 | - */ |
|
111 | - public function getDocBaseUrl(): string { |
|
112 | - return $this->defaults->getDocBaseUrl(); |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * name of your Nextcloud instance (e.g. MyPrivateCloud) |
|
117 | - * @return string |
|
118 | - * @since 6.0.0 |
|
119 | - */ |
|
120 | - public function getName(): string { |
|
121 | - return $this->defaults->getName(); |
|
122 | - } |
|
123 | - |
|
124 | - /** |
|
125 | - * Name of the software product (defaults to Nextcloud) |
|
126 | - * |
|
127 | - * @return string |
|
128 | - * @since 22.0.0 |
|
129 | - */ |
|
130 | - public function getProductName(): string { |
|
131 | - return $this->defaults->getProductName(); |
|
132 | - } |
|
133 | - |
|
134 | - /** |
|
135 | - * name of your ownCloud instance containing HTML styles |
|
136 | - * @return string |
|
137 | - * @since 8.0.0 |
|
138 | - * @deprecated 22.0.0 |
|
139 | - */ |
|
140 | - public function getHTMLName(): string { |
|
141 | - return $this->defaults->getHTMLName(); |
|
142 | - } |
|
143 | - |
|
144 | - /** |
|
145 | - * Entity behind your onwCloud instance |
|
146 | - * @return string |
|
147 | - * @since 6.0.0 |
|
148 | - */ |
|
149 | - public function getEntity(): string { |
|
150 | - return $this->defaults->getEntity(); |
|
151 | - } |
|
152 | - |
|
153 | - /** |
|
154 | - * ownCloud slogan |
|
155 | - * @return string |
|
156 | - * @since 6.0.0 |
|
157 | - */ |
|
158 | - public function getSlogan(?string $lang = null): string { |
|
159 | - return $this->defaults->getSlogan($lang); |
|
160 | - } |
|
161 | - |
|
162 | - /** |
|
163 | - * footer, short version |
|
164 | - * @return string |
|
165 | - * @since 6.0.0 |
|
166 | - */ |
|
167 | - public function getShortFooter(): string { |
|
168 | - return $this->defaults->getShortFooter(); |
|
169 | - } |
|
170 | - |
|
171 | - /** |
|
172 | - * footer, long version |
|
173 | - * @return string |
|
174 | - * @since 6.0.0 |
|
175 | - */ |
|
176 | - public function getLongFooter(): string { |
|
177 | - return $this->defaults->getLongFooter(); |
|
178 | - } |
|
179 | - |
|
180 | - /** |
|
181 | - * Returns the AppId for the App Store for the iOS Client |
|
182 | - * @return string AppId |
|
183 | - * @since 8.0.0 |
|
184 | - */ |
|
185 | - public function getiTunesAppId(): string { |
|
186 | - return $this->defaults->getiTunesAppId(); |
|
187 | - } |
|
188 | - |
|
189 | - /** |
|
190 | - * Themed logo url |
|
191 | - * |
|
192 | - * @param bool $useSvg Whether to point to the SVG image or a fallback |
|
193 | - * @return string |
|
194 | - * @since 12.0.0 |
|
195 | - */ |
|
196 | - public function getLogo(bool $useSvg = true): string { |
|
197 | - return $this->defaults->getLogo($useSvg); |
|
198 | - } |
|
199 | - |
|
200 | - /** |
|
201 | - * Returns primary color |
|
202 | - * @return string |
|
203 | - * @since 12.0.0 |
|
204 | - */ |
|
205 | - public function getColorPrimary(): string { |
|
206 | - return $this->defaults->getColorPrimary(); |
|
207 | - } |
|
208 | - |
|
209 | - /** |
|
210 | - * @param string $key |
|
211 | - * @return string URL to doc with key |
|
212 | - * @since 12.0.0 |
|
213 | - */ |
|
214 | - public function buildDocLinkToKey(string $key): string { |
|
215 | - return $this->defaults->buildDocLinkToKey($key); |
|
216 | - } |
|
217 | - |
|
218 | - /** |
|
219 | - * Returns the title |
|
220 | - * @return string title |
|
221 | - * @since 12.0.0 |
|
222 | - */ |
|
223 | - public function getTitle(): string { |
|
224 | - return $this->defaults->getTitle(); |
|
225 | - } |
|
226 | - |
|
227 | - /** |
|
228 | - * Returns primary color |
|
229 | - * @return string |
|
230 | - * @since 13.0.0 |
|
231 | - */ |
|
232 | - public function getTextColorPrimary(): string { |
|
233 | - return $this->defaults->getTextColorPrimary(); |
|
234 | - } |
|
43 | + /** |
|
44 | + * \OC_Defaults instance to retrieve the defaults |
|
45 | + * @since 6.0.0 |
|
46 | + */ |
|
47 | + private $defaults; |
|
48 | + |
|
49 | + /** |
|
50 | + * creates a \OC_Defaults instance which is used in all methods to retrieve the |
|
51 | + * actual defaults |
|
52 | + * @since 6.0.0 |
|
53 | + */ |
|
54 | + public function __construct(\OC_Defaults $defaults = null) { |
|
55 | + if ($defaults === null) { |
|
56 | + $defaults = \OC::$server->getThemingDefaults(); |
|
57 | + } |
|
58 | + $this->defaults = $defaults; |
|
59 | + } |
|
60 | + |
|
61 | + /** |
|
62 | + * get base URL for the organisation behind your ownCloud instance |
|
63 | + * @return string |
|
64 | + * @since 6.0.0 |
|
65 | + */ |
|
66 | + public function getBaseUrl(): string { |
|
67 | + return $this->defaults->getBaseUrl(); |
|
68 | + } |
|
69 | + |
|
70 | + /** |
|
71 | + * link to the desktop sync client |
|
72 | + * @return string |
|
73 | + * @since 6.0.0 |
|
74 | + */ |
|
75 | + public function getSyncClientUrl(): string { |
|
76 | + return $this->defaults->getSyncClientUrl(); |
|
77 | + } |
|
78 | + |
|
79 | + /** |
|
80 | + * link to the iOS client |
|
81 | + * @return string |
|
82 | + * @since 8.0.0 |
|
83 | + */ |
|
84 | + public function getiOSClientUrl(): string { |
|
85 | + return $this->defaults->getiOSClientUrl(); |
|
86 | + } |
|
87 | + |
|
88 | + /** |
|
89 | + * link to the Android client |
|
90 | + * @return string |
|
91 | + * @since 8.0.0 |
|
92 | + */ |
|
93 | + public function getAndroidClientUrl(): string { |
|
94 | + return $this->defaults->getAndroidClientUrl(); |
|
95 | + } |
|
96 | + |
|
97 | + /** |
|
98 | + * link to the Android client on F-Droid |
|
99 | + * @return string |
|
100 | + * @since 23.0.0 |
|
101 | + */ |
|
102 | + public function getFDroidClientUrl() { |
|
103 | + return $this->defaults->getFDroidClientUrl(); |
|
104 | + } |
|
105 | + |
|
106 | + /** |
|
107 | + * base URL to the documentation of your ownCloud instance |
|
108 | + * @return string |
|
109 | + * @since 6.0.0 |
|
110 | + */ |
|
111 | + public function getDocBaseUrl(): string { |
|
112 | + return $this->defaults->getDocBaseUrl(); |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * name of your Nextcloud instance (e.g. MyPrivateCloud) |
|
117 | + * @return string |
|
118 | + * @since 6.0.0 |
|
119 | + */ |
|
120 | + public function getName(): string { |
|
121 | + return $this->defaults->getName(); |
|
122 | + } |
|
123 | + |
|
124 | + /** |
|
125 | + * Name of the software product (defaults to Nextcloud) |
|
126 | + * |
|
127 | + * @return string |
|
128 | + * @since 22.0.0 |
|
129 | + */ |
|
130 | + public function getProductName(): string { |
|
131 | + return $this->defaults->getProductName(); |
|
132 | + } |
|
133 | + |
|
134 | + /** |
|
135 | + * name of your ownCloud instance containing HTML styles |
|
136 | + * @return string |
|
137 | + * @since 8.0.0 |
|
138 | + * @deprecated 22.0.0 |
|
139 | + */ |
|
140 | + public function getHTMLName(): string { |
|
141 | + return $this->defaults->getHTMLName(); |
|
142 | + } |
|
143 | + |
|
144 | + /** |
|
145 | + * Entity behind your onwCloud instance |
|
146 | + * @return string |
|
147 | + * @since 6.0.0 |
|
148 | + */ |
|
149 | + public function getEntity(): string { |
|
150 | + return $this->defaults->getEntity(); |
|
151 | + } |
|
152 | + |
|
153 | + /** |
|
154 | + * ownCloud slogan |
|
155 | + * @return string |
|
156 | + * @since 6.0.0 |
|
157 | + */ |
|
158 | + public function getSlogan(?string $lang = null): string { |
|
159 | + return $this->defaults->getSlogan($lang); |
|
160 | + } |
|
161 | + |
|
162 | + /** |
|
163 | + * footer, short version |
|
164 | + * @return string |
|
165 | + * @since 6.0.0 |
|
166 | + */ |
|
167 | + public function getShortFooter(): string { |
|
168 | + return $this->defaults->getShortFooter(); |
|
169 | + } |
|
170 | + |
|
171 | + /** |
|
172 | + * footer, long version |
|
173 | + * @return string |
|
174 | + * @since 6.0.0 |
|
175 | + */ |
|
176 | + public function getLongFooter(): string { |
|
177 | + return $this->defaults->getLongFooter(); |
|
178 | + } |
|
179 | + |
|
180 | + /** |
|
181 | + * Returns the AppId for the App Store for the iOS Client |
|
182 | + * @return string AppId |
|
183 | + * @since 8.0.0 |
|
184 | + */ |
|
185 | + public function getiTunesAppId(): string { |
|
186 | + return $this->defaults->getiTunesAppId(); |
|
187 | + } |
|
188 | + |
|
189 | + /** |
|
190 | + * Themed logo url |
|
191 | + * |
|
192 | + * @param bool $useSvg Whether to point to the SVG image or a fallback |
|
193 | + * @return string |
|
194 | + * @since 12.0.0 |
|
195 | + */ |
|
196 | + public function getLogo(bool $useSvg = true): string { |
|
197 | + return $this->defaults->getLogo($useSvg); |
|
198 | + } |
|
199 | + |
|
200 | + /** |
|
201 | + * Returns primary color |
|
202 | + * @return string |
|
203 | + * @since 12.0.0 |
|
204 | + */ |
|
205 | + public function getColorPrimary(): string { |
|
206 | + return $this->defaults->getColorPrimary(); |
|
207 | + } |
|
208 | + |
|
209 | + /** |
|
210 | + * @param string $key |
|
211 | + * @return string URL to doc with key |
|
212 | + * @since 12.0.0 |
|
213 | + */ |
|
214 | + public function buildDocLinkToKey(string $key): string { |
|
215 | + return $this->defaults->buildDocLinkToKey($key); |
|
216 | + } |
|
217 | + |
|
218 | + /** |
|
219 | + * Returns the title |
|
220 | + * @return string title |
|
221 | + * @since 12.0.0 |
|
222 | + */ |
|
223 | + public function getTitle(): string { |
|
224 | + return $this->defaults->getTitle(); |
|
225 | + } |
|
226 | + |
|
227 | + /** |
|
228 | + * Returns primary color |
|
229 | + * @return string |
|
230 | + * @since 13.0.0 |
|
231 | + */ |
|
232 | + public function getTextColorPrimary(): string { |
|
233 | + return $this->defaults->getTextColorPrimary(); |
|
234 | + } |
|
235 | 235 | } |
@@ -31,91 +31,91 @@ |
||
31 | 31 | * @since 9.0.0 |
32 | 32 | */ |
33 | 33 | interface IManager extends IApp, INotifier { |
34 | - /** |
|
35 | - * @param string $appClass The service must implement IApp, otherwise a |
|
36 | - * \InvalidArgumentException is thrown later |
|
37 | - * @since 17.0.0 |
|
38 | - */ |
|
39 | - public function registerApp(string $appClass): void; |
|
34 | + /** |
|
35 | + * @param string $appClass The service must implement IApp, otherwise a |
|
36 | + * \InvalidArgumentException is thrown later |
|
37 | + * @since 17.0.0 |
|
38 | + */ |
|
39 | + public function registerApp(string $appClass): void; |
|
40 | 40 | |
41 | - /** |
|
42 | - * @param \Closure $service The service must implement INotifier, otherwise a |
|
43 | - * \InvalidArgumentException is thrown later |
|
44 | - * @param \Closure $info An array with the keys 'id' and 'name' containing |
|
45 | - * the app id and the app name |
|
46 | - * @deprecated 17.0.0 use registerNotifierService instead. |
|
47 | - * @since 8.2.0 - Parameter $info was added in 9.0.0 |
|
48 | - */ |
|
49 | - public function registerNotifier(\Closure $service, \Closure $info); |
|
41 | + /** |
|
42 | + * @param \Closure $service The service must implement INotifier, otherwise a |
|
43 | + * \InvalidArgumentException is thrown later |
|
44 | + * @param \Closure $info An array with the keys 'id' and 'name' containing |
|
45 | + * the app id and the app name |
|
46 | + * @deprecated 17.0.0 use registerNotifierService instead. |
|
47 | + * @since 8.2.0 - Parameter $info was added in 9.0.0 |
|
48 | + */ |
|
49 | + public function registerNotifier(\Closure $service, \Closure $info); |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param string $notifierService The service must implement INotifier, otherwise a |
|
53 | - * \InvalidArgumentException is thrown later |
|
54 | - * @since 17.0.0 |
|
55 | - * @deprecated 22.0.0 use the IBootStrap registration context |
|
56 | - */ |
|
57 | - public function registerNotifierService(string $notifierService): void; |
|
51 | + /** |
|
52 | + * @param string $notifierService The service must implement INotifier, otherwise a |
|
53 | + * \InvalidArgumentException is thrown later |
|
54 | + * @since 17.0.0 |
|
55 | + * @deprecated 22.0.0 use the IBootStrap registration context |
|
56 | + */ |
|
57 | + public function registerNotifierService(string $notifierService): void; |
|
58 | 58 | |
59 | - /** |
|
60 | - * @return INotifier[] |
|
61 | - * @since 9.0.0 |
|
62 | - */ |
|
63 | - public function getNotifiers(): array; |
|
59 | + /** |
|
60 | + * @return INotifier[] |
|
61 | + * @since 9.0.0 |
|
62 | + */ |
|
63 | + public function getNotifiers(): array; |
|
64 | 64 | |
65 | - /** |
|
66 | - * @return INotification |
|
67 | - * @since 9.0.0 |
|
68 | - */ |
|
69 | - public function createNotification(): INotification; |
|
65 | + /** |
|
66 | + * @return INotification |
|
67 | + * @since 9.0.0 |
|
68 | + */ |
|
69 | + public function createNotification(): INotification; |
|
70 | 70 | |
71 | - /** |
|
72 | - * @return bool |
|
73 | - * @since 9.0.0 |
|
74 | - */ |
|
75 | - public function hasNotifiers(): bool; |
|
71 | + /** |
|
72 | + * @return bool |
|
73 | + * @since 9.0.0 |
|
74 | + */ |
|
75 | + public function hasNotifiers(): bool; |
|
76 | 76 | |
77 | - /** |
|
78 | - * @param bool $preparingPushNotification |
|
79 | - * @since 14.0.0 |
|
80 | - */ |
|
81 | - public function setPreparingPushNotification(bool $preparingPushNotification): void; |
|
77 | + /** |
|
78 | + * @param bool $preparingPushNotification |
|
79 | + * @since 14.0.0 |
|
80 | + */ |
|
81 | + public function setPreparingPushNotification(bool $preparingPushNotification): void; |
|
82 | 82 | |
83 | - /** |
|
84 | - * @return bool |
|
85 | - * @since 14.0.0 |
|
86 | - */ |
|
87 | - public function isPreparingPushNotification(): bool; |
|
83 | + /** |
|
84 | + * @return bool |
|
85 | + * @since 14.0.0 |
|
86 | + */ |
|
87 | + public function isPreparingPushNotification(): bool; |
|
88 | 88 | |
89 | - /** |
|
90 | - * @since 18.0.0 |
|
91 | - */ |
|
92 | - public function dismissNotification(INotification $notification): void; |
|
89 | + /** |
|
90 | + * @since 18.0.0 |
|
91 | + */ |
|
92 | + public function dismissNotification(INotification $notification): void; |
|
93 | 93 | |
94 | - /** |
|
95 | - * Start deferring notifications until `flush()` is called |
|
96 | - * |
|
97 | - * The calling app should only "flush" when it got returned true on the defer call, |
|
98 | - * otherwise another app is deferring the sending already. |
|
99 | - * @return bool |
|
100 | - * @since 20.0.0 |
|
101 | - */ |
|
102 | - public function defer(): bool; |
|
94 | + /** |
|
95 | + * Start deferring notifications until `flush()` is called |
|
96 | + * |
|
97 | + * The calling app should only "flush" when it got returned true on the defer call, |
|
98 | + * otherwise another app is deferring the sending already. |
|
99 | + * @return bool |
|
100 | + * @since 20.0.0 |
|
101 | + */ |
|
102 | + public function defer(): bool; |
|
103 | 103 | |
104 | - /** |
|
105 | - * Send all deferred notifications that have been stored since `defer()` was called |
|
106 | - * |
|
107 | - * @since 20.0.0 |
|
108 | - */ |
|
109 | - public function flush(): void; |
|
104 | + /** |
|
105 | + * Send all deferred notifications that have been stored since `defer()` was called |
|
106 | + * |
|
107 | + * @since 20.0.0 |
|
108 | + */ |
|
109 | + public function flush(): void; |
|
110 | 110 | |
111 | - /** |
|
112 | - * Whether the server can use the hosted push notification service |
|
113 | - * |
|
114 | - * We want to keep offering our push notification service for free, but large |
|
115 | - * users overload our infrastructure. For this reason we have to rate-limit the |
|
116 | - * use of push notifications. If you need this feature, consider using Nextcloud Enterprise. |
|
117 | - * |
|
118 | - * @since 23.0.0 |
|
119 | - */ |
|
120 | - public function isFairUseOfFreePushService(): bool; |
|
111 | + /** |
|
112 | + * Whether the server can use the hosted push notification service |
|
113 | + * |
|
114 | + * We want to keep offering our push notification service for free, but large |
|
115 | + * users overload our infrastructure. For this reason we have to rate-limit the |
|
116 | + * use of push notifications. If you need this feature, consider using Nextcloud Enterprise. |
|
117 | + * |
|
118 | + * @since 23.0.0 |
|
119 | + */ |
|
120 | + public function isFairUseOfFreePushService(): bool; |
|
121 | 121 | } |
@@ -35,15 +35,15 @@ |
||
35 | 35 | * @deprecated 23.0.0 Use RedirectResponse() with IURLGenerator::linkToDefaultPageUrl() instead |
36 | 36 | */ |
37 | 37 | class RedirectToDefaultAppResponse extends RedirectResponse { |
38 | - /** |
|
39 | - * Creates a response that redirects to the default app |
|
40 | - * |
|
41 | - * @since 16.0.0 |
|
42 | - * @deprecated 23.0.0 Use RedirectResponse() with IURLGenerator::linkToDefaultPageUrl() instead |
|
43 | - */ |
|
44 | - public function __construct() { |
|
45 | - /** @var IURLGenerator $urlGenerator */ |
|
46 | - $urlGenerator = \OC::$server->get(IURLGenerator::class); |
|
47 | - parent::__construct($urlGenerator->linkToDefaultPageUrl()); |
|
48 | - } |
|
38 | + /** |
|
39 | + * Creates a response that redirects to the default app |
|
40 | + * |
|
41 | + * @since 16.0.0 |
|
42 | + * @deprecated 23.0.0 Use RedirectResponse() with IURLGenerator::linkToDefaultPageUrl() instead |
|
43 | + */ |
|
44 | + public function __construct() { |
|
45 | + /** @var IURLGenerator $urlGenerator */ |
|
46 | + $urlGenerator = \OC::$server->get(IURLGenerator::class); |
|
47 | + parent::__construct($urlGenerator->linkToDefaultPageUrl()); |
|
48 | + } |
|
49 | 49 | } |