This commit is contained in:
Bruno Rybársky 2024-01-11 10:14:21 +01:00
parent 59e0957712
commit d96bbd2e2a
3 changed files with 18 additions and 4 deletions

@ -52,7 +52,9 @@ else{
$page = file_get_contents($template_dir . "404.html");
}
$nav = str_replace("href=\"/$page_name\"", "href=\"/$page_name\" class=\"active\"", $nav);
$navpages = include_once $template_dir . "navpages.php";
$nav = str_replace("__NAV_PAGES__", $navpages, $nav);
$out = $skeleton;
$out = str_replace("__TEMPLATE__NAV__", $nav, $out);

@ -1,8 +1,6 @@
<nav>
<div class="logo"><img class="standard-logo" src="http://www.adlerka.sk/wp-content/uploads/2021/09/Logo_text_Adlerka_modro_cerveno_biele-e1652431356820.png" title="Adlerka"></div>
<ul>
<li><a href="/domov">Domov</a></li>
<li><a href="/info">Informácie</a></li>
<li><a href="/login" id="login">Prihlásiť</a></li>
__NAV_PAGES__
</ul>
</nav>

14
templates/navpages.php Normal file

@ -0,0 +1,14 @@
<?php
ob_start();
$navpage_template = '<li><a href="__LOCATION__" __CLASS__>__NAME__</a></li>';
$page_dir = "/pages";
$files1 = scandir($page_dir);
echo $files1;
return ob_get_clean();
?>