aboutsummaryrefslogtreecommitdiff
path: root/app/view
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-01-30 14:29:05 +0100
committervincent-peugnet <v.peugnet@free.fr>2019-01-30 14:29:05 +0100
commit3309bd722454fa8696ce2415075f401e444c9910 (patch)
treea96f73782faf66c715504de78172328d6347fe57 /app/view
parent5e1ca86211da0439003303cf3e0741edf31bced4 (diff)
downloadwcms-3309bd722454fa8696ce2415075f401e444c9910.tar.gz
wcms-3309bd722454fa8696ce2415075f401e444c9910.zip
author and user management
Diffstat (limited to 'app/view')
-rw-r--r--app/view/templates/edit.php2
-rw-r--r--app/view/templates/editrightbar.php53
-rw-r--r--app/view/templates/navart.php2
3 files changed, 26 insertions, 31 deletions
diff --git a/app/view/templates/edit.php b/app/view/templates/edit.php
index e01846e..7c6610a 100644
--- a/app/view/templates/edit.php
+++ b/app/view/templates/edit.php
@@ -16,7 +16,7 @@
<?php $this->insert('editleftbar', ['art' => $art, 'tablist' => $tablist, 'artlist' => $artlist, 'showleftpanel' => $showleftpanel, 'faviconlist' => $faviconlist]) ?>
<?php $this->insert('edittabs', ['tablist' => $tablist, 'opentab' => $art->interface(), 'templates' => $art->template()]) ?>
- <?php $this->insert('editrightbar', ['art' => $art, 'artlist' => $artlist, 'showrightpanel' => $showrightpanel, 'templates' => $art->template(), 'tagartlist' => $tagartlist, 'lasteditedartlist' => $lasteditedartlist, 'inviteuserlist' => $inviteuserlist, 'user' => $user]) ?>
+ <?php $this->insert('editrightbar', ['art' => $art, 'artlist' => $artlist, 'showrightpanel' => $showrightpanel, 'templates' => $art->template(), 'tagartlist' => $tagartlist, 'lasteditedartlist' => $lasteditedartlist, 'editorlist' => $editorlist, 'user' => $user]) ?>
</div>
diff --git a/app/view/templates/editrightbar.php b/app/view/templates/editrightbar.php
index a081aac..15cef7f 100644
--- a/app/view/templates/editrightbar.php
+++ b/app/view/templates/editrightbar.php
@@ -65,42 +65,37 @@
</details>
<h3>Authors</h3>
- <ul>
- <?php
- foreach ($art->authors() as $author) {
- echo '<li>⬖ ' . $author .'</li>';
- }
-
- ?>
- </ul>
+
<?php if($user->level() >= 4) { ?>
- <h3>Invites editors</h3>
- <label for="invites">Invites editors</label>
- <select name="invites[]" id="invites">
- <option value="" selected>--add invite user--</option>
- <?php
- $newinviteuserlist = array_diff($inviteuserlist, $art->invites());
- foreach ($newinviteuserlist as $inviteuser) {
- echo '<option value="'.$inviteuser.'" >'.$inviteuser.'</option>';
+ <label for="authors">Invites editors</label>
+ <select name="authors[]" id="authors">
+ <option value="" selected>--add author--</option>
+ <?php
+ $notyetauthorlist = array_diff($editorlist, $art->authors());
+ foreach ($notyetauthorlist as $author) {
+ echo '<option value="'.$author.'" >'.$author.'</option>';
+ }
+ }
+ ?>
+
+ </select>
+ <?php
+ $alreadyauthorlist = array_intersect($editorlist, $art->authors());
+ foreach ($alreadyauthorlist as $author) {
+ ?>
+ <div class="checkexternal">
+ <?php if($user->level() >= 4) { ?>
+ <input type="checkbox" name="authors[]" id="<?= $author ?>" value="<?= $author ?>" checked>
+ <?php } ?>
+ <label for="<?= $author ?>" >⬗ <?= $author ?></label>
+ </div>
+ <?php
}
- ?>
- </select>
- <?php
- $validateinviteusers = array_intersect($inviteuserlist, $art->invites());
- foreach ($validateinviteusers as $invite) {
- ?>
- <div class="checkexternal">
- <input type="checkbox" name="invites[]" id="<?= $invite ?>" value="<?= $invite ?>" checked>
- <label for="<?= $invite ?>" >⬗ <?= $invite ?></label>
- </div>
- <?php
- }
?>
- <?php } ?>
</div>
diff --git a/app/view/templates/navart.php b/app/view/templates/navart.php
index 1e6b551..0e690c2 100644
--- a/app/view/templates/navart.php
+++ b/app/view/templates/navart.php
@@ -60,7 +60,7 @@
<ul>
<li class="drop">
- <span class="button" style="font-family: monospace; background-color: #7b97b9;" >User lvl : <?= $user->level() ?></span>
+ <span class="button" style="font-family: monospace; background-color: #7b97b9;" ><?= $user->id() ?> (<?= $user->level() ?>)</span>
</li>
<li class="drop">
<a class="button" href="<?= $this->url('home') ?>">home</a>