get_attribute(); //read default language out of the config xml file $default_lang=$m_array["DEFAULT"]; //read the supportet languages out from the config xml file $multilang=$multilang->get_output(); if($multilang!=""){ $multilang_long=new xml_config("MULTILANG_LONG",'config/config.xml'); $lang_long_array=explode(",",$multilang_long->get_output()); $lang_array=explode(",",$multilang); include 'multilang.php'; $lang_choice=""; for($i=0;$i$lang_long_array[$i] "; } session_register("lang_choice"); session_register("lang_array"); $path_new=$sprache."/"; } else{ $path_new=""; } //session_register("sprache"); $path=""; //******************************************************************************************* //* Variablen //******************************************************************************************* if(is_string($_POST['nodeId'])){ $nodeId=$_POST['nodeId']; } elseif(is_string($_GET['nodeId'])){ $nodeId=$_GET['nodeId']; } else{ $nodeId=""; } $navigation=new navigation(); $parser=new xmlNavigation('xml/xml_neu_navigation'.$sprache.'.xml'); $navigation->setTree($parser->get_output()); $_SESSION['navigation']=$navigation; //session_register("navigation"); if(!$nodeId){ $nodeId=$navigation->getRootNode()->getId(); } if(!key_exists($nodeId, $navigation->getTree())){ $nodeId=$navigation->getRootNode()->getId(); $useErrorFile=true; } $_SESSION['nodeId']=$nodeId; $navigation->getNavigationArray($nodeId); $node=$navigation->getNode($nodeId); //******************************************************************************************* //* Check permission //******************************************************************************************* if($node->getPermission()=="protected" and $_SESSION['auth']->checkAuth()=="nobudy"){ $data="

Zugriff verweigert

Bitte melden Sie sich mit Ihrem Benutzernamen und Ihrem Passwort am System an.

"; $meta=""; $template=new Template(".", "comment"); $template->set_file("page","stylesheet/index.ihtml"); $template->set_var(array("TITEL"=>$titel,"CONTENT"=>$data,"LOGIN"=>$login, "META"=>$meta)); $template->parse("out","page"); $template->p("out"); exit; } $navigationString=$navigation->getNavigationString(); $nav_modus=new xml_config("NAV_TYPE",'config/config.xml'); $nav_include=$nav_modus->get_output(); //******************************************************************************************* //* path generation //******************************************************************************************* // pr?ft ob datei existiert $title=$node->getName(); $id=$node->getId(); $file="xml/".$id.".xml"; $file_dat="dat/".$id.".dat"; $file_nav="xml/xml_neu_navigation".$sprache.".xml"; if($useErrorFile){ $file="xml/error.xml"; } //******************************************************************************************* //* Inhaltbeschreibung //******************************************************************************************* // if no file was found, a new one is gona created if(!@fopen($file,'r') and ($nodeId!=$navigation->getRootNode()->getId())){ $content_xml_file=" ".$node->getName()." In Bearbeitung. "; $fp=fopen($file,'w'); fputs ($fp,$content_xml_file); } // if no file was found for root, creat an empty file for the navigation element root if(!@fopen($file,'r') and $nodeId==$navigation->getRootNode()->getId()){ $content_xml_file=" "; $fp=fopen($file,'w'); fputs ($fp,$content_xml_file); } // wenn nicht wird der filename einer fehlermeldungsseite zugewiesen if(!@fopen($file,'r')){ if($titel=="_sitemap"){ $file=$file_nav; $titel="_sitemap"; } else{ $file="xml/error.xml"; $titel="_error"; } } // parst die navigation if($nav_include==0){ //$nav_parser=new xml_navigation_integriert($titel,$path); } else{ //$nav_parser=new xml_navigation_expandiert($titel,$path); } //*********************************************************************************************************** //Mutationsangabe in der Fusszeile //*********************************************************************************************************** $config=new xml_config("MODIFICATION_DATE",'config/config.xml'); if ("enabled"==$config->get_output()){ $modification="

 last mod. ".date("d. F Y",filemtime($file))."

