summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-10-27 19:17:12 +0200
committerSimon Rettberg2016-10-27 19:17:12 +0200
commit18d4892a0cb1b24402829584cfd212a0e9898f2e (patch)
treeeaa3a679d4ddcf75c48c4fda2e74c6dc8e64bf81
parent[sysconfig] Improve binddn parsing for AD wizard (diff)
downloadslx-admin-18d4892a0cb1b24402829584cfd212a0e9898f2e.tar.gz
slx-admin-18d4892a0cb1b24402829584cfd212a0e9898f2e.tar.xz
slx-admin-18d4892a0cb1b24402829584cfd212a0e9898f2e.zip
[locationinfo] Skeleton for new module
-rw-r--r--modules-available/locationinfo/api.inc.php7
-rw-r--r--modules-available/locationinfo/config.json3
-rw-r--r--modules-available/locationinfo/lang/de/module.json4
-rw-r--r--modules-available/locationinfo/lang/de/template-tags.json3
-rw-r--r--modules-available/locationinfo/lang/en/module.json4
-rw-r--r--modules-available/locationinfo/lang/en/template-tags.json3
-rw-r--r--modules-available/locationinfo/lang/pt/template-tags.json3
-rw-r--r--modules-available/locationinfo/page.inc.php30
-rw-r--r--modules-available/locationinfo/templates/_page.html4
9 files changed, 61 insertions, 0 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php
new file mode 100644
index 00000000..0d84ebce
--- /dev/null
+++ b/modules-available/locationinfo/api.inc.php
@@ -0,0 +1,7 @@
+<?php
+
+echo json_encode(array(
+ 'key' => 'value',
+ 'number' => 123,
+ 'list' => array(1,2,3,4,5,6,'foo')
+));
diff --git a/modules-available/locationinfo/config.json b/modules-available/locationinfo/config.json
new file mode 100644
index 00000000..706412d0
--- /dev/null
+++ b/modules-available/locationinfo/config.json
@@ -0,0 +1,3 @@
+{
+ "category":"main.content"
+}
diff --git a/modules-available/locationinfo/lang/de/module.json b/modules-available/locationinfo/lang/de/module.json
new file mode 100644
index 00000000..166909c3
--- /dev/null
+++ b/modules-available/locationinfo/lang/de/module.json
@@ -0,0 +1,4 @@
+{
+ "module_name": "Mein erstes Modul",
+ "page_title": "Mein erster Seitentitel"
+} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json
new file mode 100644
index 00000000..ce98ce38
--- /dev/null
+++ b/modules-available/locationinfo/lang/de/template-tags.json
@@ -0,0 +1,3 @@
+{
+ "lang_hello": "Hallo"
+} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/en/module.json b/modules-available/locationinfo/lang/en/module.json
new file mode 100644
index 00000000..b2bcbb0c
--- /dev/null
+++ b/modules-available/locationinfo/lang/en/module.json
@@ -0,0 +1,4 @@
+{
+ "module_name": "My first module",
+ "page_title": "My first page title"
+} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/en/template-tags.json b/modules-available/locationinfo/lang/en/template-tags.json
new file mode 100644
index 00000000..c30739e5
--- /dev/null
+++ b/modules-available/locationinfo/lang/en/template-tags.json
@@ -0,0 +1,3 @@
+{
+ "lang_hello": "Hello"
+} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/pt/template-tags.json b/modules-available/locationinfo/lang/pt/template-tags.json
new file mode 100644
index 00000000..e7981844
--- /dev/null
+++ b/modules-available/locationinfo/lang/pt/template-tags.json
@@ -0,0 +1,3 @@
+{
+ "lang_hello": "Olá"
+} \ No newline at end of file
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php
new file mode 100644
index 00000000..ff73107a
--- /dev/null
+++ b/modules-available/locationinfo/page.inc.php
@@ -0,0 +1,30 @@
+<?php
+
+class Page_LocationInfo extends Page
+{
+
+ /**
+ * Called before any page rendering happens - early hook to check parameters etc.
+ */
+ protected function doPreprocess()
+ {
+ User::load();
+
+ if (!User::isLoggedIn()) {
+ Message::addError('main.no-permission');
+ Util::redirect('?do=Main'); // does not return
+ }
+ }
+
+ /**
+ * Menu etc. has already been generated, now it's time to generate page content.
+ */
+ protected function doRender()
+ {
+ Render::addTemplate('_page', array(
+ 'foo' => 'bar',
+ 'now' => date('d.m.Y H:i:s')
+ ));
+ }
+
+}
diff --git a/modules-available/locationinfo/templates/_page.html b/modules-available/locationinfo/templates/_page.html
new file mode 100644
index 00000000..dfc941ae
--- /dev/null
+++ b/modules-available/locationinfo/templates/_page.html
@@ -0,0 +1,4 @@
+<div style="border:5px solid red">
+ <h1>{{lang_hello}}, {{foo}}</h1>
+ ** {{now}} **
+</div> \ No newline at end of file