Changeset 23088

Show
Ignore:
Timestamp:
11.10.2010 23:21:27 (9 years ago)
Author:
davidb
Message:

Inclusion of a new 'pre-new' routine that helps this package set GSDLHOME and related values

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/cgi-bin/gsdlCGI.pm

    r23070 r23088  
    1212 
    1313@gsdlCGI::ISA = ( 'CGI' );  
     14 
     15sub prenew { 
     16    my $class = shift @_; 
     17        
     18    my $version; 
     19    if (-e "gsdl3site.cfg") { 
     20    $version = 3; 
     21    } else { 
     22    $version = 2; 
     23    } 
     24 
     25    my $self = {}; 
     26 
     27    if ($version == 2) { 
     28    $self->{'site_filename'} = "gsdlsite.cfg"; 
     29    $self->{'greenstone_version'} = 2; 
     30    }  
     31    elsif ($version == 3) { 
     32    $self->{'site_filename'} = "gsdl3site.cfg"; 
     33    $self->{'greenstone_version'} = 3; 
     34    } 
     35     
     36    my $bself = bless $self, $class; 
     37 
     38    $bself->setup_gsdl(); 
     39 
     40    return $bself; 
     41} 
     42 
    1443 
    1544sub new {