6 Bweb - A Bacula web interface
7 Bacula
\81Â
\81® - The Network Backup Solution
9 Copyright (C) 2000-2006 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.
15 This program is Free Software; you can redistribute it and/or
16 modify it under the terms of version two of the GNU General Public
17 License as published by the Free Software Foundation plus additions
18 that are listed in the file LICENSE.
20 This program is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
30 Bacula
\81Â
\81® is a registered trademark of John Walker.
31 The licensor of Bacula is the Free Software Foundation Europe
32 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zurich,
33 Switzerland, email:ftf@fsfeurope.org.
37 This script is used to extract strings from tpl files
46 use base "HTML::Parser";
57 open(FP, "|sort -n") ;
64 next if ($w eq ' ');
67 next if ($w eq 'checked');
69 next if (exists $dict{$w});
72 # we add " at the begining and the end of the string
73 #$w =~ s/'/\\'/gm; # "
74 #print "s\@(?!value='|_)$w\@\$1_${w}_\@g;\n";
75 #print "s!(${w})([^a-zA-Z0-9]|\$)!__\$1__\$2!g;\n";
81 my ($self, $text) = @_;
83 # between <script>..</script> we take only "words"
85 my @words = ($text =~ /"([\w\s
\81é
\81è
\81à
\81ç
\81û
\81ô
\81ö
\81ü
\81ï
\81î
\81ù!?]+)"/gs);
90 # just print out the original text
91 # $text =~ s/<\/?TMPL[^>]+>//gs;
94 $text =~ s/(^\s+)|(\s+$)//gs;
96 # skip some special cases
97 return if ($text eq 'selected');
102 my ($self, $tag, $attr, $attrseq, $origtext) = @_;
104 # On note qu'on se trouve dans un script
105 # pour prendre que les chaines entre ""
106 if ($tag eq 'script') {
110 #return unless ($tag =~ /^(a|input|img)$/);
112 # liste des attributs a traduire
113 if (defined $attr->{'title'}) {
114 print_it($attr->{'title'});
117 if (defined $attr->{'alt'}) {
118 print_it($attr->{'alt'});
136 my $p = new TmplParser;
138 for (my $f = shift ; $f and -f $f ; $f = shift) {
140 # print "#============ $f ==========\n";
142 $file =~ s!.*?/([\w\d]+).tpl$!$1!;
143 $p->parse_file($f); $l=0;
146 #print "s/value='__([^']+)__'/value='\$1'/g;\n";