Changeset 14557 for gsdl/trunk


Ignore:
Timestamp:
2007-09-22T16:15:53+12:00 (17 years ago)
Author:
shaoqun
Message:

make it take a array as param

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugout.pm

    r13933 r14557  
    4141         };
    4242
    43 #globaloptions contains any options that should be passed to all plugins
     43#globaloptions contains any options that should be passed to all plugouts
    4444my ($verbosity, $outhandle, $failhandle, $globaloptions);
    4545
    4646sub load_plugout{
    47     my ($plugoutname,$plugout_options) = @_;
     47    my ($plugout) = shift @_;
    4848
    4949    my $colplugdir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"perllib/plugouts");
    50      unshift (@INC, $colplugdir);
    51 
     50    unshift (@INC, $colplugdir);
     51   
     52    my $plugoutname = shift @$plugout;
     53       
    5254    # find the plugout
    53     my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"perllib/plugouts",
     55    my $customplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "custom", $ENV{'GSDLCOLLECTION'},
     56                         'perllib', 'plugouts', "${plugoutname}.pm");
     57    my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, 'perllib', 'plugouts',
    5458                      "${plugoutname}.pm");
    55     my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'},"perllib/plugouts",
    56                        "${plugoutname}.pm");
    57     if (-e $colplugname) { require $colplugname; }
     59    my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'}, 'perllib', 'plugouts',
     60                      "${plugoutname}.pm");
     61    if (-e $customplugname) { require $customplugname; }
     62    elsif (-e $colplugname) { require $colplugname; }
    5863    elsif (-e $mainplugname) { require $mainplugname; }
    5964    else {
    60     &gsprintf(STDERR, "{plugout.could_not_find_plugout}\n",
     65    gsprintf($outhandle, "{plugout.could_not_find_plugout}\n",
    6166         $plugoutname);
    62     die "\n";
     67        die "\n";
    6368    }
    6469
     
    6671    my ($plugobj);
    6772
    68     eval ("\$plugobj = new \$plugoutname([],\$plugout_options)");
     73    eval ("\$plugobj = new \$plugoutname([],\$plugout)");
    6974    die "$@" if $@;
    7075
Note: See TracChangeset for help on using the changeset viewer.