'; $html_output_top = ''; $html_output_main = ''; $ulist = false; $ok = 0; $err = 1; global $zeile_nr; global $act_nr; global $act_tag; global $act_htmltag; global $act_endtag; $zeile_nr = 0; $href_top = '
'.$sprache_seitenanfang.'
'; 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{ // 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 // ha1-ha5 // 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 list($menuename,$menuetext) = split(',',substr($param_block,strpos($param_block,"=")+1)); if ($menuetext==''){ $menuetext = $menuename; } // Anker-Überschrifts-Tag (5tes Zeichen = a) if (substr($param_block,4,1) == 'a'){ $htmlcode = $href_top. '<'.$h_tag.'>'. '' .$menuename. ''. ''; $html_output_top .= '
  • '. ''.$menuename."". $menuetext."
  • \n"; } else{ $htmlcode = '<'.$h_tag.'>'.$menuename.''; } $line = str_replace($param_block.'>', $htmlcode, $line); if ($i++ > 10){ echo "ACHTUNG TAGFEHLER STELLE H? Zeile ".$zeile_nr."
    \n"; echo "Zeilentext:".$line."
    \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 ."/". $param_filename; // Iframe tag generieren $htmlcode = ""; // Htmlcode einsetzen $line = str_replace("", $htmlcode, $line); if ($i++ > 10){ echo "ACHTUNG TAGFEHLER STELLE iframe Zeile ".$zeile_nr."
    \n"; echo "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"; } $xml_filename = GetReplaceFile($xml_filename); // 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'){ $edit_file_xml = ''; } else{ $edit_file_xml = $xml_filename; } if ($xsl_filename == '.xsl'){ $edit_file_xsl = ''; } else{ $edit_file_xsl = $xsl_filename; } // Generiert einen Anker und Button, der zu HTML_EDIT führt bei $sys_admin $html_eingabe = GetEditButton($ufile, // Filname des Files, das geändert werden soll $alt_text, // Alternativer Buttontext $sys_xml_load_button, // Buttongrafik $sys_xml_load_err_button, $edit_file_xml, // Parm1 $edit_file_xsl); // Parm2 // Files testen und XML code generieren 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"); if ($sys_admin){ $htmlcode = $html_eingabe['ok']. ''."\n". ''."\n". ' '."\n". ''.$xml_filename.''."\n". ''."\n". ''."\n". ' '."\n". ''.$xsl_filename.''."\n". str_replace(''."\n",'',$xsl->transformToXML($doc)); } else{ $htmlcode = $html_eingabe['ok']. str_replace(''."\n",'',$xsl->transformToXML($doc)); } } else{ if ($sys_admin){ if (!file_exists( "$verz_xml/$xsl_filename")){ $sys_xsl_button_html = $sys_xsl_err_button; } else{ $sys_xsl_button_html = $sys_xsl_button; } if ($xml_filename == '.xml' || $xsl_filename == '.xls'){ $htmlcode = $html_eingabe['err']; } else{ $htmlcode = $html_eingabe['err']. ''."\n". ''."\n". ' '."\n". ''.$xml_filename.''."\n". ''."\n". ''."\n". ' '."\n". ''.$xsl_filename.''."\n"; } } 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 ){ $rtf_file .= ".rtf"; } $rtf_file = GetReplaceFile($rtf_file); // Replacefile holen falls notwendig $rtf_filename = $verz_rtf.'/'.$rtf_file; $classname = 'rtf'.$zeile_nr.$act_nr. "cf"; // 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($ufile, // Filname des Files, das geändert werden soll $alt_text, // Alternativer Buttontext $sys_rtf_load_button, // Buttongrafik $sys_rtf_load_err_button, $edit_file, // Parm1 ''); // Parm2 $htmlcode = ''; // Files testen und RTF code generieren if( file_exists($rtf_filename)){ if ($sys_admin){ $htmlcode = $html_eingabe['ok']. ''."\n". 'Edit RTF'."\n". ' '."\n". ''. $rtf_filename.''."\n". rtf_parsefile($rtf_filename,$classname); } else{ $htmlcode = $html_eingabe['ok'].rtf_parsefile($rtf_filename,$classname); } } else{ if ($sys_admin){ if (trim($rtf_file) != '.rtf'){ $htmlcode = $html_eingabe['err']. ''."\n". 'Edit RTF'."\n". ' '."\n". ''. $rtf_filename.''."\n"; } else{ $htmlcode = $html_eingabe['err']. 'RTF-File: '.$rtf_file.' not found'; } } else{ $htmlcode = $html_eingabe['err']; } } $line = GetNewTag($param_block,$htmlcode,$line); } // // Popups BASIS POPUPFENSTER // (txt) Nomaler Text (txt)Text wird nicht interpretiert // (lnk) HREF (lnk)HREF // (img) Bild (img)Bild wird angezeigt // // (klick) // (over) // SetActTag('popup'); while ((strpos($line,$act_htmltag) !== false )) { $param_block = GetParamBlock($line); // Inhalt des Tags holen list( $pop_basis_typ, $pop_basis_content, $pop_aktion, $pop_fenster_typ, $pop_fenster_content, $pop_breite, $pop_hoehe ) = split(',',$param_block); if ($pop_breite == 0){ $pop_breite = 30; } if ($pop_hoehe == 0){ $pop_hoese = 20; } $htmlcode = ''; if ($pop_href == '' && $pop_inhalt1 == '' && $pop_textf == '' && $pop_inhalt2 == ''); else{ } $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){ echo "ACHTUNG TAGFEHLER STELLE ulist Zeile ".$zeile_nr."
    \n"; echo "Zeilentext:".$line."
    \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 == ''){ echo "ACHTUNG TAGFEHLER STELLE 5 Zeile ".$zeile_nr."
    \n"; echo "Zeilentext:".$line."
    \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 == ''){ echo "ACHTUNG TAGFEHLER STELLE 4 Zeile ".$zeile_nr."
    \n"; echo "Zeilentext:".$line."
    \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($npos,$n_anker) = split('#',$param_block); $alt_text = 'LINK'; // Alternativtext falls Button nicht da ist // Generiert einen Anker und Button, der zu HTML_EDIT führt bei $sys_admin $html_eingabe = GetEditButton($ufile, // Filname des Files, das geändert werden soll $alt_text, // Alternativer Buttontext $sys_link_load_button, // Buttongrafik $sys_link_load_err_button, // Buttongrafik $npos, // Parm1 $n_anker); // Parm2 list($ntxt,$nhtml,$ninfo,$nfun,$nmenu) = $navigation[$npos]; $htmlcode = ''; if ($ntxt == '' or ($npos[0] == '*' and $nmenu != 'hauptmenu')){ if ($n_anker == ''){ $htmlcode = $html_eingabe['err']. str_replace($sys_sonderzeichen_suche_href, $sys_sonderzeichen_ersetze_href, ''.$npos.''); } else{ $htmlcode = $html_eingabe['err']. str_replace($sys_sonderzeichen_suche_href, $sys_sonderzeichen_ersetze_href, ''.$n_anker.''); } } else{ if ($n_anker == ''){ $htmlcode = $html_eingabe['ok']. str_replace($sys_sonderzeichen_suche_href, $sys_sonderzeichen_ersetze_href, ''.$ntxt.''); } else{ if ($xfile = fopen($verz_html."/".$nhtml, 'r')){ $buffer = fread($xfile,filesize($verz_html."/".$nhtml)); fclose($xfile); $k = 0; $found = false; while (++$k<=$sys_anz_ueberschriften){ $anker_position = strpos($buffer,'',$zusatztext); $htmlcode = $html_eingabe['ok']. str_replace($sys_sonderzeichen_suche_href, $sys_sonderzeichen_ersetze_href, ''. $n_anker.''); $found = true; break; } } if (!$found){ $htmlcode = $html_eingabe['err']. str_replace($sys_sonderzeichen_suche_href, $sys_sonderzeichen_ersetze_href, ''.$n_anker.''); } } else{ $htmlcode = $html_eingabe['err']. str_replace($sys_sonderzeichen_suche_href, $sys_sonderzeichen_ersetze_href, ''.$n_anker.''); } } } $line = GetNewTag($param_block,$htmlcode,$line); } } if (strpos($line,'
    ') !== false ){
    					$pre_tag = '';
    				}
    				if (strpos($line,'
    ') !== false ){ $pre_tag = '
    '; } $html_output_main .= str_replace($sys_sonderzeichen_suche, $sys_sonderzeichen_ersetze, $line) . $pre_tag."\n"; if ($ii++ > 299){ exit; // Notaustieg bei falschem tag } } echo "\n"; return str_replace('', "
      \n".$html_output_top.'
    ', $html_output_main) . $pre_tag."\n"; } } ?>