aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/settings
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-21 21:21:46 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-27 10:26:23 +0200
commit27b699bdbcd080ec9d5400a2391cdb2b725f7ee1 (patch)
tree0cd0e124cb6e7ea4b6dfdf1958df4eafae48d240 /apps/theming/settings
parentcc321bc140f707257ffe1a11b4fa0238887e16fc (diff)
downloadnextcloud-server-27b699bdbcd080ec9d5400a2391cdb2b725f7ee1.tar.gz
nextcloud-server-27b699bdbcd080ec9d5400a2391cdb2b725f7ee1.zip
Migrate logic to dynamic controller
Also adds support for having custom login backgrounds
Diffstat (limited to 'apps/theming/settings')
-rw-r--r--apps/theming/settings/settings-admin.php32
1 files changed, 14 insertions, 18 deletions
diff --git a/apps/theming/settings/settings-admin.php b/apps/theming/settings/settings-admin.php
index c79eb1475fb..59da90a47f8 100644
--- a/apps/theming/settings/settings-admin.php
+++ b/apps/theming/settings/settings-admin.php
@@ -1,22 +1,22 @@
<?php
/**
- * @author Björn Schießle <bjoern@schiessle.org>
+ * @copyright Copyright (c) 2016 Bjoern Schiessle <bjoern@schiessle.org>
+ * @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
*
- * @copyright Copyright (c) 2016, Bjoern Schiessle
- * @license AGPL-3.0
+ * @license GNU AGPL version 3 or any later version
*
- * This code is free software: you can redistribute it and/or modify
+ * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your opinion) any later version.
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
@@ -25,35 +25,31 @@
$config = \OC::$server->getConfig();
$l = \OC::$server->getL10N('theming');
$urlGenerator = \OC::$server->getURLGenerator();
-$init = new \OCA\Theming\Init($config, \OC::$server->getLogger());
$theming = new \OCA\Theming\Template(
$config,
$l,
\OC::$server->getURLGenerator(),
- $init
+ new OC_Defaults()
);
$themable = true;
$errorMessage = '';
-$theme = $config->getSystemValue('theme', 'default');
+$theme = $config->getSystemValue('theme', '');
-if ($theme !== 'theming-app' && $theme !== 'default') {
+if ($theme !== '') {
$themable = false;
$errorMessage = $l->t('You already use a custom theme');
-} elseif (!is_writable(\OC::$SERVERROOT . '/themes')) {
- $themable = false;
- $errorMessage = $l->t('Themes folder is read-only, please update the permissions to read-write');
}
$template = new OCP\Template('theming', 'settings-admin');
$template->assign('themable', $themable);
$template->assign('errorMessage', $errorMessage);
-$template->assign('name', $theming->getName());
-$template->assign('url', $theming->getUrl());
+$template->assign('name', $theming->getEntity());
+$template->assign('url', $theming->getBaseUrl());
$template->assign('slogan', $theming->getSlogan());
-$template->assign('color', $theming->getColor());
+$template->assign('color', $theming->getMailHeaderColor());
$path = $urlGenerator->linkToRoute('theming.Theming.updateLogo');
$template->assign('uploadLogoRoute', $path);