aboutsummaryrefslogtreecommitdiff
path: root/app/view
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-11-11 17:19:26 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-11-11 17:19:26 +0100
commitd7f3313ff4514e38c9f53439cd1a1287e56e45f7 (patch)
treeabff39ab11cb317f5fcd2db558da1c59bdae9239 /app/view
parent2f363e8fa26ab849539e64ff7caa21bd164e8979 (diff)
downloadwcms-d7f3313ff4514e38c9f53439cd1a1287e56e45f7.tar.gz
wcms-d7f3313ff4514e38c9f53439cd1a1287e56e45f7.zip
reboot folder
Diffstat (limited to 'app/view')
-rw-r--r--app/view/templates/arthead.php6
-rw-r--r--app/view/templates/body.php0
-rw-r--r--app/view/templates/connect.php30
-rw-r--r--app/view/templates/delete.php44
-rw-r--r--app/view/templates/edit.php35
-rw-r--r--app/view/templates/edithelp.php27
-rw-r--r--app/view/templates/editleftbar.php70
-rw-r--r--app/view/templates/editrightbar.php20
-rw-r--r--app/view/templates/edittabs.php19
-rw-r--r--app/view/templates/edittopbar.php29
-rw-r--r--app/view/templates/home.php109
-rw-r--r--app/view/templates/homeopt.php84
-rw-r--r--app/view/templates/layout.php20
-rw-r--r--app/view/templates/media.php4
-rw-r--r--app/view/templates/navart.php85
-rw-r--r--app/view/templates/navback.php54
-rw-r--r--app/view/templates/read.php67
-rw-r--r--app/view/templates/readart.php25
-rw-r--r--app/view/templates/readcreate.php5
-rw-r--r--app/view/templates/readerlayout.php15
20 files changed, 748 insertions, 0 deletions
diff --git a/app/view/templates/arthead.php b/app/view/templates/arthead.php
new file mode 100644
index 0000000..b137c7f
--- /dev/null
+++ b/app/view/templates/arthead.php
@@ -0,0 +1,6 @@
+<meta charset="utf8" />
+<meta name="viewport" content="width=device-width" />
+<link rel="shortcut icon" href="./media/logo.png" type="image/x-icon">
+<title><?= $title ?></title>
+<meta name="description" content="<?= $description ?>">
+<link rel="stylesheet" href="./css/soft.css"> \ No newline at end of file
diff --git a/app/view/templates/body.php b/app/view/templates/body.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/view/templates/body.php
diff --git a/app/view/templates/connect.php b/app/view/templates/connect.php
new file mode 100644
index 0000000..3e2aeba
--- /dev/null
+++ b/app/view/templates/connect.php
@@ -0,0 +1,30 @@
+<?php $this->layout('layout', ['title' => 'Connect', 'description' => 'connect']) ?>
+
+
+
+
+<?php $this->start('page') ?>
+
+<span>
+<?= $user->level() ?>
+</span>
+
+<?php if($user->isvisitor()) { ?>
+
+<form action="./?action=login" method="post">
+<input type="password" name="pass" id="loginpass" placeholder="password">
+<input type="submit" value="login">
+</form>
+
+
+<?php } else { ?>
+
+<form action="./?action=logout" method="post">
+<input type="submit" value="logout">
+</form>
+
+
+
+<?php } ?>
+
+<?php $this->stop() ?> \ No newline at end of file
diff --git a/app/view/templates/delete.php b/app/view/templates/delete.php
new file mode 100644
index 0000000..be54451
--- /dev/null
+++ b/app/view/templates/delete.php
@@ -0,0 +1,44 @@
+<?php $this->layout('layout', ['title' => 'delete', 'description' => 'delete']) ?>
+
+
+<?php $this->start('page') ?>
+
+
+<?php $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?>
+
+<div>
+
+<h1>Delete</h1>
+
+<ul>
+<li>Id : <?= $art->title() ?></li>
+<li>Title : <?= $art->title() ?></li>
+<li>Article(s) linked to this one : <?= $art->linkto('sort') ?></li>
+<li>Article(s) linked from this one : <?= $art->linkfrom('sort') ?></li>
+<li>Number of edits : <?= $art->editcount() ?></li>
+</ul>
+
+<?php if (!empty($art->linkto())) { ?>
+
+<h2>Article linked to :</h2>
+
+<ul>
+<?php foreach ($art->linkto('array') as $linkto) {
+ echo '<li><a href="./?id=' . $linkto . '">' . $linkto . '</a></li>';
+} ?>
+</ul>
+
+<?php
+} ?>
+
+</div>
+
+
+<form action="./?id=<?= $art->id() ?>&action=delete" method="post">
+<input type="hidden" name="deleteconfirm" value="true">
+<input type="submit" value="confirm delete">
+</form>
+
+
+
+<?php $this->stop() ?> \ No newline at end of file
diff --git a/app/view/templates/edit.php b/app/view/templates/edit.php
new file mode 100644
index 0000000..33d42f4
--- /dev/null
+++ b/app/view/templates/edit.php
@@ -0,0 +1,35 @@
+<?php $this->layout('layout', ['title' => '✏ '.$art->title()]) ?>
+
+
+
+
+<?php $this->start('page') ?>
+
+<style>.tabs textarea{font-size: <?= Config::fontsize() ?>px}</style>
+
+<body>
+<section class="editor">
+
+ <?php $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?>
+
+
+
+ <?php $this->insert('edittopbar', ['art' => $art]) ?>
+
+ <div id="workspace">
+
+ <?php $this->insert('editleftbar', ['art' => $art, 'tablist' => $tablist, 'artlist' => $artlist, 'showleftpanel' => $showleftpanel]) ?>
+ <?php $this->insert('edittabs', ['tablist' => $tablist, 'opentab' => $art->interface()]) ?>
+ <?php $this->insert('editrightbar', ['art' => $art, 'artlist' => $artlist, 'showrightpanel' => $showrightpanel]) ?>
+
+ </div>
+
+
+<input type="hidden" name="id" value="<?= $art->id() ?>">
+
+</form>
+
+</section>
+</body>
+
+<?php $this->stop() ?> \ No newline at end of file
diff --git a/app/view/templates/edithelp.php b/app/view/templates/edithelp.php
new file mode 100644
index 0000000..fee94c7
--- /dev/null
+++ b/app/view/templates/edithelp.php
@@ -0,0 +1,27 @@
+
+ <h2>Help !</h2>
+ <p>To save your article, press the HOME, UPDATE, or DISPLAY buttons. You can use the keyboard shortcuts as well.</p>
+ <pre><span class="i">ALT + W</span> : home</pre>
+ <pre><span class="i">ALT + X</span> : update</pre>
+ <pre><span class="i">ALT + C</span> : display</pre>
+ <h3>Markdown</h3>
+ <p>The html section use <a href="https://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown encoding</a>. Actualy, W is using Michel Fortin's <a href="https://michelf.ca/projects/php-markdown/extra/" target="_blank">Markdown Extra</a>.</p>
+ <h3>Links</h3>
+ <pre>[text](=<span class="i">article_id</span>)</pre>
+ <p>where article_id is the article's id you want to point to.</p>
+ <h3>Images</h3>
+ <pre>[altimage](/<span class="i">img_id.extension</span>)</pre>
+ <p>Where img_id is the id of your image and its extension.</p>
+ <h3>Shortcuts</h3>
+ <pre>%TITLE%</pre>
+ <p>Show the title of your article.</p>
+ <pre>%DESCRIPTION%</pre>
+ <p>Show the description of your article.</p>
+ <pre>%SUMMARY%</pre>
+ <p>Generate a <strong>summary</strong>, the list of all your head titles using #, ##, ###...</p>
+ <pre>%%<span class="i">tag_name</span>%%</pre>
+ <p>Generate a <strong>menu</strong>, a list of links to all articles under this tag.</p>
+ <p>vv</p>
+ <p>vv</p>
+ <p>vv</p>
+ <p></p> \ No newline at end of file
diff --git a/app/view/templates/editleftbar.php b/app/view/templates/editleftbar.php
new file mode 100644
index 0000000..7533599
--- /dev/null
+++ b/app/view/templates/editleftbar.php
@@ -0,0 +1,70 @@
+<div id="leftbar">
+ <input id="showleftpanel" name="workspace[showleftpanel]" value="1" class="toggle" type="checkbox" <?= $showleftpanel == true ? 'checked' : '' ?>>
+ <label for="showleftpanel" class="toogle">β—§</label>
+ <div id="leftbarpanel" class="panel">
+ <details id="editinfo" open>
+ <summary>Infos</summary>
+ <fieldset>
+ <label for="title">title :</label>
+ <input type="text" name="title" id="title" value="<?= $art->title(); ?>">
+ <label for="description">Description :</label>
+ <input type="text" name="description" id="description" value="<?= $art->description(); ?>">
+ <label for="tag">Tag(s) :</label>
+ <input type="text" name="tag" id="tag" value="<?= $art->tag('string'); ?>">
+ <label for="secure">Privacy level :</label>
+ <select name="secure" id="secure">
+ <option value="0" <?= $art->secure() == 0 ? 'selected' : '' ?>>0</option>
+ <option value="1" <?= $art->secure() == 1 ? 'selected' : '' ?>>1</option>
+ <option value="2" <?= $art->secure() == 2 ? 'selected' : '' ?>>2</option>
+ <option value="3" <?= $art->secure() == 3 ? 'selected' : '' ?>>3</option>
+ </select>
+ </fieldset>
+ </details>
+ <details>
+ <summary>Advanced</summary>
+ <fieldset>
+ <h3>Template options</h3>
+ <ul>
+ <?php
+ foreach ($tablist as $element => $value) {
+ if(isset($art->template()[$element])) {
+ $template = $art->template()[$element];
+ } else {
+ $template = '';
+ }
+ echo '<li>';
+ echo '<label for="'.$element.'template">'.$element.'</label>';
+ echo '<select name="template['.$element.']" id="'.$element.'template">';
+ ?>
+ <option value="" <?= $template === '' ? 'selected' : '' ?>>--no template--</option>
+ <?php
+ foreach ($artlist as $artid ) {
+
+ ?>
+ <option value="<?= $artid ?>" <?= $template === $artid ? 'selected' : '' ?>><?= $artid ?></option>
+ <?php
+ }
+ echo '</select>';
+ echo '</li>';
+ }
+
+
+ ?>
+ </ul>
+ </fieldset>
+ </details>
+ <details id="editcss" open>
+ <summary>Quick CSS</summary>
+
+ </details>
+ <details>
+ <summary>Help</summary>
+ <div id="help">
+ <?php $this->insert('edithelp') ?>
+
+ </div>
+ </details>
+
+ </div>
+
+</div> \ No newline at end of file
diff --git a/app/view/templates/editrightbar.php b/app/view/templates/editrightbar.php
new file mode 100644
index 0000000..92d5f81
--- /dev/null
+++ b/app/view/templates/editrightbar.php
@@ -0,0 +1,20 @@
+<div id="rightbar">
+ <input id="showrightpanel" name="workspace[showrightpanel]" value="1" class="toggle" type="checkbox" <?= $showrightpanel == true ? 'checked' : '' ?>>
+ <label for="showrightpanel" class="toogle">β—§</label>
+ <div id="rightbarpanel" class="panel">
+ <details id="linkassist" open>
+ <summary>Links</summary>
+ <?php
+ foreach ($artlist as $item ) {
+ ?>
+ <a href="?id=<?= $item ?>&aff=edit"><?= $item ?></a>
+ <input type="text" value="[<?= $item ?>](=<?= $item ?>)">
+ <?php
+ }
+
+ ?>
+ </details>
+
+ </div>
+
+</div> \ No newline at end of file
diff --git a/app/view/templates/edittabs.php b/app/view/templates/edittabs.php
new file mode 100644
index 0000000..efb1650
--- /dev/null
+++ b/app/view/templates/edittabs.php
@@ -0,0 +1,19 @@
+<div class="tabs">
+
+<?php
+foreach ($tablist as $key => $value) {
+ echo '<div class="tab">';
+ if ($key == $opentab) {
+ echo '<input name="interface" type="radio" value="'.$key.'" id="tab' . $key . '" class="checkboxtab" checked>';
+ } else {
+ echo '<input name="interface" type="radio" value="'.$key.'" id="tab' . $key . '" class="checkboxtab">';
+ }
+ echo '<label for="tab' . $key . '">' . $key . '</label>';
+ echo '<div class="content">';
+ echo '<textarea name="' . $key . '" id="' . $key . '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">' . $value . '</textarea>';
+ echo '</div>';
+ echo '</div>';
+}
+?>
+
+</div> \ No newline at end of file
diff --git a/app/view/templates/edittopbar.php b/app/view/templates/edittopbar.php
new file mode 100644
index 0000000..20c2d8b
--- /dev/null
+++ b/app/view/templates/edittopbar.php
@@ -0,0 +1,29 @@
+<div id="topbar">
+ <form id="delete" action="./" method="get">
+ <input type="hidden" name="id" value="<?= $art->id() ?>">
+ </form>
+
+ <form action="?id=<?= $art->id() ?>&action=update" method="post" id="update">
+
+ <span>
+ <input type="submit" name="action" value="update" accesskey="x" form="update">
+ </span>
+
+
+ <span>
+ <input type="submit" name="action" value="delete" form="delete">
+ </span>
+
+
+ <span>
+ <a href="?id=<?= $art->id() ?>" target="_blank">πŸ‘</a>
+ <a href="?id=<?= $art->id() ?>&aff=log" target="_blank">ΒΆ</a>
+ </span>
+ <span id="headid"><?= $art->id() ?></span>
+
+<span>
+
+ <label for="fontsize">Font-size</label>
+ <input type="number" name="fontsize" value="<?= Config::fontsize() ?>" id="fontsize">
+</span>
+</div> \ No newline at end of file
diff --git a/app/view/templates/home.php b/app/view/templates/home.php
new file mode 100644
index 0000000..2303f0f
--- /dev/null
+++ b/app/view/templates/home.php
@@ -0,0 +1,109 @@
+<?php $this->layout('layout', ['title' => 'home']) ?>
+
+
+
+
+<?php $this->start('page') ?>
+
+
+<body>
+
+ <?php $this->insert('navback', ['user' => $user]) ?>
+
+<?php if($user->canedit()) { ?>
+
+<section>
+
+<div>
+
+<form id="goto" action="./" method="get">
+<input type="text" name="id" placeholder="id" required>
+<input type="submit" name="aff" value="read">
+<input type="submit" name="aff" value="edit">
+<input type="submit" name="action" value="add">
+</form>
+
+
+<form action="./" method="get">
+<input type="submit" name="action" value="analyseall">
+</form>
+
+
+</div>
+
+
+<div id="flex">
+
+
+ <?php $this->insert('homeopt', ['opt' => $opt]) ?>
+
+
+
+<div id="main">
+<h2>Articles</h2>
+<form action="./" method="post">
+
+
+ <div id="massedit">
+ <h3>Mass Edit</h3>
+ <select name="massedit" required>
+ <option value="public">set as public</option>
+ <option value="private">set as private</option>
+ <option value="not published">set as not published</option>
+ <option value="erasetag">erase all tags</option>
+ <option value="erasetemplate">erase template</option>
+ <option value="delete">delete</option>
+ </select>
+
+ <input type="submit" name="massaction" value="do" onclick="confirmSubmit(event, 'Are you sure')" >
+
+ <input type="text" name="targettag" placeholder="add tag">
+ <input type="submit" name="massaction" value="add tag" onclick="confirmSubmit(event, 'Are you sure')" >
+
+ <select name="masstemplate">
+ <?php
+ foreach ($table2 as $art) {
+ echo '<option value="' . $art->id() . '">' . $art->id() . '</option>';
+ }
+ ?>
+ </select>
+
+ <input type="submit" name="massaction" value="set template" onclick="confirmSubmit(event, 'Are you sure')" >
+
+ <input type="hidden" name="action" value="massedit">
+ </div>
+
+
+ <table id="home2table">
+ <tr><th>x</th><th>id</th><th>edit</th><th>see</th><th>del</th><th>log</th><th>tag</th><th>summary</th><th>β†˜ to</th><th>β†— from</th><th>last modification</th><th>date of creation</th><th>privacy</th></tr>
+ <?php foreach ($table2 as $item) { ?>
+ <tr>
+ <td><input type="checkbox" name="id[]" value="<?= $item->id() ?>" id="<?= $item->id() ?>"></td>
+ <td><label title="<?= $item->title() ?>" for="<?= $item->id() ?>"><?= $item->id() ?></label></td>
+ <td><a href="?id=<?= $item->id() ?>&aff=edit">✏</a></td>
+ <td><a href="?id=<?= $item->id() ?>" target="_blank">πŸ‘</a></td>
+ <td><a href="?id=<?= $item->id() ?>&action=delete" >πŸ—‘</a></td>
+ <td><a href="?id=<?= $item->id() ?>&aff=log" target="_blank">ΒΆ</a></td>
+ <td><?= $item->tag('sort') ?></td>
+ <td><?= $item->description() ?></td>
+ <td><?= $item->linkto('sort') ?></td>
+ <td><?= $item->linkfrom('sort') ?></td>
+ <td><?= $item->datemodif('hrdi') ?></td>
+ <td><?= $item->datecreation('hrdi') ?></td>
+ <td><?= $item->secure('string') ?></td>
+ </tr>
+
+ <?php }?>
+ </table>
+</form>
+</div>
+</div>
+</section>
+
+<?php } ?>
+
+</body>
+
+
+
+<?php $this->stop() ?> \ No newline at end of file
diff --git a/app/view/templates/homeopt.php b/app/view/templates/homeopt.php
new file mode 100644
index 0000000..cecb79b
--- /dev/null
+++ b/app/view/templates/homeopt.php
@@ -0,0 +1,84 @@
+<div id="options">
+<h2>Options</h2>
+<form action="./" method="get" >
+<input type="submit" name="submit" value="filter">
+β¬…<input type="submit" name="submit" value="reset">
+
+
+ <!-- $this->optionsort($opt);
+ $this->optionprivacy($opt);
+ $this->optiontag($opt); -->
+
+<fieldset><legend>Sort</legend>
+<select name="sortby" id="sortby">
+<?php
+foreach ($opt->col('array') as $key => $col) {
+ echo '<option value="' . $col . '" ' . ($opt->sortby() == $col ? "selected" : "") . '>' . $col . '</option>';
+}
+?>
+</select>
+</br>
+<input type="radio" id="asc" name="order" value="1" <?= $opt->order() == '1' ? "checked" : "" ?>/><label for="asc">ascending</label>
+</br>
+<input type="radio" id="desc" name="order" value="-1" <?= $opt->order() == '-1' ? "checked" : "" ?>/><label for="desc">descending</label>
+
+</fieldset>
+
+<fieldset><legend>Privacy</legend><ul>
+<li><input type="radio" id="4" name="secure" value="4"<?= $opt->secure() == 4 ? "checked" : "" ?>/><label for="4">all</label></li>
+<li><input type="radio" id="3" name="secure" value="3"<?= $opt->secure() == 3 ? "checked" : "" ?>/><label for="3">editor</label></li>
+<li><input type="radio" id="2" name="secure" value="2"<?= $opt->secure() == 2 ? "checked" : "" ?>/><label for="2">invite only</label></li>
+<li><input type="radio" id="1" name="secure" value="1"<?= $opt->secure() == 1 ? "checked" : "" ?>/><label for="1">private</label></li>
+<li><input type="radio" id="0" name="secure" value="0"<?= $opt->secure() == 0 ? "checked" : "" ?>/><label for="0">public</label></li>
+</ul></fieldset>
+
+ <fieldset><legend>Tag</legend><ul>
+
+
+<input type="radio" id="OR" name="tagcompare" value="OR" ' . <?= $opt->tagcompare() == "OR" ? "checked" : "" ?> ><label for="OR">OR</label>
+<input type="radio" id="AND" name="tagcompare" value="AND" <?= $opt->tagcompare() == "AND" ? "checked" : "" ?>><label for="AND">AND</label>
+
+<?php
+$in = false;
+$out = false;
+$limit = 1;
+foreach ($opt->taglist() as $tagfilter => $count) {
+
+ if ($count > $limit && $in == false) {
+ echo '<details open><summary>>' . $limit . '</summary>';
+ $in = true;
+ }
+ if ($count == $limit && $in == true && $out == false) {
+ echo '</details><details><summary>' . $limit . '</summary>';
+ $out = true;
+ }
+
+ if (in_array($tagfilter, $opt->tagfilter())) {
+
+ echo '<li><input type="checkbox" name="tagfilter[]" id="' . $tagfilter . '" value="' . $tagfilter . '" checked /><label for="' . $tagfilter . '">' . $tagfilter . ' (' . $count . ')</label></li>';
+ } else {
+ echo '<li><input type="checkbox" name="tagfilter[]" id="' . $tagfilter . '" value="' . $tagfilter . '" /><label for="' . $tagfilter . '">' . $tagfilter . ' (' . $count . ')</label></li>';
+ }
+}
+if ($in = true || $out = true) {
+ echo '</details>';
+}
+?>
+
+</ul></fieldset>
+
+ <?php
+ if ($opt->invert() == 1) {
+ echo '<input type="checkbox" name="invert" value="1" id="invert" checked>';
+ } else {
+ echo '<input type="checkbox" name="invert" value="1" id="invert">';
+ }
+ echo '<label for="invert">invert</></br>';
+ ?>
+
+
+<input type="submit" name="submit" value="filter">
+β¬…<input type="submit" name="submit" value="reset">
+
+</form>
+</div>
diff --git a/app/view/templates/layout.php b/app/view/templates/layout.php
new file mode 100644
index 0000000..7439f48
--- /dev/null
+++ b/app/view/templates/layout.php
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf8" />
+
+ <meta name="viewport" content="width=device-width" />
+ <link rel="shortcut icon" href="./media/logo.png" type="image/x-icon">
+ <title><?= $title ?></title>
+ <link rel="stylesheet" href="./../public/css/soft.css">
+ <?=$this->section('customhead')?>
+ <?=$this->section('arthead')?>
+
+</head>
+
+
+
+<?=$this->section('page')?>
+
+
+</html> \ No newline at end of file
diff --git a/app/view/templates/media.php b/app/view/templates/media.php
new file mode 100644
index 0000000..8b189d5
--- /dev/null
+++ b/app/view/templates/media.php
@@ -0,0 +1,4 @@
+<?php $this->layout('base', ['title' => 'Media']) ?>
+
+<h1>Media</h1>
+<p>Hello, <?=$this->e($interface)?></p> \ No newline at end of file
diff --git a/app/view/templates/navart.php b/app/view/templates/navart.php
new file mode 100644
index 0000000..b6a7219
--- /dev/null
+++ b/app/view/templates/navart.php
@@ -0,0 +1,85 @@
+<style>
+.menu {
+ all:initial;
+ position: fixed;
+ top: 0;
+ right: 0;
+ z-index: 10;
+ background-color: var(--color1);
+}
+
+div#dropmenu {
+ display: none;
+}
+
+.menu:hover div#dropmenu {
+ display: block;
+}
+
+</style>
+
+
+<div class="menu" >
+ <?= $user->level() ?>
+ <div id="dropmenu">
+
+ <ul>
+
+ <li>
+ <a class="button" href="./">home</a>
+ </li>
+
+
+<?php if($user->isvisitor()) { ?>
+
+ <li>
+ <form action="./?action=login<?= $art->id() !== null ? '&id=' . $art->id() : '' ?>" method="post">
+ <input type="password" name="pass" id="loginpass" placeholder="password">
+ <input type="submit" value="login">
+ </form>
+ </li>
+
+<?php } else { ?>
+
+ <li>
+ <form action="./?action=logout<?= $art->id() !== null ? '&id=' . $art->id() : '' ?>" method="post">
+ <input type="submit" value="logout">
+ </form>
+ </li>
+
+<?php } ?>
+
+
+<?php if($user->canedit() && $artexist) { ?>
+
+ <li>
+ <a class="button" href="?id=<?=$art->id() ?>" target="_blank">display</a>
+ </li>
+ <li>
+ <a class="button" href="?id=<?=$art->id() ?>&aff=edit" >edit</a>
+ </li>
+
+<?php } ?>
+
+
+<?php if ($user->canedit()) { ?>
+
+ <li>
+ <a class="button" href="?aff=media" >Media</a>
+ </li>
+
+<?php } ?>
+
+<?php if($user->isadmin()) { ?>
+
+ <li>
+ <a class="button" href="?aff=admin" >Admin</a>
+ </li>
+
+<?php } ?>
+
+
+
+
+ </div>
+</div> \ No newline at end of file
diff --git a/app/view/templates/navback.php b/app/view/templates/navback.php
new file mode 100644
index 0000000..c738ae2
--- /dev/null
+++ b/app/view/templates/navback.php
@@ -0,0 +1,54 @@
+<div class="menu">
+ <?= $user->level() ?>
+ <div id="dropmenu">
+
+ <ul>
+
+ <li>
+ <a class="button" href="./">home</a>
+ </li>
+
+
+<?php if($user->isvisitor()) { ?>
+
+ <li>
+ <form action="?action=login" method="post">
+ <input type="password" name="pass" id="loginpass" placeholder="password">
+ <input type="submit" value="login">
+ </form>
+ </li>
+
+<?php } else { ?>
+
+ <li>
+ <form action="?action=logout" method="post">
+ <input type="submit" value="logout">
+ </form>
+ </li>
+
+<?php } ?>
+
+
+
+
+<?php if ($user->canedit()) { ?>
+
+ <li>
+ <a class="button" href="?aff=media" >Media</a>
+ </li>
+
+<?php } ?>
+
+<?php if($user->isadmin()) { ?>
+
+ <li>
+ <a class="button" href="?aff=admin" >Admin</a>
+ </li>
+
+<?php } ?>
+
+
+ </ul>
+
+ </div>
+</div> \ No newline at end of file
diff --git a/app/view/templates/read.php b/app/view/templates/read.php
new file mode 100644
index 0000000..35b1e7d
--- /dev/null
+++ b/app/view/templates/read.php
@@ -0,0 +1,67 @@
+<?php $this->layout('readerlayout') ?>
+
+<?php
+$this->start('head');
+
+if ($artexist) {
+ if ($canread) {
+ echo $head;
+ } else {
+ $this->insert('arthead', ['title' => $art->title(), 'description' => $art->description()]);
+ }
+} else {
+ $this->insert('arthead', ['title' => $art->id(), 'description' => $alertnotexist]);
+}
+
+
+
+$this->stop();
+?>
+
+
+
+
+
+
+
+
+
+<?php $this->start('page') ?>
+
+ <body>
+
+
+
+ <?php
+ if ($readernav) {
+ $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]);
+ }
+ ?>
+
+
+
+ <?php
+
+ if ($artexist) {
+
+ if ($canread) {
+ echo $body;
+ } else {
+ echo '<h1>'.$alertprivate.'</h1>';
+ }
+
+ } else {
+ echo '<h1>' . $alertnotexist . '</h1>';
+ if ($cancreate) {
+ $this->insert('readcreate', ['id' => $art->id()]);
+ }
+ }
+
+
+
+ ?>
+
+
+ </body>
+
+<?php $this->stop() ?> \ No newline at end of file
diff --git a/app/view/templates/readart.php b/app/view/templates/readart.php
new file mode 100644
index 0000000..e44877d
--- /dev/null
+++ b/app/view/templates/readart.php
@@ -0,0 +1,25 @@
+<script>
+<?=$art->javascript() ?>
+</script>
+
+<body>
+
+<header>
+<?=$art->header()?>
+</header>
+
+<nav>
+<?=$art->nav()?>
+</nav>
+
+<aside>
+<?=$art->aside()?>
+</aside>
+
+<section>
+<?=$art->section()?>
+</section>
+
+<footer>
+<?=$art->footer()?>
+</footer>
diff --git a/app/view/templates/readcreate.php b/app/view/templates/readcreate.php
new file mode 100644
index 0000000..dc36420
--- /dev/null
+++ b/app/view/templates/readcreate.php
@@ -0,0 +1,5 @@
+<form action="./" method="get">
+<input type="hidden" name="id" value="<?= $id ?>">
+<input type="hidden" name="action" value="add">
+<input type="submit" value="create">
+</form> \ No newline at end of file
diff --git a/app/view/templates/readerlayout.php b/app/view/templates/readerlayout.php
new file mode 100644
index 0000000..51ab406
--- /dev/null
+++ b/app/view/templates/readerlayout.php
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+
+ <?=$this->section('head')?>
+
+
+</head>
+
+
+
+<?=$this->section('page')?>
+
+
+</html> \ No newline at end of file