#!/usr/bin/php -q // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // file version <#1.0.0#> of project $gLgspConfigurationFile="lgsp.cfg.inc"; $gVersionString="<#1.0.0#>"; for ($i=1; $i")); finishHtmlLogging(); exit(-1); } $gSiteConfig=include("$gLgspConfigurationFile"); // (1) general determiner $gSiteImgDir=($gSiteConfig["SITE_ID"] . "/" . $gSiteConfig["IMG_DIR"]); // print("$gSiteImgDir\n"); $gSiteCssDir=($gSiteConfig["SITE_ID"] . "/" . $gSiteConfig["CSS_DIR"]); // print("$gSiteCssDir\n"); // (2) generate same main directories sendHtmlActionMessage("generating the multiply used site directories\n"); if (!(generateDirectoryIfMissed($gSiteConfig["SITE_ID"]))) { sendHtmlErrorMessage("cant create <" . getcwd() . "/" . $gSiteConfig["SITE_ID"] .">\n"); finishHtmlLogging(); exit(-1); } if (!(generateDirectoryIfMissed($gSiteImgDir))) { sendHtmlErrorMessage("cant create <" . getcwd() . "/" . $gSiteImgDir .">\n"); finishHtmlLogging(); exit(-1); } if (!(generateDirectoryIfMissed($gSiteCssDir))) { sendHtmlErrorMessage("cant create <" . getcwd() . "/" . $gSiteCssDir .">\n"); finishHtmlLogging(); exit(-1); } ksort($gSiteConfig["MAIN_MENU"]); // (2) do for all entries of the main menu foreach($gSiteConfig["MAIN_MENU"] as $key => $mmeArray) { // (2.A) for each entry of the mainmmenu // there must be given a correspondign directory $mmeId=$mmeArray["MME_ID"]; $mmeDir=($gSiteConfig["SITE_ID"] . "/" . $mmeId); sendHtmlActionMessage("generating directory for <" .$mmeArray["MME_ID"] . ">"); if (!(generateDirectoryIfMissed($mmeDir))) { sendHtmlErrorMessage("cant create <" . getcwd() . "/" .$mmeDir .">\n"); finishHtmlLogging(); exit(-1); } sendHtmlActionMessage("trying to write index file for <" .$mmeArray["MME_ID"] . ">"); writeIndexFile($mmeDir,$mmeArray); sendHtmlActionMessage("trying to write logo file for <" .$mmeArray["MME_ID"] . ">"); writeLogoFile($mmeDir,$mmeArray); sendHtmlActionMessage("trying to write mainmenufile for <" .$mmeArray["MME_ID"] . ">"); writeMenuFile($mmeDir,$mmeArray); sendHtmlActionMessage("trying to write submenufile for <" .$mmeArray["MME_ID"] . ">"); writeGuideFile($mmeDir,$mmeArray); sendHtmlActionMessage("trying to write missed targetfiles for <" .$mmeArray["MME_ID"] . ">"); writeContentFiles($mmeDir,$mmeArray); sendHtmlActionMessage("trying to write basic style-sheet for <" .$mmeArray["MME_ID"] . ">"); writeStyleSheet($mmeDir,$mmeArray); } sendHtmlActionMessage("trying to write top index file"); writeTopIndexFile(); finishHtmlLogging(); exit; /*** (II) functions, used by the main loop ***/ /** * (II.1) generates still missed directories */ function generateDirectoryIfMissed($pDir) { if (!(($pDir)) || ($pDir == "")) return false; if (file_exists($pDir)) return true; return mkdir($pDir,0777); } /** * (II.2) writes the index-file into the given mme-Directory */ function writeIndexFile($pMmeDir,$pMmeConfArray,$pShallFilePrefix="") { global $gSiteConfig; global $gCssFileName; $filePrefix=""; if ($pShallFilePrefix!="") $filePrefix=($pShallFilePrefix."/"); $actuallyMergedCfgArray=collectActuallyValidConfigParameters($pMmeConfArray,0); $ifContent=formPageHeader(true,$actuallyMergedCfgArray,$gCssFileName); reset($pMmeConfArray["SUB_MENU"]); $defSmeArray=current($pMmeConfArray["SUB_MENU"]); if ($defSmeArray) $defTarget=($defSmeArray["LINK_TARGET"]); else $defTargete=""; $ifContent.=("\n"); $ifContent.=(" \n"); $ifContent.=(" \n" ); $ifContent.=(" \n" ); $ifContent.=" \n"; $ifContent.=(" \n"); $ifContent.=(" \n" ); $ifContent.=" \n"; $ifContent.=" \n"; $ifContent.=" \n"; $ifContent.=(" " . formBodyTag($actuallyMergedCfgArray)); $ifContent.=( " <h1>\n" . htmlentities( $actuallyMergedCfgArray["TITLE"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) . "\n </h1>\n" ); $ifContent.=( " <p>\n". htmlentities($actuallyMergedCfgArray["ABSTRACT"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]). "\n </p>\n" ); $ifContent.=( " <p>\n" . htmlentities($actuallyMergedCfgArray["DESCRIPTION"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]). "\n </p>\n" ); $ifContent.=( " <p>\n". "Leider unterst&uuml;tzt ihr Browser keine Frames.\n" . "Den direkten Zugriff erlaubt die Seite\n" . "<a href=\"$filePrefix".formSubMenuPageFileName($actuallyMergedCfgArray)."\">". formSubMenuPageFileName($actuallyMergedCfgArray) . "</a>\n" . " </p>\n" ); $ifContent.=( " <p>\n". "We are sorry. Your browser doesn't support frames.\n" . "For a direct access use page\n" . "<a href=\"$filePrefix".formSubMenuPageFileName($actuallyMergedCfgArray)."\">". formSubMenuPageFileName($actuallyMergedCfgArray) . "</a>\n" . " </p>\n" ); $ifContent.=" </body>\n"; $ifContent.=" \n"; $ifContent.="\n"; $ifContent.="\n"; if (!(writePage($pMmeDir,formIndexPageFileName($actuallyMergedCfgArray),$ifContent))) { sendHtmlErrorMessage ( "couldn't write: <" .getcwd() . "/" .$pMmeDir ."/" . formIndexPageFileName($actuallyMergedCfgArray) .">"); return false; } sendHtmlSuccessMessage ( getcwd() . "/" .$pMmeDir ."/" . formIndexPageFileName($actuallyMergedCfgArray) .">"); return true; } /** * (II.3) writes the logo-file into the given mme-Directory */ function writeLogoFile($pMmeDir,$pMmeConfArray) { global $gCssFileName; $actuallyMergedCfgArray=collectActuallyValidConfigParameters($pMmeConfArray,0); $lfContent=formPageHeader(false,$actuallyMergedCfgArray,$gCssFileName,($pMmeConfArray["MME_ID"] . ": logo")); $lfContent.=formBodyTag($actuallyMergedCfgArray); if ($actuallyMergedCfgArray["LOGO"]) { $imgSizeStr=""; $imgTag=formImgTag ( ($pMmeConfArray["MME_ID"] . "_logo"), $actuallyMergedCfgArray["LOGO"], $actuallyMergedCfgArray, $imgSizeStr, $actuallyMergedCfgArray["TITLE"], $pIndent=" " ); $lfContent.="
\n"; $lfContent.="\n"; if ($actuallyMergedCfgArray["LOGO_TOP_MARGIN"]) { $lfContent.=sprintf( " \n",$actuallyMergedCfgArray["LOGO_TOP_MARGIN"]); } $lfContent.=" \n"; $lfContent.=" \n"; $lfContent.=" \n"; $lfContent.="
\n"; $lfContent.=$imgTag; $lfContent.="\n
\n"; $lfContent.="
\n"; } $lfContent.="\n"; $lfContent.="\n"; if (!(writePage($pMmeDir,formLogoPageFileName($actuallyMergedCfgArray),$lfContent))) { sendHtmlErrorMessage ( "couldn't write: <" .getcwd() . "/" .$pMmeDir ."/" . formLogoPageFileName($actuallyMergedCfgArray) .">"); return false; } sendHtmlSuccessMessage ( getcwd() . "/" .$pMmeDir ."/" . formLogoPageFileName($actuallyMergedCfgArray) .">"); return true; } /** * (II.4) writes the menu-file into the given mme-Directory */ function writeMenuFile($pMmeDir,$pMmeConfArray) { global $gSiteConfig; global $gCssFileName; $actuallyMergedCfgArray=collectActuallyValidConfigParameters($pMmeConfArray,0); $mfContent=formPageHeader(false,$actuallyMergedCfgArray,$gCssFileName,($pMmeConfArray["MME_ID"] . ": menu")); $mfContent.="\n"; $mfContent.="\n"; $mfContent.="\n"; $mfContent.=formBodyTag($actuallyMergedCfgArray); $numberOfMenuEntries=sizeof($gSiteConfig["MAIN_MENU"]); $bgStripSize="0"; if ($actuallyMergedCfgArray["MME_BGSTRIPE_SIZE"]) $bgStripSize=$actuallyMergedCfgArray["MME_BGSTRIPE_SIZE"]; $mfContent.="\n"; /* (a) insert top-border:menu-table-distance */ if ( ($actuallyMergedCfgArray["MAIN_MENU_TOP_MARGIN"]) && ($actuallyMergedCfgArray["MAIN_MENU_TOP_MARGIN"]!="0") ) { $mfContent.=" \n"; $mfContent.=sprintf ( " \n"; } /* (b) insert headline or headpicture */ if ($actuallyMergedCfgArray["HEADPICTURE"]) { $imageSizeStr=""; $imageTag=formImgTag ( ($actuallyMergedCfgArray["MME_ID"] ."_headpicture"), $actuallyMergedCfgArray["HEADPICTURE"], $actuallyMergedCfgArray, $imageSizeStr, $actuallyMergedCfgArray["HEADLINE"] ); $mfContent.=" \n"; $mfContent.=" \n"; $mfContent.=" \n"; } elseif($actuallyMergedCfgArray["HEADLINE"]) { $mfContent.=" \n"; $mfContent.=" \n"; $mfContent.=" \n"; if ($actuallyMergedCfgArray["ENABLED_BUTTON"]) $mfContent.=sprintf( " \n",$numberOfMenuEntries); } /* (c) insert menu-entry -buttons / -texts */ $mfContent.=" \n"; foreach($gSiteConfig["MAIN_MENU"] as $key => $loopMmeArray) { if ($loopMmeArray["ENABLED_BUTTON"]) { $imageTag=""; $imageSize=""; if ($loopMmeArray["MME_ID"]==$actuallyMergedCfgArray["MME_ID"]) { $imageFileName=""; if ($loopMmeArray["DISABLED_BUTTON"]) $imageFileName=$loopMmeArray["DISABLED_BUTTON"]; else $imageFileName=$loopMmeArray["ENABLED_BUTTON"]; $imageTag=formImgTag ( ($loopMmeArray["MME_ID"] . "_button"), $imageFileName, $actuallyMergedCfgArray, $imageSize, $loopMmeArray["ABSTRACT"], " " ); $bgColStr=""; if ($loopMmeArray["MME_BGSTRIPE_COLOR"]) $bgColStr=sprintf("bgcolor=\"%s\"",$loopMmeArray["MME_BGSTRIPE_COLOR"]); $mfContent.=" \n"; } else { $imageTag=formImgTag ( ($loopMmeArray["MME_ID"] . "_button"), $imageFileName=$loopMmeArray["ENABLED_BUTTON"], $actuallyMergedCfgArray, $imageSize, $loopMmeArray["ABSTRACT"] ); $bgColStr=""; if ($actuallyMergedCfgArray["MME_BGSTRIPE_COLOR"]) $bgColStr=sprintf("bgcolor=\"%s\"",$actuallyMergedCfgArray["MME_BGSTRIPE_COLOR"]); $mfContent.=" \n"; } } $mfContent.=" \n"; /* (d) insert subline or subpicture */ if ($actuallyMergedCfgArray["SUBPICTURE"]) { $imageSizeStr=""; $imageTag=formImgTag ( ($actuallyMergedCfgArray["MME_ID"] ."_subpicture"), $actuallyMergedCfgArray["SUBPICTURE"], $actuallyMergedCfgArray, $imageSizeStr, $actuallyMergedCfgArray["SUBLINE"] ); $mfContent.=" \n"; $mfContent.=" \n"; $mfContent.=" \n"; } elseif($actuallyMergedCfgArray["SUBLINE"]) { if ($actuallyMergedCfgArray["ENABLED_BUTTON"]) $mfContent.=sprintf( " \n",$numberOfMenuEntries); $mfContent.=" \n"; $mfContent.=" \n"; $mfContent.=" \n"; } $mfContent.="
\n", $numberOfMenuEntries, $actuallyMergedCfgArray["MAIN_MENU_TOP_MARGIN"] ); $mfContent.="
\n"; if (strpos($actuallyMergedCfgArray["HEADLINE"],"/")) { $mfContent.=sprintf (" %s\n", $actuallyMergedCfgArray["HEADLINE"], $imageTag); } else $mfContent.=(" " . $imageTag . "\n"); $mfContent.="
\n"; $htmlPreparedMmEntry=formMainMenuEntry ( " ", 14, ( "" . htmlentities($actuallyMergedCfgArray["HEADLINE"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) . "" ) ); if (strpos($actuallyMergedCfgArray["HEADLINE"],"/")) { $mfContent.=sprintf ( " %s\n", $actuallyMergedCfgArray["HEADLINE"], $htmlPreparedMmEntry ); } else { $mfContent.=(" " . $htmlPreparedMmEntry . "\n"); } $mfContent.="
\n"; $mfContent.=$imageTag; $mfContent.="\n \n"; $mfContent.=sprintf ( " \n"; $mfContent.=sprintf ( " \n", $loopMmeArray["MME_ID"], formIndexPageFileName(collectActuallyValidConfigParameters($loopMmeArray,0)) ); $mfContent.=formMainMenuEntry ( " ", 12, ( "" . htmlentities($loopMmeArray["MME_TEXT"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) . "" ) ); $mfContent.="\n \n"; $mfContent.="
\n"; if (strpos($actuallyMergedCfgArray["SUBLINE"],"/")) { $mfContent.=sprintf (" %s\n", $actuallyMergedCfgArray["SUBLINE"], $imageTag); } else $mfContent.=(" " . $imageTag . "\n"); $mfContent.="
\n"; $htmlPreparedMmEntry=formMainMenuEntry ( " ", 14, ( "" . htmlentities($actuallyMergedCfgArray["SUBLINE"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) . "" ) ); if (strpos($actuallyMergedCfgArray["SUBLINE"],"/")) { $mfContent.=sprintf ( " %s\n", $actuallyMergedCfgArray["SUBLINE"], $htmlPreparedMmEntry ); } else { $mfContent.=(" " . $htmlPreparedMmEntry . "\n"); } $mfContent.="
\n"; //$mfContent.=generateMenuPageBody($pMmeArray); $mfContent.="\n"; $mfContent.="\n"; if (!(writePage($pMmeDir,formMainMenuPageFileName($actuallyMergedCfgArray),$mfContent))) { sendHtmlErrorMessage ( "couldn't write: <" .getcwd() . "/" .$pMmeDir ."/" . formMainMenuPageFileName($actuallyMergedCfgArray) .">"); return false; } sendHtmlSuccessMessage ( getcwd() . "/" .$pMmeDir ."/" . formMainMenuPageFileName($actuallyMergedCfgArray) .">"); return true; } /** * (II.4.a) declares a java script icon */ function declareMmeJavaIcon($pMmeId,$pIconType,$pIconName,$pImageDir) { global $gSiteConfig; if (!($pIconName)) return ""; $pp=sprintf(" %s_%s_icon=new Image();\n",$pMmeId,$pIconType); $pp.=sprintf ( " %s_%s_icon.src=\"../%s/%s\";\n", $pMmeId, $pIconType, $pImageDir, $pIconName ); return $pp; } /** * (II.4.b) generate a textual menu entry */ function formMainMenuEntry($indent,$pFontSize,$pText) { $pp="$indent\n"; $pp.="$indent $pText\n"; $pp.="$indent\n"; return $pp; } /** * (II.5) writes the guide-file into the given mme-Directory */ function writeGuideFile($pMmeDir,$pMmeConfArray) { global $gSiteConfig; global $gCssFileName; $actuallyMergedCfgArray=collectActuallyValidConfigParameters($pMmeConfArray,0); $gfContent=formPageHeader(false,$actuallyMergedCfgArray,$gCssFileName,($actuallyMergedCfgArray["MME_ID"] . ": guide")); $gfContent.=formBodyTag($actuallyMergedCfgArray); $gfContent.="
\n"; $gfContent.="\n"; $sizeStr=""; if ($actuallyMergedCfgArray["MME_MARKER"]) { $mmeMarkerTag=formImgTag("",$actuallyMergedCfgArray["MME_MARKER"],$actuallyMergedCfgArray,$sizeStr); } foreach($gSiteConfig["MAIN_MENU"] as $key => $topMmeArray) { if ($topMmeArray["MME_ID"]==$actuallyMergedCfgArray["MME_ID"]) { $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; } else { $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; } } if ($actuallyMergedCfgArray["WITH_IMPRESSUM"]) { $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; $gfContent.=" \n"; } $gfContent.="
\n"; if ($actuallyMergedCfgArray["MME_MARKER"]) $gfContent.=($mmeMarkerTag . "\n"); else $gfContent.=formSubMenuAreaEntry(" ",12,"»"); $gfContent.=" \n"; $gfContent.=formSubMenuAreaEntry ( " ", 12, ( "" . htmlentities($topMmeArray["MME_TEXT"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) . "" ) ); $gfContent.="
\n"; $gfContent.="  \n"; $gfContent.=" \n"; $gfContent.=formSubMenuAreaSubMenuTable($topMmeArray,$actuallyMergedCfgArray); $gfContent.="
\n"; if ($actuallyMergedCfgArray["MME_MARKER"]) $gfContent.=($mmeMarkerTag . "\n"); else $gfContent.=formSubMenuAreaEntry(" ",12,"»"); $gfContent.=" \n"; $locallyMergedCfgArray=collectActuallyValidConfigParameters($topMmeArray,0); $gfContent.=sprintf ( " \n", $topMmeArray["MME_ID"], formIndexPageFileName($locallyMergedCfgArray) ); $gfContent.=formSubMenuAreaEntry ( " ", 12, ( "" . htmlentities($topMmeArray["MME_TEXT"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) . "" ) ); $gfContent.=" \n"; $gfContent.="
\n"; $gfContent.=" \n"; $gfContent.=formSubMenuAreaEntry( " ",8,"impressum"); $gfContent.=" \n"; $gfContent.="
\n"; $gfContent.="
\n"; $gfContent.="\n"; $gfContent.="\n"; if (!(writePage($pMmeDir,formSubMenuPageFileName($actuallyMergedCfgArray),$gfContent))) { sendHtmlErrorMessage ( "couldn't write: <" .getcwd() . "/" .$pMmeDir ."/" . formSubMenuPageFileName($actuallyMergedCfgArray) .">"); return false; } sendHtmlSuccessMessage ( getcwd() . "/" .$pMmeDir ."/" . formSubMenuPageFileName($actuallyMergedCfgArray) .">"); return true; } /** * (II.5.a) generate a sub-menu-area-entry */ function formSubMenuAreaEntry($indent,$pFontSize,$pText) { $pp="$indent\n"; $pp.="$indent $pText\n"; $pp.="$indent\n"; return $pp; } /** * (II.5.b) generate a sub-menu-area-table */ function formSubMenuAreaSubMenuTable($pMmeConfArray,$pLocalCfgArray) { $indent=" "; $pp.="$indent\n"; ksort($pMmeConfArray["SUB_MENU"]); foreach($pMmeConfArray["SUB_MENU"] as $smeArray) { if (!($smeArray)) { $pp.="$indent \n"; $pp.="$indent \n"; $pp.="$indent \n"; } else { $pp.="$indent \n"; $pp.="$indent \n"; $pp.="$indent \n"; $pp.="$indent \n"; } } $pp.="$indent
\n"; $pp.="$indent
\n"; $pp.="$indent
\n"; $pp.=formSubMenuAreaEntry(($indent." "),10,"»"); $pp.="$indent \n"; $pp.=sprintf ( "$indent \n", $smeArray["LINK_TARGET"]); $pp.=formSubMenuAreaEntry ( ($indent . " "), 10, ( "" . htmlentities($smeArray["SME_TEXT"],ENT_QUOTES,$pLocalCfgArray["ENCODING"]) . "" ) ); $pp.="$indent \n"; $pp.="$indent
\n"; return $pp; } /** * (II.6) writes all corresponding content-files into the given mme-Directory */ function writeContentFiles($pMmeDir,$pMmeConfArray) { global $gSiteConfig; global $gCssFileName; global $gRewriteTargetFiles; foreach($pMmeConfArray["SUB_MENU"] as $smeArray) { if ($smeArray) { $actuallyMergedCfgArray=collectActuallyValidConfigParameters($pMmeConfArray,$smeArray); if (!(strpos($actuallyMergedCfgArray["LINK_TARGET"],"/"))) { $fileName=($pMmeDir . "/" . $smeArray["LINK_TARGET"]); if ((file_exists($fileName))&&(!($gRewriteTargetFiles))) { sendHtmlActionMessage ( "don't overwrite already existing target file: <" .getcwd() . "/" .$pMmeDir ."/" .$fileName .">"); } else { $specificCssFileName=($actuallyMergedCfgArray["SME_ID"].".css"); $cfContent=formPageHeader(false,$actuallyMergedCfgArray,$specificCssFileName); $cfContent.=formBodyTag($actuallyMergedCfgArray); $cfContent.=sprintf ( "

