Completed
Pull Request — master (#6788)
by Markus
77:53 queued 63:49
created
apps/federatedfilesharing/templates/settings-admin.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
apps/theming/lib/ThemingDefaults.php 2 patches
Indentation   +334 added lines, -334 removed lines patch added patch discarded remove patch
@@ -33,338 +33,338 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
apps/workflowengine/templates/admin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
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; ?>
Please login to merge, or discard this patch.
apps/user_ldap/templates/part.settingcontrols.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
apps/user_ldap/templates/part.wizardcontrols.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
core/templates/update.use-cli.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
core/templates/installation.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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): ?>
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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">&nbsp;</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>
Please login to merge, or discard this patch.
core/templates/layout.noscript.warning.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
settings/templates/apps.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	</li>
23 23
 {{/each}}
24 24
 
25
-<?php if($_['appstoreEnabled']): ?>
25
+<?php if ($_['appstoreEnabled']): ?>
26 26
 	<li>
27
-		<a class="app-external icon-info" target="_blank" rel="noreferrer noopener" href="https://docs.nextcloud.org/server/12/developer_manual/"><?php p($l->t('Developer documentation'));?> ↗</a>
27
+		<a class="app-external icon-info" target="_blank" rel="noreferrer noopener" href="https://docs.nextcloud.org/server/12/developer_manual/"><?php p($l->t('Developer documentation')); ?> ↗</a>
28 28
 	</li>
29 29
 <?php endif; ?>
