- Timestamp:
- 2017-06-29T16:27:37+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/PowerPointPlugin.pm
r31742 r31761 398 398 } 399 399 400 sub generate_item_file401 {402 my $self = shift(@_);403 my ($input_filename) = @_;404 my $outhandle = $self->{'outhandle'};405 my ($tailname, $dirname, $suffix)406 = &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$");407 408 my $plugin_name = $self->{'plugin_type'};409 410 # find all the files in the directory411 if (!opendir (DIR, $dirname)) {412 print $outhandle "$plugin_name: Couldn't read directory $dirname\n";413 return $input_filename;414 }415 416 my @dir = readdir (DIR);417 closedir (DIR);418 419 # start the item file420 my $itemfile_name = &util::filename_cat($dirname, "$tailname.item");421 422 # encoding specification????423 if (!open (ITEMFILE, ">$itemfile_name")) {424 print $outhandle "$plugin_name: Couldn't open $itemfile_name for writing\n";425 }426 print ITEMFILE "<GeneratedBy>$plugin_name\n";427 # print the first page428 my @sorted_dir = sort alphanum_sort @dir;429 for (my $i = 0; $i < scalar(@sorted_dir); $i++) {430 my $file = $sorted_dir[$i];431 if ($file =~ /^img(\d+)\.jpg$/) {432 my $num = $1;433 $self->tidy_up_html(&util::filename_cat($dirname, "text$num.html"));434 print ITEMFILE "$num:img$num.jpg:text$num.html:\n";435 }436 }437 close ITEMFILE;438 return $itemfile_name;439 440 441 }442 443 400 # want to sort img1, img2, ...img10, img11 etc. 444 401 sub alphanum_sort {
Note:
See TracChangeset
for help on using the changeset viewer.