\n%s\n

\n", htmlentities( $actuallyMergedCfgArray["TITLE"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) ); $cfContent.=sprintf ( "

\n%s\n

\n", htmlentities( $actuallyMergedCfgArray["ABSTRACT"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) ); $cfContent.=sprintf ( "

\n%s\n

\n", htmlentities( $actuallyMergedCfgArray["DESCRIPTION"],ENT_QUOTES,$actuallyMergedCfgArray["ENCODING"]) ); $cfContent.=" example link \n"; $cfContent.="\n"; $cfContent.="\n"; if (!(writePage($pMmeDir,$actuallyMergedCfgArray["LINK_TARGET"],$cfContent))) { sendHtmlErrorMessage ( "couldn't write: <" .getcwd() . "/" .$pMmeDir ."/" . $actuallyMergedCfgArray["LINK_TARGET"] .">"); return false; } writeSpecificStyleSheet($pMmeDir,$actuallyMergedCfgArray,$specificCssFileName); sendHtmlSuccessMessage ( getcwd() . "/" .$pMmeDir ."/" . $actuallyMergedCfgArray["LINK_TARGET"] .">"); } } else { sendHtmlActionMessage ( "ignore external link: <" .$actuallyMergedCfgArray["LINK_TARGET"] .">"); } } } if ((file_exists($pMmeDir . "/" ."impressum.html"))&&(!($gRewriteTargetFiles))) sendHtmlActionMessage ( "don't overwrite already existing target file: <" .getcwd() . "/" .$pMmeDir ."/" ."impressum.html>"); else { $impressumMergedCfgArray=collectActuallyValidConfigParameters($pMmeConfArray,0); $ifContent=formPageHeader(false,$impressumMergedCfgArray,$gCssFileName); $ifContent.=formBodyTag($impressumMergedCfgArray); $ifContent.="
\n"; $ifContent.="

