diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2022-01-20 18:02:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 18:02:37 +0100 |
commit | 7f7980f35cdd40d113083d8cceb95e6c7613b004 (patch) | |
tree | 28c2a0392747c38ac2902f694309e7ea5bb208e0 | |
parent | ff809410f8e9d7ea313b0d3fc8e47460da40b8ef (diff) | |
parent | c0b6b78674565701df298332fc9541cc217aa72a (diff) | |
download | nextcloud-server-7f7980f35cdd40d113083d8cceb95e6c7613b004.tar.gz nextcloud-server-7f7980f35cdd40d113083d8cceb95e6c7613b004.zip |
Merge pull request #30770 from nextcloud/enh/logo-link-target-config
Allow changing the top-left logo link target in config.php
-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); |