Revision 9ead220c
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
bin/mozilla/admin.pl | ||
---|---|---|
55 | 55 |
use SL::Inifile; |
56 | 56 |
use SL::DBUpgrade2; |
57 | 57 |
use SL::DBUtils; |
58 |
use SL::Template; |
|
58 | 59 |
|
59 | 60 |
require "bin/mozilla/common.pl"; |
60 | 61 |
require "bin/mozilla/admin_groups.pl"; |
... | ... | |
1168 | 1169 |
} |
1169 | 1170 |
|
1170 | 1171 |
sub _search_templates { |
1171 |
# is there a templates basedir |
|
1172 |
if (!-d $::lx_office_conf{paths}->{templates}) { |
|
1173 |
$::form->error(sprintf($::locale->text("The directory %s does not exist."), $::lx_office_conf{paths}->{templates})); |
|
1174 |
} |
|
1175 |
|
|
1176 |
tie my %dir_h, 'IO::Dir', $::lx_office_conf{paths}->{templates}; |
|
1177 |
|
|
1178 |
my @alldir = sort grep { |
|
1179 |
-d ($::lx_office_conf{paths}->{templates} . "/$_") |
|
1180 |
&& !/^\.\.?$/ |
|
1181 |
&& !m/\.(?:html|tex|sty|odt|xml|txb)$/ |
|
1182 |
&& !m/^(?:webpages$|print$|mail$|\.)/ |
|
1183 |
} keys %dir_h; |
|
1184 |
|
|
1185 |
tie %dir_h, 'IO::Dir', "$::lx_office_conf{paths}->{templates}/print"; |
|
1186 |
my @allmaster = ('Standard', sort grep { -d ("$::lx_office_conf{paths}->{templates}/print" . "/$_") && !/^\.\.?$/ && !/^Standard$/ } keys %dir_h); |
|
1172 |
my %templates = SL::Template->available_templates; |
|
1187 | 1173 |
|
1188 |
return \@alldir, \@allmaster;
|
|
1174 |
return ($templates{print_templates}, $templates{master_templates});
|
|
1189 | 1175 |
} |
1190 | 1176 |
|
1191 | 1177 |
1; |
Auch abrufbar als: Unified diff
Funktion zum Auflisten vorhandener Druckvorlagen nach SL::Template verschoben