From a7273f1658ecbd51fbc68b35afdf32e9836dac13 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Thu, 25 Aug 2016 12:54:31 +0200 Subject: [PATCH] Make federadedfilesharing button match the theming values --- .../settings-personal.php | 21 ++++++++++++++++--- .../templates/settings-personal.php | 15 +++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/apps/federatedfilesharing/settings-personal.php b/apps/federatedfilesharing/settings-personal.php index 132a36826e71d..92f96d1ba40d2 100644 --- a/apps/federatedfilesharing/settings-personal.php +++ b/apps/federatedfilesharing/settings-personal.php @@ -41,17 +41,32 @@ $cloudID = \OC::$server->getUserSession()->getUser()->getCloudId(); $url = 'https://nextcloud.com/federation#' . $cloudID; -$ownCloudLogoPath = \OC::$server->getURLGenerator()->imagePath('core', 'logo-icon.svg'); +$logoPath = \OC::$server->getURLGenerator()->imagePath('core', 'logo-icon.svg'); $theme = \OC::$server->getThemingDefaults(); +$color = $theme->getMailHeaderColor(); +$textColor = "#ffffff"; +if(\OC::$server->getAppManager()->isEnabledForUser("theming")) { + $logoPath = $theme->getLogo(); + try { + $util = \OC::$server->query("\OCA\Theming\Util"); + if($util->invertTextColor($color)) { + $textColor = "#000000"; + } + } catch (OCP\AppFramework\QueryException $e) { + + } +} + $tmpl = new OCP\Template('federatedfilesharing', 'settings-personal'); $tmpl->assign('outgoingServer2serverShareEnabled', $federatedShareProvider->isOutgoingServer2serverShareEnabled()); $tmpl->assign('message_with_URL', $l->t('Share with me through my #Nextcloud Federated Cloud ID, see %s', [$url])); $tmpl->assign('message_without_URL', $l->t('Share with me through my #Nextcloud Federated Cloud ID', [$cloudID])); -$tmpl->assign('owncloud_logo_path', $ownCloudLogoPath); +$tmpl->assign('logoPath', $logoPath); $tmpl->assign('reference', $url); $tmpl->assign('cloudId', $cloudID); $tmpl->assign('showShareIT', !$isIE8); -$tmpl->assign('color', $theme->getMailHeaderColor()); +$tmpl->assign('color', $color); +$tmpl->assign('textColor', $textColor); return $tmpl->fetchPage(); diff --git a/apps/federatedfilesharing/templates/settings-personal.php b/apps/federatedfilesharing/templates/settings-personal.php index 3ebd64784ee13..0f51e6a5c4ed8 100644 --- a/apps/federatedfilesharing/templates/settings-personal.php +++ b/apps/federatedfilesharing/templates/settings-personal.php @@ -55,22 +55,17 @@ class='js-gs-share social-gnu'>