From: Moritz Bunkus Date: Wed, 15 Feb 2006 07:49:09 +0000 (+0000) Subject: Vorlagen werden nun direkt lokalisiert. Die Funktion zum Parsen der Vorlagen sucht... X-Git-Tag: release-2.4.0^2~338 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=40db40e8dab881065df1cfbe61bb2212de0ff6db;p=kivitendo-erp.git Vorlagen werden nun direkt lokalisiert. Die Funktion zum Parsen der Vorlagen sucht explizit zuerst nach der Vorlage fuer die ausgewaehlte Sprache. --- diff --git a/SL/Form.pm b/SL/Form.pm index 124e972ab..db2cb4907 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -424,9 +424,19 @@ function fokus(){document.$self->{fokus}.focus();} sub parse_html_template { $main::lxdebug->enter_sub(); - my ($self, $file) = @_; + my ($self, $myconfig, $file) = @_; + + if (-f "templates/webpages/${file}_" . $myconfig->{"countrycode"} . + ".html") { + $file = "templates/webpages/${file}_" . $myconfig->{"countrycode"} . + ".html"; + } elsif (-f "templates/webpages/${file}.html") { + $file = "templates/webpages/${file}.html"; + } else { + $self->error("Web page template '${file}' not found."); + } - my $template = HTML::Template->new("filename" => "templates/webpages/$file", + my $template = HTML::Template->new("filename" => $file, "die_on_bad_params" => 0, "strict" => 0, "case_sensitive" => 1, @@ -453,12 +463,12 @@ sub parse_html_template { } sub show_generic_error { - my ($self, $error, $title) = @_; + my ($self, $myconfig, $error, $title) = @_; $self->{"title"} = $title if ($title); $self->{"label_error"} = $error; - print($self->parse_html_template("generic/error.html")); + print($self->parse_html_template($myconfig, "generic/error")); } # write Trigger JavaScript-Code ($qty = quantity of Triggers)