Completed
Pull Request — master (#5398)
by Morris
28:46 queued 07:18
created
apps/theming/lib/ThemingDefaults.php 1 patch
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">' .$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">' .$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.