summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rdalverny@gmail.com>2022-01-11 12:19:28 +0100
committerRomain d'Alverny <rdalverny@gmail.com>2022-01-11 12:19:28 +0100
commit2b3469a29cb78f07500ea929dfae97570235cd9c (patch)
tree84eee0f427075ff66d4833a6ed52bd3d6ff6bddd
parent192e39a1fed4a6bc52c74b4a732c34740f189f12 (diff)
downloadplanet-2b3469a29cb78f07500ea929dfae97570235cd9c.tar
planet-2b3469a29cb78f07500ea929dfae97570235cd9c.tar.gz
planet-2b3469a29cb78f07500ea929dfae97570235cd9c.tar.bz2
planet-2b3469a29cb78f07500ea929dfae97570235cd9c.tar.xz
planet-2b3469a29cb78f07500ea929dfae97570235cd9c.zip
Show version in admin & footer
-rwxr-xr-xadmin/administration.php14
-rwxr-xr-xapp/app.php2
-rwxr-xr-xcustom/views/default/footer.tpl.php3
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 = "<a href='$releases_url'>$releases_url</a>";
+$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"
<div class="widget">
@@ -38,6 +44,14 @@ $page_content = <<<"FRAGMENT"
</form>
</div>
+ <div class="widget">
+ <h3>{$l10n->getString('Upgrade moonmoon')}</h3>
+ <form>
+ <p>{$version_current}</p>
+ <p>{$version_action}</p>
+ </form>
+ </div>
+
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 @@
<div id="footer">
- <p><?php echo str_replace('%s', 'href="http://moonmoon.org"', _g('Powered by <a %s>moonmoon</a>'))?> | <a href="./admin/"><?=_g('Administration')?></a></p>
+ <p><?php echo str_replace('%s', 'href="http://moonmoon.org" title="moonmoon '.$moon_version.'"', _g('Powered by <a %s>moonmoon</a>'))?>
+ | <a href="./admin/"><?=_g('Administration')?></a></p>
</div>