aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates
diff options
context:
space:
mode:
Diffstat (limited to 'app/view/templates')
-rw-r--r--app/view/templates/backtopbar.php1
-rw-r--r--app/view/templates/home.php16
-rw-r--r--app/view/templates/user.php88
3 files changed, 90 insertions, 15 deletions
diff --git a/app/view/templates/backtopbar.php b/app/view/templates/backtopbar.php
index d769993..1243a17 100644
--- a/app/view/templates/backtopbar.php
+++ b/app/view/templates/backtopbar.php
@@ -48,6 +48,7 @@
<?php
if($user->isadmin()) {
?>
+<a href="<?= $this->url('user') ?>" <?= $tab == 'user' ? 'class="actualpage"' : '' ?>>user</a>
<a href="<?= $this->url('admin') ?>" <?= $tab == 'admin' ? 'class="actualpage"' : '' ?>>admin</a>
<?php
}
diff --git a/app/view/templates/home.php b/app/view/templates/home.php
index 521d985..a59fddf 100644
--- a/app/view/templates/home.php
+++ b/app/view/templates/home.php
@@ -27,12 +27,11 @@
<div id="main">
-<h2>Articles</h2>
+<h2>Pages</h2>
<form action="/massedit" 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>
@@ -45,19 +44,6 @@
<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>
diff --git a/app/view/templates/user.php b/app/view/templates/user.php
new file mode 100644
index 0000000..8615f3d
--- /dev/null
+++ b/app/view/templates/user.php
@@ -0,0 +1,88 @@
+<?php $this->layout('layout', ['title' => 'user', 'css' => $css . 'home.css']) ?>
+
+
+<?php $this->start('page') ?>
+
+<body>
+
+ <?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'user']) ?>
+
+
+<main class="user">
+
+<table>
+<tr>
+<th>id</th><th>password</th><th>level</th><th>action</th>
+</tr>
+
+<tr>
+ <form action="<?= $this->url('useradd') ?>" method="post">
+ <td>
+ <input type="text" name="id" required>
+ </td>
+ <td>
+ <input type="password" name="password" minlength="4" maxlenght="64" required>
+ </td>
+ <td>
+ <select name="level" id="level">
+ <option value="1">reader</option>
+ <option value="2">invite</option>
+ <option value="3">editor</option>
+ <option value="4">super editor</option>
+ </select>
+ </td>
+ <td>
+ <input type="submit" value="add">
+ </td>
+ </form>
+</tr>
+
+
+<?php
+foreach ($userlist as $user ) {
+ ?>
+
+ <tr>
+ <form action="<?= $this->url('userupdate') ?>">
+
+ <td>
+ <?= $user->id() ?>
+ </td>
+
+ <td>
+ <input type="password" name="password" placeholder="<?= str_repeat('°', $user->password('int')) ?>" min="4" max="64" required>
+ </td>
+
+ <td>
+ <select name="level" id="level">
+ <option value="1" <?= $user->level() === 1 ? 'selected' : '' ?>>reader</option>
+ <option value="2" <?= $user->level() === 2 ? 'selected' : '' ?>>invite</option>
+ <option value="3" <?= $user->level() === 3 ? 'selected' : '' ?>>editor</option>
+ <option value="4" <?= $user->level() === 4 ? 'selected' : '' ?>>super editor</option>
+ </select>
+ </td>
+
+ <td>
+ <input type="submit" value="update">
+ </form>
+
+ <form action="<?= $this->url('userdelete') ?>" method="post">
+ <input type="submit" value="delete">
+ </form>
+ </td>
+
+ </tr>
+
+ <?php
+ }
+?>
+
+</table>
+
+<?php var_dump($userlist); ?>
+
+
+</main>
+</body>
+
+<?php $this->stop('page') ?> \ No newline at end of file