Skip to content
Snippets Groups Projects
Unverified Commit a7273f16 authored by Julius Haertl's avatar Julius Haertl
Browse files

Make federadedfilesharing button match the theming values

parent 218e2f78
No related branches found
No related tags found
No related merge requests found
...@@ -41,17 +41,32 @@ if (count($matches) > 0 && $matches[1] <= 9) { ...@@ -41,17 +41,32 @@ if (count($matches) > 0 && $matches[1] <= 9) {
$cloudID = \OC::$server->getUserSession()->getUser()->getCloudId(); $cloudID = \OC::$server->getUserSession()->getUser()->getCloudId();
$url = 'https://nextcloud.com/federation#' . $cloudID; $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(); $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 = new OCP\Template('federatedfilesharing', 'settings-personal');
$tmpl->assign('outgoingServer2serverShareEnabled', $federatedShareProvider->isOutgoingServer2serverShareEnabled()); $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_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('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('reference', $url);
$tmpl->assign('cloudId', $cloudID); $tmpl->assign('cloudId', $cloudID);
$tmpl->assign('showShareIT', !$isIE8); $tmpl->assign('showShareIT', !$isIE8);
$tmpl->assign('color', $theme->getMailHeaderColor()); $tmpl->assign('color', $color);
$tmpl->assign('textColor', $textColor);
return $tmpl->fetchPage(); return $tmpl->fetchPage();
...@@ -55,22 +55,17 @@ if ($_['showShareIT']) { ...@@ -55,22 +55,17 @@ if ($_['showShareIT']) {
<div class="hidden" id="oca-files-sharing-add-to-your-website-expanded"> <div class="hidden" id="oca-files-sharing-add-to-your-website-expanded">
<p style="margin: 10px 0"> <p style="margin: 10px 0">
<a target="_blank" rel="noreferrer" href="<?php p($_['reference']); ?>" <a target="_blank" rel="noreferrer" href="<?php p($_['reference']); ?>"
style="padding:10px;background-color:<?php p($_['color']); ?>;color:#fff;border-radius:3px;padding-left:4px;"> style="padding:10px;background-color:<?php p($_['color']); ?>;color:<?php p($_['textColor']); ?>;border-radius:3px;padding-left:4px;">
<img src="<?php p($_['owncloud_logo_path']); ?>" <span style="background-image:url(<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL($_['logoPath'])); ?>);width:50px;height:30px;position:relative;top:8px;background-size:contain;display:inline-block;background-repeat:no-repeat; background-position: center center;"></span>
style="width:50px;position:relative;top:8px;">
<?php p($l->t('Share with me via Nextcloud')); ?> <?php p($l->t('Share with me via Nextcloud')); ?>
</a> </a>
</p> </p>
<p> <p>
<?php p($l->t('HTML Code:')); ?> <?php p($l->t('HTML Code:')); ?>
<xmp><a target="_blank" rel="noreferrer" href="<?php p($_['reference']); ?>" <xmp><a target="_blank" rel="noreferrer" href="<?php p($_['reference']); ?>" style="padding:10px;background-color:<?php p($_['color']); ?>;color:<?php p($_['textColor']); ?>;border-radius:3px;padding-left:4px;">
style="padding:10px;background-color:#0082c9;color:#fff;border-radius:3px;padding-left:4px;"> <span style="background-image:url(<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL($_['logoPath'])); ?>);width:50px;height:30px;position:relative;top:8px;background-size:contain;display:inline-block;background-repeat:no-repeat; background-position: center center;"></span>
<img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL($_['owncloud_logo_path'])); ?>" <?php p($l->t('Share with me via Nextcloud')); ?></a></xmp>
style="width:50px;position:relative;top:8px;">
<?php p($l->t('Share with me via Nextcloud')); ?>
</a></xmp>
</p> </p>
</div> </div>
<?php } ?> <?php } ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment