Following the Snippet "MenuBuilderFHF"
$id = isset($id) ? $id : $modx->documentIdentifier; // base document
$indentString = 22;
$CSS_class = "nav";
$CSS_class_active = "navactive";
$menu = '';
// ----------------------------------------------------------------------
if(!isset($indent)) {
$indent = "";
$indentString = 22;
$bgcolorString = "#003399";
} else {
for($in=0; $in<$indent; $in++) {
$indentString += 10;
}
switch ($indent) {
case 0:
$bgcolorString = "#003399";
break;
case 1:
$bgcolorString = "#728EC7";
break;
case 2:
$bgcolorString = "#CBD5EA";
break;
default:
$bgcolorString = "#728EC7";
}
}
// ----------------------------------------------------------------------
$children = $modx->getActiveChildren( $id, 'menuindex', 'ASC', 'id, pagetitle, menutitle, hidemenu' );
$childrenCount = count($children);
if($children == false) {
return false;
}
for($x=0; $x<$childrenCount; $x++) {
if($children[$x]["id"] == $modx->documentIdentifier) {
$CSSclass = $CSS_class_active;
} // if
else {
$CSSclass = $CSS_class;
} // else
$parent_parentid = $modx->getParent($modx->documentObject['parent'], 1, $fields='id, parent');
if ( !$children[$x]["hidemenu"] ) {
if( $children[$x]["id"] == $modx->documentIdentifier || $children[$x]["id"] == $modx->documentObject['parent'] || $children[$x]["id"] == $parent_parentid['id'] ) {
$indent++;
$menu .= buildElement ($children[$x]["menutitle"], $children[$x]["id"],$CSSclass ,$indentString, $bgcolorString ) .'[[MenuBuilderFHF?id=' .$children[$x]["id"] .'&indent=' .$indent .']]';
} else {
$menu .= buildElement ($children[$x]["menutitle"], $children[$x]["id"],$CSSclass ,$indentString, $bgcolorString );;
}
}
}
return $menu;
// ----------------------------------------------------------------------
function buildElement ( $title, $a_href, $CSSclass = "", $extra1 = "", $extra2 = "", $extra3 = "" ) {
$menuElement = '
<table bgcolor="'.$extra2.'" width="165" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" width="' .$extra1 .'"><img src="[(base_url)]assets/templates/images/blank.gif" alt="" width="' .$extra1 .'" height="1" border="0"></td>
<td nowrap valign="top" width="10"><img src="[(base_url)]assets/templates/images/blank.gif" alt="" width="1" height="6" border="0"><br><a onMouseover="' ."ToggleImage('arrow_" .$a_href ."',1)" .'" onMouseout="' ."ToggleImage('arrow_" .$a_href ."',0)" .'" href="[~' .$a_href .'~]"><img id="arrow_' .$a_href .'" src="[(base_url)]assets/templates/images/arrow.gif" width="7" height="8" border="0" alt=""></a><img src="[(base_url)]assets/templates/images/blank.gif" width="3" height="1" border="0" alt=""></td>
<td valign="top" width="133"><img src="[(base_url)]assets/templates/images/blank.gif" alt="" width="1" height="2" border="0"><br><a onMouseover="' ."ToggleImage('arrow_" .$a_href ."',1)" .'" onMouseout="' ."ToggleImage('arrow_" .$a_href ."',0)" .'" class="' .$CSSclass .'" href="[~' .$a_href .'~]">' .$title .'</a><br><img src="[(base_url)]assets/templates/images/blank.gif" width="1" height="3" border="0" alt=""></td>
</tr>
<tr>
<td width="165" colspan="3">
<table style="background-image:url([(base_url)]assets/templates/images/dotted_line.gif)" width="165" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="[(base_url)]assets/templates/images/blank.gif" alt="" width="165" height="1" border="0"></td>
</tr>
</table>
</td>
</tr>
</table>
';
return $menuElement;
}
you can see the error at
http://goethe-wg.no-ip.org/modx-0.9.2.1/
try any of the documents listet in the menu and as the result you’ll see the error... try a link on the right (e.g. Sitemap) and it works fine...