Changeset 1820
- Timestamp:
- 04/09/08 07:50:46 (8 months ago)
- Files:
-
- branches/release-34/lib/MT/Atom.pm (modified) (2 diffs)
- branches/release-34/lib/MT/AtomServer.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-34/lib/MT/Atom.pm
r1174 r1820 37 37 # do we say it's that when all we're guaranteed is it's an opaque blob 38 38 # of text? So use 'html' for new RFC compatible output. 39 $atom->content->type($rfc_compat ? 'html' : 'application/xhtml+xml'); 39 # XML::Atom::Content intelligently determines content-type for rfc compat. 40 unless ( $rfc_compat ) { 41 $atom->content->type('application/xhtml+xml'); 42 } 40 43 41 44 my $mt_author = MT::Author->load($entry->author_id); … … 56 59 my $co = _create_issued($entry->authored_on, $blog); 57 60 $atom->issued($co); 61 my $upd = $entry->modified_on; 62 if ( $upd ) { 63 $atom->updated( _create_issued( $upd, $blog ) ); 64 } 65 else { 66 $atom->updated( $co ); 67 } 58 68 $atom->add_link({ rel => 'alternate', type => 'text/html', 59 69 href => $entry->permalink }); branches/release-34/lib/MT/AtomServer.pm
r1818 r1820 710 710 $feed->id($id); 711 711 } 712 my $latest_date = 0; 712 713 $uri .= '/entry_id='; 714 my @entries; 713 715 while (my $entry = $iter->()) { 714 716 my $e = $app->new_with_entry($entry); 715 717 $e->add_link({ rel => $app->edit_link_rel, type => $app->atom_x_content_type, 716 718 href => ($uri . $entry->id), title => encode_text($entry->title, undef,'utf-8') }); 717 $feed->add_entry($e); 718 } 719 # feed/updated should be added before entries 720 # so we postpone adding them until later 721 push @entries, $e; 722 my $date = $entry->modified_on || $entry->authored_on; 723 if ( $latest_date < $date ) { 724 $latest_date = $date; 725 $feed->updated( $e->updated ); 726 } 727 } 728 $feed->add_entry($_) foreach @entries; 719 729 ## xxx add next/prev links 720 730 $app->response_content_type($app->atom_content_type);
