sub accpending { my $self = shift; #reads the checked list from pending function. my @pids = param('list'); my @selectedparam = param('gallery'); my $i = 0; foreach my $pid (@pids) { my ( $pxml, $pob ) = @$self{'pxml','pob'}; my $item = $pob->find_node( $pxml->{'xml'}, 'item', id => $pid ); # points to gallery my $chosengallery = @selectedparam[$i]; # print "item: $item\n"; #if item cannot be found in pending list, prints this. # if( !$item ) { # WCM::Basic::doheader($self); # print "Item to approve is already gone"; # return; # } # recevie the selected gallery for addtogallery # from approve() function $item->{'_change'} = 1; # change gallery according from seelcted param. $item->{'gallery'} = {value => $chosengallery}; my $node = $self->addtogallery($item, 0); $self->genthumbs ($node); #we want to save it at iob real list to make sure we have the item in the gallery. $self->{'iob'}->save(); #make sure to delete node from pob, since file has been moved to approval list already. we dont want this picture to keep in our system. #save the newly updated pending list. #comment out if you want to temporary disable moving from pendinglist. #$pob->del_node( $pxml->{'xml'}, 'item', id => $pid ); $pob->save(); $i++; } }