aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-12-17 16:28:28 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-12-17 16:28:28 +0100
commit08edd92a2135d486603687b181979854b60a3bcc (patch)
tree8bd976d69b6f98e3aa88bef703e3bedfefe40cde /app
parent1a7a60ea3efde53ac2c3b07ca914483cfc25a827 (diff)
downloadwcms-08edd92a2135d486603687b181979854b60a3bcc.tar.gz
wcms-08edd92a2135d486603687b181979854b60a3bcc.zip
license and version info
Diffstat (limited to 'app')
-rw-r--r--app/class/config.php2
-rw-r--r--app/class/controllerinfo.php4
-rw-r--r--app/fn/fn.php11
-rw-r--r--app/view/templates/info.php7
4 files changed, 22 insertions, 2 deletions
diff --git a/app/class/config.php b/app/class/config.php
index b778d83..36a5116 100644
--- a/app/class/config.php
+++ b/app/class/config.php
@@ -20,6 +20,8 @@ abstract class Config
protected static $defaultfavicon = '';
protected static $showeditmenu = true;
protected static $editsymbol = 'pen';
+ protected static $version = '';
+
diff --git a/app/class/controllerinfo.php b/app/class/controllerinfo.php
index 8f8b494..306c818 100644
--- a/app/class/controllerinfo.php
+++ b/app/class/controllerinfo.php
@@ -12,10 +12,12 @@ class Controllerinfo extends Controller
public function desktop()
{
if($this->user->iseditor()) {
- $this->showtemplate('info', []);
+ $this->showtemplate('info', ['version' => getversion()]);
}
}
+
+
diff --git a/app/fn/fn.php b/app/fn/fn.php
index 49db200..655562f 100644
--- a/app/fn/fn.php
+++ b/app/fn/fn.php
@@ -81,6 +81,17 @@ function idclean(string $input)
}
+function getversion()
+{
+ if(file_exists('composer.json')) {
+ $composer = json_decode(file_get_contents('composer.json'), true);
+ $version = $composer['version'];
+ } else {
+ $version = 'unknown';
+ }
+ return $version;
+}
+
function array_update($base, $new)
diff --git a/app/view/templates/info.php b/app/view/templates/info.php
index d86bdc1..3203ce6 100644
--- a/app/view/templates/info.php
+++ b/app/view/templates/info.php
@@ -12,11 +12,16 @@
<h1>Info</h1>
+<h2>Version</h2>
+
+<?= $version ?>
+
+<h2>Links</h2>
<ul>
<li><a href="https://github.com/vincent-peugnet/wcms" target="_blank">🐱‍👤 Github</a></li>
<li><a href="#manual">📕 Manual</a></li>
-<li><a href="#">🌵 Website</a></li>
+<li><a href="https://w-cms.top" target="_blank">🌵 Website</a></li>
</ul>
<h2>About</h2>