@@ -37,74 +37,74 @@ |
||
37 | 37 | use OCP\Settings\ISettings; |
38 | 38 | |
39 | 39 | class Admin implements ISettings { |
40 | - /** @var IConfig */ |
|
41 | - private $config; |
|
42 | - /** @var IL10N */ |
|
43 | - private $l; |
|
44 | - /** @var ThemingDefaults */ |
|
45 | - private $themingDefaults; |
|
46 | - /** @var IURLGenerator */ |
|
47 | - private $urlGenerator; |
|
40 | + /** @var IConfig */ |
|
41 | + private $config; |
|
42 | + /** @var IL10N */ |
|
43 | + private $l; |
|
44 | + /** @var ThemingDefaults */ |
|
45 | + private $themingDefaults; |
|
46 | + /** @var IURLGenerator */ |
|
47 | + private $urlGenerator; |
|
48 | 48 | |
49 | - public function __construct(IConfig $config, |
|
50 | - IL10N $l, |
|
51 | - ThemingDefaults $themingDefaults, |
|
52 | - IURLGenerator $urlGenerator) { |
|
53 | - $this->config = $config; |
|
54 | - $this->l = $l; |
|
55 | - $this->themingDefaults = $themingDefaults; |
|
56 | - $this->urlGenerator = $urlGenerator; |
|
57 | - } |
|
49 | + public function __construct(IConfig $config, |
|
50 | + IL10N $l, |
|
51 | + ThemingDefaults $themingDefaults, |
|
52 | + IURLGenerator $urlGenerator) { |
|
53 | + $this->config = $config; |
|
54 | + $this->l = $l; |
|
55 | + $this->themingDefaults = $themingDefaults; |
|
56 | + $this->urlGenerator = $urlGenerator; |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * @return TemplateResponse |
|
61 | - */ |
|
62 | - public function getForm() { |
|
63 | - $path = $this->urlGenerator->linkToRoute('theming.Theming.updateLogo'); |
|
59 | + /** |
|
60 | + * @return TemplateResponse |
|
61 | + */ |
|
62 | + public function getForm() { |
|
63 | + $path = $this->urlGenerator->linkToRoute('theming.Theming.updateLogo'); |
|
64 | 64 | |
65 | - $themable = true; |
|
66 | - $errorMessage = ''; |
|
67 | - $theme = $this->config->getSystemValue('theme', ''); |
|
68 | - if ($theme !== '') { |
|
69 | - $themable = false; |
|
70 | - $errorMessage = $this->l->t('You are already using a custom theme. Theming app settings might be overwritten by that.'); |
|
71 | - } |
|
65 | + $themable = true; |
|
66 | + $errorMessage = ''; |
|
67 | + $theme = $this->config->getSystemValue('theme', ''); |
|
68 | + if ($theme !== '') { |
|
69 | + $themable = false; |
|
70 | + $errorMessage = $this->l->t('You are already using a custom theme. Theming app settings might be overwritten by that.'); |
|
71 | + } |
|
72 | 72 | |
73 | - $parameters = [ |
|
74 | - 'themable' => $themable, |
|
75 | - 'errorMessage' => $errorMessage, |
|
76 | - 'name' => $this->themingDefaults->getEntity(), |
|
77 | - 'url' => $this->themingDefaults->getBaseUrl(), |
|
78 | - 'slogan' => $this->themingDefaults->getSlogan(), |
|
79 | - 'color' => $this->themingDefaults->getColorPrimary(), |
|
80 | - 'logo' => $this->themingDefaults->getLogo(), |
|
81 | - 'logoMime' => $this->config->getAppValue('theming', 'logoMime', ''), |
|
82 | - 'background' => $this->themingDefaults->getBackground(), |
|
83 | - 'backgroundMime' => $this->config->getAppValue('theming', 'backgroundMime', ''), |
|
84 | - 'uploadLogoRoute' => $path, |
|
85 | - 'canThemeIcons' => $this->themingDefaults->shouldReplaceIcons(), |
|
86 | - 'iconDocs' => $this->urlGenerator->linkToDocs('admin-theming-icons') |
|
87 | - ]; |
|
73 | + $parameters = [ |
|
74 | + 'themable' => $themable, |
|
75 | + 'errorMessage' => $errorMessage, |
|
76 | + 'name' => $this->themingDefaults->getEntity(), |
|
77 | + 'url' => $this->themingDefaults->getBaseUrl(), |
|
78 | + 'slogan' => $this->themingDefaults->getSlogan(), |
|
79 | + 'color' => $this->themingDefaults->getColorPrimary(), |
|
80 | + 'logo' => $this->themingDefaults->getLogo(), |
|
81 | + 'logoMime' => $this->config->getAppValue('theming', 'logoMime', ''), |
|
82 | + 'background' => $this->themingDefaults->getBackground(), |
|
83 | + 'backgroundMime' => $this->config->getAppValue('theming', 'backgroundMime', ''), |
|
84 | + 'uploadLogoRoute' => $path, |
|
85 | + 'canThemeIcons' => $this->themingDefaults->shouldReplaceIcons(), |
|
86 | + 'iconDocs' => $this->urlGenerator->linkToDocs('admin-theming-icons') |
|
87 | + ]; |
|
88 | 88 | |
89 | - return new TemplateResponse('theming', 'settings-admin', $parameters, ''); |
|
90 | - } |
|
89 | + return new TemplateResponse('theming', 'settings-admin', $parameters, ''); |
|
90 | + } |
|
91 | 91 | |
92 | - /** |
|
93 | - * @return string the section ID, e.g. 'sharing' |
|
94 | - */ |
|
95 | - public function getSection() { |
|
96 | - return 'theming'; |
|
97 | - } |
|
92 | + /** |
|
93 | + * @return string the section ID, e.g. 'sharing' |
|
94 | + */ |
|
95 | + public function getSection() { |
|
96 | + return 'theming'; |
|
97 | + } |
|
98 | 98 | |
99 | - /** |
|
100 | - * @return int whether the form should be rather on the top or bottom of |
|
101 | - * the admin section. The forms are arranged in ascending order of the |
|
102 | - * priority values. It is required to return a value between 0 and 100. |
|
103 | - * |
|
104 | - * E.g.: 70 |
|
105 | - */ |
|
106 | - public function getPriority() { |
|
107 | - return 5; |
|
108 | - } |
|
99 | + /** |
|
100 | + * @return int whether the form should be rather on the top or bottom of |
|
101 | + * the admin section. The forms are arranged in ascending order of the |
|
102 | + * priority values. It is required to return a value between 0 and 100. |
|
103 | + * |
|
104 | + * E.g.: 70 |
|
105 | + */ |
|
106 | + public function getPriority() { |
|
107 | + return 5; |
|
108 | + } |
|
109 | 109 | |
110 | 110 | } |