get_url(),$a_dstoid); //redirects zum Node vorhanden? if (($po_node->get_url()=='{child_first}') ||($po_node->get_url()=='{child_last}') ||($a_dstoid[1]>0)){ if ((substr($po_node->get_url(),0,5)=='{oid=')&&($a_dstoid[1]>0)){ //oid Umleitung $po_node->load($a_dstoid[1],'',$o_lang->get_lang()); }else{ //ermittle Childs $o_nl = $o_tree->children($po_node); //gibt es Childs? if ($o_nl->count_nodes()>0){ //ja switch ($po_node->get_url()){ case '{child_first}': $po_node = $o_nl->first_node(); break; case '{child_last}': $po_node = $o_nl->last_node(); break; } }else{ //kein gueltiger Child vorhanden } } //rekursiv abprüfen, hat der Zielknoten ebenfalls ein redirect $po_node = redirectInternal($po_node); }else{ //nein: nichts verändern } return $po_node; } //****************************************************************************** /* input variables */ if ($_GET['oid'].$_POST['oid']) {$i_oid=$_GET['oid'].$_POST['oid'];}else{$i_oid=null;} if ($_GET['sid'].$_POST['sid']) {$s_sid=$_GET['sid'].$_POST['sid'];}else{$s_sid=null;} if ($_GET['s'].$_POST['s']) {$s_s=trim($_GET['s'].$_POST['oid']);}else{$s_s='';} if ($_GET['o'].$_POST['o']) {$s_o=$_GET['o'].$_POST['o'];}else{$s_o='';} if ($_GET['clg'].$_POST['clg']) {$s_clg=$_GET['clg'].$_POST['clg'];}else{$s_clg='';} // fullwindow or place for "adds" (true->show adds, false->no adds) $b_fullwin = true; //initial values $bool_anm=false; $o_sess = new session(); $o_sess->set_sid($s_sid); base::set_session($o_sess); $o_usr = new user(); if ($i_uid = $o_sess->getUserId()){ $o_usr->set_uid($o_sess->getUserId(),true); } base::setUser($o_usr); //create language-Object (default language from 'global.inc.php') $o_lang = new lang($s_sid); base::setLanguage($o_lang); //Sprachwechsel //Sprache angegeben, dann annehmen if ($s_clg){ //Session vorhanden? if (!$o_sess->is_valid()){ //nein, anonymous-session starten $o_sess->create_session('global'); $s_sid = $o_sess->get_sid(); //language Objekt mit session $o_lang = new lang($s_sid); } //ändere die Sprache $o_lang->changeWnfLanguage($s_clg); } $o_lang->set_txtgroup('nb'); $o_nav = new nav(); $o_nav->set_outputLanguage($o_lang->get_lang()); base::set_nav($o_nav); $o_param= new params(); $o_param->set_mandt($_WNF_mandt); $o_param->set_project('nb'); $o_param->set_object('layout'); base::set_param($o_param); $o_nf = new nodefile(); $o_loc = new location($s_sid); $o_doc = new document(); $o_tree = new tree(null, $s_sid); $o_tree->CheckByLanguage($o_lang->get_lang()); base::setTree($o_tree); $o_db = new db(0); base::set_db($o_db); /*--------------------------------------------------------*/ // perform a search (parameter 's' is set)? // search for a oid (syntax: "o ") if (preg_match('/o [0-9]+/',$s_s)){ preg_match('/o ([0-9]+)/',$s_s,$ar_temp); $i_oid=$ar_temp[1]; /*Page was not called, therefore the _SERVER['QUERY_STRING'] must contain the oid (see bottom)*/ $_SERVER['QUERY_STRING']='oid='.$i_oid; if ($s_sid!='') { $_SERVER['QUERY_STRING'].='&sid='.$s_sid; } //keine Suche $s_s=''; } //call a alias if (substr($s_s,0,1)=='#'){ $s_alias=substr($s_s,1,strlen($s_s)); $i_oid=$o_nav->get_oid_from_alias($s_alias); /*Page was not called, therefore the _SERVER['QUERY_STRING'] must contain the oid (see bottom)*/ $_SERVER['QUERY_STRING']='oid='.$i_oid; if ($s_sid!='') { $_SERVER['QUERY_STRING'].='&sid='.$s_sid; } // keine Suche $s_s=''; } //************************************************************************** do { // oid not set, then use default-oid (from global.inc.php) if($i_oid=='' or !is_numeric($i_oid)){ $i_oid=$i_root_oid; //do the same such as call with a alias $_SERVER['QUERY_STRING']='oid='.$i_oid; if ($s_sid!='') { $_SERVER['QUERY_STRING'].='&sid='.$s_sid; } } //load node $o_node = new node($i_oid,'',$o_lang->get_lang()); //internal redirect? $o_node = redirectInternal($o_node); //Prüfungen $i_oid = $o_node->get_oid(); //determine path and nodes $o_nav->set_sid($s_sid); $o_nav->set_oid($i_oid); // determine path for the requested node //$o_nav->trace_Npath("",true); $o_nav->set_OutputType('nodelists'); $o_nav->retrieve(true,true,true); //oid ungültig->oid des Parent verwenden if (!$o_nav->oidIsValid()){ //$i_oid=$i_root_oid; $a_path = $o_nav->get_pathlist(); $a_curNode = end($a_path); $i_oid = $a_curNode['oid']; } } while (!$o_nav->oidIsValid()); //wiederhole oid-Ermittlung //************************************************************************** base::setNode($o_node); //try to load a navsubtree-specific header //oid of the navrootnode (subtree) $o_navrootnode=$o_nav->get_navrootnode(); //ermittlung des Layout //$sa_layout = $o_param->get_paramvalues($o_nav->get_currentLayout()); $sa_layout = $o_param->getParamvalues($o_nav->get_currentLayout()); // enthaltene Layout-Javascripts //************************************************************************** //start searching if ($s_s != ''){ // ja: Suchergebniss ermitteln und anzeigen $s_file="search.php?oid=$i_oid&sid=$s_sid&s=$s_s"; $b_fullwin = false; }else{ //keine Suche, normal abarbeiten //************************************************************************** // wenn SID, dann Port 443 (SSL) if($s_sid!='' and $_SERVER["SERVER_PORT"]!=443 and $_WNF_https_appl=='https') { header("Location: https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); exit; } //************************************************************************** //index and follow if ($o_node->get_robots_index() == true){ $s_robots='index'; }else{ $s_robots='noindex'; } if ($o_node->get_robots_follow() == true){ $s_robots.=', follow'; }else{ $s_robots.=', nofollow'; } //Title of the current building page switch ($_WNF_title){ case '_subtree_': // Daten des hoechsten subtree-nodes ermitteln $str_title=$o_navrootnode->get_title(); break; case '_headline_': $str_title=$o_node->get_headline(); break; case '_topTitle_': //Titel-Text des Knotens unterhalb root (oid=1) $a_path = $o_nav->get_ar_path(); //gibt es Nodes im Level 1? if ($a_path[1]){ //ja $o_tmpnode2 = new node($a_path[1][oid]); $str_title = $o_tmpnode2->get_title(); }else{ //nein: RootNode verwenden $str_title = $o_navrootnode->get_title(); } break; default : $str_title=$_WNF_title; } //************************************************************************** // SB 050406 // check cookies if ((array_key_exists('wnf_'.$_WNF_mandt,$_COOKIE))&&($_COOKIE['wnf_'.$_WNF_mandt]!='') && (($o_sess->get_sid()=='') || (!$o_sess->is_valid()))){ $s_file=str_replace('wnf.php','checklogin.php',$_SERVER["SCRIPT_NAME"]); if ($_SERVER['QUERY_STRING']!='') { $s_file .= '?'. $_SERVER['QUERY_STRING'] .'&'; } else { $s_file .= '?'; } $s_file .= 'o=gl'; if (!strpos($s_file,'oid='. $i_oid)) { $s_file .= '&oid='. $i_oid; } header('Location:'. $_WNF_https_appl .'://'. $_SERVER['HTTP_HOST'] . $s_file); } // SB 050406 // ist ein Node im Pfad eine Anwendung(zu schuetzen) / Session-ID gueltig? if($o_nav->login_required() || $s_o=='gl') { //LOGIN //start login -> create a new session //create appnodes_node_array $a_appnode = $o_nav->get_applist(); //workaround (for cls_node without oid) if ($a_appnode == array()){ $o_appnode = new node(''); }else{ $o_appnode = new node($a_appnode[0]['oid']); } if ($o_appnode->get_opt_anonym_login() == true){ //anonymous login $o_sess->create_session($o_appnode->get_priv()); $o_sess->set_app('global'); $o_sess->set_val('uid',$_WNF_anonym_uid); $s_sid = $o_sess->get_sid(); //HW:20050204(l4e) $o_nav->set_sid($s_sid); $o_nav->set_oid($i_oid); $o_nav->set_OutputType('nodelists'); $o_nav->retrieve(true,true,false); }else{ //no anonymous, login required if ($s_o=='gl'){ $s_file="login.php?o=gl"; }else{ $s_file="login.php?o=false"; } //bei Login keine Seitenueberschrift anzeigen $o_node->set_headline(''); $bool_anm=true; $b_fullwin = false; } } if (!$bool_anm){ //NO LOGIN (or just anonymous_login) // create meta-tags, put in $str_meta $ar_meta['title']=$o_node->get_title(); $ar_meta['author']=$o_node->get_author(); $ar_meta['copyright']=$o_node->get_author(); $ar_meta['keywords']=str_replace(';',',',$o_node->get_keywords()); $ar_meta['description']=$o_node->get_headline(); $ar_meta['abstract']=$o_node->get_popup(); $ar_meta['robots']=$s_robots; $str_meta = ''; while(list($ky_meta,$vl_meta)=each($ar_meta)) { if($vl_meta!='') $str_meta.=''. "\n"; } //E-MAIL TO AUTHOR (HW:29.09.03) $s_maillink=''; if (($s_fauthor=explode(' ',$o_node->get_author()))!=''){ //determine e-Mail $o_mailusr=new user(); if ($o_mailusr->get_userdata($s_fauthor[0])&&$o_mailusr->get_email()!=''){ $s_maillink='' .$o_mailusr->get_fullname().''; } } //****************************************************************** // URL zur Seite bauen //start options if ($s_o!=''){ $b_fullwin = false; switch ($s_o){ //"Systemsteuerung" anzeigen case 'optpg': if ($s_odata = $_GET['optpgdata']){ $s_file = $s_odata; }else{ $s_file = 'navimg/syscontrol.png'; } //$s_file =str_replace('wnf.php','options.php',$_SERVER["SCRIPT_NAME"]); //$s_file =$_WNF_https_appl.'://'.$_SERVER["HTTP_HOST"].$s_file; $o_node->set_headline($o_lang->get_text(26)); //ermittle Layoutangaben (ueberschreibe vorhandenes Layout) //$sa_layout = $o_param->get_paramvalues('main'); $sa_layout = $o_param->getParamvalues('main'); //$_WNF_UsedLayout = 0; //auf WNF-Maintenance-Layout umschalten $s_navSysInc = $_WNF_path.'/navbar/options.inc.php'; //stellt Navigation bereit break; //stellt Contentmanager dar case 'cntmgr': break; case 'siteidx': $s_file=str_replace('wnf.php','../customizing/templates/wnf_keyidx/wnf_keyidx_tree.php',$_SERVER["SCRIPT_NAME"]); $s_file=$_WNF_https_appl.'://'.$_SERVER["HTTP_HOST"].$s_file; $o_node->set_headline($o_lang->get_text(37)); break; } }elseif( rtrim($o_node->get_url()) == ''){ //no adds until url<>'' //$b_fullwin = false; //wenn andere Seite als in tb_navbar2 zugeordnet ist, //angezeigt werden soll $o_sess->set_app('nb'); $s_page=$o_sess->get_val('shpg'); if ($s_page != ''){ $s_file=$s_page; $o_sess->del_val('shpg'); }else{ //empty page $s_file='../customizing/templates/'.$_WNF_emptyPage; } } else { // build URL (protected and unprotected) $a_appnode = $o_nav->get_applist(); if ($a_appnode == array()){ $o_appnode = new node(''); }else{ $o_appnode = new node($a_appnode[0]['oid']); } //template || url ? if ($o_node->is_template()){ //template //determine presentationfile //:HW:090426::$o_tpl = new template($o_node->get_templateId()); $o_tpl = new template(); //determine docnr to show $o_doc = new document(); //load includes for content require_once $_WNF_path.'/classes/cls_content.php'; $o_contt = new content(); //determine if available documents exist, for layout-Areas $i_q=0; //$a_reqcss = array(); //array benötigter CSS-Files while (list($i_key,$s_area) = each($sa_layout['area'])){ //alle aktuellen Dokumente zum Node $a_docs[$s_area] = $o_doc->get_derivations($o_node->get_oid(),null,null,$o_lang->get_lang(),$s_area,null,null,true,'seq, dvers asc',false,null,null,''); //versions-select (Dokumente austauschen wg. speziellem Aufruf) if ((!is_null($_GET['vs']['odnr'])) && ($_GET['vs']['area']==$s_area) && ($_GET['vs']['ndnr']!='')){ //alte Docnr im Area enthalten? for ($i_w=0;$i_wget_oid()==$i_oid)&&($o_rpldoc->get_page()==$a_docs[$s_area][$i_w]['page'])){ //ersetze docnr merken $a_docs[$s_area][$i_w][10] = $a_docs[$s_area][$i_w]['docnr']; $a_docs[$s_area][$i_w]['rpldocnr']= $a_docs[$s_area][$i_w]['docnr']; //mit neuen Eigenschaften ueberschreiben $a_docs[$s_area][$i_w][0] = $o_rpldoc->get_docnr(); $a_docs[$s_area][$i_w]['docnr'] = $a_docs[$s_area][$i_w][0]; $a_docs[$s_area][$i_w][1] = $o_rpldoc->get_dvers(); $a_docs[$s_area][$i_w]['dvers'] = $a_docs[$s_area][$i_w][1]; $a_docs[$s_area][$i_w][2] = $o_rpldoc->get_lang(); $a_docs[$s_area][$i_w]['lang'] = $a_docs[$s_area][$i_w][2]; $a_docs[$s_area][$i_w][3] = $o_rpldoc->get_docStatus(); $a_docs[$s_area][$i_w]['dstatus'] = $a_docs[$s_area][$i_w][3]; $a_docs[$s_area][$i_w][4] = $o_rpldoc->get_templateId(); $a_docs[$s_area][$i_w]['tplid'] = $a_docs[$s_area][$i_w][4]; $a_docs[$s_area][$i_w][5] = $o_rpldoc->get_page(); $a_docs[$s_area][$i_w]['page'] = $a_docs[$s_area][$i_w][5]; $a_docs[$s_area][$i_w][6] = $o_rpldoc->get_part(); $a_docs[$s_area][$i_w]['part'] = $a_docs[$s_area][$i_w][6]; $a_docs[$s_area][$i_w][7] = $o_rpldoc->get_seq(); $a_docs[$s_area][$i_w]['seq'] = $a_docs[$s_area][$i_w][7]; $a_docs[$s_area][$i_w][8] = $o_rpldoc->get_storn(); $a_docs[$s_area][$i_w]['storn'] = $a_docs[$s_area][$i_w][8]; $a_docs[$s_area][$i_w][9] = ''; $a_docs[$s_area][$i_w]['d2docnr'] = ''; } } } } //prüfe ob ein weiteres CSS-File benötigt wird // jedes neue Dokument foreach ($a_docs[$s_area] as $a_doc){ //CSS für dieses Template schon enthalten? if (!key_exists('tpl_'.$a_doc['tplid'], $sa_layout['css'])){ //ermittle TPLID $o_tpl->load($a_doc['tplid']); $sa_layout['css']['tpl_'.$a_doc['tplid']] = '../customizing/templates/'.$o_tpl->get_cssfile(); $i = 0; foreach($o_tpl->get_jsFilesArray() as $s_jsfile){ $sa_layout['javascript']['tpl_'.$a_doc['tplid'].'_'.$i]= '../customizing/templates/'.$s_jsfile; $i++; } } } //next area $i_q++; } //exist a document (in browserspecific language)? /*HW: 090426:Dokumemtumstellungen if ($o_doc->load_currently($i_oid,$o_node->get_templateId(),$_WNF_mandt,$o_lang->get_lang(),'fr')){ //build path to file //HW:20050205 (?sid... angefuegt) $s_file = '../customizing/templates/'.$o_tpl->get_presfile().'?sid='.$s_sid; //.'?docnr='.$o_doc->get_docnr(); }else{ //try to load a document in the default language if ($o_doc->load_currently($i_oid,$o_node->get_templateId(),$_WNF_mandt,$_WNF_language,'fr')){ $s_file = '../customizing/templates/'.$o_tpl->get_presfile(); }else{ //no document $s_file = '../customizing/templates/'.$_WNF_emptyPage; } } */ }else{ if ($o_appnode->get_opt_prot_area() == false){ //normal url if (substr($o_node->get_url(),0,4)=='http'){ $s_file = $o_node->get_url(); }else{ $s_file = $o_navrootnode->get_defurl().$o_node->get_url(); } }else{ //protected file //save node in session $o_sess->set_app('nb'); $o_sess->set_val('protnode',serialize($o_node)); if (strstr($_SERVER['QUERY_STRING'],'sid=') == false){ $s_file = 'get_pcontt.php?sid='.$s_sid; }else{ $s_file = 'get_pcontt.php'; } } } } //end (no login) }else{ //init values $str_meta =''; $str_onload =''; $s_maillink =''; } // if https://wnf.php -> URL call with https if ( array_key_exists('HTTPS',$_SERVER) && $_SERVER["HTTPS"]=='on' && strtolower(substr($s_file,4,1))!='s' && strtolower(substr($s_file,0,4))=='http' && $_WNF_https_appl=='https' //and (($i_options&16)!=16)) { && $o_node->get_opt_https_off() == false) { $s_file=substr($s_file,0,4) . 's' . substr($s_file,4); } //parameters to the url concatenaten if ((($o_node->get_opt_params_off() == false)||($bool_anm) ||($s_o=='optpg')||($s_o=='siteidx'))){ //&&($s_file!='') if (ereg("oid=",$s_file)){ $_SERVER['QUERY_STRING'] = ereg_replace("oid=[^\&|$]+(\&|$)", '', $_SERVER['QUERY_STRING']); } //alle Parameter an content-seite übergeben if (ereg("\?",$s_file)){ $s_file .= "&".$_SERVER['QUERY_STRING']; } else { $s_file .= "?".$_SERVER['QUERY_STRING']; } } //bit7(64): means without wnf border if ($o_node->get_opt_wnf_off() == true){ // nur das Ziel anzeigen header('Location: '. $s_file); exit; } } $o_perm = new perms($s_sid); base::setPerm($o_perm); //****************************************************************************** // Headline (height) ? if ($o_node->get_headline() != ''){ $i_height_offset = 30; }else{ $i_height_offset = 0; } // first focus if(!$bool_anm){ $str_onload=' onload="iframeHeight('.$i_height_offset.');' .' document.searchdirect.s.focus();"'; //$str_onload = ' onload="document.searchdirect.s.focus();"'; } //****************************************************************************** // login/options //1.) link for global login or options //2.) link for siteindex if ($o_sess->is_valid()){ $s_optdescr=''.$o_lang->get_text(26).''; $s_siteidx = '' .$o_lang->get_text(55).''; }else{ $s_optdescr=''.$o_lang->get_text(27).''; $s_siteidx = '' .$o_lang->get_text(55).''; } //****************************************************************************** // Node Properties (aktuell alle oids (ggf auch aus passwortgeschuetzten Bereiche) $a_pathlist = $o_nav->get_pathlistOids(); array_push($a_pathlist,$i_oid); $a_nprops = $o_tree->getPathProperties($a_pathlist); //Javascripts sicherstellen if (!$sa_layout['javascript']){ $sa_layout['javascript'] = array(); } //****************************************************************************** // load the output and make a page //require ($_WNF_LayoutPage[$_WNF_UsedLayout]); require '../customizing/layouts/'.$sa_layout['path'][0].'/layout.inc.php'; //****************************************************************************** ?>