Location: PHPKode > projects > Content*Builder > modules/menu2/menu.php
<?php
	$tpl->assign("MODULE_IMG_DIR", $location."templates/images/");
	
	$nav = new MyTree;
	
	$nav->setOpenFolder($openfolder);
	$nav->getOpenFolders($openfolder);
	
	/* alles ausgeben */
	if(empty($COLUMN_restriction)) {
		$nav->getMenu();
	} else {
		$base = $COLUMN_select->fid;
		$restrictStatus = $COLUMN_select->status;
		$nav->setStartLevel($COLUMN_select->status);
		$children = $nav->folder[$restrictStatus][$base]['children'];
		$nav->getChildren($children, ($restrictStatus + 1), $base);
	}
	
	// Article Liste laden
	if($archive == 1) { 
		$artAmount = 10000; 
	} else { 
		if(!$cbOption->getSingleOption("artAmount")) {
			$artAmount = 10;
		} else {
			$artAmount = $cbOption->getSingleOption("artAmount");
		}
	}
	if($load == "article2") {
		$dlQuery = mysql_fetch_array(mysql_query("SELECT * FROM ".TABLE."_options WHERE name = 'default_lang' AND module = 'art'"));
		$defaultLanguage = $dlQuery[value];
		
		$contentWhere = "WHERE content.ide = general.ide AND content.ide != '' AND (";
		$multiple = false;
		$counter = 0;
		$generalArticleQuery = mysql_query("SELECT ide, languages, folderID FROM ".TABLE."_art_general WHERE folderID = '$openfolder' AND stage = '3' ORDER BY datetime DESC LIMIT 0,$artAmount");
		while($generalArticle = mysql_fetch_object($generalArticleQuery)) {
			if($multiple) {
				$contentWhere .= "OR ";
			}
			$thisIDE = $generalArticle->ide;
			$generalLanguages[$thisIDE] = $generalArticle->languages;
			$generalFolderID[$thisIDE]  = $generalArticle->folderID;
			$generalOrder[$thisIDE]     = $counter;
			
			if($main_language & $generalArticle->languages) {
				$contentWhere .= "( content.ide = '$thisIDE' AND content.language = '$main_language') ";
			} else {
				$contentWhere .= "( content.ide = '$thisIDE' AND content.language = '$defaultLanguage') ";
			}
			$multiple = true;
			++$counter;
		}
		$contentWhere .= ")";
		
		if($multiple) {
			$query = "SELECT content.ide, content.language, content.title, general.datetime FROM ".TABLE."_art_content AS content, ".TABLE."_art_general AS general $contentWhere ORDER BY general.datetime DESC";
			$result = mysql_query($query);
			
			$noArticles = true;
			while($artData = mysql_fetch_object($result)) {
				$title = substr($artData->title, 0, 20);
				if(strlen($artData->title > 20)) {
					$title .= "...";
				}
				$artTitle[]		= $title;
				$artIde[]		= $artData->ide;
				$artFolderId[]	= $generalFolderID[$artData->ide];
				$noArticles = false;
			}
		} else {
			$noArticles = true;
		}
		$artType        = "article2";		
	} else {
		$query = mysql_query("SELECT title, ide, folder FROM ".TABLE."_article WHERE folder = '$openfolder' AND stage = '3' ORDER BY datum DESC LIMIT 0,$artAmount");
		$artTitle = array();
		$artIde = array();
		$artFolderId = array();
		
		$noArticles = true;
		while($articles = mysql_fetch_array($query)) {
			$title = substr($articles[title], 0, 20);
			if(strlen($articles[title]) > 20) {
				$title .= "...";
			}
			$artTitle[]		= $title;
			$artIde[]		= $articles[ide];
			$artFolderId[]	= $articles[folder];
			$noArticles = false;
		}
		unset($articles);
		$artType        = "article";
			
	}
		
	if(!$noArticles) {
		$tpl->assign("navigationArticleSet", "1");
		$navArticleData = array(
			"NAV_FOLDER"    => $artFolderId,
			"ARTICLE_TITLE" => $artTitle,
			"IDE"			=> $artIde
		);
		$tpl->assign("navArticleData", $navArticleData);
		
		$tpl->assign("navArticleDeepness", $nav->folderMatchSpace);
	}
	
	$tpl->assign("navFolderData", array ( 
		"DEEPNESS"	  => $nav->getFolderSpace(),
		"NAV_FOLDER"  => $nav->getFolderName(),
		"NAV_URL"	  => $nav->getFolderID(),
		"NAV_FID"     => $nav->folderTrueID,
		"NAV_FID_SET" => $nav->folderIDSet,
		"FOLDER_ART"  => $nav->folderArtPrint,
		"LASTSUB"	  => $nav->lastSubElement,
		"LEVEL"		  => $nav->folderLevel,
		"STATUS"      => $nav->folderStatus
	));
	
	$tpl->assign("navArticleType", $artType);
	
	$tpl->display("menu.template");
?>
Return current item: Content*Builder