diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-12-23 18:20:57 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-12-23 18:20:57 +0100 |
commit | e8566a57cf1b9cc2eed10429f27840d17da945ef (patch) | |
tree | 9902d9f4dc2e871819af21ede642e50aaab1518b /app/view | |
parent | 532cdf4bb82ab7cc6fa7659d9aec3ce122b2ec52 (diff) | |
download | wcms-e8566a57cf1b9cc2eed10429f27840d17da945ef.tar.gz wcms-e8566a57cf1b9cc2eed10429f27840d17da945ef.zip |
feature users
Diffstat (limited to 'app/view')
-rw-r--r-- | app/view/templates/backtopbar.php | 1 | ||||
-rw-r--r-- | app/view/templates/home.php | 16 | ||||
-rw-r--r-- | app/view/templates/user.php | 88 |
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 |