summaryrefslogtreecommitdiff
path: root/public/app/views/xx--admin/admin-menu.php
blob: 52e8522796d30cca1c3304cd4db1f876130439ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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>