"; } else{ $modification=""; } // parst den inhalt der ?bergebenen Datei if($_GET['function']!="sitemap"){ //nur sichtbare navigationselemente verlinken if(!file_exists($file_dat) or (filemtime($file)>filemtime($file_dat)) or (filemtime($file_nav)>filemtime($file_dat)) ){ //content aus xml erzeugen und in dat file schreiben $data=""; //var_dump($node->getName()); //print "dat integriert"; if($node->getContentLinking()=="true"){ // var_dump($navigation->getLinkerArray()); $cont_parser=new xml_content($file,$navigation->getLinkerArray(),$node->getName()); $data=$cont_parser->get_output(); } else{ $emptyarray=array(); $cont_parser=new xml_content($file,$emptyarray,$node->getName()); $data=$cont_parser->get_output(); } //dat file schreiben if($data!=""){ $handle = fopen ($file_dat, "w"); fputs($handle,$data); fclose ($handle); } elseif(file_exists($file_dat)){ unlink($file_dat); } } else{ //wenn dat file neuer ist als xml file, content aus dat file auslesen $data=""; $handle = fopen ($file_dat, "r"); while (!feof($handle)) { $data.= fgets($handle, 4096); } fclose ($handle); } // //If there is no content in the navigation element, the system redirect to the first visible subnavigation element. // $navigation_array=$navigation->getTree(); if((is_array($navigation_array[$nodeId]->getChildren()) and $data=="")or $nodeId==$navigation->getRootNode()->getId()){ //print "es geht was ab
"; $tempNode=""; $tempArray=$navigation_array[$nodeId]->getChildren(); for($i=0;$igetNode($tempArray[$i]->getId()); if($tempNode->getVisible()=="visible" and ($tempNode->getPermission()!="protected" or (string) $_SESSION['auth']->checkAuth()!="nobudy")){ $temp_titel=$tempNode->getId(); $temp_file="xml/".$path.$temp_titel.".xml"; $file_dat="dat/".$path.$tempNode->getId().".dat"; //var_dump($tempNode); if($tempNode->getContentLinking()=="true"){ // var_dump($navigation->getLinkerArray()); $cont_parser=new xml_content($temp_file,$navigation->getLinkerArray(),$tempNode->getName()); $data=$cont_parser->get_output(); } else{ $emptyarray=array(); $cont_parser=new xml_content($temp_file,$emptyarray,$tempNode->getName()); $data=$cont_parser->get_output(); } //$cont_parser=new xml_content($temp_file,$navigation->getLinkerArray(),$temp_titel); //$data=$cont_parser->get_output(); //dat file schreiben $handle = fopen ($file_dat, "w"); fputs($handle,$data); fclose ($handle); if($data!=""){ $nodeId=$tempNode->getId(); $_SESSION["nodeId"]=$nodeId; header("Location: index.php?nodeId=".$tempNode->getId()); die; } } } if($titel!=$titel_neu){ header("Location: index.php?titel=$titel_neu"); exit; } } } else{ // //sitemap output //$array = $navigation->getLinkerArray(); $data="

Sitemap

"; $data.=$navigation->renderSitemap(); $data.="

"; //var_dump($data); } /* //************************************************************* //* pdf Link //************************************************************* if($titel=="_sitemap"){ //the sitemap view dont support the pdf presentation $pdf=""; } else{ $pdf=""; } */ //******************************************************************************************* //* choose the template, language dependence //******************************************************************************************* if(is_file("stylesheet/index_".$sprache.".ihtml")){ $templatefile="index_".$sprache.".ihtml"; } $templatefile="index.ihtml"; //******************************************************************************************* //* Login Bereitstellen / Admin Navigation //******************************************************************************************* //var_dump($auth->checkAuth());die; if($auth->checkAuth()=="nobudy"){ $login=" - "; } else{ $login=" - "; } if($auth->checkAuth()=="admin"){ $adminNavi=$navigation->getAdminNavigation($nodeId); } if($auth->checkAuth()=="editor"){ $adminNavi=$navigation->getEditorNavigation($nodeId); } $titel=$node->getName(); //******************************************************************************************* //* instanziert ein template //******************************************************************************************* $template=new Template(".", "comment"); $template->set_file("page","stylesheet/$templatefile"); $template->set_var(array("LANGUAGE_CHOICE"=>$lang_choice,"IMAGE"=>$image,"ADMIN"=>$adminNavi, "TITEL"=>$titel,"CONTENT"=>$data, "SUBNAVIGATION"=>$subnavigation, "NAVIGATION"=>$navigationString, "MODIFICATION"=>$modification, "LOGIN"=>$login, "PDF"=>$pdf)); $template->parse("out","page"); $template->p("out");