aboutsummaryrefslogtreecommitdiff
path: root/w/controller
diff options
context:
space:
mode:
Diffstat (limited to 'w/controller')
-rw-r--r--w/controller/w.article.php33
-rw-r--r--w/controller/w.home.php85
-rw-r--r--w/controller/w.menu.php56
3 files changed, 174 insertions, 0 deletions
diff --git a/w/controller/w.article.php b/w/controller/w.article.php
new file mode 100644
index 0000000..307caa4
--- /dev/null
+++ b/w/controller/w.article.php
@@ -0,0 +1,33 @@
+<?php
+
+if ($app->exist($_GET['id'])) {
+
+ $art = $app->get($_GET['id']);
+
+ if (isset($_GET['edit']) and $_GET['edit'] == 1 and $app->session() >= $app::EDITOR) {
+ echo '<section class=edit>';
+ $aff->edit($art, $app, $app->getlister(['id', 'titre']), $config->fontsize(), $app->getlistermedia($app::MEDIA_DIR, 'image'));
+ //$aff->copy($art, $app->getlister(['id', 'titre']));
+ $aff->aside($app);
+ echo '</section>';
+ } else {
+ echo '<section class="lecture">';
+
+
+ $art->autotaglistupdate($app->taglist($app->getlister(['id', 'titre', 'intro', 'tag']), $art->autotaglist()));
+
+
+ $aff->lecture($art, $app);
+ echo '</section>';
+
+ }
+} else {
+ echo '<span class="alert">This article does not exist yet</span>';
+
+ if ($app->session() >= $app::EDITOR) {
+ echo '<form action="?id=' . $_GET['id'] . '&edit=1" method="post"><input type="hidden" name="action" value="new"><input type="submit" value="Create"></form>';
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/w/controller/w.home.php b/w/controller/w.home.php
new file mode 100644
index 0000000..3094d03
--- /dev/null
+++ b/w/controller/w.home.php
@@ -0,0 +1,85 @@
+<?php
+
+
+$aff->header();
+
+echo '<section class="home">';
+
+
+if ($app->session() >= $app::EDITOR) {
+
+ $app->bddinit($config);
+
+ $opt = new Opt(Art::classvarlist());
+ $opt->setcol(['id', 'tag', 'lien', 'contenu', 'intro', 'titre', 'datemodif', 'datecreation', 'secure']);
+ $table = $app->getlisteropt($opt);
+ $app->listcalclien($table);
+ $opt->settaglist($table);
+ $opt->submit();
+
+
+
+
+
+
+
+
+
+
+
+ $opt->setcol(['id', 'tag', 'lien', 'contenu', 'intro', 'titre', 'datemodif', 'datecreation', 'secure', 'liento']);
+
+
+ $aff->option($app, $opt);
+
+ $filtertagfilter = $app->filtertagfilter($table, $opt->tagfilter(), $opt->tagcompare());
+ $filtersecure = $app->filtersecure($table, $opt->secure());
+
+ $filter = array_intersect($filtertagfilter, $filtersecure);
+ $table2 = [];
+ $table2invert = [];
+ foreach ($table as $art) {
+ if (in_array($art->id(), $filter)) {
+ $table2[] = $art;
+ } else {
+ $table2invert[] = $art;
+ }
+
+
+ }
+
+ if(!empty($opt->invert())) {
+ $table2 = $table2invert;
+ }
+
+ $app->artlistsort($table2, $opt->sortby(), $opt->order());
+
+
+ echo '<div id="flex">';
+
+
+ $aff->home2table($app, $table2, $app->getlister());
+
+
+
+
+ echo '<div id="map">';
+ $aff->mapheader();
+ if(isset($_GET['map'])) {
+ $aff->mermaid($app->map($table2));
+ }
+ echo '</div>';
+
+
+
+
+
+ echo '</div>';
+
+}
+
+
+
+echo '</section>';
+
+?> \ No newline at end of file
diff --git a/w/controller/w.menu.php b/w/controller/w.menu.php
new file mode 100644
index 0000000..8e89ed1
--- /dev/null
+++ b/w/controller/w.menu.php
@@ -0,0 +1,56 @@
+<?php
+
+
+if ($app->session() >= $app::EDITOR) {
+
+ if ($_GET['aff'] == 'admin' && $app->session() >= $app::ADMIN) {
+ echo '<section>';
+ echo '<h1>Admin</h1>';
+
+ $aff->admincss($config, $app);
+ $aff->adminpassword($config);
+ $aff->admindb($config);
+ if ($app->setbdd($config)) {
+ $status = "OK";
+ } else {
+ $status = "Not Connected";
+ }
+ $aff->admintable($config, $status, $app->tablelist($config->dbname()));
+ $aff->admindisplay($config->color4());
+
+ echo '</section>';
+ } elseif ($_GET['aff'] == 'media') {
+ echo '<h1>Media</h1>';
+ echo '<section>';
+ echo '<article>';
+
+ $aff->addmedia($app);
+ $aff->medialist($app->getlistermedia($app::MEDIA_DIR), $app::MEDIA_DIR);
+
+ echo '</article>';
+ echo '</section>';
+
+ } elseif ($_GET['aff'] == 'record') {
+ echo '<h1>Record</h1>';
+ echo '<section>';
+
+ $aff->recordlist($app);
+
+ echo '</section>';
+
+ } elseif ($_GET['aff'] == 'info') {
+
+
+
+ } else {
+
+ echo '<h1>Private</h1><p>You dont have the permission to access this page.</p>';
+
+ }
+
+
+} else {
+ echo '<h1>Private</h1><p>You should be connected to access this page.</p>';
+}
+
+?> \ No newline at end of file