diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:38:16 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:38:16 +0200 |
commit | 529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 (patch) | |
tree | 8a50c30271b9b328cde0d907b1441f2dabdc341b /Neutron-trunk/api/engine-cyclic/components/drawer.php | |
parent | 15e4724761c50b30803df1811a525c85058f70bf (diff) | |
download | electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.gz electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.bz2 electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.zip |
Update
Diffstat (limited to 'Neutron-trunk/api/engine-cyclic/components/drawer.php')
-rw-r--r-- | Neutron-trunk/api/engine-cyclic/components/drawer.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Neutron-trunk/api/engine-cyclic/components/drawer.php b/Neutron-trunk/api/engine-cyclic/components/drawer.php new file mode 100644 index 0000000..f0e1db7 --- /dev/null +++ b/Neutron-trunk/api/engine-cyclic/components/drawer.php @@ -0,0 +1,54 @@ +<?php + +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist.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 cache"); + require_once $_SERVER['DOCUMENT_ROOT'] . "/api/admin/cache_pages_update.php"; +} + +if (!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)) { + rlgps("Regenerating cache"); + require_once $_SERVER['DOCUMENT_ROOT'] . "/api/admin/cache_pages_update.php"; +} + +?> + +<aside class="mdc-drawer" data-pushbar-direction="right" data-pushbar-id="navigation"> + <div class="mdc-drawer__content"> + <nav class="mdc-list"> + <a class="mdc-list-item" onclick="pushbar.close();"> + <i class="material-icons-outlined mdc-list-item__graphic" aria-hidden="true">close</i> + <span class="mdc-list-item__text"><?= $lang["viewer"]["close"] ?></span> + </a> + <hr class="mdc-list-divider"> + <a class="mdc-list-item <?= $_SERVER['PHP_SELF'] == "/index.php" ? " mdc-list-item--activated" : "" ?>" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/" aria-current="page"> + <i class="material-icons-outlined mdc-list-item__graphic" aria-hidden="true">home</i> + <span class="mdc-list-item__text"><?= $lang["viewer"]["home"] ?></span> + </a> + <?php + rlgps("Loading pages list from cache..."); + $preels = explode("\n", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/pagelist-full.mtd")); + $els = []; + foreach ($preels as $el) { + if (substr($el, 0, 1) != "@") { + $parts = explode("|", $el); + array_push($els, $parts); + } + } + rlgps("Generating menu"); + ?> + <?php foreach ($els as $el): if (trim($el[0]) !== ""): ?> + <a class="mdc-list-item" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/<?= $el[0] ?>"> + <i class="material-icons-outlined mdc-list-item__graphic" aria-hidden="true">insert_drive_file</i> + <span class="mdc-list-item__text"><?= $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 class="mdc-list-item<?= $_SERVER['PHP_SELF'] == "/cms-special/gallery/index.php" ? " mdc-list-item--activated" : "" ?>" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/gallery" aria-current="page"> + <i class="material-icons-outlined mdc-list-item__graphic" aria-hidden="true">image</i> + <span class="mdc-list-item__text"><?= $lang["viewer"]["gallery"] ?></span> + </a> + <?php rlgps("Putting gallery link");endif ?> + </nav> + </div> +</aside> +<div class="mdc-drawer-app-content">
\ No newline at end of file |