$self->{action} =~ s/( |-|,|#)/_/g;
$self->{version} = "2.2.0";
- $self->{dbversion} = "2.2.0";
$main::lxdebug->leave_sub();
my ($self, $str) = @_;
if ($str && !ref($str)) {
- $str =~ s/"/"/g;
+ $str =~ s/\"/"/g;
}
$str;
my ($self, $str) = @_;
if ($str && !ref($str)) {
- $str =~ s/"/"/g;
+ $str =~ s/"/\"/g;
}
$str;
$msg =~ s/\n/<br>/g;
$self->header;
-
- print qq|
- <body>
-
- <h2 class=error>Error!</h2>
-
- <p><b>$msg</b>
-
- </body>
- </html>
- |;
+ $self->show_generic_error($msg);
die "Error: $msg\n";
$main::lxdebug->enter_sub();
my ($self, $file, $additional_params) = @_;
+ my $language;
+
+ if (!defined($main::myconfig) || !defined($main::myconfig{"countrycode"})) {
+ $language = $main::language;
+ } else {
+ $language = $main::myconfig{"countrycode"};
+ }
+
+ if (-f "templates/webpages/${file}_${language}.html") {
+ if ((-f ".developer") &&
+ (-f "templates/webpages/${file}_master.html") &&
+ ((stat("templates/webpages/${file}_master.html"))[9] >
+ (stat("templates/webpages/${file}_${language}.html"))[9])) {
+ my $info = "Developper information: templates/webpages/${file}_master.html is newer than the localized version.\n" .
+ "Please re-run 'locales.pl' in 'locale/${language}'.";
+ print(qq|<pre>$info</pre>|);
+ die($info);
+ }
- if (-f "templates/webpages/${file}_" . $main::myconfig{"countrycode"} .
- ".html") {
- $file = "templates/webpages/${file}_" . $main::myconfig{"countrycode"} .
- ".html";
+ $file = "templates/webpages/${file}_${language}.html";
} elsif (-f "templates/webpages/${file}.html") {
$file = "templates/webpages/${file}.html";
} else {
- $self->error("Web page template '${file}' not found.");
+ my $info = "Web page template '${file}' not found.\n" .
+ "Please re-run 'locales.pl' in 'locale/${language}'.";
+ print(qq|<pre>$info</pre>|);
+ die($info);
}
my $template = HTML::Template->new("filename" => $file,
}
if ($myconfig->{numberformat} eq "1'000.00") {
- $amount =~ s/'//g;
+ $amount =~ s/\'//g;
}
$amount =~ s/,//g;