Zum Inhalt springen

XML mit komplettem Pfad generieren

Erstellt am 26. Februar 2008 · 4 Antworten · letzte Antwort am 26. Februar 2008

Tags: RealURL, Links, Frage

Crazy-Achmet ·

Hey,

um ein Flash-Menü zu steuern, generiere ich z.Z. mit folgendem Code eine XML

class user_xmlmenu {
	var $cObj; // the calling cObj

	function user_xmlMenuIProc($item,$conf) {
		$GLOBALS["TSFE"]->set_no_cache();
		$currentPageUid = $GLOBALS['TSFE']->id;
		$conf["target."]["override."]["wrap"] = $item["linkHREF"]["TARGET"];
		$typeNum = $GLOBALS["TSFE"]->tmpl->setup[$this->cObj->cObjGetSingle($conf["target"],$conf["target."])."."]["typeNum"];

		if(!$typeNum) $typeNum = 0;

		$item["parts"]["after"] = ' type="'.$typeNum.'"';

		if($this->hasSub($item,$conf)) {
			#$item["parts"]["after"] .= " >\n";
			$item["parts"]["after"] .= " variables=\"index.php?id=".$item["uid"]."\">\n";
		}
		else {
			
			$item["parts"]["title"] = str_replace("unterMenue","mLink",$item["parts"]["title"]);
			$item["parts"]["title"] = str_replace("zweitMenue","mLink",$item["parts"]["title"]);
			$item["parts"]["title"] = str_replace("drittMenue","mLink",$item["parts"]["title"]);
			$item["parts"]["after"] .= " variables=\"index.php?id=".$item["uid"]."\" link=\"true\" />\n";
		}
		return $item;
	}
	function hasSub($item,$conf) {
		$query = $GLOBALS["TSFE"]->cObj->getQuery("pages",Array("pidInList"=>$item["uid"]));
		$res = mysql(TYPO3_db, $query);
		if($row=mysql_fetch_assoc($res))
			return true;
	}
}

if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/bf_xml_for_flash/menuiproc.php"])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/bf_xml_for_flash/menuiproc.php"]);
}

Das TypoScript dazu sieht so aus

# XML
lib.xmlmenu = HMENU
lib.xmlmenu {

    1 = TMENU
    1.IProcFunc = user_xmlmenu->user_xmlMenuIProc
    1.expAll = 1
    1.NO {
      doNotLinkIt =1
      stdWrap {
        dataWrap =  <ebene01 name="|" aktion="unterMenue" 
        // the closing bracket '>' is added by the IProcFunction!
      }
    }
    1.IProcFunc.target = TEXT
    1.IProcFunc.target.value = {$PAGE_TARGET}
    2 < .1
    2.wrap =  | </ebene01>
    2.NO.stdWrap.dataWrap =  <ebene02 name="|" aktion="zweitMenue"  

    3 < .2
    3.wrap =  | </ebene02>
    3.NO.stdWrap.dataWrap =  <ebene03 name="|" aktion="drittMenue" 

    4 < .2
    4.wrap =  | </ebene03>
    4.NO.stdWrap.dataWrap =  <ebene04 name="|"
}

Klappt auch soweit wunderbar, wie man hier sehen kann: http://www.flexo-raumsysteme.de/index.php?type=444

Jetzt möchte ich aber, das in Zeile 16 statt index.php?id=".$item["uid"] der Pfad verwendet wird, so wie ich ihn mit RealURL schon verwende, leider weiß ich nicht genau, wie ich von der UID auf den Pfad komme. Gibt es hierfür vielleicht eine Funktion?

Wie immer danke im Voraus

Liebe Grüße

Flo