Weltweite Kontakte:
"; # Zuordnung Kontinent => Länder leeren für nächste Sprache %laender = (); %alle_laender = (); foreach my $file (@FILELIST) { # Zuweisung des Directory my $directory = $FILE_META_INFO{$file}->getValues('directory'); # Extrahierung des Kontinents aus Directory my @split = split('/',$directory); $kontinent = @split[4]; # Extrahierung des Landes aus Directory $land = @split[5]; $weitere = @split[6]; $docId = @split[7]; if ($kontinent ne "weltweit" && $weitere ne "weitere" && $kontinent ne "") { # Überprüfung ob Kontinent bereits vorhanden, wenn nein -> Hinzufügen! push(@kontinente, $kontinent) unless $seen_kontinent{$kontinent}++; # Speichern aller Länder my $uebersetzung = $dynamic{"text.land.".$land."_".$lingua}; $alle_laender{$land} = $uebersetzung; # Zuordnung Kontinent => Länder (Hash-Array) push (@{$laender{$kontinent}}, $land); # 1. %table # 2. +-------+---+ # 3. | | | +-------------+------------+---------+ # 4. |Europa| *----> | Deutschland | Frankreich | England | # 5. | | | +-------------+------------+---------+ # 6. +-------+---+ # 7. | | | +-------+--------+ # 8. |Asien | *----> | China | Indien | # 9. | | | +-------+--------+ # 10. +-------+---+ # 11. | | | +-----+--------+--------+ # 12. |Ameri.| *----> | USA | Kanada | Mexiko | # 13. | | | +-----+--------+--------+ # 14. +-------+---+ } elsif ($weitere eq "weitere") { $weitere_linkname = $FILE_META_INFO{$file}->getValues('linktext_'.$lingua); # Linkliste für Weitere Links z.B. unter Deutschland linkliste_erstellen($lingua, $weitere_linkname); } } # Sicherstellen, dass die "andere" Länder zum Schluss angezeigt werden my $counter = -1; @kontinente = sort @kontinente; foreach my $andere (@kontinente) { $counter++; next unless ($andere eq "andere"); splice(@kontinente, $counter, 1); push(@kontinente, "andere"); } # Tabs für Kontaktansicht erzeugen topnav_kontakte_erzeugen($lingua); # Inhalt Registerkarte Weltweit erzeugen registerkarte_weltweit_erzeugen($lingua); # Inhalt anderer Registerkarten erzeugen registerkarte_andere_erzeugen($lingua); # Haupt-SSI erzeugen haupt_ssi_erzeugen($lingua); } sub linkliste_erstellen { my $sprache = shift; my $linkname = shift; my $savefile = $stdssi_pfad."/". $land ."/index.ssi.".$sprache; my $parent_col3 = $stdssi_pfad."/". $land ."/index.shtml.".$sprache; if (exists $seen_linkliste{$savefile}) { open (SACTIVE, ">> $savefile") or die "Konnte die Datei $savefile nicht oeffnen\n"; } else { open (SACTIVE, "> $savefile") or die "Konnte die Datei $savefile nicht oeffnen\n"; # Überprüfe ob Eltern-Element Col3-Inhalte besitzt, wenn ja -> ausgeben! if (-e $parent_col3) { open (PARENT, "< $parent_col3") or die "Unerwarter Fehler: $!\n"; while ("; close SACTIVE or die "Konnte Datei $savefile nicht schliessen\n"; } sub topnav_kontakte_erzeugen { my $sprache = shift; my $i = 0; my $nav = ""; $nav .= "
- ";
my $uebersetzung = $dynamic{"text.kontinent.weltweit_".$sprache};
$nav .= "
-
$uebersetzung
";
$i++;
foreach $kontinent (@kontinente) {
next if ($kontinent eq "andere");
my $uebersetzung = $dynamic{"text.kontinent.".$kontinent."_".$sprache};
$nav .= " -
$uebersetzung
";
$i++;
}
$nav .="
$uebersetzung
"; foreach $kontinent (@kontinente) { my $uebersetzung = $dynamic{"text.kontinent.".$kontinent."_".$sprache}; $tab .= "
$uebersetzung
- ";
print "
- ".$uebersetzung." "; print "
$uebersetzung
"; foreach $land (@{$laender{$kontinent}}) { if ($land) { $uebersetzung = $dynamic{"text.land.".$land."_".$sprache}; $tab .= "$uebersetzung
"; } } $tab .= "$uebersetzung
"; $tab .= "- ";
foreach $land (@{$laender{$kontinent}}) {
if ($land) {
$uebersetzung = $dynamic{"text.land.".$land."_".$sprache};
$tab .= "
- ".$uebersetzung." "; } } $tab .= "
";
my $item;
foreach $item (@{$laender{$kontinent}}) {
next if($item eq "" || $item eq ".");
$uebersetzung = $dynamic{"text.land.".$item."_".$sprache};
my $savefile = $stdssi_pfad."/".$item."/index.ssi.".$sprache;
# Wenn Seite = Dänemark, Schweiz oder Österreich -> nehme Daten von Deutschland
if ($item =~ /(dk|ch|at|si)/) {
$savefile = $stdssi_pfad."/de/index.ssi.".$sprache;
}
$tab .= "
\n";
open (SACTIVE, "< $savefile") or die "FEHLER: Konnte die Datei $savefile nicht oeffnen\n";
while () {
chomp;
$tab .= $_;
}
close SACTIVE or die "Konnte Datei $savefile nicht schliessen\n";
$tab .= "
";
}
$tab .= "
";
$include .= "[an error occurred while processing this directive]
";
foreach $kontinent (@kontinente) {
$include .= "[an error occurred while processing this directive]
";
}
$include .= "
";
# Datei erzeugen und Tabs eintragen
my $savefile = $stdssi_pfad."/kontakte_weltweit.shtml.".$sprache;
open (SACTIVE, "> $savefile") or die "Konnte die Datei $savefile nicht oeffnen\n";
print SACTIVE $include;
close SACTIVE or die "Konnte Datei $savefile nicht schliessen\n";
}
sub readDynamicFile
{
# Einlesen der Übersetzungen für Länder/Kontinente
my $dynamicfile = $SYSTEM_CONF{'SITE-DIR'} ."/dynamic/laender.conf";
my $dynamic;
open (TRANS, "< $dynamicfile") or die "Konnte die Dynamic Datei nicht oeffnen\n";
my $i = 0;
while (