Commit d3a68bdf authored by sikeda's avatar sikeda
Browse files

[dev] tools::get_filename() and tools::make_tt2_include_path() are renamed to...

[dev] tools::get_filename() and tools::make_tt2_include_path() are renamed to tools::search_fullpath() and tools::get_search_path().  Since they have new calling convention, they are given new names.

As a side effect, Scenario::search() no longer takes both $robot and $list arguments.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@10604 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent ab4ba6ff
......@@ -1536,7 +1536,8 @@ sub get_reason_string {
my $data = {'reason' => $reason };
my $string;
my $tt2_include_path = &tools::make_tt2_include_path($robot,'mail_tt2','','');
my $tt2_include_path =
tools::get_search_path($robot, subdir => 'mail_tt2'); # FIXME: lang?
unless (&tt2::parse_tt2($data,'authorization_reject.tt2' ,\$string, $tt2_include_path)) {
my $error = &tt2::get_error();
......
......@@ -91,7 +91,7 @@ $data{'return_path_suffix'} = &Conf::get_robot_conf($domain, 'return_path_suffix
my @aliases ;
my $tt2_include_path = &tools::make_tt2_include_path($domain,'',,);
my $tt2_include_path = tools::get_search_path($domain);
my $aliases_dump;
&tt2::parse_tt2 (\%data, 'list_aliases.tt2',\$aliases_dump, $tt2_include_path);
......
......@@ -82,9 +82,7 @@ $data{'is_default_domain'} = 1 if ($domain eq $default_domain);
$data{'return_path_suffix'} = &Conf::get_robot_conf($domain, 'return_path_suffix');
my @aliases ;
my $tt2_include_path = [$Conf{'etc'}.'/'.$domain,
$Conf{'etc'},
Sympa::Constants::DEFAULTDIR];
my $tt2_include_path = tools::get_search_path($domain);
my $aliases_dump;
&tt2::parse_tt2(\%data, 'list_aliases.tt2',\$aliases_dump, $tt2_include_path);
......
......@@ -66,7 +66,8 @@ foreach $msg ( sort grep(!/^\./, readdir SPOOL )) {
unless (mkdir ($tmp_dir, 0777)) {
die "May not create $tmp_dir";
}
my $mhonarc_ressources = &tools::get_filename('etc',{},'mhonarc-ressources.tt2', $robot, $self);
my $mhonarc_ressources =
tools::search_fullpath($self, 'mhonarc-ressources.tt2');
unless ($mhonarc_ressources) {
die "Cannot find any MhOnArc ressource file";
}
......
......@@ -55,7 +55,7 @@ $data{'is_default_domain'} = 1;
$data{'return_path_suffix'} = $return_path_suffix;
my @aliases ;
my $tt2_include_path = &tools::make_tt2_include_path($domain,'',,);
my $tt2_include_path = tools::get_search_path($domain);
my $aliases_dump;
&tt2::parse_tt2 (\%data, 'list_aliases.tt2',\$aliases_dump, $tt2_include_path);
......
......@@ -366,8 +366,8 @@ sub convert_single_message {
my $destination_dir = $opts{'destination_dir'};
my $attachement_url = $opts{'attachement_url'};
my $mhonarc_ressources = tools::get_filename('etc', {},
'mhonarc-ressources.tt2', $robot, $list);
my $mhonarc_ressources = tools::search_fullpath(
$that, 'mhonarc-ressources.tt2');
unless ($mhonarc_ressources) {
Log::do_log('notice', 'Cannot find any MhOnArc ressource file');
return undef;
......
......@@ -697,7 +697,8 @@ sub checkfiles {
}
## Set TT2 path
my $tt2_include_path = &tools::make_tt2_include_path($robot,'web_tt2','','');
my $tt2_include_path =
tools::get_search_path($robot, subdir => 'web_tt2');
## Create directory if required
unless (-d $dir) {
......@@ -711,7 +712,8 @@ sub checkfiles {
foreach my $css ('style.css','print.css','fullPage.css','print-preview.css') {
$param->{'css'} = $css;
my $css_tt2_path = &tools::get_filename('etc',{}, 'web_tt2/css.tt2', $robot, undef);
my $css_tt2_path =
tools::search_fullpath($robot, 'css.tt2', subdir => 'web_tt2');
## Update the CSS if it is missing or if a new css.tt2 was installed
if (! -f $dir.'/'.$css ||
......@@ -1015,10 +1017,12 @@ sub _load_auth {
sub load_charset {
my $charset = {};
my $config_file = &_get_config_file_name({'robot' => '', 'file' => "charset.conf"});
if (-f $config_file) {
my $config_file = tools::search_fullpath('*', 'charset.conf');
return {} unless $config_file;
unless (open CONFIG, $config_file) {
printf STDERR 'Conf::load_charset(): Unable to read configuration file %s: %s\n',$config_file, $!;
Log::do_log('err', 'Unable to read configuration file %s: %s',
$config_file, $!);
return {};
}
while (<CONFIG>) {
......@@ -1028,37 +1032,35 @@ sub load_charset {
next unless /\S/;
my ($locale, $cset) = split(/\s+/, $_);
unless ($cset) {
printf STDERR 'Conf::load_charset(): Charset name is missing in configuration file %s line %d\n',$config_file, $.;
next;
Log::do_log('err', 'Charset name is missing in configuration file %s line %d',$config_file, $.);
next;
}
unless ($locale =~ s/^([a-z]+)_([a-z]+)/lc($1).'_'.uc($2).$'/ei) { #'
printf STDERR 'Conf::load_charset(): Illegal locale name in configuration file %s line %d\n',$config_file, $.;
next;
Log::do_log('err', 'Illegal locale name in configuration file %s line %d',$config_file, $.);
next;
}
$charset->{$locale} = $cset;
}
close CONFIG;
}
return $charset;
}
## load nrcpt file (limite receipient par domain
sub load_nrcpt_by_domain {
my $config_file = &_get_config_file_name({'robot' => '', 'file' => "nrcpt_by_domain.conf"});
return undef unless (-r $config_file);
my $config_file = tools::search_fullpath('*', 'nrcpt_by_domain.conf');
return unless $config_file;
my $line_num = 0;
my $config_err = 0;
my $nrcpt_by_domain ;
my $nrcpt_by_domain = {};
my $valid_dom = 0;
return undef unless (-f $config_file) ;
## Open the configuration file or return and read the lines.
unless (open(IN, $config_file)) {
printf STDERR "Conf::load_nrcpt_by_domain(): : Unable to open %s: %s\n", $config_file, $!;
return undef;
unless (open IN, '<', $config_file) {
Log::do_log('err', 'Unable to open %s: %s', $config_file, $!);
return;
}
while (<IN>) {
$line_num++;
......@@ -1069,12 +1071,12 @@ sub load_nrcpt_by_domain {
$nrcpt_by_domain->{$domain} = $value;
$valid_dom +=1;
}else {
printf STDERR gettext("Conf::load_nrcpt_by_domain(): Error at line %d: %s"), $line_num, $config_file, $_;
$config_err++;
Log::do_log('notice', 'Error at configuration file %s line %d: %s', $config_file, $line_num, $_);
$config_err++;
}
}
close(IN);
return ($nrcpt_by_domain);
close IN;
return $nrcpt_by_domain;
}
## load .sql named filter conf file
......@@ -1980,6 +1982,7 @@ sub _store_source_file_name {
$param->{'config_hash'}{'source_file'} = $param->{'config_file'};
}
# FXIME:Use tools::search_fullpath().
sub _get_config_file_name {
my $param = shift;
my $config_file;
......
......@@ -110,10 +110,8 @@ sub get_available_families {
my %families;
foreach my $dir (
Sympa::Constants::DEFAULTDIR . "/families",
$Conf::Conf{'etc'} . "/families",
$Conf::Conf{'etc'} . "/$robot/families"
) {
reverse @{tools::get_search_path($robot, subdir => 'families')}
) {
next unless (-d $dir);
unless (opendir FAMILIES, $dir) {
......@@ -1819,11 +1817,7 @@ sub _get_directory {
my $name = $self->{'name'};
&Log::do_log('debug3','Family::_get_directory(%s)',$name);
my @try = (
$Conf::Conf{'etc'} . "/$robot/families",
$Conf::Conf{'etc'} . "/families",
Sympa::Constants::DEFAULTDIR . "/families"
);
my @try = @{tools::get_search_path($robot, subdir => 'families')};
foreach my $d (@try) {
if (-d "$d/$name") {
......
......@@ -2064,8 +2064,8 @@ sub send_global_file {
$data->{'lang'} = $data->{'lang'} || $data->{'user'}{'lang'} || &Conf::get_robot_conf($robot, 'lang');
## What file
my $lang = &Language::Lang2Locale($data->{'lang'});
my $tt2_include_path = &tools::make_tt2_include_path($robot,'mail_tt2',$lang,'');
my $tt2_include_path = tools::get_search_path(
$robot, subdir => 'mail_tt2', lang => $data->{'lang'});
foreach my $d (@{$tt2_include_path}) {
&tt2::add_include_path($d);
......@@ -2195,8 +2195,8 @@ sub send_file {
}
## What file
my $lang = &Language::Lang2Locale($data->{'lang'});
my $tt2_include_path = &tools::make_tt2_include_path($robot,'mail_tt2',$lang,$self);
my $tt2_include_path = tools::get_search_path(
$self, subdir => 'mail_tt2', lang => $data->{'lang'});
push @{$tt2_include_path},$self->{'dir'}; ## list directory to get the 'info' file
push @{$tt2_include_path},$self->{'dir'}.'/archives'; ## list archives to include the last message
......@@ -5718,10 +5718,10 @@ sub may_edit {
my $edit_conf;
# Load edit_list.conf: track by file, not domain (file may come from server, robot, family or list context)
my $edit_conf_file = &tools::get_filename('etc',{},'edit_list.conf',$self->{'domain'},$self);
my $edit_conf_file = tools::search_fullpath($self, 'edit_list.conf');
if (! $edit_list_conf{$edit_conf_file} || ((stat($edit_conf_file))[9] > $mtime{'edit_list_conf'}{$edit_conf_file})) {
$edit_conf = $edit_list_conf{$edit_conf_file} = &tools::load_edit_list_conf($self->{'domain'}, $self);
$edit_conf = $edit_list_conf{$edit_conf_file} = tools::load_edit_list_conf($self);
$mtime{'edit_list_conf'}{$edit_conf_file} = time;
}else {
$edit_conf = $edit_list_conf{$edit_conf_file};
......@@ -5784,7 +5784,7 @@ sub may_create_parameter {
if ( &is_listmaster($who,$robot)) {
return 1;
}
my $edit_conf = &tools::load_edit_list_conf($robot,$self);
my $edit_conf = tools::load_edit_list_conf($self);
$edit_conf->{$parameter} ||= $edit_conf->{'default'};
if (! $edit_conf->{$parameter}) {
&Log::do_log('notice','tools::load_edit_list_conf privilege for parameter $parameter undefined');
......@@ -6049,24 +6049,10 @@ sub load_scenario_list {
my $directory = "$self->{'dir'}";
my %list_of_scenario;
my %skip_scenario;
my @list_of_scenario_dir;
if (defined $self->{'admin'}{'family_name'} ) {
@list_of_scenario_dir = (
"$directory/scenari",
"$Conf::Conf{'etc'}/$robot/families/$self->{'admin'}{'family_name'}/scenari",
"$Conf::Conf{'etc'}/families/$self->{'admin'}{'family_name'}/scenari",
"$Conf::Conf{'etc'}/$robot/scenari",
"$Conf::Conf{'etc'}/scenari",
Sympa::Constants::DEFAULTDIR . '/scenari'
);
}else{
@list_of_scenario_dir = (
"$directory/scenari",
"$Conf::Conf{'etc'}/$robot/scenari",
"$Conf::Conf{'etc'}/scenari",
Sympa::Constants::DEFAULTDIR . '/scenari'
);
}
my @list_of_scenario_dir =
@{tools::get_search_path($self, subdir => 'scenari')};
unshift @list_of_scenario_dir, $self->{'dir'} . '/scenari'; #FIXME
foreach my $dir (@list_of_scenario_dir) {
next unless (-d $dir);
......@@ -6106,12 +6092,8 @@ sub load_task_list {
my %list_of_task;
foreach my $dir (
"$directory/list_task_models",
"$Conf::Conf{'etc'}/$robot/list_task_models",
"$Conf::Conf{'etc'}/list_task_models",
Sympa::Constants::DEFAULTDIR . '/list_task_models'
@{tools::get_search_path($self, subdir => 'list_task_models')}
) {
next unless (-d $dir);
foreach my $file (<$dir/$action.*>) {
......@@ -6173,10 +6155,7 @@ sub load_data_sources_list {
my %list_of_data_sources;
foreach my $dir (
"$directory/data_sources",
"$Conf::Conf{'etc'}/$robot/data_sources",
"$Conf::Conf{'etc'}/data_sources",
Sympa::Constants::DEFAULTDIR . '/data_sources'
@{tools::get_search_path($self, subdir => 'data_sources')}
) {
next unless (-d $dir);
......@@ -6283,8 +6262,8 @@ sub _include_users_remote_sympa_list {
$cert_file = $dir.'/cert.pem';
$key_file = $dir.'/private_key';
}elsif($cert eq 'robot') {
$cert_file = &tools::get_filename('etc',{},'cert.pem',$robot,$self);
$key_file = &tools::get_filename('etc',{},'private_key',$robot,$self);
$cert_file = tools::search_fullpath($self, 'cert.pem');
$key_file = tools::search_fullpath($self, 'private_key');
}
unless ((-r $cert_file) && ( -r $key_file)) {
&Log::do_log('err', 'Include remote list https://%s:%s/%s using cert %s, unable to open %s or %s', $host, $port, $path, $cert,$cert_file,$key_file);
......@@ -7334,7 +7313,8 @@ sub _load_list_admin_from_include {
$option{'profile'} = $entry->{'profile'} if (defined $entry->{'profile'} && ($role eq 'owner'));
my $include_file = &tools::get_filename('etc',{},"data_sources/$entry->{'source'}\.incl",$self->{'domain'},$self);
my $include_file = tools::search_fullpath(
$self, $entry->{'source'} . '.incl', subdir => 'data_sources');
unless (defined $include_file){
&Log::do_log('err', 'the file %s.incl doesn\'t exist',$entry->{'source'});
......@@ -8951,12 +8931,13 @@ sub lowercase_field {
}
## Loads the list of topics if updated
## FIXME: This might be moved to Robot package.
sub load_topics {
my $robot = shift ;
&Log::do_log('debug2', 'List::load_topics(%s)',$robot);
my $conf_file = &tools::get_filename('etc',{},'topics.conf',$robot);
my $conf_file = tools::search_fullpath($robot, 'topics.conf');
unless ($conf_file) {
&Log::do_log('err','No topics.conf defined');
......@@ -9013,7 +8994,7 @@ sub load_topics {
$mtime{'topics'}{$robot} = (stat($conf_file))[9];
unless ($#raugh_data > -1) {
&Log::do_log('notice', 'No topic defined in %s/topics.conf', $Conf::Conf{'etc'});
Log::do_log('notice', 'No topic defined in %s', $conf_file);
return undef;
}
......@@ -10206,10 +10187,10 @@ sub _urlize_part {
$parser->output_to_core(1);
my $new_part;
my $lang = &Language::GetLang();
my $charset = tools::lang2charset(Language::GetLang());
my $tt2_include_path = &tools::make_tt2_include_path($robot,'mail_tt2',$lang,$list);
my $tt2_include_path = tools::get_search_path(
$list, subdir => 'mail_tt2', lang => Language::GetLang());
&tt2::parse_tt2({'file_name' => $file_name,
'file_url' => $file_url,
......
......@@ -75,7 +75,8 @@ sub new {
($parameters{'function'}, $parameters{'name'}) = ($1, $2);
}else {
## We can't use &tools::get_filename() because we don't have a List object yet ; it's being constructed
## We can't use tools::search_fullpath() because we don't have a List object yet ; it's being constructed
## FIXME: Give List object instead of 'directory' parameter.
my @dirs = ($Conf::Conf{'etc'}.'/'.$parameters{'robot'}, $Conf::Conf{'etc'}, Sympa::Constants::DEFAULTDIR);
unshift @dirs, $parameters{'directory'} if (defined $parameters{'directory'});
foreach my $dir (@dirs) {
......@@ -1086,11 +1087,7 @@ sub verify {
if ($condition_key eq 'search') {
my $val_search;
# we could search in the family if we got ref on Family object
if (defined $list){
$val_search = &search($args[0],$context,$robot,$list);
}else {
$val_search = &search($args[0],$context,$robot);
}
$val_search = search($list || $robot, $args[0], $context);
return undef unless defined $val_search;
if($val_search == 1) {
if ($log_it == 1) {
......@@ -1191,26 +1188,25 @@ sub verify {
## Verify if a given user is part of an LDAP, SQL or TXT search filter
sub search{
Log::do_log('debug2', '(%s, %s, %s)', @_);
my $that = shift; # List or Robot
my $filter_file = shift;
my $context = shift;
my $robot = shift;
my $list = shift;
my $sender = $context->{'sender'};
&Log::do_log('debug2', 'List::search(%s,%s,%s)', $filter_file, $sender, $robot);
if ($filter_file =~ /\.sql$/) {
my $file = &tools::get_filename('etc',{},"search_filters/$filter_file", $robot, $list);
my $file = tools::search_fullpath(
$that, $filter_file, subdir => 'search_filters');
my $timeout = 3600;
my ($sql_conf, $tsth);
my $time = time;
unless ($sql_conf = &Conf::load_sql_filter($file)) {
$list->send_notify_to_owner('named_filter',{'filter' => $filter_file})
if (defined $list && ref($list) eq 'List');
$that->send_notify_to_owner('named_filter',{'filter' => $filter_file})
if ref $that eq 'List';
return undef;
}
......@@ -1287,7 +1283,8 @@ sub search{
}elsif ($filter_file =~ /\.ldap$/) {
## Determine full path of the filter file
my $file = &tools::get_filename('etc',{},"search_filters/$filter_file", $robot, $list);
my $file = tools::search_fullpath(
$that, $filter_file, subdir => 'search_filters');
unless ($file) {
&Log::do_log('err', 'Could not find search filter %s', $filter_file);
......@@ -1372,7 +1369,9 @@ sub search{
}elsif($filter_file =~ /\.txt$/){
# &Log::do_log('info', 'List::search: eval %s', $filter_file);
my @files = &tools::get_filename('etc',{'order'=>'all'},"search_filters/$filter_file", $robot, $list);
my @files = tools::search_fullpath(
$that, $filter_file, subdir => 'search_filters',
'order' => 'all');
## Raise an error except for blacklist.txt
unless (@files) {
......@@ -1423,8 +1422,11 @@ sub verify_custom {
}
# use this if your want per list customization (be sure you know what you are doing)
#my $file = &tools::get_filename('etc',{},"custom_conditions/${condition}.pm", $robot, $list);
my $file = &tools::get_filename('etc',{},"custom_conditions/${condition}.pm", $robot);
# my $file = tools::search_fullpath(
# $list || $robot, $condition . '.pm',
# subdir => 'custom_conditions');
my $file = tools::search_fullpath(
$robot, $condition . '.pm', subdir => 'custom_conditions');
unless ($file) {
&Log::do_log('err', 'No module found for %s custom condition', $condition);
return undef;
......
......@@ -120,13 +120,15 @@ Creates a list. Used by the create_list() sub in sympa.pl and the do_create_list
=item * List::has_include_data_sources
=item * List::sync_includetools::get_filename
=item * List::sync_include
=item * tools::search_fullpath
=item * Log::do_log
=item * tools::get_regexp
=item * tools::make_tt2_include_path
=item * tools::get_search_path
=item * tt2::parse_tt2
......@@ -230,7 +232,8 @@ sub create_list_old{
## Check the template supposed to be used exist.
my $template_file = &tools::get_filename('etc',{},'create_list_templates/'.$template.'/config.tt2', $robot);
my $template_file = tools::search_fullpath(
$robot, 'config.tt2', subidr => 'create_list_templates/' . $template);
unless (defined $template_file) {
&Log::do_log('err', 'no template %s found',$template);
return undef;
......@@ -272,7 +275,8 @@ sub create_list_old{
$param->{'creation_email'} = "listmaster\@$host" unless ($param->{'creation_email'});
$param->{'status'} = 'open' unless ($param->{'status'});
my $tt2_include_path = &tools::make_tt2_include_path($robot,'create_list_templates/'.$template,'','');
my $tt2_include_path = tools::get_search_path(
$robot, subdir => 'create_list_templates/' . $template);
## Lock config before openning the config file
my $lock_fh = Sympa::LockedFile->new($list_dir . '/config', 5, '>');
......@@ -427,7 +431,7 @@ sub create_list{
}
## template file
my $template_file = &tools::get_filename('etc',{},'config.tt2', $robot,$family);
my $template_file = tools::search_fullpath($family, 'config.tt2');
unless (defined $template_file) {
&Log::do_log('err', 'admin::create_list : no config template from family %s@%s',$family->{'name'},$robot);
return undef;
......@@ -501,7 +505,7 @@ sub create_list{
push @files_to_parse,$file;
}
for my $file (@files_to_parse) {
my $template_file = &tools::get_filename('etc',{},$file.".tt2", $robot,$family);
my $template_file = tools::search_fullpath($family, $file.".tt2");
if (defined $template_file) {
my $file_content;
my $tt_result = &tt2::parse_tt2($param, $file.".tt2", \$file_content, [$family->{'dir'}]);
......@@ -595,7 +599,7 @@ sub update_list{
}
## template file
my $template_file = &tools::get_filename('etc',{}, 'config.tt2', $robot,$family);
my $template_file = tools::search_fullpath($family, 'config.tt2');
unless (defined $template_file) {
&Log::do_log('err', 'admin::update_list : no config template from family %s@%s',$family->{'name'},$robot);
return undef;
......@@ -647,7 +651,7 @@ sub update_list{
push @files_to_parse,$file;
}
for my $file (@files_to_parse) {
my $template_file = &tools::get_filename('etc',{},$file.".tt2", $robot,$family);
my $template_file = tools::search_fullpath($family, $file.".tt2");
if (defined $template_file) {
my $file_content;
my $tt_result = &tt2::parse_tt2($param, $file.".tt2", \$file_content, [$family->{'dir'}]);
......
......@@ -26,6 +26,7 @@ package tools;
use strict;
use Carp;
#use Cwd qw();
use Digest::MD5;
use Encode::Guess; ## Useful when encoding should be guessed
use Encode::MIME::Header;
......@@ -384,15 +385,15 @@ sub checkcommand {
## return a hash from the edit_list_conf file
sub load_edit_list_conf {
my $robot = shift;
Log::do_log('debug2', '(%s)', @_);
my $list = shift;
&Log::do_log('debug2', 'tools::load_edit_list_conf (%s)',$robot);
my $robot = $list->{'domain'};
my $file;
my $conf ;
return undef
unless ($file = &tools::get_filename('etc',{},'edit_list.conf',$robot,$list));
unless $file = tools::search_fullpath($list, 'edit_list.conf');
unless (open (FILE, $file)) {
&Log::do_log('info','Unable to open config file %s', $file);
......@@ -443,7 +444,7 @@ sub load_create_list_conf {
my $file;
my $conf ;
$file = &tools::get_filename('etc',{}, 'create_list.conf', $robot);
$file = tools::search_fullpath($robot, 'create_list.conf');
unless ($file) {
&Log::do_log('info', 'unable to read %s', Sympa::Constants::DEFAULTDIR . '/create_list.conf');
return undef;
......@@ -492,9 +493,8 @@ sub get_list_list_tpl {
}
foreach my $dir (
Sympa::Constants::DEFAULTDIR . '/create_list_templates',
"$Conf::Conf{'etc'}/create_list_templates",
"$Conf::Conf{'etc'}/$robot/create_list_templates"
reverse
@{tools::get_search_path($robot, subdir => 'create_list_templates')}
) {
if (opendir(DIR, $dir)) {
foreach my $template ( sort grep (!/^\./,readdir(DIR))) {
......@@ -2250,179 +2250,261 @@ sub duration_conv {
return $duration;
}
## Look for a file in the list > robot > server > default locations
## Possible values for $options : order=all
sub get_filename {
my ($type, $options, $name, $robot, $object) = @_;
my $list;
my $family;
&Log::do_log('debug3','tools::get_filename(%s,%s,%s,%s,%s)', $type, join('/',keys %$options), $name, $robot, $object->{'name'});
=head3 Finding config files and templates
if (ref($object) eq 'List') {
$list = $object;
if ($list->{'admin'}{'family_name'}) {
unless ($family = $list->get_family()) {
&Log::do_log('err', 'Impossible to get list %s family : %s. The list is set in status error_config',$list->{'name'},$list->{'admin'}{'family_name'});
$list->set_status_error_config('no_list_family',$list->{'name'}, $list->{'admin'}{'family_name'});
return undef;
}
}
}elsif (ref($object) eq 'Family') {
$family = $object;
=over 4
=item search_fullpath ( $that, $name, [ opt => val, ...] )
# To get file name for global site
$file = tools::search_fullpath('*', $name);
# To get file name for a robot
$file = tools::search_fullpath($robot_id, $name);
# To get file name for a family
$file = tools::search_fullpath($family, $name);
# To get file name for a list
$file = tools::search_fullpath($list, $name);
Look for a file in the list > robot > site > default locations.
Possible values for options:
order => 'all'
subdir => directory ending each path
lang => language
lang_only => if paths without lang subdirectory would be omitted
Returns full path of target file C<I<root>/I<subdir>/I<lang>/I<name>>
or C<I<root>/I<subdir>/I<name>>.
I<root> is the location determined by target object $that.
I<subdir> and I<lang> are optional.
If C<lang_only> option is set, paths without I<lang> subdirectory is omitted.
=back
=cut
sub search_fullpath {
Log::do_log('debug3', '(%s, %s, %s)', @_);
my $that = shift;
my $name = shift;