This commit is contained in:
Bruno Rybársky 2024-01-11 16:02:10 +01:00
parent 1b02f6eb44
commit 2fdcc0fcbd

@ -1,5 +1,4 @@
<?php <?php
ob_start();
$navsite_template = '<li><a href="__LOCATION__" __CLASS__>__NAME__</a><ul class="navpage_list">__NAVPAGES__</ul></li>'; $navsite_template = '<li><a href="__LOCATION__" __CLASS__>__NAME__</a><ul class="navpage_list">__NAVPAGES__</ul></li>';
$navpage_template = '<li><a class="navpage_link" href="__LOCATION__" __CLASS__>__NAME__</a></li>'; $navpage_template = '<li><a class="navpage_link" href="__LOCATION__" __CLASS__>__NAME__</a></li>';
@ -7,9 +6,10 @@ $navpage_template = '<li><a class="navpage_link" href="__LOCATION__" __CLASS__>_
$site_dirs = array_diff(scandir($static_page_dir), array('.', '..')); $site_dirs = array_diff(scandir($static_page_dir), array('.', '..'));
$nav_out = "";
foreach($site_dirs as $site_dir){ foreach($site_dirs as $site_dir){
echo "trying $static_page_dir/$site_dir"; $pages_dir = array_diff(scandir("$static_page_dir$site_dir"), array('.', '..'));
$pages_dir = array_diff(scandir("$static_page_dir/$site_dir"), array('.', '..'));
$navsite = $navpage_template; $navsite = $navpage_template;
$site_location = "$site_dir.$domain.$tld/$default_page"; $site_location = "$site_dir.$domain.$tld/$default_page";
@ -42,8 +42,9 @@ foreach($site_dirs as $site_dir){
$navpages .= $navpage; $navpages .= $navpage;
} }
$navsite = str_replace("__NAVPAGES__", $navpages, $navsite); $navsite = str_replace("__NAVPAGES__", $navpages, $navsite);
$nav_out .= $navsite;
} }
return ob_get_clean(); return $nav_out;
?> ?>