Impressum

\n"; $ifContent.="

\n"; $ifContent.= ( sprintf ( "%s:
%s\n", htmlentities("Inhaltlich Verantwortlich gemäß § 6 MDStV"), htmlentities($impressumMergedCfgArray["AUTHOR"]) ) ); $ifContent.="

\n"; $ifContent.="

\n"; $ifContent.= ( htmlentities ( "Trotz sorgfältiger inhaltlicher Kontrolle übernehmen " . "wir keine Haftung für die Inhalte externer Links. Für den Inhalt " . "der verlinkten Seiten sind ausschließlich deren Betreiber verantwortlich." ) ); $ifContent.="

\n"; $ifContent.="
\n"; $ifContent.="\n"; $ifContent.="\n"; if (!(writePage($pMmeDir,"impressum.html",$ifContent))) { sendHtmlErrorMessage( "couldn't write: <" .getcwd() . "/" .$pMmeDir ."/" . "impressum.html" .">"); return false; } sendHtmlSuccessMessage(getcwd() . "/" .$pMmeDir ."/" . "impressum.html>"); } sendHtmlSuccessMessage ( "having created the still missed corresponding targetfiles"); return true; } /** * (II.8) writes the top index-file into the site directory */ function writeTopIndexFile() { global $gSiteConfig; ksort($gSiteConfig["MAIN_MENU"]); reset($gSiteConfig["MAIN_MENU"]); $mmeArray=current($gSiteConfig["MAIN_MENU"]); writeIndexFile($gSiteConfig["SITE_ID"],$mmeArray,$mmeArray["MME_ID"]); return true; } /** * (II.7) writes default style scheet */ function writeStyleSheet($pMmeDir,$pMmeConfArray) { global $gCssFileName; global $gRewriteTargetFiles; $actuallyMergedCfgArray=collectActuallyValidConfigParameters($pMmeConfArray,0); $styleSheetDir=($pMmeDir . "/" . $actuallyMergedCfgArray["CSS_DIR"] ); if (!(generateDirectoryIfMissed($styleSheetDir))) { sendHtmlErrorMessage("cant create <" . getcwd() . "/" .$styleSheetDir .">\n"); finishHtmlLogging(); exit(-1); } if ((file_exists(($styleSheetDir . "/" . $gCssFileName)))&&(!($gRewriteTargetFiles))) { sendHtmlActionMessage ( "don't overwrite already existing stylesheet file: <" .getcwd() . "/" . $styleSheetDir ."/" .$gCssFileName .">" ); } else { $csContent=sprintf("a:link { color: %s; }\n",$actuallyMergedCfgArray["LINK_COLOR"]); $csContent.=sprintf("a:visited { color: %s; }\n",$actuallyMergedCfgArray["VLINK_COLOR"]); $csContent.=sprintf("a:active{ color: %s; }\n",$actuallyMergedCfgArray["ALINK_COLOR"]); $csContent.=sprintf("a:hover{ color: %s; }\n",$actuallyMergedCfgArray["HOVER_COLOR"]); if (!(writePage($styleSheetDir,$gCssFileName,$csContent))) { sendHtmlErrorMessage( "couldn't write: <" .getcwd() . "/" .$styleSheetDir ."/" . $gCssFileName .">"); return false; } sendHtmlSuccessMessage( getcwd() . "/" .$styleSheetDir ."/" . $gCssFileName .">"); } return true; } function writeSpecificStyleSheet($pMmeDir,$pActuallyMergedCfgArray,$pSpecificCssFileName) { global $gRewriteTargetFiles; $styleSheetDir=($pMmeDir . "/" . $pActuallyMergedCfgArray["CSS_DIR"] ); if (!(generateDirectoryIfMissed($styleSheetDir))) { sendHtmlErrorMessage("cant create <" . getcwd() . "/" .$styleSheetDir .">\n"); finishHtmlLogging(); exit(-1); } if ((file_exists(($styleSheetDir . "/" . $pSpecificCssFileName)))&&(!($gRewriteTargetFiles))) { sendHtmlActionMessage ( "don't overwrite already existing stylesheet file: <" .getcwd() . "/" . $styleSheetDir ."/" .$styleSheetDir . "/" . $pSpecificCssFileName .">" ); } else { $csContent=sprintf("a:link { color: %s; }\n",$pActuallyMergedCfgArray["LINK_COLOR"]); $csContent.=sprintf("a:visited { color: %s; }\n",$pActuallyMergedCfgArray["VLINK_COLOR"]); $csContent.=sprintf("a:active{ color: %s; }\n",$pActuallyMergedCfgArray["ALINK_COLOR"]); $csContent.=sprintf("a:hover{ color: %s; }\n",$pActuallyMergedCfgArray["HOVER_COLOR"]); if (!(writePage($styleSheetDir,$pSpecificCssFileName,$csContent))) { sendHtmlErrorMessage( "couldn't write: <" .getcwd() . "/" .$styleSheetDir ."/" . $pSpecificCssFileName .">"); return false; } sendHtmlSuccessMessage( getcwd() . "/" .$styleSheetDir ."/" . $pSpecificCssFileName .">"); } return true; } /** * (II.8) help screen for commandline call */ function printCmdlHV() { global $gVersionString; print ( "lgsp.php [-v|-h] lgspSiteConfigurationFile\n\n" . "Little GNU Site Preparer release ${gVersionString}\n" . "Copyright (C) 2003 Karsten Reincke\n" . "lgsp comes with ABSOLUTELY NO WARRANTY. This\n" . "is free software, and you are welcome to use and\n" . "to redistribute it under the terms of the GNU\n" . "GNU General Public Licence as published by the\n" . "Free Software Foundation; either version 2 of the\n" . "Licence, or (at your opinion) any later version.\n" ); } function formHtmlHV() { return ( "lgsp.php [-v|-h] lgspSiteConfigurationFile
\n
\n" . "Little GNU Site Preparer release ${gVersionString}
\n" . "Copyright (C) 2003 Karsten Reincke
\n" . "lgsp comes with ABSOLUTELY NO WARRANTY. This
\n" . "is free software, and you are welcome to use and
\n" . "to redistribute it under the terms of the GNU
\n" . "GNU General Public Licence as published by the
\n" . "Free Software Foundation; either version 2 of the
\n" . "Licence, or (at your opinion) any later version.
\n
\n" ); } /*** (III) functions, used by more than one of the main functions ***/ /** * (III.A) collect the actually valid configuration parameters * * merges the reachable configuration parameter * and returns the set of all actually valid * atribute-value-pairs (= hash array) * * \param $pMmeConfig :- main-menu-entry-config-array * \param $pSmeConfig :- sub-menu-entry-config-array */ function collectActuallyValidConfigParameters ( $pMmeConfig, $pSmeConfig ) { global $gSiteConfig; $car=array(); /* (1) insert the internally used defaults */ $car["SITE_ID"] = "site"; $car["IMG_DIR"] = "images"; $car["CSS_DIR"] = "css"; $car["INTRO_MARKER"] = "index"; $car["LOGO_MARKER"] = "logo"; $car["MENU_MARKER"] = "mm-guide"; $car["GUIDE_MARKER"] = "sm-guide"; $car["WRITE_XML_DECLARATION"] = "yes"; /* some infos for writing a page */ $car["AUTHOR"] = ""; $car["ENCODING"] = "UTF-8"; $car["TITLE"] = "site page"; $car["ABSTRACT"] = ""; $car["DESCRIPTION"] = ""; $car["KEYWORDS_EN"] = ""; $car["KEYWORDS_FREE"] = ""; $car["KEYWORDS_FREE_LANGUAGE"] = ""; $car["BACKGROUND_PICTURE"] = ""; $car["BACKGROUND_COLOR"] = "#888888"; $car["TEXT_COLOR"] = "#000000"; $car["LINK_COLOR"] = "#FF0000"; $car["VLINK_COLOR"] = "#880000"; $car["ALINK_COLOR"] = "#0000FF"; $car["HOVER_COLOR"] = "#00FF00"; /* some infos for writing an index page */ $car["MENU_AREA_HEIGHT"] = "120"; $car["GUIDE_AREA_WIDTH"] = "120"; /* some infos for writing a logo page */ $car["LOGO_TOP_MARGIN"] = "20"; $car["LOGO"] = ""; /* some infos for writing the guide page */ $car["MME_MARKER"] = ""; $car["WITH_IMPRESSUM"] = ""; /* some infos for writing the main menu page */ $car["MAIN_MENU_TOP_MARGIN"]="0"; $car["HEADLINE"] = ""; $car["HEADPICTURE"] = ""; $car["MME_BGSTRIPE_COLOR"] = ""; $car["MME_BGSTRIPE_SIZE"] = "0"; $car["ENABLED_BUTTON"] = ""; $car["MOUSEOVER_BUTTON"] = ""; $car["MOUSEDOWN_BUTTON"] = ""; $car["DISABLED_BUTTON"] = ""; $car["SUBLINE"] = ""; $car["SUBPICTURE"] = ""; /* (2) let the internally used defaults be overwritten * by the externally determined global default values */ /* some directorynames */ if ($gSiteConfig["SITE_ID"]) $car["SITE_ID"] = $gSiteConfig["SITE_ID"]; if ($gSiteConfig["IMG_DIR"]) $car["IMG_DIR"] = $gSiteConfig["IMG_DIR"]; if ($gSiteConfig["CSS_DIR"]) $car["CSS_DIR"] = $gSiteConfig["CSS_DIR"]; if ($gSiteConfig["INTRO_MARKER"]) $car["INTRO_MARKER"] = $gSiteConfig["INTRO_MARKER"]; if ($gSiteConfig["LOGO_MARKER"]) $car["LOGO_MARKER"] = $gSiteConfig["LOGO_MARKER"]; if ( $gSiteConfig["MENU_MARKER"]) $car["MENU_MARKER"] = $gSiteConfig["MENU_MARKER"]; if ($gSiteConfig["GUIDE_MARKER"]) $car["GUIDE_MARKER"] = $gSiteConfig["GUIDE_MARKER"]; /* some infos for writing a page */ if ($gSiteConfig["AUTHOR"]) $car["AUTHOR"] = $gSiteConfig["AUTHOR"]; if ($gSiteConfig["ENCODING"]) $car["ENCODING"] = $gSiteConfig["ENCODING"]; if ($gSiteConfig["TITLE"]) $car["TITLE"] = $gSiteConfig["TITLE"]; if ($gSiteConfig["ABSTRACT"]) $car["ABSTRACT"] = $gSiteConfig["ABSTRACT"]; if ($gSiteConfig["DESCRIPTION"]) $car["DESCRIPTION"] = $gSiteConfig["DESCRIPTION"]; if ($gSiteConfig["KEYWORDS_EN"]) $car["KEYWORDS_EN"] = $gSiteConfig["KEYWORDS_EN"]; if ($gSiteConfig["KEYWORDS_FREE"]) $car["KEYWORDS_FREE"] = $gSiteConfig["KEYWORDS_FREE"]; if ($gSiteConfig["KEYWORDS_FREE_LANGUAGE"]) $car["KEYWORDS_FREE_LANGUAGE"] = $gSiteConfig["KEYWORDS_FREE_LANGUAGE"]; if ($gSiteConfig["BACKGROUND_PICTURE"]) $car["BACKGROUND_PICTURE"] = $gSiteConfig["BACKGROUND_PICTURE"]; if ($gSiteConfig["BACKGROUND_COLOR"]) $car["BACKGROUND_COLOR"] = $gSiteConfig["BACKGROUND_COLOR"]; if ($gSiteConfig["MME_BGSTRIPE_COLOR"]) $car["MME_BGSTRIPE_COLOR"] = $gSiteConfig["MME_BGSTRIPE_COLOR"]; if ($gSiteConfig["MME_BGSTRIPE_SIZE"]) $car["MME_BGSTRIPE_SIZE"] = $gSiteConfig["MME_BGSTRIPE_SIZE"]; if ($gSiteConfig["TEXT_COLOR"]) $car["TEXT_COLOR"] = $gSiteConfig["TEXT_COLOR"]; if ($gSiteConfig["LINK_COLOR"]) $car["LINK_COLOR"] = $gSiteConfig["LINK_COLOR"]; if ($gSiteConfig["VLINK_COLOR"]) $car["VLINK_COLOR"] = $gSiteConfig["VLINK_COLOR"]; if ($gSiteConfig["ALINK_COLOR"]) $car["ALINK_COLOR"] = $gSiteConfig["ALINK_COLOR"]; if ($gSiteConfig["HOVER_COLOR"]) $car["HOVER_COLOR"] = $gSiteConfig["HOVER_COLOR"]; /* some infos for writing an index page */ if ( $gSiteConfig["MENU_AREA_HEIGHT"]) $car["MENU_AREA_HEIGHT"] = $gSiteConfig["MENU_AREA_HEIGHT"]; if ($gSiteConfig["GUIDE_AREA_WIDTH"]) $car["GUIDE_AREA_WIDTH"] = $gSiteConfig["GUIDE_AREA_WIDTH"]; /* some infos for writing a logo page */ if ( $gSiteConfig["LOGO_TOP_MARGIN"]) $car["LOGO_TOP_MARGIN"] = $gSiteConfig["LOGO_TOP_MARGIN"]; if ($gSiteConfig["LOGO"]) $car["LOGO"] = $gSiteConfig["LOGO"]; /* some infos for writing the guide page */ if ($gSiteConfig["MME_MARKER"]) $car["MME_MARKER"] = $gSiteConfig["MME_MARKER"]; if ($gSiteConfig["WITH_IMPRESSUM"]) $car["WITH_IMPRESSUM"] = $gSiteConfig["WITH_IMPRESSUM"]; /* some infos for writing a main menu page */ if ( $gSiteConfig["MAIN_MENU_TOP_MARGIN"]) $car["MAIN_MENU_TOP_MARGIN"] = $gSiteConfig["MAIN_MENU_TOP_MARGIN"]; if ($gSiteConfig["HEADLINE"]) $car["HEADLINE"] = $gSiteConfig["HEADLINE"]; if ($gSiteConfig["HEADPICTURE"]) $car["HEADPICTURE"] = $gSiteConfig["HEADPICTURE"]; if ($gSiteConfig["SUBLINE"]) $car["SUBLINE"] = $gSiteConfig["SUBLINE"]; if ($gSiteConfig["SUBPICTURE"]) $car["SUBPICTURE"] = $gSiteConfig["SUBPICTURE"]; /* if () $car[""] = $gSiteConfig[""]; */ /* (3) let the externally determined global defaults be overwritten * by the externally determined main-menu-entry specific values */ if ($pMmeConfig) { if ($pMmeConfig["MME_ID"]) $car["MME_ID"] = $pMmeConfig["MME_ID"]; if ($pMmeConfig["IMG_DIR"]) $car["IMG_DIR"] = $pMmeConfig["IMG_DIR"]; if ($pMmeConfig["CSS_DIR"]) $car["CSS_DIR"] = $pMmeConfig["CSS_DIR"]; if ($pMmeConfig["INTRO_MARKER"]) $car["INTRO_MARKER"] = $pMmeConfig["INTRO_MARKER"]; if ($pMmeConfig["LOGO_MARKER"]) $car["LOGO_MARKER"] = $pMmeConfig["LOGO_MARKER"]; if ($pMmeConfig["MENU_MARKER"]) $car["MENU_MARKER"] = $pMmeConfig["MENU_MARKER"]; if ($pMmeConfig["GUIDE_MARKER"]) $car["GUIDE_MARKER"] = $pMmeConfig["GUIDE_MARKER"]; /* some infos for writing a page */ if ($pMmeConfig["AUTHOR"]) $car["AUTHOR"] = $pMmeConfig["AUTHOR"]; if ($pMmeConfig["ENCODING"]) $car["ENCODING"] = $pMmeConfig["ENCODING"]; if ($pMmeConfig["TITLE"]) $car["TITLE"] = $pMmeConfig["TITLE"]; if ($pMmeConfig["ABSTRACT"]) $car["ABSTRACT"] = $pMmeConfig["ABSTRACT"]; if ($pMmeConfig["DESCRIPTION"]) $car["DESCRIPTION"] = $pMmeConfig["DESCRIPTION"]; if ($pMmeConfig["KEYWORDS_EN"]) $car["KEYWORDS_EN"] = $pMmeConfig["KEYWORDS_EN"]; if ($pMmeConfig["KEYWORDS_FREE"]) $car["KEYWORDS_FREE"] = $pMmeConfig["KEYWORDS_FREE"]; if ($pMmeConfig["KEYWORDS_FREE_LANGUAGE"]) $car["KEYWORDS_FREE_LANGUAGE"] = $pMmeConfig["KEYWORDS_FREE_LANGUAGE"]; if ($pMmeConfig["BACKGROUND_PICTURE"]) $car["BACKGROUND_PICTURE"] = $pMmeConfig["BACKGROUND_PICTURE"]; if ($pMmeConfig["BACKGROUND_COLOR"]) $car["BACKGROUND_COLOR"] = $pMmeConfig["BACKGROUND_COLOR"]; if ($pMmeConfig["TEXT_COLOR"]) $car["TEXT_COLOR"] = $pMmeConfig["TEXT_COLOR"]; if ($pMmeConfig["LINK_COLOR"]) $car["LINK_COLOR"] = $pMmeConfig["LINK_COLOR"]; if ($pMmeConfig["VLINK_COLOR"]) $car["VLINK_COLOR"] = $pMmeConfig["VLINK_COLOR"]; if ($pMmeConfig["ALINK_COLOR"]) $car["ALINK_COLOR"] = $pMmeConfig["ALINK_COLOR"]; if ($pMmeConfig["HOVER_COLOR"]) $car["HOVER_COLOR"] = $pMmeConfig["HOVER_COLOR"]; /* some infos for writing an index page */ if ($pMmeConfig["MENU_AREA_HEIGHT"]) $car["MENU_AREA_HEIGHT"] = $pMmeConfig["MENU_AREA_HEIGHT"]; if ($pMmeConfig["GUIDE_AREA_WIDTH"]) $car["GUIDE_AREA_WIDTH"] = $pMmeConfig["GUIDE_AREA_WIDTH"]; /* some infos for writing a logo page */ if ($pMmeConfig["LOGO_TOP_MARGIN"]) $car["LOGO_TOP_MARGIN"] = $pMmeConfig["LOGO_TOP_MARGIN"]; if ($pMmeConfig["LOGO"]) $car["LOGO"] = $pMmeConfig["LOGO"]; /* some infos for writing a guide page */ if ($pMmeConfig["MME_MARKER"]) $car["MME_MARKER"] = $pMmeConfig["MME_MARKER"]; if ($pMmeConfig["WITH_IMPRESSUM"]) $car["WITH_IMPRESSUM"] = $pMmeConfig["WITH_IMPRESSUM"]; /* some infos for writing the menu page */ if ($pMmeConfig["MAIN_MENU_TOP_MARGIN"]) $car["MAIN_MENU_TOP_MARGIN"] = $pMmeConfig["MAIN_MENU_TOP_MARGIN"]; if ($pMmeConfig["HEADLINE"]) { $car["HEADLINE"] = $pMmeConfig["HEADLINE"]; } if ($pMmeConfig["HEADPICTURE"]) $car["HEADPICTURE"] = $pMmeConfig["HEADPICTURE"]; if ($pMmeConfig["MME_TEXT"]) $car["MME_TEXT"] = $pMmeConfig["MME_TEXT"]; if ($pMmeConfig["MME_BGSTRIPE_COLOR"]) $car["MME_BGSTRIPE_COLOR"] = $pMmeConfig["MME_BGSTRIPE_COLOR"]; if ($pMmeConfig["MME_BGSTRIPE_SIZE"]) $car["MME_BGSTRIPE_SIZE"] = $pMmeConfig["MME_BGSTRIPE_SIZE"]; if ($pMmeConfig["ENABLED_BUTTON"]) $car["ENABLED_BUTTON"] = $pMmeConfig["ENABLED_BUTTON"]; if ($pMmeConfig["MOUSEOVER_BUTTON"]) $car["MOUSEOVER_BUTTON"] = $pMmeConfig["MOUSEOVER_BUTTON"]; if ($pMmeConfig["MOUSEDOWN_BUTTON"]) $car["MOUSEDOWN_BUTTON"] = $pMmeConfig["MOUSEDOWN_BUTTON"]; if ($pMmeConfig["DISABLED_BUTTON"]) $car["DISABLED_BUTTON"] = $pMmeConfig["DISABLED_BUTTON"]; if ($pMmeConfig["SUBLINE"]) $car["SUBLINE"] = $pMmeConfig["SUBLINE"]; if ($pMmeConfig["SUBPICTURE"]) $car["SUBPICTURE"] = $pMmeConfig["SUBPICTURE"]; /*if () $car[""] = $pSmeConfig[""]; */ } /* (3) let the externally determined main-menu-entry defaults be overwritten * by the externally determined sub-menu-entry specific values */ if ($pSmeConfig) { if ($pSmeConfig["SME_ID"]) $car["SME_ID"] = $pSmeConfig["SME_ID"]; if ($pSmeConfig["SME_TEXT"]) $car["SME_TEXT"]= $pSmeConfig["SME_TEXT"]; if ($pSmeConfig["LINK_TARGET"]) $car["LINK_TARGET"]= $pSmeConfig["LINK_TARGET"]; /* some infos for writing a page */ if ($pSmeConfig["AUTHOR"]) $car["AUTHOR"] = $pSmeConfig["AUTHOR"]; if ($pSmeConfig["ENCODING"]) $car["ENCODING"] = $pSmeConfig["ENCODING"]; if ($pSmeConfig["TITLE"]) $car["TITLE"] = $pSmeConfig["TITLE"]; if ($pSmeConfig["ABSTRACT"]) $car["ABSTRACT"] = $pSmeConfig["ABSTRACT"]; if ($pSmeConfig["DESCRIPTION"]) $car["DESCRIPTION"] = $pSmeConfig["DESCRIPTION"]; if ($pSmeConfig["KEYWORDS_EN"]) $car["KEYWORDS_EN"] = $pSmeConfig["KEYWORDS_EN"]; if ($pSmeConfig["KEYWORDS_FREE"]) $car["KEYWORDS_FREE"] = $pSmeConfig["KEYWORDS_FREE"]; if ($pSmeConfig["KEYWORDS_FREE_LANGUAGE"]) $car["KEYWORDS_FREE_LANGUAGE"] = $pSmeConfig["KEYWORDS_FREE_LANGUAGE"]; if ($pSmeConfig["BACKGROUND_PICTURE"]) $car["BACKGROUND_PICTURE"] = $pSmeConfig["BACKGROUND_PICTURE"]; if ($pSmeConfig["BACKGROUND_COLOR"]) $car["BACKGROUND_COLOR"] = $pSmeConfig["BACKGROUND_COLOR"]; if ($pSmeConfig["TEXT_COLOR"]) $car["TEXT_COLOR"] = $pSmeConfig["TEXT_COLOR"]; if ($pSmeConfig["LINK_COLOR"]) $car["LINK_COLOR"] = $pSmeConfig["LINK_COLOR"]; if ($pSmeConfig["VLINK_COLOR"]) $car["VLINK_COLOR"] = $pSmeConfig["VLINK_COLOR"]; if ($pSmeConfig["ALINK_COLOR"]) $car["ALINK_COLOR"] = $pSmeConfig["ALINK_COLOR"]; if ($pSmeConfig["HOVER_COLOR"]) $car["HOVER_COLOR"] = $pSmeConfig["HOVER_COLOR"]; } return $car; } /** * (III.B) generate a valid page-header * * creates page header section witzh respect to the given configuration array * (undefined values will be ignored) */ function formPageHeader($pForFramesetPage,$pCfgArray,$pCssFileName,$pSpecialTitle="") { $pp=""; if (strtolower($pCfgArray["WRITE_XML_DECLARATION"])=="yes") $pp=("\n"); if ($pForFramesetPage) { $pp.= ( "\n" ); } else { $pp.= ( "\n" ); } $pp.="\n"; $pp.=sprintf ( "\n", $pCfgArray["CSS_DIR"], $pCssFileName ); $pp.="\n"; $pp.=(" \n" ); if ($pCfgArray["ABSTRACT"] ) { $pp.=(" \n" ); } if ($pCfgArray["AUTHOR"] ) { $pp.=(" \n" ); } if ($pCfgArray["KEYWORDS_FREE_LANGUAGE"]) { $pp.=(" \n" ); } if ($pCfgArray["KEYWORDS_EN"]) { $pp.=(" \n" ); } $pp.=" \n"; $pp.=" \n"; if ($pSpecialTitle!="") $pp.=(" ".$pSpecialTitle."\n"); elseif ($pCfgArray["TITLE"]) $pp.=" ".$pCfgArray["TITLE"]."\n"; else $pp.=" ???\n"; $pp.="\n"; return $pp; } /** * (III.C.a) generate index-page-file-name */ function formIndexPageFileName($pLocalCfgArray) { return ($pLocalCfgArray["INTRO_MARKER"] . ".html"); } /** * (III.C.b) generate logo-page-file-name */ function formLogoPageFileName($pLocalCfgArray) { return ($pLocalCfgArray["LOGO_MARKER"] . ".html"); } /** * (III.C.c) generate main-menu-page-file-name */ function formMainMenuPageFileName($pLocalCfgArray) { return ($pLocalCfgArray["MENU_MARKER"] . ".html"); } /** * (III.C.d) generate submenu-page-file-name */ function formSubMenuPageFileName($pLocalCfgArray) { return ($pLocalCfgArray["GUIDE_MARKER"] . ".html"); } /** * (III.D) generate an adequate image-tag-string */ function formImgTag ( $pImageName, $pImageFileName, $pLocalCfgArray, &$pImageSizeStr, $pAlt="", $pIndent="" ) { if (!($pImageFileName)) return ""; $buildImagePath=sprintf("%s/%s/%s",$pLocalCfgArray["SITE_ID"] ,$pLocalCfgArray["IMG_DIR"],$pImageFileName); if (file_exists($buildImagePath)) { $imageSizeArray=getimagesize($buildImagePath); $pImageSizeStr=$imageSizeArray[3]; } $nameAttribute=""; if ($pImageName) $nameAttribute=sprintf("name=\"%s\"",$pImageName); $altAttribute=""; if ($pAlt) $altAttribute=sprintf("alt=\"%s\"",htmlentities($pAlt)); return ( sprintf ( "%s", $pIndent, $nameAttribute, $pLocalCfgArray["IMG_DIR"], $pImageFileName, $pImageSizeStr, $altAttribute ) ); } /** * (III.E) generate the corresponding body tag */ function formBodyTag($pLocalCfgArray) { $bgPicAttribute=""; if ($pLocalCfgArray["BACKGROUND_PICTURE"]) $bgPicAttribute=sprintf ( "background=\"../%s/%s\"", $pLocalCfgArray["IMG_DIR"], $pLocalCfgArray["BACKGROUND_PICTURE"] ); return ( sprintf ( ( "\n" ), $pLocalCfgArray["BACKGROUND_COLOR"], $pLocalCfgArray["TEXT_COLOR"], $pLocalCfgArray["LINK_COLOR"], $pLocalCfgArray["VLINK_COLOR"], $pLocalCfgArray["ALINK_COLOR"] ) ); } /** * (III.F) write the content into a file being positioned into dir */ function writePage($pFileDir,$pFileName,$pFileContent) { if ($pFileDir != "") { $filePath=($pFileDir . "/" . $pFileName); } else $filePath=($pFileName); if (!($fp=fopen($filePath,"w"))) return false; if (fwrite($fp,$pFileContent)<0) return false; fclose($fp); return true; } /*** (IV) funktions for log-handling ***/ /** * (IV) logging functions */ /** * (IV.a) write the html-page-header for logging */ function startHtmlLogging() { $date=date("Y-m-d-\T-H-i-s"); print ( "\n" . "\n" . "\n" . "\n" . " \n" . " \n" . " \n" . " lgsp-logging: $date\n" . "\n" . "\n" . "\n" ); insertLgspReturnButton(); } /** * (IV.b) write an html-action-message */ function sendHtmlActionMessage($pLogMessage,$pLogAdd1="", $pLogAdd2="") { print(htmlentities($pLogMessage) . "
\n"); if ($pLogAdd1) print(" " . htmlentities($pLogAdd1) . "
\n"); if ($pLogAdd2) print(" " . htmlentities($pLogAdd2) . "
\n"); } /** * (IV.c) write an html-error-message */ function sendHtmlErrorMessage($pErrorMessage,$pLogAdd1="", $pLogAdd2="") { print("\n error: "); print(htmlentities($pErrorMessage) . "
\n"); if ($pLogAdd1) print(" " . htmlentities($pLogAdd1) . "
\n"); if ($pLogAdd2) print(" " . htmlentities($pLogAdd2) . "
\n"); } /** * (IV.d) write an html-success-message */ function sendHtmlSuccessMessage($pSuccessMessage,$pLogAdd1="", $pLogAdd2="") { print("\n success: "); print(htmlentities($pSuccessMessage) . "
\n"); if ($pLogAdd1) print(" " . htmlentities($pLogAdd1) . "
\n"); if ($pLogAdd2) print(" " . htmlentities($pLogAdd2) . "
\n"); } /** * (IV.e) write the lgsp-return-button */ function insertLgspReturnButton() { global $gLgspReturnTarget; global $gLgspConfigurationFile; $tgp=urlencode($gLgspConfigurationFile); if ($gLgspReturnTarget) { print("

$gLgspReturnTarget

\n"); } } /** * (IV.f) write the html-page-footer for logging */ function finishHtmlLogging() { insertLgspReturnButton(); print ( "
\n" . "\n" . "\n" ); } ?>