So ein Stück wurde mir schon in einem anderen Forum weitergeholfen. Mein Problem nun dabei ist jetzt, wie kriege ich raus welche/r Link(ID) gerade aktiv ist? Und wie gebe ich den 3. Zustand zurück im Return? Ich steh irgendwie gerade voll auf dem Schlauch
So ist mein derzeitiger Stand:
Typoscript-Code:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
| page.includeLibs.usermenu = fileadmin/web1/scripts/menue_webkontent.php lib.usermenu = HMENU lib.usermenu.special = userfunction lib.usermenu.special.userFunc = user_menuFunc->makeMenuArray lib.usermenu.special.userFunc.table = pages lib.usermenu.special.userFunc.select.pidInList = 1 lib.usermenu.1 = TMENU lib.usermenu.1 { NO { ATagBeforeWrap = 1 linkWrap = <SPAN class="dritteebene">|</SPAN><BR> stdWrap.data = field:name typolink.parameter.data = field:www stdWrap.field = title stdWrap.typolink.parameter.field = pid stdWrap.typolink.section.field = uid stdWrap.htmlSpecialChars = 1 } } |
PHP-Code:
<?php
class user_menuFunc {
function makeMenuArray($content,$conf) {
$menuArr = array();
$lConf = $conf["userFunc."];
$res = $this->cObj->exec_getQuery($lConf["table"],$lConf["select."]);
if ($error = $GLOBALS['TYPO3_DB']->sql_error()) {
$GLOBALS['TT']->setTSlogMessage($error,3);
} else {
$GLOBALS['TT']->setTSlogMessage('NUMROWS: '.$GLOBALS['TYPO3_DB']->sql_num_rows($res));
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$menuArr[] = $row;
}
}
return $menuArr;
}
}
?>
Ausgabe: HTML-Code:
<a href="index.php?id=5" onfocus="blurLink(this);"><span class="dritteebene"><a href="index.php?id=1#c5">Home</a></span><br /></a> <a href="index.php?id=4" onfocus="blurLink(this);"><span class="dritteebene"><a href="index.php?id=1#c4">Produkte</a></span><br /></a> <a href="index.php?id=3" onfocus="blurLink(this);"><span class="dritteebene"><a href="index.php?id=1#c3">Referenzen</a></span><br /></a> <a href="index.php?id=2" onfocus="blurLink(this);"><span class="dritteebene"><a href="index.php?id=1#c2">Kontakt</a></span><br /></a>