setMaxRecords(1); if (isset($_REQUEST["id"])) { $id = $_REQUEST["id"]; $pages->getRecords($id); } else { $pages->getRecords(0,"startpagina","ja"); $id = key($pages->objects); } //create menu $menuArray = array(); $menuPages = new DataObject("pagina"); $menuPages->setMaxRecords(999); $menuPages->setOrder("menuvolgorde","down"); $menuPages->getRecords(0); foreach ($menuPages->objects as $menuid => $page) { $menuArray[$menuid] = $page["menutitel"]; $paginaArray[$menuid] = getTextBetweenTags($page["tekst"],"a name"); } $width = round(800/count($menuArray)); $menuString = ""; $counter = 1; foreach ($menuArray as $menuid => $menuitem) { $menuString .= ""; $counter++; } $menuString .= "
"; $javamenuitem = str_replace(" ","",strtolower($menuitem)); $menuString .= ""; $menuString .= "
"; foreach ($paginaArray[$menuid] as $key => $name) { $menuString .= ""; } $menuString .= "
$name
"; $menuString .= ""; $menuString .= "
"; if ($userId) { $loginString = ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; if ($userRights[0]!="") $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= "
Welkom $userName
Meld een storing
Aanvragen Haal- en Brengservice
Voertuig Management Systeem
"; } else { $loginString = "
"; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= ""; $loginString .= "
Loginnaam
Paswoord
"; $loginString .= "
"; } //get other elements $elements = new DataObject("overig"); $elements->setMaxRecords(999); $elements->getRecords(0); //render page content $replace[] = array("onderdeel" => "subtitel", "tekst" => $pages->objects[$id]["menutitel"]); $replace[] = array("onderdeel" => "description", "tekst" => createMetaDescription($pages->objects[$id]["menutitel"]." ".$pages->objects[$id]["tekst"])); $replace[] = array("onderdeel" => "body", "tekst" => $pages->objects[$id]["tekst"]); $replace[] = array("onderdeel" => "login", "tekst" => $loginString); foreach ($elements->objects as $element) { $replace[] = array("onderdeel" => $element["element"], "tekst" => $element["tekst"]); } //parse template $objects = $replace; //set search values $replace[] = array("onderdeel" => "keywords","tekst" => retrieveSearchWords($objects)); srand(); $replace[] = array("onderdeel" => "menu","tekst" => $menuString); $replace[] = array("onderdeel" => "link","tekst" => "index.php?id=".$id); $objects = array_merge($objects,$replace); echo parseTemplate("index", $objects); ?>