diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2022-01-20 12:27:29 +0100 |
---|---|---|
committer | Julien Veyssier <eneiluj@posteo.net> | 2022-01-20 15:11:16 +0100 |
commit | c0b6b78674565701df298332fc9541cc217aa72a (patch) | |
tree | 45b31da74c96301402eed1c34b711a1d679cd90d | |
parent | a9b098eed59f594f9c6531c172617cd740de167a (diff) | |
download | nextcloud-server-c0b6b78674565701df298332fc9541cc217aa72a.tar.gz nextcloud-server-c0b6b78674565701df298332fc9541cc217aa72a.zip |
allow changing the top-left logo link target in system config
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
-rw-r--r-- | config/config.sample.php | 7 | ||||
-rw-r--r-- | core/templates/layout.user.php | 2 | ||||
-rw-r--r-- | lib/private/TemplateLayout.php | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 21ccab6732c..3dcde590d89 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -354,6 +354,13 @@ $CONFIG = [ 'lost_password_link' => 'https://example.org/link/to/password/reset', /** + * URL to use as target for the logo link in the header (top-left logo) + * + * Defaults to the base URL of your Nextcloud instance + */ +'logo_url' => 'https://example.org', + +/** * Mail Parameters * * These configure the email settings for Nextcloud notifications and password diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 8bdb4811df9..c9ca4e23110 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -56,7 +56,7 @@ $getUserAvatar = static function (int $size) use ($_): string { </div> <header role="banner" id="header"> <div class="header-left"> - <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" + <a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>" id="nextcloud"> <div class="logo logo-icon"> <h1 class="hidden-visually"> diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 9cfc1aec6dd..d7a86ff92bf 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -98,6 +98,10 @@ class TemplateLayout extends \OC_Template { $this->initialState->provideInitialState('unified-search', 'limit-default', SearchQuery::LIMIT_DEFAULT); Util::addScript('core', 'unified-search', 'core'); + // set logo link target + $logoUrl = $this->config->getSystemValueString('logo_url', ''); + $this->assign('logoUrl', $logoUrl); + // Add navigation entry $this->assign('application', ''); $this->assign('appid', $appId); |