From 2b3469a29cb78f07500ea929dfae97570235cd9c Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Tue, 11 Jan 2022 12:19:28 +0100 Subject: Show version in admin & footer --- admin/administration.php | 14 ++++++++++++++ app/app.php | 2 +- custom/views/default/footer.tpl.php | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/admin/administration.php b/admin/administration.php index 26f6710..369f65b 100755 --- a/admin/administration.php +++ b/admin/administration.php @@ -19,6 +19,12 @@ $header_extra = <<<"HTML" HTML; +$repo_url = 'https://github.com/moonmoon/moonmoon'; +$releases_url = "$repo_url/releases"; +$link_url = "$releases_url"; +$version_current = str_replace('%s', $moon_version, $l10n->getString('Your moonmoon instance version is %s.')); +$version_action = str_replace('%s', $link_url, $l10n->getString('You can check for a more recent version on: %s.')); + $page_content = <<<"FRAGMENT"
@@ -38,6 +44,14 @@ $page_content = <<<"FRAGMENT"
+
+

{$l10n->getString('Upgrade moonmoon')}

+
+

{$version_current}

+

{$version_action}

+
+
+ FRAGMENT; $footer_extra = ''; diff --git a/app/app.php b/app/app.php index 0797cc7..f82b262 100755 --- a/app/app.php +++ b/app/app.php @@ -5,7 +5,7 @@ error_reporting(0); require_once __DIR__.'/../vendor/autoload.php'; $savedConfig = __DIR__.'/../custom/config.yml'; -$moon_version = file_get_contents(__DIR__.'/../VERSION'); +$moon_version = trim(file_get_contents(__DIR__.'/../VERSION')); session_start(); diff --git a/custom/views/default/footer.tpl.php b/custom/views/default/footer.tpl.php index c9c84b1..d7d6c1a 100755 --- a/custom/views/default/footer.tpl.php +++ b/custom/views/default/footer.tpl.php @@ -1,3 +1,4 @@ -- cgit v1.2.1