// ====================================\
@include_once('_dir.php');
// ====================================/
include_once("$ROOT_PATH/common/all_head.php");
?>
$AllPages=array();
$res=db_query("select pageID,type,static_page,title,bottom_links,
IF(url_name!='',url_name,pageID) as url_name
from site_pages
where type<2 and active and in_map order by type,pageID");
while ($row=@$sql_fetch_assoc($res)) {
$pageID=$row['pageID'];
$row['title']=to_html($row['title']);
$row['href']=make_url($row['static_page'],$row['url_name'],$row['type']);
$row['bottom_links']=call('intval',explode(':',$row['bottom_links']));
$AllPages[$pageID]=$row;
}
$Pages=$AllPages;
// foreach ($MenuItems as $item)
// if ($item['level']) unset($Pages[$item['pageID']]);
$Space=str_repeat(' ',6);
// ------------------------------------\
function write_subpages($list,$prefix='',$suffix='') {
global $AllPages,$Pages,$Space;
foreach ($list as $id)
if ($page=$Pages[$id]) {
echo "$prefix$page[title]$suffix
";
unset($Pages[$id]);
write_subpages($AllPages[$id]['bottom_links'],"$prefix$Space");
}
}
// ------------------------------------/
/*
foreach ($MenuItems as $item) {
$l=$item['level'];
if (!$l) continue;
$pageID=$item['pageID'];
$title=to_html($item['menu_title']);
$lattrs=$item['newwin'] ? 'target=_blank' : '';
if ($item['href']) $title="$title";
$title=($l==1) ?
"