6 Bweb - A Bacula web interface
7 Bacula
\81Â
\81® - The Network Backup Solution
9 Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
11 The main author of Bweb is Eric Bollengier.
12 The main author of Bacula is Kern Sibbald, with contributions from
13 many others, a complete list can be found in the file AUTHORS.
14 This program is Free Software; you can redistribute it and/or
15 modify it under the terms of version three of the GNU Affero General Public
16 License as published by the Free Software Foundation and included
19 This program is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 Affero General Public License for more details.
24 You should have received a copy of the GNU Affero General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 Bacula
\81® is a registered trademark of Kern Sibbald.
30 The licensor of Bacula is the Free Software Foundation Europe
31 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Z
\81ürich,
32 Switzerland, email:ftf@fsfeurope.org.
36 This script is used to extract strings from tpl files
41 use base "HTML::Parser";
52 open(FP, "|sort -n") ;
59 next if ($w eq ' ');
62 next if ($w eq 'checked');
64 next if (exists $dict{$w});
67 # we add " at the begining and the end of the string
68 #$w =~ s/'/\\'/gm; # "
69 #print "s\@(?!value='|_)$w\@\$1_${w}_\@g;\n";
70 #print "s!(${w})([^a-zA-Z0-9]|\$)!__\$1__\$2!g;\n";
76 my ($self, $text) = @_;
78 # between <script>..</script> we take only "words"
80 my @words = ($text =~ /"([\w\s
\81é
\81è
\81à
\81ç
\81û
\81ô
\81ö
\81ü
\81ï
\81î
\81ù!?]+)"/gs);
85 # just print out the original text
86 # $text =~ s/<\/?TMPL[^>]+>//gs;
89 $text =~ s/(^\s+)|(\s+$)//gs;
91 # skip some special cases
92 return if ($text eq 'selected');
97 my ($self, $tag, $attr, $attrseq, $origtext) = @_;
99 # On note qu'on se trouve dans un script
100 # pour prendre que les chaines entre ""
101 if ($tag eq 'script') {
105 #return unless ($tag =~ /^(a|input|img)$/);
107 # liste des attributs a traduire
108 if (defined $attr->{'title'}) {
109 print_it($attr->{'title'});
112 if (defined $attr->{'alt'}) {
113 print_it($attr->{'alt'});
131 my $p = new TmplParser;
133 for (my $f = shift ; $f and -f $f ; $f = shift) {
135 # print "#============ $f ==========\n";
137 $file =~ s!.*?/([\w\d]+).tpl$!$1!;
138 $p->parse_file($f); $l=0;
141 #print "s/value='__([^']+)__'/value='\$1'/g;\n";