aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/api/engine-cyclic/components/menubar.php
blob: b6bce59377c300cecbefe47a57df01f17e28e8df (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
48
49
50
51
52
<?php

if ((!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist-old.mtd") || (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist-full.mtd") && strpos(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist-old.mtd"), "<a") === false)) || (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist-full.mtd") || (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist-full.mtd") && strpos(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist-full.mtd"), "|") === false)) || (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist-old.mtd") || (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist.mtd") && strpos(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist.mtd"), "|") === false))) {
    rlgps("Regenerating pages cache");
    require_once $_SERVER['DOCUMENT_ROOT'] . "/api/admin/cache_pages_update.php";
}

?>

<header class="mdc-top-app-bar">
    <div class="mdc-top-app-bar__row">
        <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
            <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/" id="menubar-home-link">
                <span id="menubar-logo"></span>
                <span class="mdc-top-app-bar__title title rsp-desktoponly"><?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename") ?></span>
            </a>
        </section>
        <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar">
            <span class="rsp-desktoponly" id="menuitems">
                <?php
                rlgps("Loading pages from cache...");
            
                $preels = explode("\n", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist.mtd"));
                $els = [];
                foreach ($preels as $el) {
                    if (substr($el, 0, 1) != "@") {
                        $parts = explode("|", $el);
                        array_push($els, $parts);
                    }
                }

                ?>
                <?php rlgps("Generating menubar");foreach ($els as $el): ?>
                <?php if (trim($el[1]) != ""): ?>
                <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/<?= $el[0] ?>" class="mdc-button rsp-desktoponly">
                    <div class="mdc-button__ripple"></div>
                    <span class="mdc-button__label menubutton"><?= $el[1] ?></span>
                </a>
                <?php endif;endforeach; ?>
                <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures") && count(scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures")) > 2): ?>
                <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/gallery" class="mdc-button rsp-desktoponly">
                    <div class="mdc-button__ripple"></div>
                    <span class="mdc-button__label menubutton"><?= $lang["viewer"]["gallery"] ?></span>
                </a>
                <?php endif ?>
            </span>
            <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button">home</a>
            <button class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button" onclick="pushbar.open('navigation');">menu</button>
            <button class="material-icons-outlined mdc-top-app-bar__action-item mdc-icon-button rsp-mobileonly rsp-widgetbar" onclick="pushbar.open('widgets');">info</button>
        </section>
    </div>
</header>