summaryrefslogtreecommitdiff
path: root/public/app/views/admin/admin-menu.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/app/views/admin/admin-menu.php')
-rw-r--r--public/app/views/admin/admin-menu.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/public/app/views/admin/admin-menu.php b/public/app/views/admin/admin-menu.php
new file mode 100644
index 0000000..52e8522
--- /dev/null
+++ b/public/app/views/admin/admin-menu.php
@@ -0,0 +1,47 @@
+<?php
+/** admin panel
+ * -----------------------------------------------------------------------------
+ *
+ * imported variables:
+ * ---
+ * @param $action (string): array of articles
+ * @param $id (int): id of entity (when editing entity) | 0: new entity
+ *
+ * example call:
+ * ---
+ * Render::template("sections/admin_panel.php",[
+ * 'action' => 'posts',
+ * 'id' => 4
+ * ])
+ * -----------------------------------------------------------------------------
+ */
+
+$admin_options = [
+ 'panel' => 'Διαχείριση',
+ 'edit_lesson' => 'Νέο Μάθημα',
+ 'lessons' => 'Μαθήματα',
+ 'categories' => 'Κεφάλαια',
+ 'pages' => 'Σελίδες',
+ 'files' => 'Αρχεία',
+ 'privileges' => 'Πρόσβαση',
+ 'users' => 'Χρήστες'
+];
+?>
+
+<div class="top-bar">
+
+ <?php foreach($admin_options as $opt => $label) : ?>
+
+ <?php if (($opt == $action) & (!$id)) : ?>
+ <span class="btn btn-primary selected"><?=$label?></span>
+
+ <?php else : ?>
+ <a href="/admin/<?= $opt ?>" class="btn"><?= $label ?></a>
+
+ <?php endif; ?>
+
+ <?php endforeach ?>
+
+ <a href="/logout" class="btn">Logout</a>
+
+</div> \ No newline at end of file