'.$sprache_browser;
}
}
// Liefert Author
function PrintAuthor()
{
global $sys_author;
echo '"';
echo HtmlText($sys_author);
echo '"';
}
// Liefert Editor
function GetEditor($ueditor)
{
$l_root = substr( $_SERVER['SCRIPT_FILENAME'], 0, strpos( $_SERVER['SCRIPT_FILENAME'], '/' ));
foreach ($ueditor as $l_editor){
if (file_exists($l_root.$l_editor)){
return $l_root.$l_editor;
}
}
return '';
}
// Gibt den Parameterbereich eines Tags zurück
function GetParamBlock($line){
global $act_htmltag;
$param_start_pos = strpos($line,$act_htmltag) + strlen($act_htmltag);
$param_ende_pos = strpos($line,'>',$param_start_pos);
// kompletten block bis abschliessendem '>' ausschneiden
return(substr($line, $param_start_pos, $param_ende_pos - $param_start_pos));
}
// Ersetzt das alte Tag mit dem neuen Wert
function GetNewTag($param_block,$html_code,$line){
global $act_tag;
global $act_htmltag;
global $act_nr;
global $act_endtag;
global $zeile_nr;
if ($act_nr++ > 10){
echo "ACHTUNG TAGFEHLER STELLE '.$act_tag.' Zeile ".$zeile_nr."
\n";
echo "Zeilentext:".$line."
\n";
exit; // Notaustieg bei falschem tag
}
return(str_replace($act_htmltag.$param_block.$act_endtag,$html_code,$line));
}
// Setzt replace file falls notwendig
function GetReplaceFile($orig_file){
global $act_nr;
global $act_tag;
global $zeile_nr;
global $_replzlnr;
global $_repllnknr;
$replfile = 'repl'.$act_tag;
// Diese $_GET nicht ändern - sind dynamisch
if ($_GET[$replfile] != '' && $_replzlnr == $zeile_nr && $_repllnknr == $act_nr){
return ($_GET[$replfile]);
}
else{
return($orig_file);
}
}
// Button erstellen
function GetButton($button,$text,$onclick){
return ( '
'
);
}
// Aktuellen Tag setzten
function SetActTag($tag){
global $act_nr;
$act_nr = 0;
global $act_tag;
$act_tag = $tag;
global $act_htmltag;
$act_htmltag = '';
}
// Aktuellen Tag ersetzten
function ResetActTag($tag){
global $act_tag;
$act_tag = $tag;
global $act_htmltag;
$act_htmltag = ''.
'
';
$htmltext['err'] = ''.
'
';
}
else {
$htmltext['ok'] = '';
$htmltext['err'] = '';
}
return $htmltext;
}
// Gibt den Filenamen zurück falls das file schon angelegt ist
function GetExists($upath,$ufile)
{
if (!file_exists($upath."/".$ufile)){
return $ufile;
}
else{
return '';
}
}
function EchoText($utext){
echo str_replace(" "," ",$utext)."
\n";
}
function HtmlHref($utext){
global $sys_sonderzeichen_suche_href;
global $sys_sonderzeichen_ersetze_href;
return str_replace($sys_sonderzeichen_suche_href,
$sys_sonderzeichen_ersetze_href,
$utext);
}
function HtmlText($utext){
global $sys_sonderzeichen_suche_full;
global $sys_sonderzeichen_ersetze_full;
return str_replace($sys_sonderzeichen_suche_full,
$sys_sonderzeichen_ersetze_full,
$utext);
}
function PrintFehler($utext){
echo "==>".str_replace(" "," ","".$utext."
\n");
global $err;
global $ierr;
$err = true;
$ierr++;
}
function PrintFile($ufile){
global $sys_sonderzeichen_suche;
global $sys_sonderzeichen_ersetze;
if ($lfile = fopen($ufile, 'r')){
echo str_replace( $sys_sonderzeichen_suche,
$sys_sonderzeichen_ersetzte,
trim(fread($lfile,filesize($ufile))));
fclose($lfile);
}
}
// Stetzt farbe je nach fileoption
function GetEditColour($udir,$ufile,$ufarbe){
$f_weiss = ' style="background-color: rgb(202,202,202);"';
$f_gruen = ' style="background-color: rgb(50,202,50);"';
$f_blau = ' style="background-color: rgb(50,50,202);"';
$f_rot = ' style="background-color: rgb(202,50,50);"';
switch($ufarbe)
{
case 'rot':
return $f_rot;
case 'gruen':
return $f_gruen;
case 'blau':
return $f_blau;
case 'weiss':
return $f_weiss;
default:
if (!file_exists($udir."/".$ufile)){
return $f_gruen;
}
else{
if (in_array($ufile,$_SESSION["lastedit"])){
if (in_array($ufile,$_SESSION["deledit"])){
return $f_rot;
}
else {
return $f_blau;
}
}
}
return $f_weiss;
}
}
function GetAnkermenuetext($ufile,$umenunamen)
{
global $sys_anz_ueberschriften;
global $verz_rtf;
if ($lfile = fopen($ufile, 'r')){
while (!feof ($lfile)){
$line = trim(fgets ($lfile, 4096));
$k = 0;
while (++$k<=$sys_anz_ueberschriften){
while ((strpos($line,'',$param_start_pos);
// param_block = name der span Klasse
$param_block = substr($line, $param_start_pos, $param_ende_pos - $param_start_pos);
$line = str_replace('','',$line);
list($menuename,$menuetext) = split(',',$param_block);
if ($menuename == $umenunamen){
if ($menuetext != ''){
return($menuetext);
}
else{
return($menuename);
}
}
}
}
}
}
return('');
}
// Setzt Menuetag um $uaktion a nur anker, r nur rtf, b beide
function Get_Anker_Styles_HX($ufile,$uaktion)
{
global $anker;
global $sys_anz_ueberschriften;
global $verz_rtf;
global $act_htmltag;
global $act_endtag;
global $act_nr;
global $zeile_nr;
$zeile_nr = 0;
unset($anker['menuename']);
unset($anker['menuetext']);
$j = 0;
if (!file_exists($ufile) || is_dir($ufile)){
return;
}
if ($lfile = fopen($ufile, 'r')){
while (!feof ($lfile)){
$line = trim(fgets ($lfile, 4096));
$zeile_nr++;
// a Anker oder b Both
if ($uaktion == 'a' || $uaktion == 'b'){
$k = 0;
// Durchlesen aller oder Tags
while (++$k<=$sys_anz_ueberschriften){
SetActTag('h'.$k.'a'); // Aktives Tag setzten
while (strpos($line,$act_htmltag) !== false ) {
$param_block = GetParamBlock($line); // Inhalt des Tags holen
list($anker['menuename'][$j],$anker['menuetext'][$j]) = split(',',$param_block);
if ($anker['menuetext'][$j] == ''){
$anker['menuetext'][$j] = $anker['menuename'][$j];
}
$j++;
$line = GetNewTag($param_block,'',$line);
}
}
}
// r RTF oder b Both
if ($uaktion == 'r' || $uaktion == 'b'){
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
// Files testen und RTF code generieren
if( file_exists($rtf_filename)){
$rtf = file_get_contents( $rtf_filename );
echo parse_styles($rtf,$classname);
}
$line = GetNewTag($param_block,'',$line);
}
}
}
fclose($lfile);
}
/*
// Testeinbau Anfang
echo ":::".$anker['menuetext'][0].":::\n";
echo ":::".$anker['menuetext'][1].":::\n";
echo ":::".$anker['menuetext'][2].":::\n";
echo ":::".$anker['menuename'][0].":::\n";
echo ":::".$anker['menuename'][1].":::\n";
echo ":::".$anker['menuename'][2].":::\n";
exit;
// Testeinbau Ende
*/
}
// Verzeichnisstruktur lesen und in array stellen
//
function ListCss($udir,$uext,$uvlg)
{
global $sprache_aktivieren;
global $sprache_abbrechen;
global $_self;
if ($fudir = opendir($udir))
{
global $sys_css;
echo '\n";
}
}
?>