30 30
 </script>
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 {{#if newCategory}}
34 34
 <div class="apps-header">
35 35
 	<div class="app-image"></div>
36
-	<h2>{{categoryName}} <input class="enable" type="submit" data-bundleid="{{bundleId}}" data-active="true" value="<?php p($l->t('Enable all'));?>"/></h2>
36
+	<h2>{{categoryName}} <input class="enable" type="submit" data-bundleid="{{bundleId}}" data-active="true" value="<?php p($l->t('Enable all')); ?>"/></h2>
37 37
 	<div class="app-version"></div>
38 38
 	<div class="app-level"></div>
39 39
 	<div class="app-groups"></div>
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	</div>
52 52
 	<div class="app-version">{{version}}</div>
53 53
 	<div class="app-level">
54
-		{{{level}}}{{#unless internal}}<a href="https://apps.nextcloud.com/apps/{{id}}"><?php p($l->t('View in store'));?> ↗</a>{{/unless}}
54
+		{{{level}}}{{#unless internal}}<a href="https://apps.nextcloud.com/apps/{{id}}"><?php p($l->t('View in store')); ?> ↗</a>{{/unless}}
55 55
 	</div>
56 56
 
57 57
 	<div class="app-groups">
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 		<input class="uninstall" type="submit" value="<?php p($l->t('Remove')); ?>" data-appid="{{id}}" />
75 75
 		{{/if}}
76 76
 		{{#if active}}
77
-		<input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/>
77
+		<input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable")); ?>"/>
78 78
 		{{else}}
79
-		<input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/>
79
+		<input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable")); ?>"/>
80 80
 		{{/if}}
81 81
 	</div>
82 82
 </div>
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	<div class="app-description-container hidden">
107 107
 		<div class="app-version">{{version}}</div>
108 108
 		{{#if profilepage}}<a href="{{profilepage}}" target="_blank" rel="noreferrer noopener">{{/if}}
109
-		<div class="app-author"><?php p($l->t('by %s', ['{{author}}']));?>
109
+		<div class="app-author"><?php p($l->t('by %s', ['{{author}}'])); ?>
110 110
 			{{#if licence}}
111 111
 			(<?php p($l->t('%s-licensed', ['{{licence}}'])); ?>)
112 112
 			{{/if}}
@@ -116,37 +116,37 @@  discard block
 block discarded – undo
116 116
 		<!--<div class="app-changed">{{changed}}</div>-->
117 117
 		{{#if documentation}}
118 118
 		<p class="documentation">
119
-			<?php p($l->t("Documentation:"));?>
119
+			<?php p($l->t("Documentation:")); ?>
120 120
 			{{#if documentation.user}}
121 121
 			<span class="userDocumentation">
122
-			<a id="userDocumentation" class="appslink" href="{{documentation.user}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('User documentation'));?> ↗</a>
122
+			<a id="userDocumentation" class="appslink" href="{{documentation.user}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('User documentation')); ?> ↗</a>
123 123
 			</span>
124 124
 			{{/if}}
125 125
 
126 126
 			{{#if documentation.admin}}
127 127
 			<span class="adminDocumentation">
128
-			<a id="adminDocumentation" class="appslink" href="{{documentation.admin}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Admin documentation'));?> ↗</a>
128
+			<a id="adminDocumentation" class="appslink" href="{{documentation.admin}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Admin documentation')); ?> ↗</a>
129 129
 			</span>
130 130
 			{{/if}}
131 131
 
132 132
 			{{#if documentation.developer}}
133 133
 			<span class="developerDocumentation">
134
-			<a id="developerDocumentation" class="appslink" href="{{documentation.developer}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Developer documentation'));?> ↗</a>
134
+			<a id="developerDocumentation" class="appslink" href="{{documentation.developer}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Developer documentation')); ?> ↗</a>
135 135
 			</span>
136 136
 			{{/if}}
137 137
 		</p>
138 138
 		{{/if}}
139 139
 
140 140
 		{{#if website}}
141
-		<a id="userDocumentation" class="appslink" href="{{website}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Visit website'));?> ↗</a>
141
+		<a id="userDocumentation" class="appslink" href="{{website}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Visit website')); ?> ↗</a>
142 142
 		{{/if}}
143 143
 
144 144
 		{{#if bugs}}
145
-		<a id="adminDocumentation" class="appslink" href="{{bugs}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Report a bug'));?> ↗</a>
145
+		<a id="adminDocumentation" class="appslink" href="{{bugs}}" target="_blank" rel="noreferrer noopener"><?php p($l->t('Report a bug')); ?> ↗</a>
146 146
 		{{/if}}
147 147
 	</div><!-- end app-description-container -->
148
-	<div class="app-description-toggle-show" role="link"><?php p($l->t("Show description …"));?></div>
149
-	<div class="app-description-toggle-hide hidden" role="link"><?php p($l->t("Hide description …"));?></div>
148
+	<div class="app-description-toggle-show" role="link"><?php p($l->t("Show description …")); ?></div>
149
+	<div class="app-description-toggle-hide hidden" role="link"><?php p($l->t("Hide description …")); ?></div>
150 150
 
151 151
 	<div class="app-dependencies update hidden">
152 152
 		<p><?php p($l->t('This app has an update available.')); ?></p>
@@ -177,14 +177,14 @@  discard block
 block discarded – undo
177 177
 
178 178
 	<input class="update hidden" type="submit" value="<?php p($l->t('Update to %s', array('{{update}}'))); ?>" data-appid="{{id}}" />
179 179
 	{{#if active}}
180
-	<input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/>
180
+	<input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable")); ?>"/>
181 181
 	<div class="groups-enable">
182 182
 		<input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/>
183 183
 		<label for="groups_enable-{{id}}"><?php p($l->t('Enable only for specific groups')); ?></label>
184 184
 	</div>
185 185
 	<input type="hidden" class="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
186 186
 	{{else}}
187
-	<input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/>
187
+	<input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable")); ?>"/>
188 188
 	{{/if}}
189 189
 	{{#if canUnInstall}}
190 190
 	<input class="uninstall" type="submit" value="<?php p($l->t('Remove')); ?>" data-appid="{{id}}" />
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	</div>
196 196
 </script>
197 197
 
198
-<div id="app-navigation" class="icon-loading" data-category="<?php p($_['category']);?>">
198
+<div id="app-navigation" class="icon-loading" data-category="<?php p($_['category']); ?>">
199 199
 	<ul id="apps-categories">
200 200
 
201 201
 	</ul>
Please login to merge, or discard this patch.