link;
switch( @$node->type ) {
case 'separator':
break;
case 'url':
if ( eregi( "index.php\?", $link ) ) {
if ( strpos( 'Itemid=', $link ) === FALSE ) {
$link .= '&Itemid='.$node->id;
}
}
break;
default:
$link .= '&Itemid='.$node->id;
break;
}
if( strcasecmp( substr($link, 0, 5), 'http:' ) != 0 ) {
$link = sefRelToAbs($link); // make path absolute and apply SEF transformation (if any)
if( strcasecmp( substr($link,0,9), 'index.php' ) === 0 ){ // fix broken sefRelToAbs()
$link = $mosConfig_live_site. '/' .$link;
}
if( strncmp($link, '/', 1) === 0) { // removes the dash again, when live_site URL is empty
$link = $mosConfig_live_site.$link;
}
}
$is_extern = ( 0 != strcasecmp( substr($link, 0, $len_live_site), $mosConfig_live_site ) );
if( !isset($node->browserNav) )
$node->browserNav = 0;
if( $node->browserNav != 3 // ignore "no link"
&& !$is_extern) { // ignore external links
$out .= "\n";
$out .= " ". $link ."\n"; // http://complete-url
if( isset($node->modified) && $node->modified != FALSE && $node->modified != -1) {
$modified = date('Y-m-d\TH:i:s', $node->modified); // ISO 8601 yyyy-mm-ddThh:mm:ss.sTZD
$modified .= sprintf("%+03d:00", $GLOBALS['mosConfig_offset']); //TimeZoneDesignator
$out .= " ". $modified ."\n";
}
//$out .= " always"; // always, hourly, daily, weekly, monthly, yearly, never
//$out .= " 0.8"; // 0.0 - 1.0
$out .= "\n";
}
if( isset($node->tree) ) {
$out .= JoomapGoogle::getList( $node->tree );
}
}
return $out;
}
/** Print a Google Sitemaps representation of tree */
function printTree( &$joomap, &$root ) {
header('Content-type: text/xml;');
echo ''."\n";
echo ''."\n";
$tmp = array();
foreach( $root as $menu ) { // concatenate all menu-trees
foreach( $menu->tree as $node ) {
$tmp[] = $node;
}
}
echo JoomapGoogle::getList( $tmp );
echo "\n";
die();
}
};
?>