diff options
| author | fukachan <fukachan> | 2001-10-21 05:53:58 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-10-21 05:53:58 +0000 |
| commit | d3fcb221c7d62c39a301e8771660a290a434b142 (patch) | |
| tree | f656db6427b3eaf2330d72c367d5e82072718c7b /fml/lib/Mail/HTML | |
| parent | b85e1228d0796d0dd8dbc1646d8ec3c4541f0303 (diff) | |
| download | fml8-d3fcb221c7d62c39a301e8771660a290a434b142.tar.gz fml8-d3fcb221c7d62c39a301e8771660a290a434b142.tar.bz2 fml8-d3fcb221c7d62c39a301e8771660a290a434b142.zip | |
fix sorted order in monthly_index.html
Diffstat (limited to 'fml/lib/Mail/HTML')
| -rw-r--r-- | fml/lib/Mail/HTML/Lite.pm | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/fml/lib/Mail/HTML/Lite.pm b/fml/lib/Mail/HTML/Lite.pm index 1566f08b..d180f8e8 100644 --- a/fml/lib/Mail/HTML/Lite.pm +++ b/fml/lib/Mail/HTML/Lite.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Lite.pm,v 1.12 2001/10/21 04:17:17 fukachan Exp $ +# $FML: Lite.pm,v 1.13 2001/10/21 05:22:10 fukachan Exp $ # package Mail::HTML::Lite; @@ -1286,14 +1286,19 @@ sub _update_id_montly_index_master $self->_db_open(); my $db = $self->{ _db }; my $mlist = $db->{ _monthly_idlist }; - my (@list) = keys %$mlist; + my (@list) = sort __sort_yyyymm keys %$mlist; $self->_print_ul($wh, $db, $code); for my $id (@list) { # ( YYYY/MM YYYY/MM ... ) my $xx = $id; $xx =~ s@/@@g; my $fn = "month.$xx.html"; - _print($wh, "<LI>", $code); - _print($wh, "<A HREF=\"$fn\"> $id </A>", $code); + + use File::Spec; + my $file = File::Spec->catfile($html_base_dir, $fn); + if (-f $file) { + _print($wh, "<LI>", $code); + _print($wh, "<A HREF=\"$fn\"> $id </A>", $code); + } } $self->_print_end_of_ul($wh, $db, $code); @@ -1302,6 +1307,15 @@ sub _update_id_montly_index_master } +sub __sort_yyyymm +{ + my ($xa, $xb) = ($a, $b); + $xa =~ s@/@@; + $xb =~ s@/@@; + $a <=> $b; +} + + # Descriptions: # Arguments: $self $args # Side Effects: |
