root/trunk/tools/write-default-templates

Revision 4196, 0.7 kB (checked in by takayama, 3 months ago)

* Set svn keywords

  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/usr/bin/perl -w
2use strict;
3
4use lib 'lib';
5use MT;
6use MT::Util qw( encode_html dirify );
7
8my $mt = MT->new
9    or die MT->errstr;
10
11my $tmpl = do 'lib/MT/default-templates.pl';
12print "<ul>\n";
13for my $t (@$tmpl) {
14    next if $t->{name} eq 'Stylesheet';
15    printf qq(<li><a href="#%s">%s</a></li>\n), dirify($t->{name}), $t->{name};
16}
17print "</ul>\n\n";
18
19print "\n<form>\n\n";
20for my $t (@$tmpl) {
21    next if $t->{name} eq 'Stylesheet';
22    $t->{text} = $mt->translate_templatized($t->{text});
23    printf <<HTML, dirify($t->{name}), $t->{name}, encode_html($t->{text});
24<div class="template">
25<a name="%s"><h4>%s</h4></a>
26<textarea cols="60" name="text" rows="20" wrap="virtual">
27%s
28</textarea>
29</div>
30HTML
31}
32
33print "\n</form>\n";
Note: See TracBrowser for help on using the browser.