Changeset 370
- Timestamp:
- 04/07/08 15:22:06 (9 months ago)
- Location:
- Movable Type/TemplatePreview
- Files:
-
- 3 modified
-
TemplatePreview.pl (modified) (1 diff)
-
lib/TemplatePreview.pm (modified) (1 diff)
-
lib/TemplatePreview/App.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Movable Type/TemplatePreview/TemplatePreview.pl
r222 r370 8 8 use TemplatePreview; 9 9 10 our $VERSION = "1. 0";10 our $VERSION = "1.1"; 11 11 my $plugin = TemplatePreview->new({ 12 12 name => "Template Preview", -
Movable Type/TemplatePreview/lib/TemplatePreview.pm
r254 r370 17 17 code => \&__hdlr_tmpl_edit_template 18 18 }, 19 'MT::App::CMS::template_source.template_table' => { 20 code => \&__hdlr_tmpl_template_table_mt4 21 }, 22 'MT::App::CMS::template_source.edit_template' => { 23 code => \&__hdlr_tmpl_edit_template_mt4 24 }, 19 25 }, 20 26 }); 21 27 }; 28 29 sub __hdlr_tmpl_edit_template_mt4 { 30 my ($cb, $app, $tmpl) = @_; 31 32 my $preview_link_url_tmpl = sprintf( 33 'plugins/TemplatePreview/preview.cgi?blog_id=%d&template_id=<mt:var name="id">', 34 $app->param('blog_id'), $app->param('id') 35 ); 36 37 $$tmpl =~ s!label="<__trans phrase="Useful Links">">.*?<ul>!$&\n<li><a href="$preview_link_url_tmpl" class="icon-left icon-related" target="<__trans phrase="_external_link_target">"><__trans phrase="Preview Template"></a></li>!s; 38 } 39 40 sub __hdlr_tmpl_template_table_mt4 { 41 my ($cb, $app, $tmpl) = @_; 42 43 my $preview_link_url_tmpl = sprintf( 44 'plugins/TemplatePreview/preview.cgi?blog_id=%d&template_id=<mt:var name="id">', 45 $app->param('blog_id'), $app->param('id') 46 ); 47 48 $$tmpl =~ s!</tr>\s*</thead>!<th class="view-template si">Preview</th>\n$&!s; 49 $$tmpl =~ s!</tr>\s*<mt:if __last__>!<td class="view-template si status-view"><a href="$preview_link_url_tmpl" target="<__trans phrase="_external_link_target">" title="<__trans phrase="Preview Template">"><img src="<mt:var name="static_uri">images/spacer.gif" alt="<__trans phrase="Preview Template">" width="13" height="9" /></a></td>\n$&!s; 50 } 22 51 23 52 sub __hdlr_tmpl_list_template { -
Movable Type/TemplatePreview/lib/TemplatePreview/App.pm
r254 r370 218 218 my ($app, $blog, $ctx) = @_; 219 219 my @entries = MT::Entry->load({ blog_id => $blog->id }, { 220 'sort' => 'created_on', direction => 'descend', 220 221 limit => 10, 221 222 });
