Compare commits

..

2 Commits

Author SHA1 Message Date
d96bbd2e2a test 2024-01-11 10:14:21 +01:00
59e0957712 add main 2024-01-11 10:08:25 +01:00
4 changed files with 19 additions and 4 deletions

View File

@@ -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
pages/home/domov.html Normal file
View File

@@ -0,0 +1 @@
<h1>Vitaj na tejto úžasnej stránke</h1>

View File

@@ -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
View 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();
?>