aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE.md21
-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
5 files changed, 43 insertions, 2 deletions
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..4d7a09c
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Vincent Peugnet
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
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>