aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates/timeline.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-01-12 19:49:41 +0100
committervincent-peugnet <v.peugnet@free.fr>2019-01-12 19:51:41 +0100
commiteb30a63c819ca50ebbc896eb293a0745dcd043be (patch)
tree45144b6d8e2a841de56d76c463e53c99ad029f02 /app/view/templates/timeline.php
parent36d878ac00f4df0a4ff54e2ea8355b323f0a87f3 (diff)
downloadwcms-eb30a63c819ca50ebbc896eb293a0745dcd043be.tar.gz
wcms-eb30a63c819ca50ebbc896eb293a0745dcd043be.zip
timeline message working
Diffstat (limited to 'app/view/templates/timeline.php')
-rw-r--r--app/view/templates/timeline.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/app/view/templates/timeline.php b/app/view/templates/timeline.php
new file mode 100644
index 0000000..8ddc7f1
--- /dev/null
+++ b/app/view/templates/timeline.php
@@ -0,0 +1,65 @@
+<?php $this->layout('layout', ['title' => 'timeline', 'css' => $css . 'home.css', 'favicon' => '']) ?>
+
+
+
+
+<?php $this->start('page') ?>
+
+
+<body>
+
+ <?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'timeline']) ?>
+
+<?php if($user->iseditor()) { ?>
+
+<main class="timeline">
+
+<h1>Timeline</h1>
+
+<ul>
+
+<?php
+foreach ($eventlist as $event) {
+ if($user->id() === $event->user()) {
+ $class = 'class="self event"';
+ } else {
+ $class = 'class="event"';
+ }
+ echo '<li '. $class .'>';
+ switch ($event->type()) {
+ case 'message':
+ echo '<h3>'. $event->user() .'</h3>';
+ echo '<p>'. $event->message() .'</p>';
+ echo '<i>'. $event->date('hrdi') .' ago</i>';
+ break;
+
+ default:
+
+ break;
+ echo '</li>';
+ }
+}
+?>
+
+</ul>
+
+<form action="<?= $this->url('timelineadd') ?>" method="post">
+
+<input type="hidden" name="type" value="message">
+
+<input type="hidden" name="user" value="<?= $user->id() ?>">
+
+<label for="message">message</label>
+<textarea name="message" id="message" cols="30" rows="10"></textarea>
+<input type="submit" value="send">
+</form>
+
+</main>
+
+<?php } ?>
+
+</body>
+
+
+
+<?php $this->stop() ?> \ No newline at end of file