From 3c48d693ffde17ee78724a98778519c81cd84043 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 25 Feb 2022 12:26:29 +0100 Subject: [PATCH] about: Fix documentation link and use a version dependent one --- application/views/scripts/about/index.phtml | 3 ++- library/Icinga/Application/Version.php | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/application/views/scripts/about/index.phtml b/application/views/scripts/about/index.phtml index 9a7e890b5..e80cd89c6 100644 --- a/application/views/scripts/about/index.phtml +++ b/application/views/scripts/about/index.phtml @@ -80,7 +80,8 @@ use ipl\Web\Widget\Icon;
'https://github.com/icinga/icingaweb2/issues', + 'href' => 'https://icinga.com/docs/icinga-web-2/' + . (isset($version['docVersion']) ? $version['docVersion'] : 'latest'), 'target' => '_blank', 'title' => $this->translate('Icinga Documentation') ], [ diff --git a/library/Icinga/Application/Version.php b/library/Icinga/Application/Version.php index 0044cd7d7..e6f5404e2 100644 --- a/library/Icinga/Application/Version.php +++ b/library/Icinga/Application/Version.php @@ -18,6 +18,9 @@ class Version public static function get() { $version = array('appVersion' => self::VERSION); + preg_match('/2.(\d+)\./', self::VERSION, $matches); + $version['docVersion'] = isset($matches[1]) ? '2.' . $matches[1] : null; + if (false !== ($appVersion = @file_get_contents(Icinga::app()->getApplicationDir('VERSION')))) { $matches = array(); if (@preg_match('/^(?P\w+) (?P\S+)/', $appVersion, $matches)) {