0) {
$children_started = false;
$first = true;
foreach ($pages_list as $page) {
if (trim($page['parent']) === '' && $children_started) {
$children_started = false;
$sitemap_html .= "
\n";
} elseif(!$first && (trim($page['parent']) !== '' && $children_started || trim($page['parent']) === '')) {
$sitemap_html .= "\n";
}
if (trim($page['parent']) !== '') $parent = $page['parent'].'/'; else $parent = '';
if (trim($page['parent']) !== '' && !$children_started) {
$children_started = true;
$sitemap_html .= "\n";
}
$sitemap_html .= '- '.$page['title'].'';
$first = false;
}
if (trim($page['parent']) === '' && $children_started) {
$sitemap_html .= "
\n";
} else {
$sitemap_html .= "\n";
}
}
// Display components
if (count($components) > 0) {
foreach ($components as $component) {
$sitemap_html .= ''.__(ucfirst($component), $component).''."\n";
}
}
echo $sitemap_html;
?>