Ich habe mir diese Seite angesehen:
http://www.goezay.de
und finde das Menu bzw. dessen Umsetzung klasse. Durch Zufall kam ich dann auf die XML Seite: http://www.goezay.de/navigation.php
Nun habe ich das Modul cmsx.navigation.php so angepasst, dass es dieselben Ausgaben macht (d.h. in einer Zeile mit options).
Leider ist dabei die Parent bzw. Sub-Funktion verloren gegangen, wie kann ich diese noch in mein Script setzen?
Dies ist die Ausgabe
Code: Alles auswählen
<?xml version="1.0" encoding="ISO-8859-1"?>
<navigation>
<option name="Hauptnavigation" text="Hauptnavigation" link="?idcat=1"></option>
<option name="Home" text="Home" link="?idcat=2"></option>
<option name="Kontakt" text="Kontakt" link="?idcat=3"></option>
</navigation>
Code: Alles auswählen
$spc = ' '; // Tabulator
$lvl = 0;
for ($i = 0; $i < count($mnu); $i ++) {
while ($lvl >= $mnu[$i][3]) {
if ($nolists != 1) {
print '' . str_repeat($spc, $lvl + 1) . '';
}
print '' . str_repeat($spc, $lvl) . '';
$lvl -= (($nolists == 1) ? 1 : 2);
}
$lvl = $mnu[$i][3];
if ($short == 1) {
print '' . str_repeat($spc, $lvl) . '
<item name="' . $mnu[$i][2] . '" text="' . $mnu[$i][2] . '" link="?idcat=' . $mnu[$i][0] . '">';
if ($nolists != 1) {
print '' . str_repeat($spc, $lvl + 1) . '';
}
} else {
print '' . str_repeat($spc, $lvl) . '
<option name="' . $mnu[$i][2] . '" text="' . $mnu[$i][2] . '" link="?idcat=' . $mnu[$i][0] . '"></option>';
if ($nolists != 1) {
print '' . str_repeat($spc, $lvl + 1) . '';
}
}
}
while ($lvl > 0) {
if ($nolists != 1) {
print '' . str_repeat($spc, $lvl + 1) . '';
}
print '' . str_repeat($spc, $lvl) . '';
$lvl -= (($nolists == 1) ? 1 : 2);
}
print '
</navigation>';