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.
798 lines
27 KiB
PHP
798 lines
27 KiB
PHP
<?php
|
|
function PrintHtml( $ufile,
|
|
$sys_admin,
|
|
$verz_img,
|
|
$default_img,
|
|
$img_load_button,
|
|
$img_load_err_button,
|
|
$verz_rtf,
|
|
$rtf_load_button,
|
|
$rtf_load_err_button,
|
|
$verz_xml,
|
|
$xml_load_button,
|
|
$xml_load_err_button,
|
|
$key,
|
|
$sys_anz_ueberschriften,
|
|
$verz_incl,
|
|
$incl_aktiv,
|
|
$anker_seite
|
|
){
|
|
|
|
if (!file_exists($ufile) || is_dir($ufile)){
|
|
errorlog( "######################################################\n");
|
|
errorlog( "######################################################\n");
|
|
errorlog( "ACHTUNG File nicht gefunden\n");
|
|
errorlog( "File:".$ufile."\n");
|
|
errorlog( "######################################################\n");
|
|
errorlog( "######################################################\n");
|
|
return;
|
|
}
|
|
|
|
|
|
if ($lfile = fopen($ufile, 'r')){
|
|
|
|
$tag_close = array();
|
|
$noprt = false;
|
|
$ii = 0;
|
|
$pre_tag = '<br>';
|
|
$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 = '<br>';
|
|
}
|
|
else{
|
|
// Table Nachfassen damit er in einer Zeile ist
|
|
if (strpos($line,'<table') !== false){
|
|
while (strpos($line,'</table>') === 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
|
|
// <!h?=Überschrift> h1-h5
|
|
// <!h?=Überschrift> h1a-h5a
|
|
// 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
|
|
// 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.'>'.
|
|
'<a name="'.$menueanker.'"></a>'.
|
|
'<div class="hbox"></div>'.
|
|
'<div id="h'.$is.'_menue_link">'.
|
|
'<div class="h_'.$h_tag.'">'.
|
|
'<a href="'.$_self.'">' .$menuetextk. '</a>'.
|
|
'</div>'.
|
|
'</div>';
|
|
//'</'.$h_tag.'>';
|
|
|
|
|
|
$html_output_top .= '<li>'.
|
|
'<a href="javascript:setAnker(\''.$menueanker.'\')" style="float: right;" >'.$menuetextk."</a>".
|
|
$menuetextl."</li>\n";
|
|
$html_output_MLeiste .= $key.'='.$menuetextk.':'.$menuetextl.','.$menueanker.'!!??';
|
|
// echo $key.'*'.$menuetextk.':'.$menuetextl.','.$menueanker;
|
|
// exit;
|
|
}
|
|
else{
|
|
$htmlcode = '<'.$h_tag.'>'.$menuetextk.'</'.$h_tag.'>';
|
|
}
|
|
$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,'<!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_src . $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){
|
|
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('<?xml version="1.0"?>'."\n",'',$xsl->transformToXML($doc)).
|
|
'</font>';/** 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
|
|
//<!popup=testseite4,anker_stelle2>
|
|
SetActTag('popup');
|
|
while ((strpos($line,$act_htmltag) !== false )) {
|
|
|
|
$param_block = GetParamBlock($line); // Inhalt des Tags holen
|
|
list($xkey,$xanker,$xfreierText) = split(',',$param_block);
|
|
|
|
$htmlcode = '<a href="javascript:getLinkPopup(\''.$xkey.'\',\''.$xanker.'\')">'.$xfreierText."</a>";
|
|
$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 .= ' ';
|
|
}
|
|
$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){
|
|
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>','<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 == ''){
|
|
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);
|
|
|
|
}
|
|
|
|
// <!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
|
|
|
|
if($img_file == ''){
|
|
$img_file = $default_img; // Default file mitgeben wenn nicht ok
|
|
$htmllink = $default_img;
|
|
$edit_img_file = '';
|
|
}else{
|
|
$htmllink = $verz_img.$img_file;
|
|
if (!file_exists($htmllink)){
|
|
$edit_img_file = $img_file;
|
|
$img_file = $default_img; // Default file mitgeben wenn nicht ok
|
|
$htmllink = $default_img;
|
|
$found = false;
|
|
}
|
|
else{
|
|
$edit_img_file = $img_file;
|
|
$found = true;
|
|
}
|
|
}
|
|
|
|
$alt_text = 'IMG';
|
|
|
|
// Generiert einen Anker und Button, der zu HTML_EDIT führt bei $sys_admin
|
|
$html_eingabe = GetEditButton('img', // Kennung
|
|
$ufile, // Filname des Files, das geändert werden soll
|
|
$alt_text, // Alternativer Buttontext
|
|
$img_load_button, // Buttongrafik
|
|
$img_load_err_button,
|
|
$edit_img_file,
|
|
$sys_admin);
|
|
|
|
if ($found){
|
|
$htmlcode = $html_eingabe['ok'];
|
|
}
|
|
else{
|
|
$htmlcode = $html_eingabe['err'];
|
|
}
|
|
|
|
$img_action = '';
|
|
$htmllink_action = str_replace('/','_big/',$verz_img).$img_file;
|
|
if (file_exists($htmllink_action)){
|
|
// $img_action = 'onmouseover="popup_on(\''.$htmllink_action.'\')" onmouseout="popup_off()" ';
|
|
$img_action = 'onmouseover="popup_on(\''.$htmllink_action.'\')"';
|
|
}
|
|
|
|
|
|
$htmlcode .= '<img class="' . $class . '" title="' . $img_titel . '" alt="' . $img_text . '" src="'.$htmllink.'" '.$img_action.' >';
|
|
|
|
$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($param_block_ref,$freierText) = split(',',$param_block);
|
|
list($npos,$n_anker) = split('#',$param_block_ref);
|
|
|
|
$htmlcode = '<a href="javascript:getLink(\''.$npos.'\',\''.$n_anker.'\')">'.$freierText."</a>";
|
|
$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 = '<span class="'.$class_span.'" '.
|
|
'id="'.$span_replace.'"'.
|
|
'onmouseover="aktiviereMenue(this)" onmouseout="deaktiviereMenue(this)" '.
|
|
'onclick="klappeInclude(\''.$span_replace.'\',\''.$include_replace.'\')" '.
|
|
'>'.$include_Text.'</span><br>'.
|
|
'<div id="'.$include_replace.'" class="'.$class_block.'">'.
|
|
'<!remotefile='.$include_Remotefile.'>'.
|
|
'</div>';
|
|
$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,'<pre>') !== false ){
|
|
$pre_tag = '';
|
|
}
|
|
if (strpos($line,'</pre>') !== false ){
|
|
$pre_tag = '<br>';
|
|
}
|
|
$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 .= '<a name="szl'.$anker_zeile_nr++.$anker_seite.'"></a>'.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('\\','<br>',$html_output_main);
|
|
// Achtung keine Anker im Menue (links) wenn das Tag <!menue> nicht eingehängt ist !!!!
|
|
return '<!--ok--><a name="top"><a>'.str_replace( '<!menue>',
|
|
"\n<!--ma--".$html_output_MLeiste."--me-->\n"."<ul>\n".$html_output_top."</ul>\n",
|
|
$html_output_main).
|
|
$pre_tag."\n";
|
|
|
|
}
|
|
}
|
|
|
|
?>
|