Location: PHPKode > projects > Content*Builder > modules/menu2/menu_path.php
<?php
	
	/*
	* Ermittlung der Default Sprache ... wird leider noch als article Option gesetzt
	*/
	$dlQuery = mysql_fetch_array(mysql_query("SELECT * FROM ".TABLE."_options WHERE name = 'default_lang' AND module = 'art'"));
	$defaultLanguage = $dlQuery[value];
	
	/*
	* Wenn im Cookie ne andere Sprache steht, diese nehmen
	*/
	if(!empty($_COOKIE['main_language'])) {
		if(ereg("^[0-9]*$", $_COOKIE['main_language'])) {
			$defaultLanguage = $_COOKIE['main_language'];
		}
	}
	
	if(!is_object($nestedSet)) {
		/* 
		* Initialisierung der NeSet Array's für das 
		* Folder Nested Set Objekt 
		*/
		$folderParams = array (
			'table'  => TABLE.'_columns',
			'id'     => 'fid',
			'parent' => 'mfolder',
			'root'   => 'rootID',
			'l'      => 'leftID',
			'r'      => 'rightID',
			'level'  => 'level',
			'norder' => 'order_num'
		);
		
		$folderAdditional = array (
			'name'          => 'fname',
			'status'        => 'status',
			'writestatus'   => 'writestatus',
			'description'   => 'describt',
			'loadurl'       => 'loadurl',
			'usersallowed'  => 'usersallowed',
			'groupsAllowed' => 'groupsAllowed',
			'skin'          => 'skin'
		);
		
		$nestedSet = CB_NestedSet::factory($folderParams, $folderAdditional);
	}
	
	$additionalSQL = array (
		"field" => ", lang.text, lang.languageID",
		"join"  => "LEFT JOIN ".TABLE."_language AS lang ON lang.typeID = n.fid AND lang.type = 'column' AND lang.languageID = '$defaultLanguage'"
	);
	
	if(isset($openfolder)) {
		$menuPath = $nestedSet->getPath($openfolder, true, $additionalSQL);
		if($menuPath != false) {
			foreach($menuPath as $v) {
				if($v['loadurl'] != "") {
					if(!ereg("^http://", $v['loadurl'])) {
						$v['url']     = $v[id]."&load=".$v['loadurl'];
						$v['urlType'] = "1";
					} else {
						$v['url']     = $v['loadurl'];
						$v['urlType'] = "0";
					}
				} else {
					$v['url']     = $v[id];
					$v['urlType'] = "1";
				}
				
				if($v[text] != "") {
					$v[name] = $v[text];
				}
				
				$folderPath[] = $v;
			}
			$tpl->assign("folderPath", $folderPath);
			$tpl->display("menu_path.template");
		}
	}
?>
Return current item: Content*Builder