Changeset 950
- Timestamp:
- 12/19/06 08:23:11 (2 years ago)
- Files:
-
- branches/wheeljack/default_templates/atom_index.tmpl (modified) (1 diff)
- branches/wheeljack/lib/MT/DefaultTemplates.pm (modified) (2 diffs)
- branches/wheeljack/lib/MT/Template.pm (modified) (1 diff)
- branches/wheeljack/lib/MT/Template/ContextHandlers.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/wheeljack/default_templates/atom_index.tmpl
r855 r950 4 4 <link rel="alternate" type="text/html" href="<$MTBlogURL encode_xml="1"$>" /> 5 5 <link rel="self" type="application/atom+xml" href="<$MTBlogURL$>atom.xml" /> 6 <id>tag:<$MTBlogHost exclude_port="1" encode_xml="1"$>,<$MT Dateformat="%Y-%m-%d"$>:<$MTBlogRelativeURL encode_xml="1"$>/<$MTBlogID$></id>6 <id>tag:<$MTBlogHost exclude_port="1" encode_xml="1"$>,<$MTTemplateCreatedOn format="%Y-%m-%d"$>:<$MTBlogRelativeURL encode_xml="1"$>/<$MTBlogID$></id> 7 7 <updated><MTEntries lastn="1"><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></MTEntries></updated> 8 8 <MTIfNonEmpty tag="MTBlogDescription"><subtitle><$MTBlogDescription remove_html="1" encode_xml="1"$></subtitle></MTIfNonEmpty> branches/wheeljack/lib/MT/DefaultTemplates.pm
r873 r950 108 108 ]; 109 109 110 use MT::Util qw(format_ts);111 112 110 sub templates { 113 111 if (!$loaded) { … … 122 120 if ((-e $file) && (-r $file)) { 123 121 open FIN, "<$file"; my $data = <FIN>; close FIN; 124 if ('Atom Index' eq $tmpl->{name}) {125 if ($data =~ m!<\$MTDate format="([\S]+)"\$>!) {126 my @ts = gmtime(time);127 my $ts = sprintf '%04d%02d%02d%02d%02d%02d',128 $ts[5]+1900, $ts[4]+1, @ts[3,2,1,0];129 my $date = format_ts($1, $ts);130 $data =~ s!<\$MTDate format="([\S]+)"\$>!$date!;131 }132 }133 122 $tmpl->{text} = $data; 134 123 } else { branches/wheeljack/lib/MT/Template.pm
r910 r950 65 65 my $tmpl = shift; 66 66 my($ctx, $cond) = @_; 67 $ctx->stash('template', $tmpl); 67 68 my $tokens; 68 69 my $build = MT::Builder->new; branches/wheeljack/lib/MT/Template/ContextHandlers.pm
r949 r950 282 282 283 283 TemplateNote => sub { '' }, 284 TemplateCreatedOn => \&_hdlr_template_created_on, 284 285 Ignore => [ sub { '' }, 1 ], 285 286 … … 965 966 $file =~ s!(^/|/$)!!g; 966 967 $file; 968 } 969 970 sub _hdlr_template_created_on { 971 my($ctx, $args, $cond) = @_; 972 my $template = $ctx->stash('template') 973 or return $ctx->error(MT->translate("Can't load template")); 974 $args->{ts} = $template->created_on; 975 _hdlr_date($_[0], $args); 967 976 } 968 977
