'; $html_output_MLeiste = ''; $html_output_top = ''; $html_output_main = ''; $ulist = false; $ok = 0; $err = 1; global $zeile_nr; global $act_nr; global $act_max; global $act_tag; global $act_htmltag; global $act_endtag; $act_max_default = 10; // Maximale Tags pro Zeile $act_max = $act_max_default; $zeile_nr = 0; $anker_zeile_nr = 1; $include_nr = 0; $span_replace = 'XXXSPANINCLUDEFILEIDXXX'; $include_replace = 'XXXREMOTEINCLUDEFILEIDXXX'; while (!feof ($lfile)){ $line = trim(fgets ($lfile, 4096)); $zeile_nr++; // Kommentare überlesen if ($noprt) { if ((strpos($line,"*/") !== false )){ $noprt = false; $line = substr($line,strpos($line,"*/")+2); if ($line == ''){ continue; } } else { continue; } } if ($line == ''){ // $line = '
'; } else{ // Table Nachfassen damit er in einer Zeile ist if (strpos($line,'') === false && !feof($lfile)){ $line .= trim(fgets ($lfile, 4096)); $zeile_nr++; } } // Mehrere Kommentarebeginnne und Enden in einer zeile überlesen while ((strpos($line,"/*") !== false )){ if ((strpos($line,"*/") !== false )){ $line = substr($line,0,strpos($line,"/*")) . substr($line,strpos($line,"*/")+2); } else{ $line = substr($line,0,strpos($line,"/*")); $noprt = true; } if ($line == '') continue; } // Kommentare bis Ende der Zeile kappen if ((strpos($line,"//") !== false )){ $line = substr($line,0,strpos($line,"//")); if ($line == '') continue; } // Restliche Tags bearbeiten // h1-h5 // h1a-h5a // Sonderverarbeitung $is = 0; while (++$is<=$sys_anz_ueberschriften){ $h_tag = 'h'.$is; $i = 0; while (strpos($line,'',$param_start_pos); // param_block inkl. start Tags, ohne endtag $param_block = substr($line, $param_start_pos, $param_ende_pos - $param_start_pos); // texte nach dem = heraushholen // Menuetextk = Text für das Menue (links) // Menuetextl = Text (Bescheibung) für das Tag Menue (Langtext) in der HTML_Seite // Menueanker = Anker für das Menue list($menuetextk,$menuetextl,$menueanker) = split(',',substr($param_block,strpos($param_block,"=")+1)); // Anker-Überschrifts-Tag (5tes Zeichen = a) if (substr($param_block,4,1) == 'a'){ if ($menuetextk == '' || $menuetextl == '' || $menueanker == ''){ errorlog( "######################################################\n"); errorlog( "######################################################\n"); errorlog( "ACHTUNG TAGFEHLER STELLE H? Zeile ".$zeile_nr."\n"); errorlog( "Zeilentext:".$line."\n"); errorlog( "Ueberschriftstag ungueltig\n"); errorlog( "######################################################\n"); errorlog( "######################################################\n"); // exit; // Notaustieg bei falschem Tag Überschrift return ''; } // $_dom = $_SERVER['SERVER_NAME']; // $_path = substr( $_SERVER['PHP_SELF'], 0, strrpos( $_SERVER['PHP_SELF'], '/' )).'/'; // $_self = 'http://'.$_dom.$_path.'go.php?link='.$key.'&anker='.$menueanker; $_self = 'xxxl3lib-domainnamexxxgo.php?link='.$key.'&anker='.$menueanker; $htmlcode = //'<'.$h_tag.'>'. ''. '
'. ''; //''; $html_output_top .= '
  • '. ''.$menuetextk."". $menuetextl."
  • \n"; $html_output_MLeiste .= $key.'='.$menuetextk.':'.$menuetextl.','.$menueanker.'!!??'; // echo $key.'*'.$menuetextk.':'.$menuetextl.','.$menueanker; // exit; } else{ $htmlcode = '<'.$h_tag.'>'.$menuetextk.''; } $line = str_replace($param_block.'>', $htmlcode, $line); if ($i++ > 10){ errorlog( "######################################################\n"); errorlog( "######################################################\n"); errorlog( "ACHTUNG TAGFEHLER STELLE H? Zeile ".$zeile_nr."\n"); errorlog( "Zeilentext:".$line."\n"); errorlog( "######################################################\n"); errorlog( "######################################################\n"); exit; // Notaustieg bei falschem tag } } } //////////////////////////////////////////////////////////////// // Hier neue Tags einbauen start //////////////////////////////////////////////////////////////// // // IFRAME (nur test) // /* $i = 0; while ((strpos($line,'',$param_start_pos); // kompletten block bis abschliessendem '>' ausschneiden $param_block = substr($line, $param_start_pos, $param_ende_pos - $param_start_pos); // Parameter splitten list($param_filename, $param_width, $param_height) = split(',',$param_block); // Defaultwerte setzen if ($param_width == ''){ $param_width = '400'; } if ($param_height == ''){ $param_height = '400'; } $param_filename = $verz_html_src . $param_filename; // Iframe tag generieren $htmlcode = ""; // Htmlcode einsetzen $line = str_replace("", $htmlcode, $line); if ($i++ > 10){ errorlog( "ACHTUNG TAGFEHLER STELLE iframe Zeile ".$zeile_nr."\n"); errorlog( "Zeilentext:".$line."\n"); exit; // Notaustieg bei falschem tag } } */ // XML PARSEN // SetActTag('xml'); while (strpos($line,$act_htmltag) !== false ) { $param_block = GetParamBlock($line); // Parameter splitten list($xml_filename, $xsl_filename) = split(',',$param_block); // Parameter 1 = Filename zum XML file, extension wird geadded wenn fehlt if( strpos($xml_filename,".xml") == FALSE ){ $xml_filename .= ".xml"; } // Parameter 2 = Filename XSL File, wenn fehlt, dann aus XML Filenamen generieren if ($xsl_filename == ''){ $xsl_filename = str_replace( ".xml", ".xsl", $xml_filename); } $alt_text = 'XML'; if ($xml_filename == '.xml'){ $xml_file = ''; } else{ $xml_file = $xml_filename.':'.$xsl_filename; } // Generiert einen Anker und Button, der zu HTML_EDIT führt bei $sys_admin $html_eingabe = GetEditButton('xml', // Kennung $ufile, // Filname des Files, das geändert werden soll $alt_text, // Alternativer Buttontext $xml_load_button, // Buttongrafik $xml_load_err_button, $xml_file, $sys_admin); // Files testen und XML code generieren $htmlcode = ''; if( file_exists( $verz_xml.$xml_filename ) && file_exists( $verz_xml.$xsl_filename )){ $doc = new DOMDocument(); $xsl = new XSLTProcessor(); $doc->load($verz_xml.$xsl_filename); $xsl->importStyleSheet($doc); $doc->load($verz_xml.$xml_filename); $htmlcode = $html_eingabe['ok']. str_replace(''."\n",'',$xsl->transformToXML($doc)). '';/** Workaround da xmlgenerator diese tag offenlässt */ }else{ $htmlcode = $html_eingabe['err']; } $line = GetNewTag($param_block,$htmlcode,$line); } // // RTF PARSEN // SetActTag('rtf'); while (strpos($line,$act_htmltag) !== false ) { $param_block = GetParamBlock($line); // Inhalt des Tags holen $rtf_file = $param_block; // extension wird geadded wenn fehlt if( strpos($rtf_file,".rtf") == FALSE ){ if( $rtf_file == '' || file_exists($rtf_file.'.rtf')){ $rtf_file .= ".rtf"; } } $rtf_filename = $verz_rtf.'/'.$rtf_file; $classname = 'rtfcol'; // erstes file in einem dokument bekommt cf0 $alt_text = 'RTF'; if ($rtf_file == '.rtf'){ $edit_file = ''; } else{ $edit_file = $rtf_file; } // Generiert einen Anker und Button, der zu HTML_EDIT führt bei $sys_admin $html_eingabe = GetEditButton('rtf', // Kennung $ufile, // Filname des Files, das geändert werden soll $alt_text, // Alternativer Buttontext $rtf_load_button, // Buttongrafik $rtf_load_err_button, $edit_file, $sys_admin); $htmlcode = ''; // Files testen und RTF code generieren if( file_exists($rtf_filename)){ $htmlcode = $html_eingabe['ok'].rtf_parsefile($rtf_filename,$classname); }else{ $htmlcode = $html_eingabe['err']; } $line = GetNewTag($param_block,$htmlcode,$line); } // // Popups BASIS POPUPFENSTER // SetActTag('popup'); while ((strpos($line,$act_htmltag) !== false )) { $param_block = GetParamBlock($line); // Inhalt des Tags holen list($xkey,$xanker,$xfreierText) = split(',',$param_block); $htmlcode = ''.$xfreierText.""; $line = GetNewTag($param_block,$htmlcode,$line); } // // Einfügen von nonbreakingspaces // SetActTag('sp'); while (strpos($line,$act_htmltag) !== false ) { $param_block = GetParamBlock($line); // Inhalt des Tags holen $htmlcode = ''; for ($j=1;$j<=$param_block;$j++){ $htmlcode .= ' '; } $line = GetNewTag($param_block,$htmlcode,$line); } // // wTag COLOR SPANS (Wordgrenze) // Beispiel: das ist der Satz. html: das ist der Satz. // Unbedingt nach RTF lesen, da im RTF Tags eingehängt werden, die hier aufgelöst werden müssen SetActTag(''); $act_endtag = ''; // Tag endet vor dem Wort, das eingefärbt werden soll while (strpos($line,'',$param_start_pos); // kompletten block bis exclusiv '>' ausschneiden // param_block = name der span Klasse $class = substr($line, $param_start_pos, $param_ende_pos - $param_start_pos); // ResetActTag($class); // es gibt ja img und img0-9 // Ausnahmen $act_tag = $class; $act_htmltag = '<'.$class.'>'; // param_block = name der span Klasse // Jetzt das Wort suchen $word_start = $param_ende_pos + 1; // Ende Wort Suchen, blank, oder neuer Tag und \n beenden das Wort $i = $word_start; $len = strlen($line); while( $i++ < $len ) { if( $line[$i] == " " ){ break; } else if( $line[$i] == "." ){ break; } else if( $line[$i] == "," ){ break; } else if( $line[$i] == "<" ){ break; } else if( $line[$i] == "\n" ){ break; } else if( $line[$i] == "§" && $line[$i+1] == ">" ){ break; } } // word ausschneiden $param_block = substr($line, $word_start, $i - $word_start ); // Html mit span erzeugen $htmlcode = ''.$param_block.''; $line = GetNewTag($param_block,$htmlcode,$line); } //////////////////////////////////////////////////////////////// // Hier neue Tags einbauen ende //////////////////////////////////////////////////////////////// //
  • ',$line); $ulist = true; $old_pre = $pre_tag; $pre_tag = ''; } $i = 0; while ($ulist && (strpos($line,'\\') !== false )){ $line = str_replace('\\
    ','
  • ',$line); $line = str_replace('\\','
  • ',$line); if ($i++ > 10){ errorlog( "######################################################\n"); errorlog( "######################################################\n"); errorlog( "ACHTUNG TAGFEHLER STELLE ulist Zeile ".$zeile_nr."\n"); errorlog( "Zeilentext:".$line."\n"); errorlog( "######################################################\n"); errorlog( "######################################################\n"); exit; // Notaustieg bei falschem tag } } if ($ulist && (strpos($line,'=ul>') !== false )){ $line = str_replace('=ul>','
  • ',$line); $ulist = false; $pre_tag = $old_pre; } // <§?= Mehrzeilige Tags erstellen while (strpos($line,'<§') !== false ){ $tag_basis = strpos($line,'<§'); $tag_basis_ende = strpos(substr($line,$tag_basis),'='); $tag_param = substr($line,$tag_basis,$tag_basis_ende+1); $html_text = ''; $tag_c = ''; if (strchr($tag_param,'p') !== false ){ // Paragraph $tag_c .= '

    '; $html_text .= '

    '; } if (strchr($tag_param,'f') !== false ){ // Fett $tag_c .= ''; $html_text .= ''; } if (strchr($tag_param,'u') !== false ){ // Unterstrichen $tag_c .= ''; $html_text .= ''; $x4 = str_replace('u','',$x4); } if (strchr($tag_param,'i') !== false ){ // Kursiv Italic $tag_c .= ''; $html_text .= ''; } if (strchr($tag_param,'g') !== false ){ // Grosser Text $tag_c .= ''; $html_text .= ''; } if (strchr($tag_param,'k') !== false ){ // Klein $tag_c .= ''; $html_text .= ''; } if (strchr($tag_param,'t') !== false ){ // Terminal Text $tag_c .= ''; $html_text .= ''; } if (strchr($tag_param,'c') !== false ){ // Center $tag_c .= ''; $html_text .= '

    '; } if (strchr($tag_param,'w') !== false ){ // Word Tags $tag_w = substr($tag_param,strpos($tag_param,'w'),2); $tag_c .= ''; $html_text .= ''; } $line = substr($line,0,$tag_basis).$html_text.substr($line,$tag_basis+$tag_basis_ende+1); array_push($tag_close,$tag_c); $e = strpos($line,'<§'); if ($e !== false){ $f = strpos($line,'§>'); if ($f !== false){ if ($e > $f){ $tag_c = array_pop($tag_close); if ($tag_c == ''){ errorlog( "######################################################\n"); errorlog( "######################################################\n"); errorlog( "ACHTUNG TAGFEHLER STELLE 5 Zeile ".$zeile_nr."\n"); errorlog( "Zeilentext:".$line."\n"); errorlog( "######################################################\n"); errorlog( "######################################################\n"); exit; // Notaustieg bei falschem tag } $line = substr($line,0,strpos($line,'§>')).$tag_c.substr($line,strpos($line,'§>')+2); } } } } // Zeilenübergreifende Tags beenden while(strpos($line,'§>') !== false ){ $tag_c = array_pop($tag_close); if ($tag_c == ''){ errorlog( "######################################################\n"); errorlog( "######################################################\n"); errorlog( "ACHTUNG TAGFEHLER STELLE 4 Zeile ".$zeile_nr."\n"); errorlog( "Zeilentext:".$line."\n"); errorlog( "######################################################\n"); errorlog( "######################################################\n"); exit; // Notaustieg bei falschem tag } $line = substr($line,0,strpos($line,'§>')).$tag_c.substr($line,strpos($line,'§>')+2); } // SetActTag(''); while (strpos($line,''; $line = GetNewTag($param_block,$htmlcode,$line); } // /* SetActTag(''); while (strpos($line,'' ,'' ,'' ,'' ,'' ,'' ,'
    ' . $vid_titel . '
    ' ,'' ,'' ,'' ,'
    ' ,'' ); $line = GetNewTag($param_block,$htmlcode,$line); } */ // Links SetActTag('link'); while (strpos($line,$act_htmltag) !== false ) { $param_block = GetParamBlock($line); // Inhalt des Tags holen list($param_block_ref,$freierText) = split(',',$param_block); list($npos,$n_anker) = split('#',$param_block_ref); $htmlcode = ''.$freierText.""; $line = GetNewTag($param_block,$htmlcode,$line); } // include SetActTag('include'); while (strpos($line,$act_htmltag) !== false ) { $param_block = GetParamBlock($line); // Inhalt des Tags holen list($include_Text,$include_Remotefile,$include_offenzu) = split(',',$param_block); if (strpos($include_Remotefile,'.html') === false ){ $include_Remotefile .= '.html'; } // Offen if ($include_offenzu != ''){ $class_span = 'include_offen'; $class_block = 'include_block_offen'; }else{ $class_span = 'include_zu'; $class_block = 'include_block_zu'; } $htmlcode = ''.$include_Text.'
    '. '
    '. ''. '
    '; $line = GetNewTag($param_block,$htmlcode,$line); } // Remotefile einbinden $i = 0; $act_max = 999; // Maximale Tags pro Zeile if ($incl_aktiv){ // aufgelöste includes (remotfiles) einbinden SetActTag('remotefile'); while (strpos($line,$act_htmltag) !== false ) { $param_block = GetParamBlock($line); // Inhalt des Tags holen $inc_file = $verz_incl.$param_block; if ($fincl = fopen($inc_file,'r')){ $htmlcode = fread($fincl,filesize($inc_file)); fclose($fincl); } $line = GetNewTag($param_block,$htmlcode,$line); if ($i++ > 100){ errorlog( "######################################################\n"); errorlog( "######################################################\n"); errorlog( "ACHTUNG FEHLER Zeile ".$zeile_nr."\n"); errorlog( "Generierte Seite in Remotfile Include loopt \n"); errorlog( "Filename:".$inc_file." \n"); errorlog( "######################################################\n"); errorlog( "######################################################\n"); exit; // Notaustieg bei falschem tag } } $line = str_replace($span_replace ,$span_replace .'-'.$include_nr,$line); $line = str_replace($include_replace,$include_replace.'-'.$include_nr,$line); $include_nr++; } $act_max = $act_max_default; // Maximale Tags pro Zeile zurück auf delfault /*ENDE TAGS*/ } // if line = '' if (strpos($line,'
    ') !== false ){
    					$pre_tag = '';
    				}
    				if (strpos($line,'
    ') !== false ){ $pre_tag = '
    '; } $lastchar = substr($line,strlen($line)-1,1); // backslash wird extra am Ende umgesetzt if ($lastchar == '>' || $lastchar == '\\'){ $pre_tag_insert = ''; }else{ $pre_tag_insert = $pre_tag; } $html_output_main .= ''.replace_escape_toHtml($line) . $pre_tag_insert."\n"; if ($ii++ > 999){ errorlog( "######################################################\n"); errorlog( "######################################################\n"); errorlog( "ACHTUNG FEHLER Zeile ".$zeile_nr."\n"); errorlog( "Generierte Seite loopt \n"); errorlog( "######################################################\n"); errorlog( "######################################################\n"); exit; // Notaustieg bei falschem tag } } if ($incl_aktiv){ // aufgelöste includes (remotfiles) einbinden // alle $include_replace auflösen und Eindeutige id's vergeben // Immer nur im Paar auflösen for ($i=0;$i<$include_nr;$i++){ $span_replace_nr = $span_replace.'-'.$i; $include_replace_nr = $include_replace.'-'.$i; $j = 0; while (strpos($html_output_main,$include_replace_nr) !== false ) { $klappids = 'span-klappid-'.$i.'-'.$j; $klappid = 'include-klappid-'.$i.'-'.$j; $j++; $pos = strpos($html_output_main,$span_replace_nr); $html_output_main = substr_replace($html_output_main, $klappids, $pos, strlen($span_replace_nr)); $pos = strpos($html_output_main,$span_replace_nr); $html_output_main = substr_replace($html_output_main, $klappids, $pos, strlen($span_replace_nr)); $pos = strpos($html_output_main,$include_replace_nr); $html_output_main = substr_replace($html_output_main, $klappid, $pos, strlen($include_replace_nr)); $pos = strpos($html_output_main,$include_replace_nr); $html_output_main = substr_replace($html_output_main, $klappid, $pos, strlen($include_replace_nr)); } } } //alle Backslash auf return umsetzten $html_output_main = str_replace('\\','
    ',$html_output_main); // Achtung keine Anker im Menue (links) wenn das Tag nicht eingehängt ist !!!! return ''.str_replace( '', "\n\n"."
      \n".$html_output_top."
    \n", $html_output_main). $pre_tag."\n"; } } ?>