Seite 1 von 1

XML Ausgabe für Menu

Verfasst: Sa 28. Jul 2007, 12:18
von typo
Hallo zusammen,


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>
und dies ist der PHP Code:

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>';

Verfasst: Fr 3. Aug 2007, 07:29
von emergence
ähm...
sicher das du im richtigen forum bist ? denke nicht...

nicht nachvollziehbar da einfach zu wenig info deinerseits gegeben ist zb: wie genau sieht den cmsx.navigation.php aus ?

diese frage:
Leider ist dabei die Parent bzw. Sub-Funktion verloren gegangen, wie kann ich diese noch in mein Script setzen?
läßt sich somit nicht beantworten...