@@ -2,18 +2,18 @@ discard block |
||
2 | 2 | <ul class="with-icon"> |
3 | 3 | <?php $pinned = 0 ?> |
4 | 4 | <?php foreach ($_['navigationItems'] as $item) { |
5 | - strpos($item['classes'], 'pinned')!==false ? $pinned++ : ''; |
|
5 | + strpos($item['classes'], 'pinned') !== false ? $pinned++ : ''; |
|
6 | 6 | ?> |
7 | - <li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?> <?php p($item['classes']) ?> <?php p($pinned===1?'first-pinned':'') ?>"> |
|
7 | + <li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?> <?php p($item['classes']) ?> <?php p($pinned === 1 ? 'first-pinned' : '') ?>"> |
|
8 | 8 | <a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>" |
9 | 9 | class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg"> |
10 | - <?php p($item['name']);?> |
|
10 | + <?php p($item['name']); ?> |
|
11 | 11 | </a> |
12 | 12 | </li> |
13 | 13 | <?php } ?> |
14 | 14 | <li id="quota" class="pinned <?php |
15 | 15 | if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) { |
16 | - ?>has-tooltip" title="<?php p($_['usage_relative'] . '%'); |
|
16 | + ?>has-tooltip" title="<?php p($_['usage_relative'].'%'); |
|
17 | 17 | } ?>"> |
18 | 18 | <a href="#" class="nav-icon-quota svg"> |
19 | 19 | <p id="quotatext"><?php |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } ?></p> |
25 | 25 | <div class="quota-container"> |
26 | 26 | <progress value="<?php p($_['usage_relative']); ?>" max="100" |
27 | - <?php if($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>></progress> |
|
27 | + <?php if ($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>></progress> |
|
28 | 28 | </div> |
29 | 29 | </a> |
30 | 30 | </li> |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | <div id="app-settings"> |
33 | 33 | <div id="app-settings-header"> |
34 | 34 | <button class="settings-button" data-apps-slide-toggle="#app-settings-content"> |
35 | - <?php p($l->t('Settings'));?> |
|
35 | + <?php p($l->t('Settings')); ?> |
|
36 | 36 | </button> |
37 | 37 | </div> |
38 | 38 | <div id="app-settings-content"> |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | <input class="checkbox" id="showhiddenfilesToggle" checked="checked" type="checkbox"> |
41 | 41 | <label for="showhiddenfilesToggle"><?php p($l->t('Show hidden files')); ?></label> |
42 | 42 | </div> |
43 | - <label for="webdavurl"><?php p($l->t('WebDAV'));?></label> |
|
43 | + <label for="webdavurl"><?php p($l->t('WebDAV')); ?></label> |
|
44 | 44 | <input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" /> |
45 | - <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em> |
|
45 | + <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', array(link_to_docs('user-webdav')))); ?></em> |
|
46 | 46 | </div> |
47 | 47 | </div> |
48 | 48 | </div> |
@@ -4,12 +4,12 @@ discard block |
||
4 | 4 | script('federatedfilesharing', 'settings-admin'); |
5 | 5 | ?> |
6 | 6 | |
7 | -<?php if($_['internalOnly'] === false): ?> |
|
7 | +<?php if ($_['internalOnly'] === false): ?> |
|
8 | 8 | |
9 | 9 | <div id="fileSharingSettings" class="followupsection"> |
10 | - <h3><?php p($l->t('Federated Cloud Sharing'));?></h3> |
|
10 | + <h3><?php p($l->t('Federated Cloud Sharing')); ?></h3> |
|
11 | 11 | <a target="_blank" rel="noreferrer noopener" class="icon-info svg" |
12 | - title="<?php p($l->t('Open documentation'));?>" |
|
12 | + title="<?php p($l->t('Open documentation')); ?>" |
|
13 | 13 | href="<?php p(link_to_docs('admin-sharing-federated')); ?>"></a> |
14 | 14 | <p class="settings-hint"><?php p($l->t('Adjust how people can share between servers.')); ?></p> |
15 | 15 | |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | <input type="checkbox" name="outgoing_server2server_share_enabled" id="outgoingServer2serverShareEnabled" class="checkbox" |
18 | 18 | value="1" <?php if ($_['outgoingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> |
19 | 19 | <label for="outgoingServer2serverShareEnabled"> |
20 | - <?php p($l->t('Allow users on this server to send shares to other servers'));?> |
|
20 | + <?php p($l->t('Allow users on this server to send shares to other servers')); ?> |
|
21 | 21 | </label> |
22 | 22 | </p> |
23 | 23 | |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | <input type="checkbox" name="incoming_server2server_share_enabled" id="incomingServer2serverShareEnabled" class="checkbox" |
26 | 26 | value="1" <?php if ($_['incomingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> |
27 | 27 | <label for="incomingServer2serverShareEnabled"> |
28 | - <?php p($l->t('Allow users on this server to receive shares from other servers'));?> |
|
28 | + <?php p($l->t('Allow users on this server to receive shares from other servers')); ?> |
|
29 | 29 | </label><br/> |
30 | 30 | </p> |
31 | 31 | <p> |
32 | 32 | <input type="checkbox" name="lookupServerEnabled" id="lookupServerEnabled" class="checkbox" |
33 | 33 | value="1" <?php if ($_['lookupServerEnabled']) print_unescaped('checked="checked"'); ?> /> |
34 | 34 | <label for="lookupServerEnabled"> |
35 | - <?php p($l->t('Search global and public address book for users'));?> |
|
35 | + <?php p($l->t('Search global and public address book for users')); ?> |
|
36 | 36 | </label><br/> |
37 | 37 | </p> |
38 | 38 | <p> |
39 | 39 | <input type="checkbox" name="lookupServerUploadEnabled" id="lookupServerUploadEnabled" class="checkbox" |
40 | 40 | value="1" <?php if ($_['lookupServerUploadEnabled']) print_unescaped('checked="checked"'); ?> /> |
41 | 41 | <label for="lookupServerUploadEnabled"> |
42 | - <?php p($l->t('Allow users to publish their data to a global and public address book'));?> |
|
42 | + <?php p($l->t('Allow users to publish their data to a global and public address book')); ?> |
|
43 | 43 | </label><br/> |
44 | 44 | </p> |
45 | 45 |
@@ -33,338 +33,338 @@ |
||
33 | 33 | |
34 | 34 | class ThemingDefaults extends \OC_Defaults { |
35 | 35 | |
36 | - /** @var IConfig */ |
|
37 | - private $config; |
|
38 | - /** @var IL10N */ |
|
39 | - private $l; |
|
40 | - /** @var IURLGenerator */ |
|
41 | - private $urlGenerator; |
|
42 | - /** @var IAppData */ |
|
43 | - private $appData; |
|
44 | - /** @var ICacheFactory */ |
|
45 | - private $cacheFactory; |
|
46 | - /** @var Util */ |
|
47 | - private $util; |
|
48 | - /** @var IAppManager */ |
|
49 | - private $appManager; |
|
50 | - /** @var string */ |
|
51 | - private $name; |
|
52 | - /** @var string */ |
|
53 | - private $title; |
|
54 | - /** @var string */ |
|
55 | - private $entity; |
|
56 | - /** @var string */ |
|
57 | - private $url; |
|
58 | - /** @var string */ |
|
59 | - private $slogan; |
|
60 | - /** @var string */ |
|
61 | - private $color; |
|
62 | - |
|
63 | - /** @var string */ |
|
64 | - private $iTunesAppId; |
|
65 | - /** @var string */ |
|
66 | - private $iOSClientUrl; |
|
67 | - /** @var string */ |
|
68 | - private $AndroidClientUrl; |
|
69 | - |
|
70 | - /** |
|
71 | - * ThemingDefaults constructor. |
|
72 | - * |
|
73 | - * @param IConfig $config |
|
74 | - * @param IL10N $l |
|
75 | - * @param IURLGenerator $urlGenerator |
|
76 | - * @param \OC_Defaults $defaults |
|
77 | - * @param IAppData $appData |
|
78 | - * @param ICacheFactory $cacheFactory |
|
79 | - * @param Util $util |
|
80 | - * @param IAppManager $appManager |
|
81 | - */ |
|
82 | - public function __construct(IConfig $config, |
|
83 | - IL10N $l, |
|
84 | - IURLGenerator $urlGenerator, |
|
85 | - IAppData $appData, |
|
86 | - ICacheFactory $cacheFactory, |
|
87 | - Util $util, |
|
88 | - IAppManager $appManager |
|
89 | - ) { |
|
90 | - parent::__construct(); |
|
91 | - $this->config = $config; |
|
92 | - $this->l = $l; |
|
93 | - $this->urlGenerator = $urlGenerator; |
|
94 | - $this->appData = $appData; |
|
95 | - $this->cacheFactory = $cacheFactory; |
|
96 | - $this->util = $util; |
|
97 | - $this->appManager = $appManager; |
|
98 | - |
|
99 | - $this->name = parent::getName(); |
|
100 | - $this->title = parent::getTitle(); |
|
101 | - $this->entity = parent::getEntity(); |
|
102 | - $this->url = parent::getBaseUrl(); |
|
103 | - $this->slogan = parent::getSlogan(); |
|
104 | - $this->color = parent::getColorPrimary(); |
|
105 | - $this->iTunesAppId = parent::getiTunesAppId(); |
|
106 | - $this->iOSClientUrl = parent::getiOSClientUrl(); |
|
107 | - $this->AndroidClientUrl = parent::getAndroidClientUrl(); |
|
108 | - } |
|
109 | - |
|
110 | - public function getName() { |
|
111 | - return strip_tags($this->config->getAppValue('theming', 'name', $this->name)); |
|
112 | - } |
|
113 | - |
|
114 | - public function getHTMLName() { |
|
115 | - return $this->config->getAppValue('theming', 'name', $this->name); |
|
116 | - } |
|
117 | - |
|
118 | - public function getTitle() { |
|
119 | - return strip_tags($this->config->getAppValue('theming', 'name', $this->title)); |
|
120 | - } |
|
121 | - |
|
122 | - public function getEntity() { |
|
123 | - return strip_tags($this->config->getAppValue('theming', 'name', $this->entity)); |
|
124 | - } |
|
125 | - |
|
126 | - public function getBaseUrl() { |
|
127 | - return $this->config->getAppValue('theming', 'url', $this->url); |
|
128 | - } |
|
129 | - |
|
130 | - public function getSlogan() { |
|
131 | - return \OCP\Util::sanitizeHTML($this->config->getAppValue('theming', 'slogan', $this->slogan)); |
|
132 | - } |
|
133 | - |
|
134 | - public function getShortFooter() { |
|
135 | - $slogan = $this->getSlogan(); |
|
136 | - $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . |
|
137 | - ' rel="noreferrer noopener">' .$this->getEntity() . '</a>'. |
|
138 | - ($slogan !== '' ? ' – ' . $slogan : ''); |
|
139 | - |
|
140 | - return $footer; |
|
141 | - } |
|
142 | - |
|
143 | - /** |
|
144 | - * Color that is used for the header as well as for mail headers |
|
145 | - * |
|
146 | - * @return string |
|
147 | - */ |
|
148 | - public function getColorPrimary() { |
|
149 | - return $this->config->getAppValue('theming', 'color', $this->color); |
|
150 | - } |
|
151 | - |
|
152 | - /** |
|
153 | - * Themed logo url |
|
154 | - * |
|
155 | - * @param bool $useSvg Whether to point to the SVG image or a fallback |
|
156 | - * @return string |
|
157 | - */ |
|
158 | - public function getLogo($useSvg = true) { |
|
159 | - $logo = $this->config->getAppValue('theming', 'logoMime', false); |
|
160 | - |
|
161 | - $logoExists = true; |
|
162 | - try { |
|
163 | - $this->appData->getFolder('images')->getFile('logo'); |
|
164 | - } catch (\Exception $e) { |
|
165 | - $logoExists = false; |
|
166 | - } |
|
167 | - |
|
168 | - $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
169 | - |
|
170 | - if(!$logo || !$logoExists) { |
|
171 | - if($useSvg) { |
|
172 | - $logo = $this->urlGenerator->imagePath('core', 'logo.svg'); |
|
173 | - } else { |
|
174 | - $logo = $this->urlGenerator->imagePath('core', 'logo.png'); |
|
175 | - } |
|
176 | - return $logo . '?v=' . $cacheBusterCounter; |
|
177 | - } |
|
178 | - |
|
179 | - return $this->urlGenerator->linkToRoute('theming.Theming.getLogo') . '?v=' . $cacheBusterCounter; |
|
180 | - } |
|
181 | - |
|
182 | - /** |
|
183 | - * Themed background image url |
|
184 | - * |
|
185 | - * @return string |
|
186 | - */ |
|
187 | - public function getBackground() { |
|
188 | - $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime',false); |
|
189 | - |
|
190 | - $backgroundExists = true; |
|
191 | - try { |
|
192 | - $this->appData->getFolder('images')->getFile('background'); |
|
193 | - } catch (\Exception $e) { |
|
194 | - $backgroundExists = false; |
|
195 | - } |
|
196 | - |
|
197 | - $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
198 | - |
|
199 | - if(!$backgroundLogo || !$backgroundExists) { |
|
200 | - return $this->urlGenerator->imagePath('core','background.png') . '?v=' . $cacheBusterCounter; |
|
201 | - } |
|
202 | - |
|
203 | - return $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground') . '?v=' . $cacheBusterCounter; |
|
204 | - } |
|
205 | - |
|
206 | - /** |
|
207 | - * @return string |
|
208 | - */ |
|
209 | - public function getiTunesAppId() { |
|
210 | - return $this->config->getAppValue('theming', 'iTunesAppId', $this->iTunesAppId); |
|
211 | - } |
|
212 | - |
|
213 | - /** |
|
214 | - * @return string |
|
215 | - */ |
|
216 | - public function getiOSClientUrl() { |
|
217 | - return $this->config->getAppValue('theming', 'iOSClientUrl', $this->iOSClientUrl); |
|
218 | - } |
|
219 | - |
|
220 | - /** |
|
221 | - * @return string |
|
222 | - */ |
|
223 | - public function getAndroidClientUrl() { |
|
224 | - return $this->config->getAppValue('theming', 'AndroidClientUrl', $this->AndroidClientUrl); |
|
225 | - } |
|
226 | - |
|
227 | - |
|
228 | - /** |
|
229 | - * @return array scss variables to overwrite |
|
230 | - */ |
|
231 | - public function getScssVariables() { |
|
232 | - $cache = $this->cacheFactory->create('theming'); |
|
233 | - if ($value = $cache->get('getScssVariables')) { |
|
234 | - return $value; |
|
235 | - } |
|
236 | - |
|
237 | - $variables = [ |
|
238 | - 'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'", |
|
239 | - 'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime', '') . "'", |
|
240 | - 'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime', '') . "'" |
|
241 | - ]; |
|
242 | - |
|
243 | - $variables['image-logo'] = "'".$this->urlGenerator->getAbsoluteURL($this->getLogo())."'"; |
|
244 | - $variables['image-login-background'] = "'".$this->urlGenerator->getAbsoluteURL($this->getBackground())."'"; |
|
245 | - $variables['image-login-plain'] = 'false'; |
|
246 | - |
|
247 | - if ($this->config->getAppValue('theming', 'color', null) !== null) { |
|
248 | - if ($this->util->invertTextColor($this->getColorPrimary())) { |
|
249 | - $colorPrimaryText = '#000000'; |
|
250 | - } else { |
|
251 | - $colorPrimaryText = '#ffffff'; |
|
252 | - } |
|
253 | - $variables['color-primary'] = $this->getColorPrimary(); |
|
254 | - $variables['color-primary-text'] = $colorPrimaryText; |
|
255 | - $variables['color-primary-element'] = $this->util->elementColor($this->getColorPrimary()); |
|
256 | - } |
|
257 | - |
|
258 | - if ($this->config->getAppValue('theming', 'backgroundMime', null) === 'backgroundColor') { |
|
259 | - $variables['image-login-plain'] = 'true'; |
|
260 | - } |
|
261 | - $cache->set('getScssVariables', $variables); |
|
262 | - return $variables; |
|
263 | - } |
|
264 | - |
|
265 | - /** |
|
266 | - * Check if the image should be replaced by the theming app |
|
267 | - * and return the new image location then |
|
268 | - * |
|
269 | - * @param string $app name of the app |
|
270 | - * @param string $image filename of the image |
|
271 | - * @return bool|string false if image should not replaced, otherwise the location of the image |
|
272 | - */ |
|
273 | - public function replaceImagePath($app, $image) { |
|
274 | - if($app==='') { |
|
275 | - $app = 'core'; |
|
276 | - } |
|
277 | - $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
278 | - |
|
279 | - if ($image === 'favicon.ico' && $this->shouldReplaceIcons()) { |
|
280 | - return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
281 | - } |
|
282 | - if ($image === 'favicon-touch.png' && $this->shouldReplaceIcons()) { |
|
283 | - return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
284 | - } |
|
285 | - if ($image === 'manifest.json') { |
|
286 | - try { |
|
287 | - $appPath = $this->appManager->getAppPath($app); |
|
288 | - if (file_exists($appPath . '/img/manifest.json')) { |
|
289 | - return false; |
|
290 | - } |
|
291 | - } catch (AppPathNotFoundException $e) {} |
|
292 | - return $this->urlGenerator->linkToRoute('theming.Theming.getManifest') . '?v=' . $cacheBusterValue; |
|
293 | - } |
|
294 | - return false; |
|
295 | - } |
|
296 | - |
|
297 | - /** |
|
298 | - * Check if Imagemagick is enabled and if SVG is supported |
|
299 | - * otherwise we can't render custom icons |
|
300 | - * |
|
301 | - * @return bool |
|
302 | - */ |
|
303 | - public function shouldReplaceIcons() { |
|
304 | - $cache = $this->cacheFactory->create('theming'); |
|
305 | - if($value = $cache->get('shouldReplaceIcons')) { |
|
306 | - return (bool)$value; |
|
307 | - } |
|
308 | - $value = false; |
|
309 | - if(extension_loaded('imagick')) { |
|
310 | - $checkImagick = new \Imagick(); |
|
311 | - if (count($checkImagick->queryFormats('SVG')) >= 1) { |
|
312 | - $value = true; |
|
313 | - } |
|
314 | - $checkImagick->clear(); |
|
315 | - } |
|
316 | - $cache->set('shouldReplaceIcons', $value); |
|
317 | - return $value; |
|
318 | - } |
|
319 | - |
|
320 | - /** |
|
321 | - * Increases the cache buster key |
|
322 | - */ |
|
323 | - private function increaseCacheBuster() { |
|
324 | - $cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
325 | - $this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1); |
|
326 | - $this->cacheFactory->create('theming')->clear('getScssVariables'); |
|
327 | - } |
|
328 | - |
|
329 | - /** |
|
330 | - * Update setting in the database |
|
331 | - * |
|
332 | - * @param string $setting |
|
333 | - * @param string $value |
|
334 | - */ |
|
335 | - public function set($setting, $value) { |
|
336 | - $this->config->setAppValue('theming', $setting, $value); |
|
337 | - $this->increaseCacheBuster(); |
|
338 | - } |
|
339 | - |
|
340 | - /** |
|
341 | - * Revert settings to the default value |
|
342 | - * |
|
343 | - * @param string $setting setting which should be reverted |
|
344 | - * @return string default value |
|
345 | - */ |
|
346 | - public function undo($setting) { |
|
347 | - $this->config->deleteAppValue('theming', $setting); |
|
348 | - $this->increaseCacheBuster(); |
|
349 | - |
|
350 | - switch ($setting) { |
|
351 | - case 'name': |
|
352 | - $returnValue = $this->getEntity(); |
|
353 | - break; |
|
354 | - case 'url': |
|
355 | - $returnValue = $this->getBaseUrl(); |
|
356 | - break; |
|
357 | - case 'slogan': |
|
358 | - $returnValue = $this->getSlogan(); |
|
359 | - break; |
|
360 | - case 'color': |
|
361 | - $returnValue = $this->getColorPrimary(); |
|
362 | - break; |
|
363 | - default: |
|
364 | - $returnValue = ''; |
|
365 | - break; |
|
366 | - } |
|
367 | - |
|
368 | - return $returnValue; |
|
369 | - } |
|
36 | + /** @var IConfig */ |
|
37 | + private $config; |
|
38 | + /** @var IL10N */ |
|
39 | + private $l; |
|
40 | + /** @var IURLGenerator */ |
|
41 | + private $urlGenerator; |
|
42 | + /** @var IAppData */ |
|
43 | + private $appData; |
|
44 | + /** @var ICacheFactory */ |
|
45 | + private $cacheFactory; |
|
46 | + /** @var Util */ |
|
47 | + private $util; |
|
48 | + /** @var IAppManager */ |
|
49 | + private $appManager; |
|
50 | + /** @var string */ |
|
51 | + private $name; |
|
52 | + /** @var string */ |
|
53 | + private $title; |
|
54 | + /** @var string */ |
|
55 | + private $entity; |
|
56 | + /** @var string */ |
|
57 | + private $url; |
|
58 | + /** @var string */ |
|
59 | + private $slogan; |
|
60 | + /** @var string */ |
|
61 | + private $color; |
|
62 | + |
|
63 | + /** @var string */ |
|
64 | + private $iTunesAppId; |
|
65 | + /** @var string */ |
|
66 | + private $iOSClientUrl; |
|
67 | + /** @var string */ |
|
68 | + private $AndroidClientUrl; |
|
69 | + |
|
70 | + /** |
|
71 | + * ThemingDefaults constructor. |
|
72 | + * |
|
73 | + * @param IConfig $config |
|
74 | + * @param IL10N $l |
|
75 | + * @param IURLGenerator $urlGenerator |
|
76 | + * @param \OC_Defaults $defaults |
|
77 | + * @param IAppData $appData |
|
78 | + * @param ICacheFactory $cacheFactory |
|
79 | + * @param Util $util |
|
80 | + * @param IAppManager $appManager |
|
81 | + */ |
|
82 | + public function __construct(IConfig $config, |
|
83 | + IL10N $l, |
|
84 | + IURLGenerator $urlGenerator, |
|
85 | + IAppData $appData, |
|
86 | + ICacheFactory $cacheFactory, |
|
87 | + Util $util, |
|
88 | + IAppManager $appManager |
|
89 | + ) { |
|
90 | + parent::__construct(); |
|
91 | + $this->config = $config; |
|
92 | + $this->l = $l; |
|
93 | + $this->urlGenerator = $urlGenerator; |
|
94 | + $this->appData = $appData; |
|
95 | + $this->cacheFactory = $cacheFactory; |
|
96 | + $this->util = $util; |
|
97 | + $this->appManager = $appManager; |
|
98 | + |
|
99 | + $this->name = parent::getName(); |
|
100 | + $this->title = parent::getTitle(); |
|
101 | + $this->entity = parent::getEntity(); |
|
102 | + $this->url = parent::getBaseUrl(); |
|
103 | + $this->slogan = parent::getSlogan(); |
|
104 | + $this->color = parent::getColorPrimary(); |
|
105 | + $this->iTunesAppId = parent::getiTunesAppId(); |
|
106 | + $this->iOSClientUrl = parent::getiOSClientUrl(); |
|
107 | + $this->AndroidClientUrl = parent::getAndroidClientUrl(); |
|
108 | + } |
|
109 | + |
|
110 | + public function getName() { |
|
111 | + return strip_tags($this->config->getAppValue('theming', 'name', $this->name)); |
|
112 | + } |
|
113 | + |
|
114 | + public function getHTMLName() { |
|
115 | + return $this->config->getAppValue('theming', 'name', $this->name); |
|
116 | + } |
|
117 | + |
|
118 | + public function getTitle() { |
|
119 | + return strip_tags($this->config->getAppValue('theming', 'name', $this->title)); |
|
120 | + } |
|
121 | + |
|
122 | + public function getEntity() { |
|
123 | + return strip_tags($this->config->getAppValue('theming', 'name', $this->entity)); |
|
124 | + } |
|
125 | + |
|
126 | + public function getBaseUrl() { |
|
127 | + return $this->config->getAppValue('theming', 'url', $this->url); |
|
128 | + } |
|
129 | + |
|
130 | + public function getSlogan() { |
|
131 | + return \OCP\Util::sanitizeHTML($this->config->getAppValue('theming', 'slogan', $this->slogan)); |
|
132 | + } |
|
133 | + |
|
134 | + public function getShortFooter() { |
|
135 | + $slogan = $this->getSlogan(); |
|
136 | + $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . |
|
137 | + ' rel="noreferrer noopener">' .$this->getEntity() . '</a>'. |
|
138 | + ($slogan !== '' ? ' – ' . $slogan : ''); |
|
139 | + |
|
140 | + return $footer; |
|
141 | + } |
|
142 | + |
|
143 | + /** |
|
144 | + * Color that is used for the header as well as for mail headers |
|
145 | + * |
|
146 | + * @return string |
|
147 | + */ |
|
148 | + public function getColorPrimary() { |
|
149 | + return $this->config->getAppValue('theming', 'color', $this->color); |
|
150 | + } |
|
151 | + |
|
152 | + /** |
|
153 | + * Themed logo url |
|
154 | + * |
|
155 | + * @param bool $useSvg Whether to point to the SVG image or a fallback |
|
156 | + * @return string |
|
157 | + */ |
|
158 | + public function getLogo($useSvg = true) { |
|
159 | + $logo = $this->config->getAppValue('theming', 'logoMime', false); |
|
160 | + |
|
161 | + $logoExists = true; |
|
162 | + try { |
|
163 | + $this->appData->getFolder('images')->getFile('logo'); |
|
164 | + } catch (\Exception $e) { |
|
165 | + $logoExists = false; |
|
166 | + } |
|
167 | + |
|
168 | + $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
169 | + |
|
170 | + if(!$logo || !$logoExists) { |
|
171 | + if($useSvg) { |
|
172 | + $logo = $this->urlGenerator->imagePath('core', 'logo.svg'); |
|
173 | + } else { |
|
174 | + $logo = $this->urlGenerator->imagePath('core', 'logo.png'); |
|
175 | + } |
|
176 | + return $logo . '?v=' . $cacheBusterCounter; |
|
177 | + } |
|
178 | + |
|
179 | + return $this->urlGenerator->linkToRoute('theming.Theming.getLogo') . '?v=' . $cacheBusterCounter; |
|
180 | + } |
|
181 | + |
|
182 | + /** |
|
183 | + * Themed background image url |
|
184 | + * |
|
185 | + * @return string |
|
186 | + */ |
|
187 | + public function getBackground() { |
|
188 | + $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime',false); |
|
189 | + |
|
190 | + $backgroundExists = true; |
|
191 | + try { |
|
192 | + $this->appData->getFolder('images')->getFile('background'); |
|
193 | + } catch (\Exception $e) { |
|
194 | + $backgroundExists = false; |
|
195 | + } |
|
196 | + |
|
197 | + $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
198 | + |
|
199 | + if(!$backgroundLogo || !$backgroundExists) { |
|
200 | + return $this->urlGenerator->imagePath('core','background.png') . '?v=' . $cacheBusterCounter; |
|
201 | + } |
|
202 | + |
|
203 | + return $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground') . '?v=' . $cacheBusterCounter; |
|
204 | + } |
|
205 | + |
|
206 | + /** |
|
207 | + * @return string |
|
208 | + */ |
|
209 | + public function getiTunesAppId() { |
|
210 | + return $this->config->getAppValue('theming', 'iTunesAppId', $this->iTunesAppId); |
|
211 | + } |
|
212 | + |
|
213 | + /** |
|
214 | + * @return string |
|
215 | + */ |
|
216 | + public function getiOSClientUrl() { |
|
217 | + return $this->config->getAppValue('theming', 'iOSClientUrl', $this->iOSClientUrl); |
|
218 | + } |
|
219 | + |
|
220 | + /** |
|
221 | + * @return string |
|
222 | + */ |
|
223 | + public function getAndroidClientUrl() { |
|
224 | + return $this->config->getAppValue('theming', 'AndroidClientUrl', $this->AndroidClientUrl); |
|
225 | + } |
|
226 | + |
|
227 | + |
|
228 | + /** |
|
229 | + * @return array scss variables to overwrite |
|
230 | + */ |
|
231 | + public function getScssVariables() { |
|
232 | + $cache = $this->cacheFactory->create('theming'); |
|
233 | + if ($value = $cache->get('getScssVariables')) { |
|
234 | + return $value; |
|
235 | + } |
|
236 | + |
|
237 | + $variables = [ |
|
238 | + 'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'", |
|
239 | + 'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime', '') . "'", |
|
240 | + 'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime', '') . "'" |
|
241 | + ]; |
|
242 | + |
|
243 | + $variables['image-logo'] = "'".$this->urlGenerator->getAbsoluteURL($this->getLogo())."'"; |
|
244 | + $variables['image-login-background'] = "'".$this->urlGenerator->getAbsoluteURL($this->getBackground())."'"; |
|
245 | + $variables['image-login-plain'] = 'false'; |
|
246 | + |
|
247 | + if ($this->config->getAppValue('theming', 'color', null) !== null) { |
|
248 | + if ($this->util->invertTextColor($this->getColorPrimary())) { |
|
249 | + $colorPrimaryText = '#000000'; |
|
250 | + } else { |
|
251 | + $colorPrimaryText = '#ffffff'; |
|
252 | + } |
|
253 | + $variables['color-primary'] = $this->getColorPrimary(); |
|
254 | + $variables['color-primary-text'] = $colorPrimaryText; |
|
255 | + $variables['color-primary-element'] = $this->util->elementColor($this->getColorPrimary()); |
|
256 | + } |
|
257 | + |
|
258 | + if ($this->config->getAppValue('theming', 'backgroundMime', null) === 'backgroundColor') { |
|
259 | + $variables['image-login-plain'] = 'true'; |
|
260 | + } |
|
261 | + $cache->set('getScssVariables', $variables); |
|
262 | + return $variables; |
|
263 | + } |
|
264 | + |
|
265 | + /** |
|
266 | + * Check if the image should be replaced by the theming app |
|
267 | + * and return the new image location then |
|
268 | + * |
|
269 | + * @param string $app name of the app |
|
270 | + * @param string $image filename of the image |
|
271 | + * @return bool|string false if image should not replaced, otherwise the location of the image |
|
272 | + */ |
|
273 | + public function replaceImagePath($app, $image) { |
|
274 | + if($app==='') { |
|
275 | + $app = 'core'; |
|
276 | + } |
|
277 | + $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
278 | + |
|
279 | + if ($image === 'favicon.ico' && $this->shouldReplaceIcons()) { |
|
280 | + return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
281 | + } |
|
282 | + if ($image === 'favicon-touch.png' && $this->shouldReplaceIcons()) { |
|
283 | + return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
284 | + } |
|
285 | + if ($image === 'manifest.json') { |
|
286 | + try { |
|
287 | + $appPath = $this->appManager->getAppPath($app); |
|
288 | + if (file_exists($appPath . '/img/manifest.json')) { |
|
289 | + return false; |
|
290 | + } |
|
291 | + } catch (AppPathNotFoundException $e) {} |
|
292 | + return $this->urlGenerator->linkToRoute('theming.Theming.getManifest') . '?v=' . $cacheBusterValue; |
|
293 | + } |
|
294 | + return false; |
|
295 | + } |
|
296 | + |
|
297 | + /** |
|
298 | + * Check if Imagemagick is enabled and if SVG is supported |
|
299 | + * otherwise we can't render custom icons |
|
300 | + * |
|
301 | + * @return bool |
|
302 | + */ |
|
303 | + public function shouldReplaceIcons() { |
|
304 | + $cache = $this->cacheFactory->create('theming'); |
|
305 | + if($value = $cache->get('shouldReplaceIcons')) { |
|
306 | + return (bool)$value; |
|
307 | + } |
|
308 | + $value = false; |
|
309 | + if(extension_loaded('imagick')) { |
|
310 | + $checkImagick = new \Imagick(); |
|
311 | + if (count($checkImagick->queryFormats('SVG')) >= 1) { |
|
312 | + $value = true; |
|
313 | + } |
|
314 | + $checkImagick->clear(); |
|
315 | + } |
|
316 | + $cache->set('shouldReplaceIcons', $value); |
|
317 | + return $value; |
|
318 | + } |
|
319 | + |
|
320 | + /** |
|
321 | + * Increases the cache buster key |
|
322 | + */ |
|
323 | + private function increaseCacheBuster() { |
|
324 | + $cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
325 | + $this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1); |
|
326 | + $this->cacheFactory->create('theming')->clear('getScssVariables'); |
|
327 | + } |
|
328 | + |
|
329 | + /** |
|
330 | + * Update setting in the database |
|
331 | + * |
|
332 | + * @param string $setting |
|
333 | + * @param string $value |
|
334 | + */ |
|
335 | + public function set($setting, $value) { |
|
336 | + $this->config->setAppValue('theming', $setting, $value); |
|
337 | + $this->increaseCacheBuster(); |
|
338 | + } |
|
339 | + |
|
340 | + /** |
|
341 | + * Revert settings to the default value |
|
342 | + * |
|
343 | + * @param string $setting setting which should be reverted |
|
344 | + * @return string default value |
|
345 | + */ |
|
346 | + public function undo($setting) { |
|
347 | + $this->config->deleteAppValue('theming', $setting); |
|
348 | + $this->increaseCacheBuster(); |
|
349 | + |
|
350 | + switch ($setting) { |
|
351 | + case 'name': |
|
352 | + $returnValue = $this->getEntity(); |
|
353 | + break; |
|
354 | + case 'url': |
|
355 | + $returnValue = $this->getBaseUrl(); |
|
356 | + break; |
|
357 | + case 'slogan': |
|
358 | + $returnValue = $this->getSlogan(); |
|
359 | + break; |
|
360 | + case 'color': |
|
361 | + $returnValue = $this->getColorPrimary(); |
|
362 | + break; |
|
363 | + default: |
|
364 | + $returnValue = ''; |
|
365 | + break; |
|
366 | + } |
|
367 | + |
|
368 | + return $returnValue; |
|
369 | + } |
|
370 | 370 | } |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | |
134 | 134 | public function getShortFooter() { |
135 | 135 | $slogan = $this->getSlogan(); |
136 | - $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . |
|
137 | - ' rel="noreferrer noopener">' .$this->getEntity() . '</a>'. |
|
138 | - ($slogan !== '' ? ' – ' . $slogan : ''); |
|
136 | + $footer = '<a href="'.$this->getBaseUrl().'" target="_blank"'. |
|
137 | + ' rel="noreferrer noopener">'.$this->getEntity().'</a>'. |
|
138 | + ($slogan !== '' ? ' – '.$slogan : ''); |
|
139 | 139 | |
140 | 140 | return $footer; |
141 | 141 | } |
@@ -167,16 +167,16 @@ discard block |
||
167 | 167 | |
168 | 168 | $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
169 | 169 | |
170 | - if(!$logo || !$logoExists) { |
|
171 | - if($useSvg) { |
|
170 | + if (!$logo || !$logoExists) { |
|
171 | + if ($useSvg) { |
|
172 | 172 | $logo = $this->urlGenerator->imagePath('core', 'logo.svg'); |
173 | 173 | } else { |
174 | 174 | $logo = $this->urlGenerator->imagePath('core', 'logo.png'); |
175 | 175 | } |
176 | - return $logo . '?v=' . $cacheBusterCounter; |
|
176 | + return $logo.'?v='.$cacheBusterCounter; |
|
177 | 177 | } |
178 | 178 | |
179 | - return $this->urlGenerator->linkToRoute('theming.Theming.getLogo') . '?v=' . $cacheBusterCounter; |
|
179 | + return $this->urlGenerator->linkToRoute('theming.Theming.getLogo').'?v='.$cacheBusterCounter; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * @return string |
186 | 186 | */ |
187 | 187 | public function getBackground() { |
188 | - $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime',false); |
|
188 | + $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', false); |
|
189 | 189 | |
190 | 190 | $backgroundExists = true; |
191 | 191 | try { |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | |
197 | 197 | $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
198 | 198 | |
199 | - if(!$backgroundLogo || !$backgroundExists) { |
|
200 | - return $this->urlGenerator->imagePath('core','background.png') . '?v=' . $cacheBusterCounter; |
|
199 | + if (!$backgroundLogo || !$backgroundExists) { |
|
200 | + return $this->urlGenerator->imagePath('core', 'background.png').'?v='.$cacheBusterCounter; |
|
201 | 201 | } |
202 | 202 | |
203 | - return $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground') . '?v=' . $cacheBusterCounter; |
|
203 | + return $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground').'?v='.$cacheBusterCounter; |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -235,9 +235,9 @@ discard block |
||
235 | 235 | } |
236 | 236 | |
237 | 237 | $variables = [ |
238 | - 'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'", |
|
239 | - 'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime', '') . "'", |
|
240 | - 'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime', '') . "'" |
|
238 | + 'theming-cachebuster' => "'".$this->config->getAppValue('theming', 'cachebuster', '0')."'", |
|
239 | + 'theming-logo-mime' => "'".$this->config->getAppValue('theming', 'logoMime', '')."'", |
|
240 | + 'theming-background-mime' => "'".$this->config->getAppValue('theming', 'backgroundMime', '')."'" |
|
241 | 241 | ]; |
242 | 242 | |
243 | 243 | $variables['image-logo'] = "'".$this->urlGenerator->getAbsoluteURL($this->getLogo())."'"; |
@@ -271,25 +271,25 @@ discard block |
||
271 | 271 | * @return bool|string false if image should not replaced, otherwise the location of the image |
272 | 272 | */ |
273 | 273 | public function replaceImagePath($app, $image) { |
274 | - if($app==='') { |
|
274 | + if ($app === '') { |
|
275 | 275 | $app = 'core'; |
276 | 276 | } |
277 | 277 | $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); |
278 | 278 | |
279 | 279 | if ($image === 'favicon.ico' && $this->shouldReplaceIcons()) { |
280 | - return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
280 | + return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]).'?v='.$cacheBusterValue; |
|
281 | 281 | } |
282 | 282 | if ($image === 'favicon-touch.png' && $this->shouldReplaceIcons()) { |
283 | - return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
283 | + return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]).'?v='.$cacheBusterValue; |
|
284 | 284 | } |
285 | 285 | if ($image === 'manifest.json') { |
286 | 286 | try { |
287 | 287 | $appPath = $this->appManager->getAppPath($app); |
288 | - if (file_exists($appPath . '/img/manifest.json')) { |
|
288 | + if (file_exists($appPath.'/img/manifest.json')) { |
|
289 | 289 | return false; |
290 | 290 | } |
291 | 291 | } catch (AppPathNotFoundException $e) {} |
292 | - return $this->urlGenerator->linkToRoute('theming.Theming.getManifest') . '?v=' . $cacheBusterValue; |
|
292 | + return $this->urlGenerator->linkToRoute('theming.Theming.getManifest').'?v='.$cacheBusterValue; |
|
293 | 293 | } |
294 | 294 | return false; |
295 | 295 | } |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function shouldReplaceIcons() { |
304 | 304 | $cache = $this->cacheFactory->create('theming'); |
305 | - if($value = $cache->get('shouldReplaceIcons')) { |
|
306 | - return (bool)$value; |
|
305 | + if ($value = $cache->get('shouldReplaceIcons')) { |
|
306 | + return (bool) $value; |
|
307 | 307 | } |
308 | 308 | $value = false; |
309 | - if(extension_loaded('imagick')) { |
|
309 | + if (extension_loaded('imagick')) { |
|
310 | 310 | $checkImagick = new \Imagick(); |
311 | 311 | if (count($checkImagick->queryFormats('SVG')) >= 1) { |
312 | 312 | $value = true; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | */ |
323 | 323 | private function increaseCacheBuster() { |
324 | 324 | $cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0'); |
325 | - $this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1); |
|
325 | + $this->config->setAppValue('theming', 'cachebuster', (int) $cacheBusterKey + 1); |
|
326 | 326 | $this->cacheFactory->create('theming')->clear('getScssVariables'); |
327 | 327 | } |
328 | 328 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | <h2 class="inlineblock"><?php p($_['heading']); ?></h2> |
27 | 27 | <?php if (!empty($_['docs'])): ?> |
28 | 28 | <a target="_blank" rel="noreferrer noopener" class="icon-info svg" |
29 | - title="<?php p($l->t('Open documentation'));?>" |
|
29 | + title="<?php p($l->t('Open documentation')); ?>" |
|
30 | 30 | href="<?php p(link_to_docs($_['docs'])); ?>"> |
31 | 31 | </a> |
32 | 32 | <?php endif; ?> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <div class="ldapSettingControls"> |
2 | 2 | <button type="button" class="ldap_action_test_connection" name="ldap_action_test_connection"> |
3 | - <?php p($l->t('Test Configuration'));?> |
|
3 | + <?php p($l->t('Test Configuration')); ?> |
|
4 | 4 | </button> |
5 | 5 | <a href="<?php p(link_to_docs('admin-ldap')); ?>" |
6 | 6 | target="_blank" rel="noreferrer noopener"> |
7 | 7 | <img src="<?php print_unescaped(image_path('', 'actions/info.svg')); ?>" |
8 | 8 | style="height:1.75ex" /> |
9 | - <?php p($l->t('Help'));?> |
|
9 | + <?php p($l->t('Help')); ?> |
|
10 | 10 | </a> |
11 | 11 | </div> |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <div class="ldapWizardControls"> |
2 | - <span class="ldap_saving hidden"><?php p($l->t('Saving'));?> <img class="wizSpinner" src="<?php p(image_path('core', 'loading.gif')); ?>"/></span> |
|
2 | + <span class="ldap_saving hidden"><?php p($l->t('Saving')); ?> <img class="wizSpinner" src="<?php p(image_path('core', 'loading.gif')); ?>"/></span> |
|
3 | 3 | <span class="ldap_config_state_indicator"></span> <span class="ldap_config_state_indicator_sign"></span> |
4 | 4 | <button class="ldap_action_back invisible" name="ldap_action_back" |
5 | 5 | type="button"> |
6 | - <?php p($l->t('Back'));?> |
|
6 | + <?php p($l->t('Back')); ?> |
|
7 | 7 | </button> |
8 | 8 | <button class="ldap_action_continue" name="ldap_action_continue" type="button"> |
9 | - <?php p($l->t('Continue'));?> |
|
9 | + <?php p($l->t('Continue')); ?> |
|
10 | 10 | </button> |
11 | 11 | <a href="<?php p(link_to_docs('admin-ldap')); ?>" |
12 | 12 | target="_blank" rel="noreferrer noopener"> |
13 | 13 | <img src="<?php print_unescaped(image_path('', 'actions/info.svg')); ?>" |
14 | 14 | style="height:1.75ex" /> |
15 | - <span class="ldap_grey"><?php p($l->t('Help'));?></span> |
|
15 | + <span class="ldap_grey"><?php p($l->t('Help')); ?></span> |
|
16 | 16 | </a> |
17 | 17 | </div> |
@@ -3,12 +3,12 @@ |
||
3 | 3 | <h2 class="title"><?php p($l->t('Update needed')) ?></h2> |
4 | 4 | <div class="infogroup"> |
5 | 5 | <?php if ($_['tooBig']) { |
6 | - p($l->t('Please use the command line updater because you have a big instance with more than 50 users.')); |
|
7 | - } else { |
|
8 | - p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); |
|
9 | - } ?><br><br> |
|
6 | + p($l->t('Please use the command line updater because you have a big instance with more than 50 users.')); |
|
7 | + } else { |
|
8 | + p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); |
|
9 | + } ?><br><br> |
|
10 | 10 | <?php |
11 | - print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?><br><br> |
|
11 | + print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?><br><br> |
|
12 | 12 | </div> |
13 | 13 | </div> |
14 | 14 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | script('core', [ |
3 | - 'jquery-showpassword', |
|
4 | - 'installation' |
|
3 | + 'jquery-showpassword', |
|
4 | + 'installation' |
|
5 | 5 | ]); |
6 | 6 | ?> |
7 | 7 | <input type='hidden' id='hasMySQL' value='<?php p($_['hasMySQL']) ?>'> |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | <legend><strong><?php p($l->t('Security warning'));?></strong></legend> |
31 | 31 | <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br> |
32 | 32 | <?php print_unescaped($l->t( |
33 | - 'For information how to properly configure your server, please see the <a href="%s" target="_blank" rel="noreferrer noopener">documentation</a>.', |
|
34 | - link_to_docs('admin-install') |
|
35 | - )); ?></p> |
|
33 | + 'For information how to properly configure your server, please see the <a href="%s" target="_blank" rel="noreferrer noopener">documentation</a>.', |
|
34 | + link_to_docs('admin-install') |
|
35 | + )); ?></p> |
|
36 | 36 | </fieldset> |
37 | 37 | <?php endif; ?> |
38 | 38 | <fieldset id="adminaccount"> |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
77 | 77 | <fieldset id='databaseBackend'> |
78 | 78 | <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) |
79 | - $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?> |
|
79 | + $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?> |
|
80 | 80 | <legend><?php p($l->t( 'Configure the database' )); ?></legend> |
81 | 81 | <div id="selectDbType"> |
82 | 82 | <?php foreach($_['databases'] as $type => $label): ?> |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | <input type='hidden' id='hasOracle' value='<?php p($_['hasOracle']) ?>'> |
11 | 11 | <form action="index.php" method="post"> |
12 | 12 | <input type="hidden" name="install" value="true"> |
13 | - <?php if(count($_['errors']) > 0): ?> |
|
13 | + <?php if (count($_['errors']) > 0): ?> |
|
14 | 14 | <fieldset class="warning"> |
15 | - <legend><strong><?php p($l->t('Error'));?></strong></legend> |
|
16 | - <?php foreach($_['errors'] as $err): ?> |
|
15 | + <legend><strong><?php p($l->t('Error')); ?></strong></legend> |
|
16 | + <?php foreach ($_['errors'] as $err): ?> |
|
17 | 17 | <p> |
18 | - <?php if(is_array($err)):?> |
|
18 | + <?php if (is_array($err)):?> |
|
19 | 19 | <?php print_unescaped($err['error']); ?> |
20 | 20 | <span class='hint'><?php print_unescaped($err['hint']); ?></span> |
21 | 21 | <?php else: ?> |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | <?php endforeach; ?> |
26 | 26 | </fieldset> |
27 | 27 | <?php endif; ?> |
28 | - <?php if(!$_['htaccessWorking']): ?> |
|
28 | + <?php if (!$_['htaccessWorking']): ?> |
|
29 | 29 | <fieldset class="warning"> |
30 | - <legend><strong><?php p($l->t('Security warning'));?></strong></legend> |
|
31 | - <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br> |
|
30 | + <legend><strong><?php p($l->t('Security warning')); ?></strong></legend> |
|
31 | + <p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.')); ?><br> |
|
32 | 32 | <?php print_unescaped($l->t( |
33 | 33 | 'For information how to properly configure your server, please see the <a href="%s" target="_blank" rel="noreferrer noopener">documentation</a>.', |
34 | 34 | link_to_docs('admin-install') |
@@ -36,35 +36,35 @@ discard block |
||
36 | 36 | </fieldset> |
37 | 37 | <?php endif; ?> |
38 | 38 | <fieldset id="adminaccount"> |
39 | - <legend><?php print_unescaped($l->t( 'Create an <strong>admin account</strong>' )); ?></legend> |
|
39 | + <legend><?php print_unescaped($l->t('Create an <strong>admin account</strong>')); ?></legend> |
|
40 | 40 | <p class="grouptop"> |
41 | 41 | <input type="text" name="adminlogin" id="adminlogin" |
42 | - placeholder="<?php p($l->t( 'Username' )); ?>" |
|
42 | + placeholder="<?php p($l->t('Username')); ?>" |
|
43 | 43 | value="<?php p($_['adminlogin']); ?>" |
44 | 44 | autocomplete="off" autocapitalize="none" autocorrect="off" autofocus required> |
45 | - <label for="adminlogin" class="infield"><?php p($l->t( 'Username' )); ?></label> |
|
45 | + <label for="adminlogin" class="infield"><?php p($l->t('Username')); ?></label> |
|
46 | 46 | </p> |
47 | 47 | <p class="groupbottom"> |
48 | 48 | <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass" |
49 | - placeholder="<?php p($l->t( 'Password' )); ?>" |
|
49 | + placeholder="<?php p($l->t('Password')); ?>" |
|
50 | 50 | value="<?php p($_['adminpass']); ?>" |
51 | 51 | autocomplete="off" autocapitalize="none" autocorrect="off" required> |
52 | - <label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label> |
|
52 | + <label for="adminpass" class="infield"><?php p($l->t('Password')); ?></label> |
|
53 | 53 | <input type="checkbox" id="show" name="show"> |
54 | 54 | <label for="show"></label> |
55 | 55 | </p> |
56 | 56 | </fieldset> |
57 | 57 | |
58 | - <?php if(!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
58 | + <?php if (!$_['directoryIsSet'] OR !$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
59 | 59 | <fieldset id="advancedHeader"> |
60 | - <legend><a id="showAdvanced"><?php p($l->t( 'Storage & database' )); ?> <img src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend> |
|
60 | + <legend><a id="showAdvanced"><?php p($l->t('Storage & database')); ?> <img src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a></legend> |
|
61 | 61 | </fieldset> |
62 | 62 | <?php endif; ?> |
63 | 63 | |
64 | - <?php if(!$_['directoryIsSet'] OR count($_['errors']) > 0): ?> |
|
64 | + <?php if (!$_['directoryIsSet'] OR count($_['errors']) > 0): ?> |
|
65 | 65 | <fieldset id="datadirField"> |
66 | 66 | <div id="datadirContent"> |
67 | - <label for="directory"><?php p($l->t( 'Data folder' )); ?></label> |
|
67 | + <label for="directory"><?php p($l->t('Data folder')); ?></label> |
|
68 | 68 | <input type="text" name="directory" id="directory" |
69 | 69 | placeholder="<?php p(OC::$SERVERROOT.'/data'); ?>" |
70 | 70 | value="<?php p($_['directory']); ?>" |
@@ -73,19 +73,19 @@ discard block |
||
73 | 73 | </fieldset> |
74 | 74 | <?php endif; ?> |
75 | 75 | |
76 | - <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
76 | + <?php if (!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
77 | 77 | <fieldset id='databaseBackend'> |
78 | - <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) |
|
79 | - $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?> |
|
80 | - <legend><?php p($l->t( 'Configure the database' )); ?></legend> |
|
78 | + <?php if ($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) |
|
79 | + $hasOtherDB = true; else $hasOtherDB = false; //other than SQLite ?> |
|
80 | + <legend><?php p($l->t('Configure the database')); ?></legend> |
|
81 | 81 | <div id="selectDbType"> |
82 | - <?php foreach($_['databases'] as $type => $label): ?> |
|
83 | - <?php if(count($_['databases']) === 1): ?> |
|
82 | + <?php foreach ($_['databases'] as $type => $label): ?> |
|
83 | + <?php if (count($_['databases']) === 1): ?> |
|
84 | 84 | <p class="info"> |
85 | - <?php p($l->t( 'Only %s is available.', array($label) )); ?> |
|
86 | - <?php p($l->t( 'Install and activate additional PHP modules to choose other database types.' )); ?><br> |
|
85 | + <?php p($l->t('Only %s is available.', array($label))); ?> |
|
86 | + <?php p($l->t('Install and activate additional PHP modules to choose other database types.')); ?><br> |
|
87 | 87 | <a href="<?php print_unescaped(link_to_docs('admin-source_install')); ?>" target="_blank" rel="noreferrer noopener"> |
88 | - <?php p($l->t( 'For more details check out the documentation.' )); ?> ↗</a> |
|
88 | + <?php p($l->t('For more details check out the documentation.')); ?> ↗</a> |
|
89 | 89 | </p> |
90 | 90 | <input type="hidden" id="dbtype" name="dbtype" value="<?php p($type) ?>"> |
91 | 91 | <?php else: ?> |
@@ -97,75 +97,75 @@ discard block |
||
97 | 97 | </div> |
98 | 98 | </fieldset> |
99 | 99 | |
100 | - <?php if($hasOtherDB): ?> |
|
100 | + <?php if ($hasOtherDB): ?> |
|
101 | 101 | <fieldset id='databaseField'> |
102 | 102 | <div id="use_other_db"> |
103 | 103 | <p class="grouptop"> |
104 | - <label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label> |
|
104 | + <label for="dbuser" class="infield"><?php p($l->t('Database user')); ?></label> |
|
105 | 105 | <input type="text" name="dbuser" id="dbuser" |
106 | - placeholder="<?php p($l->t( 'Database user' )); ?>" |
|
106 | + placeholder="<?php p($l->t('Database user')); ?>" |
|
107 | 107 | value="<?php p($_['dbuser']); ?>" |
108 | 108 | autocomplete="off" autocapitalize="none" autocorrect="off"> |
109 | 109 | </p> |
110 | 110 | <p class="groupmiddle"> |
111 | 111 | <input type="password" name="dbpass" id="dbpass" data-typetoggle="#dbpassword-toggle" |
112 | - placeholder="<?php p($l->t( 'Database password' )); ?>" |
|
112 | + placeholder="<?php p($l->t('Database password')); ?>" |
|
113 | 113 | value="<?php p($_['dbpass']); ?>" |
114 | 114 | autocomplete="off" autocapitalize="none" autocorrect="off"> |
115 | - <label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label> |
|
115 | + <label for="dbpass" class="infield"><?php p($l->t('Database password')); ?></label> |
|
116 | 116 | <input type="checkbox" id="dbpassword-toggle" name="dbpassword-toggle"> |
117 | 117 | <label for="dbpassword-toggle"></label> |
118 | 118 | </p> |
119 | 119 | <p class="groupmiddle"> |
120 | - <label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label> |
|
120 | + <label for="dbname" class="infield"><?php p($l->t('Database name')); ?></label> |
|
121 | 121 | <input type="text" name="dbname" id="dbname" |
122 | - placeholder="<?php p($l->t( 'Database name' )); ?>" |
|
122 | + placeholder="<?php p($l->t('Database name')); ?>" |
|
123 | 123 | value="<?php p($_['dbname']); ?>" |
124 | 124 | autocomplete="off" autocapitalize="none" autocorrect="off" |
125 | 125 | pattern="[0-9a-zA-Z$_-]+"> |
126 | 126 | </p> |
127 | - <?php if($_['hasOracle']): ?> |
|
127 | + <?php if ($_['hasOracle']): ?> |
|
128 | 128 | <div id="use_oracle_db"> |
129 | 129 | <p class="groupmiddle"> |
130 | - <label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label> |
|
130 | + <label for="dbtablespace" class="infield"><?php p($l->t('Database tablespace')); ?></label> |
|
131 | 131 | <input type="text" name="dbtablespace" id="dbtablespace" |
132 | - placeholder="<?php p($l->t( 'Database tablespace' )); ?>" |
|
132 | + placeholder="<?php p($l->t('Database tablespace')); ?>" |
|
133 | 133 | value="<?php p($_['dbtablespace']); ?>" |
134 | 134 | autocomplete="off" autocapitalize="none" autocorrect="off"> |
135 | 135 | </p> |
136 | 136 | </div> |
137 | 137 | <?php endif; ?> |
138 | 138 | <p class="groupbottom"> |
139 | - <label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label> |
|
139 | + <label for="dbhost" class="infield"><?php p($l->t('Database host')); ?></label> |
|
140 | 140 | <input type="text" name="dbhost" id="dbhost" |
141 | - placeholder="<?php p($l->t( 'Database host' )); ?>" |
|
141 | + placeholder="<?php p($l->t('Database host')); ?>" |
|
142 | 142 | value="<?php p($_['dbhost']); ?>" |
143 | 143 | autocomplete="off" autocapitalize="none" autocorrect="off"> |
144 | 144 | </p> |
145 | 145 | <p class="info"> |
146 | - <?php p($l->t( 'Please specify the port number along with the host name (e.g., localhost:5432).' )); ?> |
|
146 | + <?php p($l->t('Please specify the port number along with the host name (e.g., localhost:5432).')); ?> |
|
147 | 147 | </p> |
148 | 148 | </div> |
149 | 149 | </fieldset> |
150 | 150 | <?php endif; ?> |
151 | 151 | <?php endif; ?> |
152 | 152 | |
153 | - <?php if(!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
153 | + <?php if (!$_['dbIsSet'] OR count($_['errors']) > 0): ?> |
|
154 | 154 | <fieldset id="sqliteInformation" class="warning"> |
155 | - <legend><?php p($l->t('Performance warning'));?></legend> |
|
156 | - <p><?php p($l->t('SQLite will be used as database.'));?></p> |
|
157 | - <p><?php p($l->t('For larger installations we recommend to choose a different database backend.'));?></p> |
|
155 | + <legend><?php p($l->t('Performance warning')); ?></legend> |
|
156 | + <p><?php p($l->t('SQLite will be used as database.')); ?></p> |
|
157 | + <p><?php p($l->t('For larger installations we recommend to choose a different database backend.')); ?></p> |
|
158 | 158 | <p><?php p($l->t('Especially when using the desktop client for file syncing the use of SQLite is discouraged.')); ?></p> |
159 | 159 | </fieldset> |
160 | 160 | <?php endif ?> |
161 | 161 | |
162 | 162 | <div class="icon-loading-dark float-spinner"> </div> |
163 | 163 | |
164 | - <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" data-finishing="<?php p($l->t( 'Finishing …' )); ?>"></div> |
|
164 | + <div class="buttons"><input type="submit" class="primary" value="<?php p($l->t('Finish setup')); ?>" data-finishing="<?php p($l->t('Finishing …')); ?>"></div> |
|
165 | 165 | |
166 | 166 | <p class="info"> |
167 | 167 | <span class="icon-info-white"></span> |
168 | - <?php p($l->t('Need help?'));?> |
|
169 | - <a target="_blank" rel="noreferrer noopener" href="<?php p(link_to_docs('admin-install')); ?>"><?php p($l->t('See the documentation'));?> ↗</a> |
|
168 | + <?php p($l->t('Need help?')); ?> |
|
169 | + <a target="_blank" rel="noreferrer noopener" href="<?php p(link_to_docs('admin-install')); ?>"><?php p($l->t('See the documentation')); ?> ↗</a> |
|
170 | 170 | </p> |
171 | 171 | </form> |
@@ -2,10 +2,10 @@ |
||
2 | 2 | <div id="nojavascript"> |
3 | 3 | <div> |
4 | 4 | <?php print_unescaped(str_replace( |
5 | - ['{linkstart}', '{linkend}'], |
|
6 | - ['<a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">', '</a>'], |
|
7 | - $l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.') |
|
8 | - )); ?> |
|
5 | + ['{linkstart}', '{linkend}'], |
|
6 | + ['<a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">', '</a>'], |
|
7 | + $l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.') |
|
8 | + )); ?> |
|
9 | 9 | </div> |
10 | 10 | </div> |
11 | 11 | </noscript> |