Ignore:
Timestamp:
2017-11-06T18:54:37+13:00 (6 years ago)
Author:
ak19
Message:

Moving two subroutines from modmetadataaction.pm to metadataaction.pm since they're already referenced in metadataaction.pm; and since metadataaction.pm includes modmetadataaction.pm anyway, so modmeta won't be missing the moved subroutines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/modmetadataaction.pm

    r31617 r32061  
    987987}
    988988
    989 
    990 sub dxml_start_section
    991 {
    992     my ($tagname, $attrHash, $contextArray, $parentDataArray, $parser) = @_;
    993 
    994     my $new_depth = scalar(@$contextArray);
    995 
    996 #   print STDERR "**** START SECTION \n";
    997    
    998     if ($new_depth == 1) {
    999     $parser->{'parameters'}->{'curr_section_depth'} = 1;
    1000     $parser->{'parameters'}->{'curr_section_num'}   = "";
    1001     }
    1002 
    1003     my $old_depth  = $parser->{'parameters'}->{'curr_section_depth'};
    1004     my $old_secnum = $parser->{'parameters'}->{'curr_section_num'};
    1005 
    1006     my $new_secnum;
    1007 
    1008     if ($new_depth > $old_depth) {
    1009     # child subsection
    1010     $new_secnum = "$old_secnum.1";
    1011     }
    1012     elsif ($new_depth == $old_depth) {
    1013     # sibling section => increase it's value by 1
    1014     my ($tail_num) = ($old_secnum =~ m/\.(\d+)$/);
    1015     $tail_num++;
    1016     $new_secnum = $old_secnum;
    1017     $new_secnum =~ s/\.(\d+)$/\.$tail_num/;
    1018     }
    1019     else {
    1020     # back up to parent section => lopp off tail
    1021     $new_secnum = $old_secnum;
    1022     $new_secnum =~ s/\.\d+$//;
    1023     }
    1024 
    1025     $parser->{'parameters'}->{'curr_section_depth'} = $new_depth;
    1026     $parser->{'parameters'}->{'curr_section_num'}   = $new_secnum;
    1027    
    1028     1;
    1029 }
    1030 
    1031989sub edit_xml_file
    1032990{
     
    16511609
    16521610
    1653 sub mxml_filename
    1654 {
    1655     my ($tagname, $attrHash, $contextArray, $parentDataArray, $parser) = @_;
    1656 
    1657     # Store the filename of the Current Fileset
    1658     # Note: According to http://greenstone.org/dtd/DirectoryMetadata/1.0/DirectoryMetadata.dtd
    1659     # FileName tag must come before Description tag
    1660     $parser->{'parameters'}->{'current_file'} = $attrHash->{'_content'};
    1661 
    1662     # RAW is [$tagname => $attrHash] not $tagname => $attrHash!!
    1663     return [$tagname => $attrHash];
    1664 }
    1665 
    1666 
    16671611sub mxml_fileset
    16681612{
Note: See TracChangeset for help on using the changeset viewer.