From 6984efdafd96f110c59b8fecb3d517f0be46d942 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 3 Dec 2020 13:33:28 +0100 Subject: [PATCH] fix issue #51: add link on the logo --- lib/Controller/JsController.php | 4 ++++ lib/Settings/Admin.php | 1 + src/Logo.vue | 9 ++++++++- src/SideMenu.vue | 15 +++++++++++++-- src/l10n/fixtures/de.yaml | 1 + src/l10n/fixtures/fr.yaml | 1 + templates/settings/admin-form.php | 12 ++++++++++++ 7 files changed, 40 insertions(+), 3 deletions(-) diff --git a/lib/Controller/JsController.php b/lib/Controller/JsController.php index b30e929..b5ed845 100644 --- a/lib/Controller/JsController.php +++ b/lib/Controller/JsController.php @@ -97,6 +97,7 @@ class JsController extends Controller $targetBlankApps = $this->config->getAppValueArray('target-blank-apps', '[]'); $useAvatar = $this->config->getAppValueBool('use-avatar', '0'); $isForced = $this->config->getAppValueBool('force', '0'); + $addLogoLink = $this->config->getAppValueBool('add-logo-link', '1'); $avatar = null; $settings = null; @@ -141,6 +142,8 @@ class JsController extends Controller } } + $indexUrl = OC::$server->getURLGenerator()->linkTo('', 'index.php'); + return [ 'opener-position' => $this->config->getAppValue('opener-position', 'before'), 'opener-hover' => $this->config->getAppValueBool('opener-hover', '0'), @@ -156,6 +159,7 @@ class JsController extends Controller 'target-blank-apps' => $targetBlankApps, 'settings' => $settings, 'logo' => $this->themingDefaults->getLogo(), + 'logo-link' => $addLogoLink ? $indexUrl : null, ]; } } diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index fdcfb43..1707818 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -79,6 +79,7 @@ class Admin implements ISettings 'big-menu' => $this->config->getAppValue('big-menu', '0'), 'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'), 'display-logo' => $this->config->getAppValue('display-logo', '1'), + 'add-logo-link' => $this->config->getAppValue('add-logo-link', '1'), 'use-avatar' => $this->config->getAppValue('use-avatar', '0'), 'opener-position' => $this->config->getAppValue('opener-position', 'before'), 'opener-hover' => $this->config->getAppValue('opener-hover', '0'), diff --git a/src/Logo.vue b/src/Logo.vue index 82297d2..36aa7b6 100644 --- a/src/Logo.vue +++ b/src/Logo.vue @@ -16,7 +16,10 @@ along with this program. If not, see . --> @@ -28,6 +31,10 @@ export default { type: String, required: true }, + link: { + type: String, + required: false + }, classes: { type: Object, required: true diff --git a/src/SideMenu.vue b/src/SideMenu.vue index 0fd1dbd..68fcccb 100644 --- a/src/SideMenu.vue +++ b/src/SideMenu.vue @@ -25,8 +25,17 @@ along with this program. If not, see . - - + + +
    @@ -62,6 +71,7 @@ export default { return { apps: [], logo: null, + logoLink: null, avatar: null, forceLightIcon: false, targetBlankApps: [], @@ -135,6 +145,7 @@ export default { that.forceLightIcon = config['force-light-icon'] that.avatar = config['avatar'] that.logo = config['logo'] + that.logoLink = config['logo-link'] that.settings = config['settings'] }); }, diff --git a/src/l10n/fixtures/de.yaml b/src/l10n/fixtures/de.yaml index 8466462..7ce4fe6 100644 --- a/src/l10n/fixtures/de.yaml +++ b/src/l10n/fixtures/de.yaml @@ -66,3 +66,4 @@ "Except when the configuration is forced.": "Außer wenn die Konfiguration erzwungen wird." "Apps that should not be displayed in the menu": "Apps, die nicht im Menü angezeigt werden sollen" "This feature is only compatible with the big menu display.": "Kompatibel mit der Anzeige Großes Menü ." +"The logo is a link to the default app": "Das Logo ist ein Link zur Standard-App" diff --git a/src/l10n/fixtures/fr.yaml b/src/l10n/fixtures/fr.yaml index 56847c3..8a21e06 100644 --- a/src/l10n/fixtures/fr.yaml +++ b/src/l10n/fixtures/fr.yaml @@ -66,3 +66,4 @@ "Except when the configuration is forced.": "Sauf lorsque la configuration est forcée." "Apps that should not be displayed in the menu": "Applications qui ne doivent pas être affichées dans le menu" "This feature is only compatible with the big menu display.": "Compatible avec l'affichage Menu large." +"The logo is a link to the default app": "Le logo est un lien vers l'application par défaut" diff --git a/templates/settings/admin-form.php b/templates/settings/admin-form.php index 2b8cc21..7b858be 100644 --- a/templates/settings/admin-form.php +++ b/templates/settings/admin-form.php @@ -359,6 +359,18 @@ $choicesSizes = [ +

    t('The logo is a link to the default app')); ?>

    + +
    + +
    +