You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

865 lines
27 KiB
PHP

<?php
function PrintHtml($ufile)
{
if ($lfile = fopen($ufile, 'r')){
global $navigation;
global $verz_img;
global $verz_video;
global $verz_xml;
global $verz_html;
global $verz_rtf;
global $sys_default_img;
global $sys_default_video;
global $sys_anz_ueberschriften;
global $sys_sonderzeichen_suche;
global $sys_sonderzeichen_ersetze;
global $sys_sonderzeichen_suche_full;
global $sys_sonderzeichen_ersetze_full;
global $sys_sonderzeichen_suche_href;
global $sys_sonderzeichen_ersetze_href;
global $sys_xml_button;
global $sys_xsl_button;
global $sys_xsl_err_button;
global $sys_rtf_button;
global $sys_rtf_load_button;
global $sys_rtf_load_err_button;
global $sys_link_load_button;
global $sys_link_load_err_button;
global $sys_img_load_button;
global $sys_img_load_err_button;
global $sys_xml_load_button;
global $sys_xml_load_err_button;
global $edit_string;
global $sys_path_xmleditor;
global $sys_path_rtfeditor;
global $navpos;
global $sys_path_xml;
global $sys_path_rtf;
global $sys_path_batch;
global $sys_admin;
global $html_output_top;
global $sprache_seitenanfang;
$tag_close = array();
$noprt = false;
$ii = 0;
$pre_tag = '<br>';
$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 = '<div class="totop"><a href="#top">'.$sprache_seitenanfang.'</a></div>';
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 = '<br>';
}
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
// <!h?=Überschrift> h1-h5
// <!h?=Überschrift> ha1-ha5
// Sonderverarbeitung
$is = 0;
while (++$is<=$sys_anz_ueberschriften){
$h_tag = 'h'.$is;
$i = 0;
while (strpos($line,'<!'.$h_tag) !== false ){
$param_start_pos = strpos($line,'<!'.$h_tag);
$param_ende_pos = 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.'>'.
'<a name="'.$menuename.'">' .$menuename. '</a>'.
'</'.$h_tag.'>';
$html_output_top .= '<li>'.
'<a href="#'.$menuename.'" style="float: right;">'.$menuename."</a>".
$menuetext."</li>\n";
}
else{
$htmlcode = '<'.$h_tag.'>'.$menuename.'</'.$h_tag.'>';
}
$line = str_replace($param_block.'>', $htmlcode, $line);
if ($i++ > 10){
echo "ACHTUNG TAGFEHLER STELLE H? Zeile ".$zeile_nr."<BR>\n";
echo "Zeilentext:".$line."<BR>\n";
exit; // Notaustieg bei falschem tag
}
}
}
////////////////////////////////////////////////////////////////
// Hier neue Tags einbauen start
////////////////////////////////////////////////////////////////
//
// IFRAME (nur test)
//
/* $i = 0;
while ((strpos($line,'<!iframe=') !== false )){
// auf erstes Zeichen und letztes Zeichen positionieren
$param_start_pos = strpos($line,'<!iframe=') + 9;
$param_ende_pos = 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 = "<iframe src=\"$param_filename\"";
$htmlcode .= " width=\"$param_width\"";
$htmlcode .= " height=\"$param_heigth\"";
$htmlcode .= ' frameborder="0" scrolling="0" valign="top" >';
$htmlcode .= "<a href=\"$param_filename\"></a></iframe>";
// Htmlcode einsetzen
$line = str_replace("<!iframe=$param_block>", $htmlcode, $line);
if ($i++ > 10){
echo "ACHTUNG TAGFEHLER STELLE iframe Zeile ".$zeile_nr."<BR>\n";
echo "Zeilentext:".$line."<BR>\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'].
'<a href="'.
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
sprintf($edit_string,
$sys_path_xmleditor,
$navpos,
$sys_path_xml."/".$xml_filename,
$sys_path_batch,
GetHtmlAnker(),
'',
GetExists($sys_path_xml,$xml_filename)
)
).
'">'."\n".
'<img src="'.$sys_xml_button.' " alt="" align="top">'."\n".
'</a> '."\n".
'<span '.GetEditColour($sys_path_xml,$xml_filename,'').'>'.$xml_filename.'</span>'."\n".
'<a href="'.
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
sprintf($edit_string,
$sys_path_xmleditor,
$navpos,
$sys_path_xml."/".$xsl_filename,
$sys_path_batch,
GetHtmlAnker(),
'',
GetExists($sys_path_xml,$xsl_filename)
)
).
'">'."\n".
'<img src="'.$sys_xsl_button.' " alt="" align="top">'."\n".
'</a> '."\n".
'<span '.GetEditColour($sys_path_xml,$xsl_filename,'').'>'.$xsl_filename.'</span>'."\n".
str_replace('<?xml version="1.0"?>'."\n",'',$xsl->transformToXML($doc));
}
else{
$htmlcode = $html_eingabe['ok'].
str_replace('<?xml version="1.0"?>'."\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'].
'<a href="'.
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
sprintf($edit_string,
$sys_path_xmleditor,
$navpos,
$sys_path_xml."/".$xml_filename,
$sys_path_batch,
GetHtmlAnker(),
'',
GetExists($sys_path_xml,$xml_filename)
)
).
'">'."\n".
'<img src="'.$sys_xml_button.'" alt="" align="top">'."\n".
'</a> '."\n".
'<span '.GetEditColour($sys_path_xml,$xml_filename,'').'>'.$xml_filename.'</span>'."\n".
'<a href="'.
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
sprintf($edit_string,
$sys_path_xmleditor,
$navpos,
$sys_path_xml."/".$xsl_filename,
$sys_path_batch,
GetHtmlAnker(),
'',
GetExists($sys_path_xml,$xsl_filename))
).
'">'."\n".
'<img src="'.$sys_xsl_button_html.'" alt="" align="top">'."\n".
'</a> '."\n".
'<span '.GetEditColour($sys_path_xml,$xsl_filename,'').'>'.$xsl_filename.'</span>'."\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'].
'<a href="'.
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
sprintf($edit_string,
$sys_path_rtfeditor,
$navpos,
$sys_path_rtf."/".$rtf_file,
$sys_path_batch,
GetHtmlAnker(),
'',
GetExists($sys_path_rtf,$rtf_file)
)
).
'">'."\n".
'<img src="'.$sys_rtf_button.'" alt="Edit RTF" align="top">'."\n".
'</a> '."\n".
'<span '.GetEditColour($sys_path_rtf,$rtf_filename,'').'>'.
$rtf_filename.'</span>'."\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'].
'<a href="'.
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
sprintf($edit_string,
$sys_path_rtfeditor,
$navpos,$sys_path_rtf."/".$rtf_file,
$sys_path_batch,
GetHtmlAnker(),
'',
GetExists($sys_path_rtf,$rtf_file)
)
).
'">'."\n".
'<img src="'.$sys_rtf_button.'" alt="Edit RTF" align="top">'."\n".
'</a> '."\n".
'<span '.GetEditColour($sys_path_rtf,$rtf_filename,'').'>'.
$rtf_filename.'</span>'."\n";
}
else{
$htmlcode =
$html_eingabe['err'].
'<strong><big><big><font color="#FF0000">RTF-File: '.$rtf_file.' not found</font></big></big></strong>';
}
}
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
// <!popup=TYP,CONTENT,AKT, TYP,CONTENT,BREITE,HÖHE>
// (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
// <!sp=ANZAHL>
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 .= '&nbsp;';
}
$line = GetNewTag($param_block,$htmlcode,$line);
}
//
// wTag COLOR SPANS (Wordgrenze)
// Beispiel: das ist der <w1>Satz. html: das ist der <span class="w1">Satz</span>.
// 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,'<w') !== false ) {
// auf das Zeichen 'w' und letztes Zeichen positionieren
$param_start_pos = strpos($line,'<w') + 1;
$param_ende_pos = 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 = '<span class="'.$class.'">'.$param_block.'</span>';
$line = GetNewTag($param_block,$htmlcode,$line);
}
////////////////////////////////////////////////////////////////
// Hier neue Tags einbauen ende
////////////////////////////////////////////////////////////////
// <ul=Unsorted List über mehrere zeilen
if (strpos($line,'<!ul=') !== false ){
$line = str_replace('<!ul=','<ul><br><li>',$line);
$ulist = true;
$old_pre = $pre_tag;
$pre_tag = '';
}
$i = 0;
while ($ulist && (strpos($line,'\\') !== false )){
$line = str_replace('\\<br>','<br></li><li>',$line);
$line = str_replace('\\','</li><li>',$line);
if ($i++ > 10){
echo "ACHTUNG TAGFEHLER STELLE ulist Zeile ".$zeile_nr."<BR>\n";
echo "Zeilentext:".$line."<BR>\n";
exit; // Notaustieg bei falschem tag
}
}
if ($ulist && (strpos($line,'=ul>') !== false )){
$line = str_replace('=ul>','<br></li></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 .= '</p>';
$html_text .= '<p>';
}
if (strchr($tag_param,'f') !== false ){ // Fett
$tag_c .= '</b>';
$html_text .= '<b>';
}
if (strchr($tag_param,'u') !== false ){ // Unterstrichen
$tag_c .= '</u>';
$html_text .= '<u>';
$x4 = str_replace('u','',$x4);
}
if (strchr($tag_param,'i') !== false ){ // Kursiv Italic
$tag_c .= '</i>';
$html_text .= '<i>';
}
if (strchr($tag_param,'g') !== false ){ // Grosser Text
$tag_c .= '</big>';
$html_text .= '<big>';
}
if (strchr($tag_param,'k') !== false ){ // Klein
$tag_c .= '</small>';
$html_text .= '<small>';
}
if (strchr($tag_param,'t') !== false ){ // Terminal Text
$tag_c .= '</tt>';
$html_text .= '<tt>';
}
if (strchr($tag_param,'c') !== false ){ // Center
$tag_c .= '</center>';
$html_text .= '<center>';
}
if (strchr($tag_param,'w') !== false ){ // Word Tags
$tag_w = substr($tag_param,strpos($tag_param,'w'),2);
$tag_c .= '</span>';
$html_text .= '<span class="'.$tag_w.'">';
}
$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."<BR>\n";
echo "Zeilentext:".$line."<BR>\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."<BR>\n";
echo "Zeilentext:".$line."<BR>\n";
exit; // Notaustieg bei falschem tag
}
$line = substr($line,0,strpos($line,'§>')).$tag_c.substr($line,strpos($line,'§>')+2);
}
// <!img?=text,titel>
SetActTag('');
while (strpos($line,'<!img') !== false ) {
$tag_beginn = substr($line,strpos($line,'<!img'));
$class = substr( $tag_beginn,2,strpos($tag_beginn,'=')-2);
ResetActTag($class); // es gibt ja img und img0-9
$param_block = GetParamBlock($line); // Inhalt des Tags holen
// Parameter splitten
list($img_file, $img_titel) = split(',',$param_block);
$img_file = GetReplaceFile($img_file); // Replacefile holen falls notwendig
$htmllink = $verz_img.'/'.$img_file;
if (!file_exists($htmllink) || $img_file == ''){
$img_file = $sys_default_img; // Defualt file mitgeben wenn nicht ok
$htmllink = $sys_default_img;
$found = false;
}
else{
$found = true;
}
$alt_text = 'IMG';
// 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_img_load_button, // Buttongrafik
$sys_img_load_err_button,
$img_file, // Parm1
$img_titel); // Parm2
if ($found){
$htmlcode = $html_eingabe['ok'];
}
else{
$htmlcode = $html_eingabe['err'];
}
$htmlcode .= '<img class="' . $class . '" title="' . $img_titel . '" alt="' . $img_text . '" src="'.$htmllink.'">';
$line = GetNewTag($param_block,$htmlcode,$line);
}
// <!vid?=text,titel>
SetActTag('');
while (strpos($line,'<!vid') !== false ){
$tag_beginn = substr($line,strpos($line,'<!vid'));
$class = substr( $tag_beginn,2,strpos($tag_beginn,'=')-2);
ResetActTag($class); // es gibt ja img und img0-9
$param_block = GetParamBlock($line); // Inhalt des Tags holen
// Parameter splitten
list($vid_file, $vid_titel) = split(',',$param_block);
$vid_file = GetReplaceFile($vid_file); // Replacefile holen falls notwendig
$vid_filename = $verz_video.'/'.$vid_file;
if (!file_exists($vid_filename.'.html') or !file_exists($vid_filename.'.swf')){
$img_link = $sys_default_video;
$html_link = '';
}
else {
if (file_exists($vid_filename . '.jpg')){
$img_link = $vid_filename . '.jpg';
}
else if (file_exists($link . '.gif')){
$img_link = $vid_filename . '.gif';
}
else{
$img_link = $sys_default_video;
}
$html_link = $vid_filename . '.html';
}
$repl_tag = array (
'<div class="'.$class.'">'
,'<table>'
,'<caption>' . $vid_titel . '</caption>'
,'<tr>'
,'<td>'
,'<a href="' . $html_link . '" target="_blank" >'
,'<img src="' . $img_link . '" title="'.$titel.'">'
,'<a>'
,'</td>'
,'</tr>'
,'</table>'
,'</div>'
);
$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,
'<b>'.$npos.'</b>');
}
else{
$htmlcode = $html_eingabe['err'].
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
'<b>'.$n_anker.'</b>');
}
}
else{
if ($n_anker == ''){
$htmlcode = $html_eingabe['ok'].
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
'<a href="'.$_SERVER['PHP_SELF'].'?ap='.$npos.'">'.$ntxt.'</a>');
}
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,'<!h'.$k.'a='.$n_anker);
if ($anker_position) {
list($dummy_teil1,$zusatztext) = split(',',substr($buffer,$anker_position));
list($zusatztext,$dumm_teil2) = split('>',$zusatztext);
$htmlcode = $html_eingabe['ok'].
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
'<a href="'.$_SERVER['PHP_SELF'].
'?ap='.$npos.
'&an='.$n_anker.
'" title="'.$zusatztext.'">'.
$n_anker.'</a>');
$found = true;
break;
}
}
if (!$found){
$htmlcode = $html_eingabe['err'].
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
'<b>'.$n_anker.'</b>');
}
}
else{
$htmlcode = $html_eingabe['err'].
str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
'<b>'.$n_anker.'</b>');
}
}
}
$line = GetNewTag($param_block,$htmlcode,$line);
}
}
if (strpos($line,'<pre>') !== false ){
$pre_tag = '';
}
if (strpos($line,'</pre>') !== false ){
$pre_tag = '<br>';
}
$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('<!menu>', "<ul>\n".$html_output_top.'</ul>', $html_output_main) . $pre_tag."\n";
}
}
?>