Ignore:
Timestamp:
2011-03-09T15:04:33+13:00 (13 years ago)
Author:
davidb
Message:

CGI Perl scripts updated to work with Greenstone 3. This in turn required these supporting routines to optionally handle the 'site' variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/inexport.pm

    r23485 r23767  
    130130{
    131131    my $class = shift (@_);
    132     my ($mode,$collect) = @_;
     132    my ($mode,$collect,$gsdl_cgi,$opt_site) = @_;
    133133
    134134    my $self = { 'xml' => 0, 'mode' => $mode };
    135135
    136136    $self->{'out'} = STDERR;
    137     $self->{'site'} = "";
    138     $self->{'collectdir'} = &util::filename_cat($ENV{'GSDLHOME'},"collect");
     137   
     138    if (defined $gsdl_cgi) {
     139        $self->{'site'} = $opt_site;
     140        my $collect_dir = $gsdl_cgi->get_collection_dir($opt_site);
     141        $self->{'collectdir'} = $collect_dir;
     142    }
     143    else { 
     144        $self->{'site'} = "";
     145        $self->{'collectdir'} = &util::filename_cat($ENV{'GSDLHOME'},"collect");
     146    }
    139147    $self->{'faillog'} = "";
    140148   
     
    159167    my $site       = $self->{'site'};
    160168    my $out        = $self->{'out'};
    161 
     169   
    162170    if (($collection = &colcfg::use_collection($site, $collection, $collectdir)) eq "") {
    163171    &PrintUsage::print_txt_usage($options, "{import.params}");
Note: See TracChangeset for help on using the changeset viewer.