<?php
function O__createPTmenu(){
	global $O__libPath, $O__DBpath, $O__PT;
	
	$O__filesArray = O__dirToArray($O__libPath . "/pageTypes");
	sort($O__filesArray);
	$O__output = "";
		
	for($i=0;$i<count($O__filesArray);$i++){
		// Load settings
		$O__pathSettings = $O__DBpath . "/pageTypes/" . $O__filesArray[$i][0] . "/configs/settings.xml";
		if (file_exists($O__pathSettings)){
			$O__fileData = O__XMLdata($O__DBpath . "/pageTypes/" . $O__filesArray[$i][0] . "/configs/settings.xml", 0, 0);
			$O__menuDisplay = O__XMLgetData($O__fileData,"/settings/setting[@id='menuDisplay']/value");
			unset($O__fileData);
		}
		
		$O__fileData = O__XMLdata($O__libPath . "/pageTypes/" . $O__filesArray[$i][0] . "/info.xml", 0, 0);
		if ($O__menuDisplay == 1){
			$O__output .= "<a href=\"/" . $O__fileData->pageType . "\">". $O__fileData->name . "</a><hr>";
		}
	}
	
	return $O__output;
}

echo(O__createPTmenu());
?>
