<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>COPYING</filename>
    </added>
    <added>
      <filename>build/mt-dists/MTOS.mk</filename>
    </added>
    <added>
      <filename>default_templates/sidebar.mtml</filename>
    </added>
    <added>
      <filename>mt-static/images/arrow-left-blue.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/arrow-left-gray.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/arrow-left-green.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/arrow-right-blue.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/arrow-right-gray.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/arrow-right-green.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/audio-success.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/audio-warning.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/audio.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/file-success.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/file-warning.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/file.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/image-success.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/image-warning.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/image.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/video-success.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/video-warning.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/asset/video.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/beta_icons/beta_icon.png</filename>
    </added>
    <added>
      <filename>mt-static/images/beta_icons/beta_icon_system.png</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-listing-system.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-listing.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-system.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-tw-listing-system.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-tw-listing.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-tw-system.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-tw.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-twt-listing-system.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-twt-listing.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-twt-system.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-twt.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-wm.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-wt-listing-system.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-wt-listing.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-wt-system.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner-wt.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-inner.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/content-system.jpg</filename>
    </added>
    <added>
      <filename>mt-static/images/content.jpg</filename>
    </added>
    <added>
      <filename>mt-static/images/divider.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/nav_icons/color/entry.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/nav_icons/color/page.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/next.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/preview.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/previous.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/status-widget-bar-bottom.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/status-widget-bar-top.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/status_icons/draft-k.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/status_icons/future-k.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/status_icons/share.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/status_icons/success-k.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/status_icons/view-k.gif</filename>
    </added>
    <added>
      <filename>mt-static/images/status_icons/warning-k.gif</filename>
    </added>
    <added>
      <filename>php/lib/block.mtauthorhasentry.php</filename>
    </added>
    <added>
      <filename>php/lib/block.mtauthorhaspage.php</filename>
    </added>
    <added>
      <filename>php/lib/block.mtloop.php</filename>
    </added>
    <added>
      <filename>plugins/WXRImporter/lib/WXRImporter/Worker/Downloader.pm</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/about_this_page.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/archive_meta_widget.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/author_archive_list.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/calendar.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/category_archive_list.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/creative_commons.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/current_author_monthly_archive_list.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/current_category_monthly_archive_list.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/date_based_author_archives.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/date_based_category_archives.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/main_index_meta_widget.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/monthly_archive_dropdown.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/monthly_archive_list.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/pages_list.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/powered_by.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/recent_assets.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/recent_comments.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/recent_entries.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/search.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/signin.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/syndication.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/tag_cloud.mtml</filename>
    </added>
    <added>
      <filename>plugins/WidgetManager/default_widgets/technorati_search.mtml</filename>
    </added>
    <added>
      <filename>tmpl/cms/dialog/refresh_templates.tmpl</filename>
    </added>
    <added>
      <filename>tmpl/cms/edit_asset.tmpl</filename>
    </added>
    <added>
      <filename>tmpl/cms/include/asset_upload.tmpl</filename>
    </added>
    <added>
      <filename>tmpl/cms/refresh_results.tmpl</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -39,14 +39,21 @@ mt-static/themes/unity-purple
 #mt-static/themes/unity-tricolor
 
 # Conditional SKIP rule; format: #?(var=value) RULE
+#?package=MT ^COPYING
+^addons
 #?package=MT ^addons
+^mt-cp.cgi
 #?package=MT ^mt-cp.cgi
+^mt-static/addons
 #?package=MT ^mt-static/addons
+^mt-static/themes/tristan-blue
 #?package=MT ^mt-static/themes/tristan-blue
+#?package=MTE ^COPYING
 #?package=MTE ^addons/Community.pack
 #?package=MTE ^mt-static/addons/Community.pack
 #?package=MTE ^mt-cp.cgi
 #?package=MTE ^mt-static/themes/tristan-blue
+#?package=MTCS ^COPYING
 #?package=MTCS ^addons/Enterprise.pack
 #?package=MTCS ^mt-static/addons/Enterprise.pack
 
@@ -148,3 +155,4 @@ Makefile
 ^MT.*\.gz
 index\.html\..*
 build-language-stamp
+.gitignore</diff>
      <filename>MANIFEST.SKIP</filename>
    </modified>
    <modified>
      <diff>@@ -87,6 +87,7 @@ lib/MT.pm: %: %.pre build-language-stamp build/mt-dists/$(BUILD_PACKAGE).mk buil
 	    -e 's!__SCHEMA_VERSION__!$(SCHEMA_VERSION)!g' \
 	    -e 's!__API_VERSION__!$(API_VERSION)!g' \
 	    -e 's!__NEWSBOX_URL__!$(NEWSBOX_URL)!g' \
+	    -e 's!__LEARNINGNEWS_URL__!$(LEARNINGNEWS_URL)!g' \
 	    -e 's!__SUPPORT_URL__!$(SUPPORT_URL)!g' \
 	    -e 's!__NEWS_URL__!$(NEWS_URL)!g' \
 	    -e 's!__HELP_URL__!$(HELP_URL)!g' \</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
 
 package Build;
@@ -27,9 +31,6 @@ Build - Movable Type build functionality
 A C&lt;Build&gt; object contains the internal routines needed to build
 Movable Type distributions in multiple languages.
 
-Please see the full documentation at:
-https://intranet.sixapart.com/wiki/index.php/Movable_Type:MT_Export-Deploy
-
 =cut
 
 use strict;
@@ -40,6 +41,7 @@ use File::Basename;
 use File::Copy;
 use File::Path;
 use File::Spec;
+use File::Find;
 use Getopt::Long;
 use IO::File;
 use LWP::UserAgent;
@@ -63,20 +65,21 @@ sub get_options {
       'cleanup!'        =&gt; 1,  # Remove the exported directory after deployment.
       'date!'           =&gt; 1,  # Toggle date stamping.
       'debug'           =&gt; 0,  # Turn on/off the actual system calls.
-      'deploy:s'        =&gt; '', #($ENV{USER}||$ENV{USERNAME}).'@rongo:/usr/local/cifs/intranet/mt-interest/',
-      'deploy-uri=s'    =&gt; 'https://intranet.sixapart.com/mt-interest',
+      'deploy:s'        =&gt; '',
+      'deploy-uri=s'    =&gt; '',
       'build!'          =&gt; 1,  # Build distribution files?
       'email-bcc:s'     =&gt; undef,
       'email-body=s'    =&gt; '',  # Constructed at run-time.
       'email-cc:s'      =&gt; undef,
-      'email-from=s'    =&gt; ( $ENV{USER} || $ENV{USERNAME} ) .'@sixapart.com',
-      'email-host=s'    =&gt; 'mail.sixapart.com',
+      'email-from=s'    =&gt; ( $ENV{USER} || $ENV{USERNAME} ),
+      'email-host=s'    =&gt; 'localhost',
       'email-subject=s' =&gt; '',  # Constructed at run-time.
       'export!'         =&gt; 1,  # To export or not to export. That is the question.
       'export-dir=s'    =&gt; '',  # Constructed at run-time.
       'footer=s'        =&gt; &quot;&lt;br/&gt;&lt;b&gt;SOFTWARE IS PROVIDED FOR TESTING ONLY - NOT FOR PRODUCTION USE.&lt;/b&gt;\n&quot;,
       'footer-tmpl=s'   =&gt; 'tmpl/cms/include/copyright.tmpl',
       'help|h'          =&gt; 0,  # Show the program usage.
+      'license=s'       =&gt; undef,
       'http-user=s'     =&gt; undef,
       'http-pass=s'     =&gt; undef,
       'ldap'            =&gt; 0,  # Use LDAP (and don't initialize the database).
@@ -92,12 +95,12 @@ sub get_options {
       'prod-dir=s'      =&gt; 'Production_Builds',
       'qa'              =&gt; 0,  # Command-line --option alias
       'repo=s'          =&gt; 'trunk',  # Reset at runtime depending on branch,tag.
-      'repo-uri=s'      =&gt; '',  #'https://intranet.sixapart.com/repos/eng',
+      'repo-uri=s'      =&gt; '',
       'rev!'            =&gt; 1,  # Toggle revision stamping.
       'revision=s'      =&gt; undef,  # Constructed at run-time.
       'stage'           =&gt; 0,  # Command-line --option alias
-      'stage-dir=s'     =&gt; '/var/www/html/mt-stage',
-      'stage-uri=s'     =&gt; 'http://mt.sixapart.com',
+      'stage-dir=s'     =&gt; '',
+      'stage-uri=s'     =&gt; '',
       'short-lang=s'    =&gt; '',  # Constructed at run-time.
       'stamp=s'         =&gt; $ENV{BUILD_VERSION_ID},
       'symlink!'        =&gt; 1,  # Make build symlinks when staging.
@@ -173,9 +176,10 @@ sub setup {
     $self-&gt;set_repo();
 
     # Create the build-stamp if one is not already defined.
-    if( !$self-&gt;{'stamp=s'} ) {
+    if( !$self-&gt;{'stamp=s'} || $args{language} ) {
         # Read-in the configuration variables for substitution.
         my $config = $self-&gt;read_conf( &quot;build/mt-dists/default.mk&quot;, &quot;build/mt-dists/$self-&gt;{'pack=s'}.mk&quot; );
+        $self-&gt;{'license=s'} ||= $config-&gt;{LICENSE};
         my @stamp = ();
         push @stamp, $config-&gt;{PRODUCT_VERSION} . (
             $self-&gt;{'alpha=s'} ? &quot;a$self-&gt;{'alpha=s'}&quot;
@@ -221,12 +225,13 @@ sub make {
 
     if( $self-&gt;{'build!'} ) {
         $self-&gt;verbose_command( sprintf(
-            '%s build/mt-dists/make-dists --package=%s --language=%s --stamp=%s %s',
+            '%s build/mt-dists/make-dists --package=%s --language=%s --stamp=%s %s --license=%s',
             $^X,
             $self-&gt;{'pack=s'},
             $self-&gt;{'lang=s'},
             $self-&gt;{'export-dir=s'},
-            ($self-&gt;{'verbose!'} ? '--silent' : '')
+            ($self-&gt;{'verbose!'} ? '--silent' : ''),
+            $self-&gt;{'license=s'} || '',
         ));
     }
     else {
@@ -456,8 +461,8 @@ sub stage_distro {
         my $fh = IO::File-&gt;new( &quot;&gt;$config&quot; );
         print $fh &lt;&lt;CONFIG;
 CGIPath $url
-DefaultSiteURL http://mt.sixapart.com/blogs/
-DefaultSiteRoot /var/www/html/mt-stage/blogs/
+# DefaultSiteURL http://example.com/blogs/
+# DefaultSiteRoot /var/www/html/blogs/
 Database $db
 ObjectDriver DBI::mysql
 DBUser root
@@ -466,7 +471,7 @@ CONFIG
         if( $self-&gt;{'ldap'} ) {
             print $fh &lt;&lt;CONFIG;
 AuthenticationModule LDAP
-AuthLDAPURL ldap://ldap.sixapart.com/dc=sixapart,dc=com
+# AuthLDAPURL ldap://ldap.example.com/dc=example,dc=com
 CONFIG
         }
 
@@ -772,8 +777,8 @@ sub notify {
         $self-&gt;{'stage'}   ? ' - Staging'                :
         $self-&gt;{'qa'}      ? ' - QA'                     : '';
     # If an email-cc exists, add a comma in front of the QA address.
-    $self-&gt;{'email-cc:s'} .= ($self-&gt;{'email-cc:s'} ? ',' : '') . 'sixapart@qasource.com'
-        if $self-&gt;{'qa'};
+    # $self-&gt;{'email-cc:s'} .= ($self-&gt;{'email-cc:s'} ? ',' : '')
+    #     if $self-&gt;{'qa'};
     # Show the deployed URL's.
     $self-&gt;{'email-body=s'} = sprintf &quot;File URL(s):\n%s\n\n&quot;,
         join( &quot;\n&quot;, @{ $distros-&gt;{url} } )
@@ -896,9 +901,6 @@ sub usage {
     # --qa
     # --stage
 
- Please see the full documentation at:
- https://intranet.sixapart.com/wiki/index.php/Movable_Type:MT_Export-Deploy
-
 USAGE
     exit;
 }</diff>
      <filename>build/Build.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 #!/usr/bin/perl
+
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
+
 use strict;
 use warnings;
 use lib 'build';</diff>
      <filename>build/exportmt.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,11 @@
+#!/usr/bin/perl
+
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 use strict;
 use Getopt::Long;
 </diff>
      <filename>build/l10n/diff.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
-#! /usr/local/bin/perl
+#!/usr/bin/perl
+
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 
 use strict;
 </diff>
      <filename>build/l10n/trans.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 #! /usr/bin/perl -w
 
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 my $wc =0; # New: count the number of words left to translate!
 
 BEGIN {</diff>
      <filename>build/l10n/wrap.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,11 @@
 #!/usr/bin/perl -w
+
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 use strict;
 
 if (grep { /--help/ } @ARGV) {</diff>
      <filename>build/make-l10n</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 PRODUCT_NAME = Movable Type Core
 
 PRODUCT_VERSION = 4.02
-SCHEMA_VERSION = 4.0034
+SCHEMA_VERSION = 4.0035
 API_VERSION = 4.02
 
 # BUILD_LANGUAGE = en_US
@@ -11,6 +11,7 @@ PORTAL_URL = http://www.sixapart.com/movabletype/
 SUPPORT_URL = http://www.sixapart.com/movabletype/support/
 NEWS_URL = http://www.sixapart.com/movabletype/news/
 NEWSBOX_URL = http://www.sixapart.com/movabletype/news/mt4_news_widget.html
+LEARNINGNEWS_URL = http://learning.movabletype.org/newsbox.html
 HELP_URL = http://www.sixapart.com/movabletype/docs/4.0/
 CATEGORY_NAME_NODASH = 0
 DEFAULT_TIMEZONE = 0</diff>
      <filename>build/mt-dists/default.mk</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@ PORTAL_URL = http://www.sixapart.jp/movabletype/
 SUPPORT_URL = http://www.sixapart.jp/movabletype/support/
 NEWS_URL = http://www.sixapart.jp/movabletype/
 NEWSBOX_URL = http://www.sixapart.jp/movabletype/news/newsbox.html
+LEARNINGNEWS_URL = http://www.movabletype.jp/newsbox.html
 HELP_URL = http://www.movabletype.jp/documentation/
 CATEGORY_NAME_NODASH = 1
 DEFAULT_TIMEZONE = 9</diff>
      <filename>build/mt-dists/ja.mk</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,16 @@
 #!/usr/bin/perl -w
+
+# Movable Type (r) (C) 2001-2007 Six Apart, Ltd. All Rights Reserved.
+# This code cannot be redistributed without permission from www.sixapart.com.
+# For more information, consult your Movable Type license.
 #
 # $Id$
-#
+
 use strict;
 use lib 'extlib', 'lib';
 use ExtUtils::Manifest qw( maniread manicopy mkmanifest );
 use File::Copy;
+use File::Find;
 use File::Spec::Functions;
 use File::Basename;
 use Getopt::Long;
@@ -13,12 +18,14 @@ use Getopt::Long;
 my $langlist = '';
 my $stamp = '';
 my $package = '';
+my $license = '';
 my $silent = 0;
 
 GetOptions(
     'language:s' =&gt; \$langlist,
     'package:s' =&gt; \$package,
     'silent' =&gt; \$silent,
+    'license:s' =&gt; \$license,
     'stamp:s' =&gt; \$stamp,
 ) or die &quot;ERROR: Couldn't get the command-line options&quot;;
 
@@ -40,14 +47,15 @@ my $orig = eval {
 
 my $skip_rules = `cat $skip`;
 if ($skip_rules =~ m/^#\?/m) { # conditional rule
-	move($skip, $skip_bak);
+    move($skip, $skip_bak);
 }
 
 my @languages = split(/,/, $langlist);
 @languages = qw( en_US nl fr de es ja ) unless @languages;
 for my $lang (@languages) {
-	$options{language} = $lang;
-	$options{package} = $package;
+    $options{language} = $lang;
+    $options{package} = $package;
+    $options{license} = $license;
 
     print join(&quot; &quot;, @languages), &quot;\n&quot;;
     my $short_lang = $lang;
@@ -65,7 +73,7 @@ for my $lang (@languages) {
     verbose_command(&quot;$make clean&quot;);  # to clean MT.pm
     verbose_command($make);
 
-	make_manifest_skip($skip_rules, $skip);
+    make_manifest_skip($skip_rules, $skip);
 
     # my $lang_skip = &quot;$skip.$lang&quot;;
     # if (-e $lang_skip) {
@@ -76,6 +84,10 @@ for my $lang (@languages) {
     mkmanifest();
     manicopy(maniread(), $distname, 'best');
 
+    if (($license || '') ne 'GPL') {
+        assign_license( $distname );
+    }
+
     verbose_command(&quot;find $distname -name .exists | xargs rm&quot;);
     verbose_command(&quot;chmod +x $distname/*.cgi&quot;); 
     verbose_command(&quot;chmod +x $distname/tools/*&quot;); 
@@ -94,31 +106,80 @@ END {
     move($skip_bak, $skip) if -e $skip_bak;
 }
 
+sub assign_license {
+    my ($dir) = @_;
+    find( { wanted =&gt; \&amp;process_file_for_license, no_chdir =&gt; 1 },
+        $dir );
+}
+
+sub process_file_for_license {
+    my $file = $_;
+
+    # skip any '.git', '.svn' directory
+    return if $file =~ m! / \. !x;
+
+    # must be a file, not a directory
+    return unless -f $file;
+
+    # must have a source file extension or be a utility script (extensionless)
+    return unless $file =~ m! / ( [A-Za-z0-9_.-]+ \. ( pl | php | pm | cgi | js | t ) | [a-z0-9_-] + ) $ !x;
+
+    my $content;
+    open FIN, &quot;&lt;$file&quot;;
+    {
+        local $/;
+        $content = &lt;FIN&gt;;
+    }
+    close FIN;
+
+    my $open = quotemeta('# Movable Type (r) Open Source (C)');
+
+    # skip file if it doesn't contain the Open Source license
+    return unless $content =~ m/$open/;
+
+    my $close = quotemeta('# GNU General Public License, version 2.');
+
+    # non-distributable license text
+    my $license = &lt;&lt;EOT;
+
+# This code cannot be redistributed without permission from www.sixapart.com.
+# For more information, consult your Movable Type license.
+EOT
+    chomp($license);
+
+    $content =~ s{$open (\d+(-\d+)?).*?$close}
+        { '# Movable Type (r) (C) ' . $1 . ' Six Apart, Ltd. All Rights Reserved.' . $license }se;
+
+    open FOUT, &quot;&gt;$file&quot;;
+    print FOUT $content;
+    close FOUT;
+}
+
 sub make_manifest_skip {
-	my ($rules, $file) = @_;
-	my @rules = split /\n/, $rules;
-
-	my @result;
-	foreach my $rule (@rules) {
-		if ($rule =~ m/^#\?([^=]+)=([^ ]+) +(.+)$/) {
-			# a conditional rule
-			my $var = $1;
-			my $val = $2;
-			my $skip = $3;
-
-			if (($options{$var} || '') eq $val) {
-				push @result, $skip;
-			}
-		}
-		push @result, $rule;
-	}
-
-	my $result = join &quot;\n&quot;, @result;
-
-	local *FOUT;
-	open *FOUT, &quot;&gt;$file&quot;;
-	print FOUT $result;
-	close FOUT;
+    my ($rules, $file) = @_;
+    my @rules = split /\n/, $rules;
+
+    my @result;
+    foreach my $rule (@rules) {
+        if ($rule =~ m/^#\?([^=]+)=([^ ]+) +(.+)$/) {
+            # a conditional rule
+            my $var = $1;
+            my $val = $2;
+            my $skip = $3;
+
+            if (($options{$var} || '') eq $val) {
+                push @result, $skip;
+            }
+        }
+        push @result, $rule;
+    }
+
+    my $result = join &quot;\n&quot;, @result;
+
+    local *FOUT;
+    open *FOUT, &quot;&gt;$file&quot;;
+    print FOUT $result;
+    close FOUT;
 }
 
 sub verbose_command {</diff>
      <filename>build/mt-dists/make-dists</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::L10N::lang_tag;  ## &lt;--- Replace &quot;lang_tag&quot; with proper tag.
 use strict;
 use MT::L10N;</diff>
      <filename>build/sample.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,10 @@
 #!/usr/bin/perl
 
-#is svn working?
-
-# Six Apart Theme Repo
-# https://svn.sixapart.com/repos/themes/
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 
 use strict;
 use warnings;</diff>
      <filename>build/theme-builder.pl</filename>
    </modified>
    <modified>
      <diff>@@ -401,12 +401,12 @@ ul { list-style: disc outside; }
     margin-bottom: 5px;
 }
 
-.widget-cloud .widget-list {
+.widget-tag-cloud .widget-list {
     margin-right: 0;
     margin-left: 0;
 }
 
-.widget-cloud .widget-list-item {
+.widget-tag-cloud .widget-list-item {
     display: inline;
     margin: 0 5px 0 0;
     padding: 0;
@@ -414,23 +414,23 @@ ul { list-style: disc outside; }
     background: none;
 }
 
-.widget-cloud .rank-1  { font-size: 1.75em; }
-.widget-cloud .rank-2  { font-size: 1.75em; }
-.widget-cloud .rank-3  { font-size: 1.625em; }
-.widget-cloud .rank-4  { font-size: 1.5em; }
-.widget-cloud .rank-5  { font-size: 1.375em; }
-.widget-cloud .rank-6  { font-size: 1.25em; }
-.widget-cloud .rank-7  { font-size: 1.125em; }
-.widget-cloud .rank-8  { font-size: 1em; }
-.widget-cloud .rank-9  { font-size: 0.95em; }
-.widget-cloud .rank-10 { font-size: 0.9em; }
+.widget-tag-cloud .rank-1  { font-size: 1.75em; }
+.widget-tag-cloud .rank-2  { font-size: 1.75em; }
+.widget-tag-cloud .rank-3  { font-size: 1.625em; }
+.widget-tag-cloud .rank-4  { font-size: 1.5em; }
+.widget-tag-cloud .rank-5  { font-size: 1.375em; }
+.widget-tag-cloud .rank-6  { font-size: 1.25em; }
+.widget-tag-cloud .rank-7  { font-size: 1.125em; }
+.widget-tag-cloud .rank-8  { font-size: 1em; }
+.widget-tag-cloud .rank-9  { font-size: 0.95em; }
+.widget-tag-cloud .rank-10 { font-size: 0.9em; }
 
 #footer .widget-content {
     margin-top: 0;
     margin-bottom: 0;
 }
 
-.widget-assets .widget-content .widget-list {
+.widget-recent-assets .widget-content .widget-list {
     overflow: auto;
     margin-right: 0;
 }</diff>
      <filename>default_templates/base_theme.mtml</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,9 @@
 &lt;MTSetVar name=&quot;feedback_template&quot; value=&quot;1&quot;&gt;
 &lt;MTSetVarBlock name=&quot;page_title&quot;&gt;&lt;__trans phrase=&quot;Comment on [_1]&quot; params=&quot;&lt;$MTEntryTitle$&gt;&quot;&gt;&lt;/MTSetVarBlock&gt;
 &lt;MTSetVarBlock name=&quot;title&quot;&gt;&lt;$MTBlogName encode_html=&quot;1&quot;$&gt;: &lt;$MTGetVar name=&quot;page_title&quot;$&gt;&lt;/MTSetVarBlock&gt;
+&lt;MTSetVarBlock name=&quot;html_head&quot;&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;$MTLink template=&quot;javascript&quot;$&gt;&quot;&gt;&lt;/script&gt;
+&lt;/MTSetVarBlock&gt;
 
 &lt;$MTInclude module=&quot;&lt;__trans phrase=&quot;Header&quot;&gt;&quot;$&gt;
 </diff>
      <filename>default_templates/comment_preview.mtml</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,6 @@
 &lt;MTSetVar name=&quot;main_template&quot; value=&quot;1&quot;&gt;
 &lt;MTSetVar name=&quot;main_index&quot; value=&quot;1&quot;&gt;
 &lt;MTSetVar name=&quot;sidebar&quot; value=&quot;1&quot;&gt;
-&lt;MTSetVar name=&quot;module_recent_entries&quot; value=&quot;1&quot;&gt;
-&lt;MTSetVar name=&quot;module_category_archives&quot; value=&quot;1&quot;&gt;
-&lt;MTSetVar name=&quot;module_author_archives&quot; value=&quot;1&quot;&gt;
-&lt;MTSetVar name=&quot;module_monthly_archives&quot; value=&quot;1&quot;&gt;
 &lt;MTSetVarBlock name=&quot;title&quot;&gt;&lt;$MTBlogName encode_html=&quot;1&quot;$&gt;&lt;/MTSetVarBlock&gt;
 
 &lt;$MTInclude module=&quot;&lt;__trans phrase=&quot;Header&quot;&gt;&quot;$&gt;</diff>
      <filename>default_templates/main_index.mtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-&lt;__trans phrase=&quot;A new [_3] entitled '[_1]' has been published to [_2].&quot; params=&quot;&lt;$MTEntryTitle$&gt;%%&lt;$MTBlogName$&gt;%%&lt;$MTEntryClassLabel lower_case=&quot;1&quot;$&gt;&quot;&gt;
+&lt;__trans phrase=&quot;A new [lc,_3] entitled '[_1]' has been published to [_2].&quot; params=&quot;&lt;$MTEntryTitle$&gt;%%&lt;$MTBlogName$&gt;%%&lt;$MTEntryClassLabel$&gt;&quot;&gt;
 
-&lt;__trans phrase=&quot;View [_1]:&quot; params=&quot;&lt;$MTEntryClass lower_case=&quot;1&quot;$&gt;&quot;&gt; &lt;&lt;mt:setvarblock name=&quot;entry_status&quot;&gt;&lt;$MTEntryStatus$&gt;&lt;/mt:setvarblock&gt;&lt;mt:if name=&quot;entry_status&quot; eq=&quot;Publish&quot;&gt;&lt;$MTEntryPermalink$&gt;&lt;mt:else&gt;&lt;mt:var name=&quot;entry_editurl&quot;&gt;&lt;/mt:if&gt;&gt;
+&lt;__trans phrase=&quot;View [lc,_1]:&quot; params=&quot;&lt;$MTEntryClass$&gt;&quot;&gt; &lt;&lt;mt:setvarblock name=&quot;entry_status&quot;&gt;&lt;$MTEntryStatus$&gt;&lt;/mt:setvarblock&gt;&lt;mt:if name=&quot;entry_status&quot; eq=&quot;Publish&quot;&gt;&lt;$MTEntryPermalink$&gt;&lt;mt:else&gt;&lt;mt:var name=&quot;entry_editurl&quot;&gt;&lt;/mt:if&gt;&gt;
 
 ------------------------------------------------------------------------
 &lt;__trans phrase=&quot;[_1] Title: [_2]&quot; params=&quot;&lt;$MTEntryClassLabel lower_case=&quot;1&quot;$&gt;%%&lt;$MTEntryTitle$&gt;&quot;&gt;</diff>
      <filename>default_templates/notify-entry.mtml</filename>
    </modified>
    <modified>
      <diff>@@ -4,5 +4,7 @@
 
 &lt;__trans phrase=&quot;_USAGE_FORGOT_PASSWORD_2&quot;&gt;
 
+    &lt;mt:var name=&quot;link_to_login&quot;&gt;
+
 &lt;mt:include module=&quot;&lt;__trans phrase=&quot;Mail Footer&quot;&gt;&quot;&gt;
 </diff>
      <filename>default_templates/recover-password.mtml</filename>
    </modified>
    <modified>
      <diff>@@ -33,7 +33,7 @@
     &lt;/MTIfTagSearch&gt;
 &lt;/MTIf&gt;
 &lt;MTIf name=&quot;module_about_context&quot;&gt;
-        &lt;div class=&quot;widget-welcome widget&quot;&gt;
+        &lt;div class=&quot;widget-about-this-page widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;
     &lt;MTIf name=&quot;entry_template&quot;&gt;
                 &lt;__trans phrase=&quot;About this Entry&quot;&gt;
@@ -109,7 +109,7 @@
         &lt;/div&gt;
 &lt;/MTIf&gt;
 &lt;MTIf name=&quot;module_recent_entries&quot;&gt;
-        &lt;div class=&quot;widget-archives widget&quot;&gt;
+        &lt;div class=&quot;widget-archive widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;Recent Entries&quot;&gt;&lt;/h3&gt;
             &lt;div class=&quot;widget-content&quot;&gt;
                 &lt;ul class=&quot;widget-list&quot;&gt;
@@ -124,8 +124,8 @@
     &lt;MTIfNonZero tag=&quot;AssetCount&quot;&gt;
         &lt;MTAssets type=&quot;image&quot; lastn=&quot;10&quot;&gt;
             &lt;MTAssetsHeader&gt;
-        &lt;div class=&quot;widget-assets widget&quot;&gt;
-            &lt;h3 class=&quot;widget-header&quot;&gt;Photos&lt;/h3&gt;
+        &lt;div class=&quot;widget-recent-assets widget&quot;&gt;
+            &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;Photos&quot;&gt;&lt;/h3&gt;
             &lt;div class=&quot;widget-content&quot;&gt;
                 &lt;ul class=&quot;widget-list&quot;&gt;&lt;/MTAssetsHeader&gt;
                 &lt;li class=&quot;item&quot;&gt;&lt;a class=&quot;asset-image&quot; href=&quot;&lt;$MTAssetURL$&gt;&quot;&gt;&lt;img src=&quot;&lt;$MTAssetThumbnailURL height=&quot;70&quot;$&gt;&quot; class=&quot;asset-img-thumb&quot; alt=&quot;&lt;$MTAssetLabel$&gt;&quot; title=&quot;&lt;$MTAssetLabel$&gt;&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
@@ -136,7 +136,7 @@
         &lt;/MTAssets&gt;
     &lt;/MTIfNonZero&gt;
 &lt;/MTIf&gt; 
-&lt;MTIf name=&quot;module_category_archives&quot;&gt;
+&lt;MTIf name=&quot;main_index&quot;&gt;
     &lt;MTIfArchiveTypeEnabled archive_type=&quot;Category&quot;&gt;
         &lt;div class=&quot;widget-categories widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;Categories&quot;&gt;&lt;/h3&gt;
@@ -161,7 +161,7 @@
     &lt;/MTIfArchiveTypeEnabled&gt;
 &lt;/MTIf&gt;
 &lt;MTIf name=&quot;main_index&quot;&gt;
-        &lt;div class=&quot;widget-cloud widget&quot;&gt;
+        &lt;div class=&quot;widget-tag-cloud widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;Tag Cloud&quot;&gt;&lt;/h3&gt;
             &lt;div class=&quot;widget-content&quot;&gt;
                 &lt;ul class=&quot;widget-list&quot;&gt;
@@ -172,7 +172,7 @@
             &lt;/div&gt;
         &lt;/div&gt;
 &lt;/MTIf&gt;
-&lt;MTIf name=&quot;module_author_archives&quot;&gt;
+&lt;MTIf name=&quot;main_index&quot;&gt;
     &lt;MTIfArchiveTypeEnabled archive_type=&quot;Author&quot;&gt;
         &lt;MTArchiveList archive_type=&quot;Author&quot;&gt;
             &lt;MTArchiveListHeader&gt;
@@ -190,11 +190,11 @@
         &lt;/MTArchiveList&gt;
     &lt;/MTIfArchiveTypeEnabled&gt;
 &lt;/MTIf&gt;
-&lt;MTIf name=&quot;module_monthly_archives&quot;&gt;
+&lt;MTIf name=&quot;main_index&quot;&gt;
     &lt;MTIfArchiveTypeEnabled archive_type=&quot;Monthly&quot;&gt;
         &lt;MTArchiveList archive_type=&quot;Monthly&quot;&gt;
             &lt;MTArchiveListHeader&gt;
-        &lt;div class=&quot;widget-archives widget&quot;&gt;
+        &lt;div class=&quot;widget-archive widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;[_1] &lt;a href=&quot;[_2]&quot;&gt;Archives&lt;/a&gt;&quot; params=&quot;&lt;$MTArchiveTypeLabel$&gt;%%&lt;$MTLink template=&quot;archive_index&quot;$&gt;&quot;&gt;&lt;/h3&gt;
             &lt;div class=&quot;widget-content&quot;&gt;
                 &lt;ul class=&quot;widget-list&quot;&gt;</diff>
      <filename>default_templates/sidebar_2col.mtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;div id=&quot;beta&quot;&gt;
     &lt;div id=&quot;beta-inner&quot;&gt;
 &lt;MTIf name=&quot;module_about_context&quot;&gt;
-        &lt;div class=&quot;widget-welcome widget&quot;&gt;
+        &lt;div class=&quot;widget-about-this-page widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;
     &lt;MTIf name=&quot;entry_template&quot;&gt;
                 &lt;__trans phrase=&quot;About this Entry&quot;&gt;
@@ -77,7 +77,7 @@
         &lt;/div&gt;
 &lt;/MTIf&gt;
 &lt;MTIf name=&quot;main_index&quot;&gt;
-        &lt;div class=&quot;widget-cloud widget&quot;&gt;
+        &lt;div class=&quot;widget-tag-cloud widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;Tag Cloud&quot;&gt;&lt;/h3&gt;
             &lt;div class=&quot;widget-content&quot;&gt;
                 &lt;ul class=&quot;widget-list&quot;&gt;
@@ -88,7 +88,7 @@
             &lt;/div&gt;
         &lt;/div&gt;
 &lt;/MTIf&gt;
-&lt;MTIf name=&quot;module_author_archives&quot;&gt;
+&lt;MTIf name=&quot;main_index&quot;&gt;
     &lt;MTIfArchiveTypeEnabled archive_type=&quot;Author&quot;&gt;
         &lt;MTArchiveList archive_type=&quot;Author&quot;&gt;
             &lt;MTArchiveListHeader&gt;
@@ -106,11 +106,11 @@
         &lt;/MTArchiveList&gt;
     &lt;/MTIfArchiveTypeEnabled&gt;
 &lt;/MTIf&gt;
-&lt;MTIf name=&quot;module_monthly_archives&quot;&gt;
+&lt;MTIf name=&quot;main_index&quot;&gt;
     &lt;MTIfArchiveTypeEnabled archive_type=&quot;Monthly&quot;&gt;
         &lt;MTArchiveList archive_type=&quot;Monthly&quot;&gt;
             &lt;MTArchiveListHeader&gt;
-        &lt;div class=&quot;widget-archives widget&quot;&gt;
+        &lt;div class=&quot;widget-archive widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;[_1] &lt;a href=&quot;[_2]&quot;&gt;Archives&lt;/a&gt;&quot; params=&quot;&lt;$MTArchiveTypeLabel$&gt;%%&lt;$MTLink template=&quot;archive_index&quot;$&gt;&quot;&gt;&lt;/h3&gt;
             &lt;div class=&quot;widget-content&quot;&gt;
                 &lt;ul class=&quot;widget-list&quot;&gt;
@@ -214,7 +214,7 @@
     &lt;/MTIfTagSearch&gt;
 &lt;/MTIf&gt;
 &lt;MTIf name=&quot;module_recent_entries&quot;&gt;
-        &lt;div class=&quot;widget-archives widget&quot;&gt;
+        &lt;div class=&quot;widget-archive widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;Recent Entries&quot;&gt;&lt;/h3&gt;
             &lt;div class=&quot;widget-content&quot;&gt;
                 &lt;ul class=&quot;widget-list&quot;&gt;
@@ -229,8 +229,8 @@
     &lt;MTIfNonZero tag=&quot;AssetCount&quot;&gt;
         &lt;MTAssets type=&quot;image&quot; lastn=&quot;10&quot;&gt;
             &lt;MTAssetsHeader&gt;
-        &lt;div class=&quot;widget-assets widget&quot;&gt;
-            &lt;h3 class=&quot;widget-header&quot;&gt;Photos&lt;/h3&gt;
+        &lt;div class=&quot;widget-recent-assets widget&quot;&gt;
+            &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;Photos&quot;&gt;&lt;/h3&gt;
             &lt;div class=&quot;widget-content&quot;&gt;
                 &lt;ul class=&quot;widget-list&quot;&gt;&lt;/MTAssetsHeader&gt;
                 &lt;li class=&quot;item&quot;&gt;&lt;a class=&quot;asset-image&quot; href=&quot;&lt;$MTAssetURL$&gt;&quot;&gt;&lt;img src=&quot;&lt;$MTAssetThumbnailURL height=&quot;70&quot;$&gt;&quot; class=&quot;asset-img-thumb&quot; alt=&quot;&lt;$MTAssetLabel$&gt;&quot; title=&quot;&lt;$MTAssetLabel$&gt;&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
@@ -241,7 +241,7 @@
         &lt;/MTAssets&gt;
     &lt;/MTIfNonZero&gt;
 &lt;/MTIf&gt; 
-&lt;MTIf name=&quot;module_category_archives&quot;&gt;
+&lt;MTIf name=&quot;main_index&quot;&gt;
     &lt;MTIfArchiveTypeEnabled archive_type=&quot;Category&quot;&gt;
         &lt;div class=&quot;widget-categories widget&quot;&gt;
             &lt;h3 class=&quot;widget-header&quot;&gt;&lt;__trans phrase=&quot;Categories&quot;&gt;&lt;/h3&gt;</diff>
      <filename>default_templates/sidebar_3col.mtml</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,9 @@
 
 package TheSchwartz;
 use strict;
-use fields qw( databases retry_seconds dead_dsns retry_at funcmap_cache verbose all_abilities current_abilities current_job cached_drivers driver_cache_expiration );
+use fields qw( databases retry_seconds dead_dsns retry_at funcmap_cache verbose all_abilities current_abilities current_job cached_drivers driver_cache_expiration scoreboard );
+
+our $VERSION = &quot;1.06&quot;;
 
 use Carp qw( croak );
 use Data::ObjectDriver::Errors;
@@ -34,6 +36,7 @@ sub new {
 
     $client-&gt;{retry_seconds} = delete $args{retry_seconds} || RETRY_DEFAULT;
     $client-&gt;set_verbose(delete $args{verbose});
+    $client-&gt;set_scoreboard(delete $args{scoreboard});
     $client-&gt;{driver_cache_expiration} = delete $args{driver_cache_expiration} || 0;
     croak &quot;unknown options &quot;, join(', ', keys %args) if keys %args;
 
@@ -78,8 +81,8 @@ sub driver_for {
                 ($db-&gt;{prefix} ? (prefix   =&gt; $db-&gt;{prefix}) : ()),
         );
         if ($cache_duration) {
-            $client-&gt;{cached_drivers}{$hashdsn}{driver} = $driver;            
-            $client-&gt;{cached_drivers}{$hashdsn}{create_ts} = $t;                        
+            $client-&gt;{cached_drivers}{$hashdsn}{driver} = $driver;
+            $client-&gt;{cached_drivers}{$hashdsn}{create_ts} = $t;
         }
     }
     return $driver;
@@ -266,6 +269,13 @@ sub find_job_for_workers {
     }
 }
 
+sub get_server_time {
+    my TheSchwartz $client = shift;
+    my($driver) = @_;
+    my $unixtime_sql = $driver-&gt;dbd-&gt;sql_for_unixtime;
+    return $driver-&gt;rw_handle-&gt;selectrow_array(&quot;SELECT $unixtime_sql&quot;);
+}
+
 sub _grab_a_job {
     my TheSchwartz $client = shift;
     my $hashdsn = shift;
@@ -284,8 +294,7 @@ sub _grab_a_job {
         my $worker_class = $job-&gt;funcname;
         my $old_grabbed_until = $job-&gt;grabbed_until;
 
-        my $unixtime_sql = $driver-&gt;dbd-&gt;sql_for_unixtime;
-        my $server_time = $driver-&gt;rw_handle-&gt;selectrow_array(&quot;SELECT $unixtime_sql&quot;)
+        my $server_time = $client-&gt;get_server_time($driver)
             or die &quot;expected a server time&quot;;
 
         $job-&gt;grabbed_until($server_time + ($worker_class-&gt;grab_for || 1));
@@ -321,15 +330,21 @@ sub shuffled_databases {
 sub insert_job_to_driver {
     my $client = shift;
     my($job, $driver, $hashdsn) = @_;
-    #eval {
+    eval {
         ## Set the funcid of the job, based on the funcname. Since each
         ## database has a separate cache, this needs to be calculated based
         ## on the hashed DSN. Also: this might fail, if the database is dead.
         $job-&gt;funcid( $client-&gt;funcname_to_id($driver, $hashdsn, $job-&gt;funcname) );
 
+        ## This is sub-optimal because of clock skew, but something is
+        ## better than a NULL value. And currently, nothing in TheSchwartz
+        ## code itself uses insert_time. TODO: use server time, but without
+        ## having to do a roundtrip just to get the server time.
+        $job-&gt;insert_time(time);
+
         ## Now, insert the job. This also might fail.
         $driver-&gt;insert($job);
-    #};
+    };
     if ($@) {
         unless (OK_ERRORS-&gt;{ $driver-&gt;last_error || 0 }) {
             $client-&gt;mark_database_as_dead($hashdsn);
@@ -564,6 +579,108 @@ sub set_verbose {
     $client-&gt;{verbose} = $logger;
 }
 
+sub scoreboard {
+    my TheSchwartz $client = shift;
+
+    return $client-&gt;{scoreboard};
+}
+
+sub set_scoreboard {
+    my TheSchwartz $client = shift;
+    my ($dir) = @_;
+
+    return unless $dir;
+
+    # They want the scoreboard but don't care where it goes
+    if (($dir eq '1') or ($dir eq 'on')) {
+        # Find someplace in tmpfs to save this
+        foreach my $d (qw(/var/run /dev/shm)) {
+            $dir = $d;
+            last if -e $dir;
+        }
+    }
+
+    $dir .= '/theschwartz';
+    unless (-e $dir) {
+        mkdir($dir, 0755) or die &quot;Can't create scoreboard directory '$dir': $!&quot;;
+    }
+
+    $client-&gt;{scoreboard} = $dir.&quot;/scoreboard.$$&quot;;
+}
+
+sub start_scoreboard {
+    my TheSchwartz $client = shift;
+
+    # Don't do anything if we're not configured to write to the scoreboard
+    my $scoreboard = $client-&gt;scoreboard;
+    return unless $scoreboard;
+
+    # Don't do anything of (for some reason) we don't have a current job
+    my $job = $client-&gt;current_job;
+    return unless $job;
+
+    my $class = $job-&gt;funcname;
+
+    open(SB, '&gt;', $scoreboard)
+      or $job-&gt;debug(&quot;Could not write scoreboard '$scoreboard': $!&quot;);
+    print SB join(&quot;\n&quot;, (&quot;pid=$$&quot;,
+                         'funcname='.($class||''),
+                         'started='.($job-&gt;grabbed_until-($class-&gt;grab_for||1)),
+                         'arg='._serialize_args($job-&gt;arg),
+                        )
+                 ), &quot;\n&quot;;
+    close(SB);
+
+    return;
+}
+
+# Quick and dirty serializer.  Don't use Data::Dumper because we don't need to
+# recurse indefinitely and we want to truncate the output produced
+sub _serialize_args {
+    my ($args) = @_;
+
+    if (ref $args) {
+        if (ref $args eq 'HASH') {
+            return join ',',
+                   map { ($_||'').'='.substr($args-&gt;{$_}||'', 0, 200) }
+                   keys %$args;
+        } elsif (ref $args eq 'ARRAY') {
+            return join ',',
+                   map { substr($_||'', 0, 200) }
+                   @$args;
+        }
+    } else {
+        return $args;
+    }
+}
+
+sub end_scoreboard {
+    my TheSchwartz $client = shift;
+
+    # Don't do anything if we're not configured to write to the scoreboard
+    my $scoreboard = $client-&gt;scoreboard;
+    return unless $scoreboard;
+
+    my $job = $client-&gt;current_job;
+
+    open(SB, '&gt;&gt;', $scoreboard)
+      or $job-&gt;debug(&quot;Could not append scoreboard '$scoreboard': $!&quot;);
+    print SB &quot;done=&quot;.time.&quot;\n&quot;;
+    close(SB);
+
+    return;
+}
+
+sub clean_scoreboard {
+    my TheSchwartz $client = shift;
+
+    # Don't do anything if we're not configured to write to the scoreboard
+    my $scoreboard = $client-&gt;scoreboard;
+    return unless $scoreboard;
+
+    unlink($scoreboard);
+}
+
 # current job being worked.  so if something dies, work_safely knows which to mark as dead.
 sub current_job {
     my TheSchwartz $client = shift;
@@ -575,6 +692,15 @@ sub set_current_job {
     $client-&gt;{current_job} = shift;
 }
 
+DESTROY {
+    foreach my $arg (@_) {
+        # Call 'clean_scoreboard' on TheSchwartz objects
+        if (ref($arg) and $arg-&gt;isa('TheSchwartz')) {
+            $arg-&gt;clean_scoreboard;
+        }
+    }
+}
+
 1;
 
 __END__
@@ -603,14 +729,14 @@ TheSchwartz - reliable job queue
     sub work {
         my $class = shift;
         my TheSchwartz::Job $job = shift;
-        
+
         print &quot;Workin' hard or hardly workin'? Hyuk!!\n&quot;;
 
         $job-&gt;completed();
     }
 
     package main;
-    
+
     my $client = TheSchwartz-&gt;new( databases =&gt; $DATABASE_INFO );
     $client-&gt;can_do('MyWorker');
     $client-&gt;work();
@@ -788,6 +914,10 @@ Find and perform any jobs C&lt;$client&gt; can do, forever. When no job is available,
 the working process will sleep for C&lt;$delay&gt; seconds (or 5, if not specified)
 before looking again.
 
+=head2 C&lt;$client-E&lt;gt&gt;work_on($handle)&gt;
+
+Given a job handle (a scalar string) I&lt;$handle&gt;, runs the job, then returns.
+
 =head2 C&lt;$client-E&lt;gt&gt;find_job_for_workers( [$abilities] )&gt;
 
 Returns a C&lt;TheSchwartz::Job&gt; for a random job that the client can do. If
@@ -808,5 +938,19 @@ Note the C&lt;TheSchwartz&gt; implementation of this function uses a C&lt;LIKE&gt; query to
 find matching jobs, with all the attendant performance implications for your
 job databases.
 
+=head2 C&lt;$client-E&lt;gt&gt;get_server_time( $driver )&gt;
+
+Given an open driver I&lt;$driver&gt; to a database, gets the current server time from the database.
+
+=head1 COPYRIGHT, LICENSE &amp; WARRANTY
+
+This software is Copyright 2007, Six Apart Ltd, cpan@sixapart.com. All
+rights reserved.
+
+TheSchwartz is free software; you may redistribute it and/or modify it
+under the same terms as Perl itself.
+
+TheScwhartz comes with no warranty of any kind.
+
 =cut
 </diff>
      <filename>extlib/TheSchwartz.pm</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,8 @@ sub work_safely {
 
     $job-&gt;debug(&quot;Working on $class ...&quot;);
     $job-&gt;set_as_current;
+    $client-&gt;start_scoreboard;
+
     eval {
         $res = $class-&gt;work($job);
     };
@@ -37,6 +39,8 @@ sub work_safely {
         $cjob-&gt;failed('Job did not explicitly complete, fail, or get replaced');
     }
 
+    $client-&gt;end_scoreboard;
+
     # FIXME: this return value is kinda useless/undefined.  should we even return anything?  any callers? -brad
     return $res;
 }</diff>
      <filename>extlib/TheSchwartz/Worker.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2005-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/BackupRestoreSample/BackupRestoreSample.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/BackupRestoreSample/lib/BackupRestoreSample/Object.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# CommentByGoogleAccount plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# CommentByGoogleAccount plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package MT::Plugin::CommentByGoogleAccount;
 
 use strict;</diff>
      <filename>extras/examples/plugins/CommentByGoogleAccount/CommentByGoogleAccount.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# CommentByGoogleAccount plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# CommentByGoogleAccount plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package CommentByGoogleAccount;
 use strict;
 </diff>
      <filename>extras/examples/plugins/CommentByGoogleAccount/lib/CommentByGoogleAccount.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# FiveStarRating plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# FiveStarRating plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package MT::Plugin::FiveStarRating;
 
 use strict;</diff>
      <filename>extras/examples/plugins/FiveStarRating/plugins/FiveStarRating/FiveStarRating.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2005-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/FiveStarRating/plugins/FiveStarRating/lib/FiveStarRating.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2005-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/FiveStarRating/plugins/FiveStarRating/rate.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# GoogleSearch plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# GoogleSearch plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package MT::Plugin::GoogleSearch;
 
 use strict;</diff>
      <filename>extras/examples/plugins/GoogleSearch/GoogleSearch.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# GoogleSearch plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# GoogleSearch plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package GoogleSearch::L10N;
 use strict;
 use base 'MT::Plugin::L10N';</diff>
      <filename>extras/examples/plugins/GoogleSearch/lib/GoogleSearch/L10N.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,12 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 # GoogleSearch plugin for Movable Type
 # Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
-#
-# $Id: ja.pm 30952 2006-06-13 09:20:43Z jallen $
+# Released under the Artistic and GPLv2 License
 
 package GoogleSearch::L10N::de;
 </diff>
      <filename>extras/examples/plugins/GoogleSearch/lib/GoogleSearch/L10N/de.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# GoogleSearch plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# GoogleSearch plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package GoogleSearch::L10N::en_us;
 
 use strict;</diff>
      <filename>extras/examples/plugins/GoogleSearch/lib/GoogleSearch/L10N/en_us.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,12 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 # GoogleSearch plugin for Movable Type
 # Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
-#
-# $Id: ja.pm 30952 2006-06-13 09:20:43Z jallen $
+# Released under the Artistic and GPLv2 License
 
 package GoogleSearch::L10N::es;
 </diff>
      <filename>extras/examples/plugins/GoogleSearch/lib/GoogleSearch/L10N/es.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,12 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 # GoogleSearch plugin for Movable Type
 # Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
-#
-# $Id: ja.pm 30952 2006-06-13 09:20:43Z jallen $
+# Released under the Artistic and GPLv2 License
 
 package GoogleSearch::L10N::fr;
 </diff>
      <filename>extras/examples/plugins/GoogleSearch/lib/GoogleSearch/L10N/fr.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# GoogleSearch plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# GoogleSearch plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package GoogleSearch::L10N::ja;
 
 use strict;</diff>
      <filename>extras/examples/plugins/GoogleSearch/lib/GoogleSearch/L10N/ja.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,12 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 # GoogleSearch plugin for Movable Type
 # Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
-#
-# $Id: ja.pm 30952 2006-06-13 09:20:43Z jallen $
+# Released under the Artistic and GPLv2 License
 
 package GoogleSearch::L10N::nl;
 </diff>
      <filename>extras/examples/plugins/GoogleSearch/lib/GoogleSearch/L10N/nl.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtgooglesearch($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('google_result_item', 'google_results', '_result_count');
     if (!isset($content)) {</diff>
      <filename>extras/examples/plugins/GoogleSearch/php/block.mtgooglesearch.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtgooglesearchresult($args, &amp;$ctx) {
     $result = $ctx-&gt;stash('google_result_item');
     $prop = $args['property'];</diff>
      <filename>extras/examples/plugins/GoogleSearch/php/function.mtgooglesearchresult.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2005-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/l10nsample/l10nsample.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2005-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/l10nsample/l10nsample.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2005-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/l10nsample/lib/l10nsample.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/l10nsample/lib/l10nsample/L10N.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package l10nsample::L10N::en_us;
 
 use strict;</diff>
      <filename>extras/examples/plugins/l10nsample/lib/l10nsample/L10N/en_us.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package l10nsample::L10N::ja;
 
 use strict;</diff>
      <filename>extras/examples/plugins/l10nsample/lib/l10nsample/L10N/ja.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2004-2007 Six Apart. This code cannot be redistributed without
-# permission from www.movabletype.org.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>extras/examples/plugins/mirror/lib/Mirror.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,8 @@
-#!/usr/bin/perl
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 
 use strict;
 </diff>
      <filename>extras/examples/plugins/mirror/mirror.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 #!/usr/bin/perl -w
 
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 use strict;
 use lib &quot;lib&quot;, ($ENV{MT_HOME} ? &quot;$ENV{MT_HOME}/lib&quot; : &quot;../../lib&quot;);
 use MT::Bootstrap App =&gt; 'Mirror';</diff>
      <filename>extras/examples/plugins/mirror/mt-mirror.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# reCaptcha plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# reCaptcha plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package reCaptcha;
 
 use strict;</diff>
      <filename>extras/examples/plugins/reCaptcha/lib/reCaptcha.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;captcha_lib.php&quot;);
 
 class reCaptcha extends BaseCaptchaProvider {</diff>
      <filename>extras/examples/plugins/reCaptcha/php/init.reCaptcha.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# reCaptcha plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# reCaptcha plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package MT::Plugin::reCaptcha;
 
 use strict;</diff>
      <filename>extras/examples/plugins/reCaptcha/reCaptcha.pl</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
 
             a:link,
             a:visited {
-                color: #61889b;
+                color: #33789c;
             }
 
             a:hover,</diff>
      <filename>index.html.de</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
 
             a:link,
             a:visited {
-                color: #61889b;
+                color: #33789c;
             }
 
             a:hover,</diff>
      <filename>index.html.en_US</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
 
             a:link,
             a:visited {
-                color: #61889b;
+                color: #33789c;
             }
 
             a:hover,</diff>
      <filename>index.html.es</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
 
             a:link,
             a:visited {
-                color: #61889b;
+                color: #33789c;
             }
 
             a:hover,</diff>
      <filename>index.html.fr</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
 
             a:link,
             a:visited {
-                color: #61889b;
+                color: #33789c;
             }
 
             a:hover,</diff>
      <filename>index.html.ja</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
 
             a:link,
             a:visited {
-                color: #61889b;
+                color: #33789c;
             }
 
             a:hover,</diff>
      <filename>index.html.nl</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -481,8 +481,7 @@ sub add_plugin {
         return;
     }
     $plugin-&gt;envelope($plugin_envelope);
-    Carp::confess
-&quot;You cannot register multiple plugin objects from a single script. $plugin_sig&quot;
+    Carp::confess(&quot;You cannot register multiple plugin objects from a single script. $plugin_sig&quot;)
       if exists( $Plugins{$plugin_sig} )
       &amp;&amp; ( exists $Plugins{$plugin_sig}{object} );
 
@@ -961,6 +960,7 @@ sub init_core {
     my $defaults = $c-&gt;{registry}{config_settings};
     $defaults-&gt;{DefaultLanguage}{default} = '__BUILD_LANGUAGE__';
     $defaults-&gt;{NewsboxURL}{default} = '__NEWSBOX_URL__';
+    $defaults-&gt;{LearningNewsURL}{default} = '__LEARNINGNEWS_URL__';
     $defaults-&gt;{SupportURL}{default} = '__SUPPORT_URL__';
     $defaults-&gt;{NewsURL}{default} = '__NEWS_URL__';
     $defaults-&gt;{HelpURL}{default} = '__HELP_URL__';
@@ -1758,7 +1758,7 @@ sub static_file_path {
         if exists $app-&gt;{__static_file_path};
 
     my $path = $app-&gt;config('StaticFilePath');
-    return $app-&gt;{__static_file_path} = $path if $path &amp;&amp; -d $path;
+    return $app-&gt;{__static_file_path} = $path if defined $path;
 
     # Attempt to derive StaticFilePath based on environment
     my $web_path = $app-&gt;config-&gt;StaticWebPath || 'mt-static';
@@ -1934,7 +1934,7 @@ sub build_page {
     }
     pop @{ $param-&gt;{page_titles} };
     if (my $lang_id = $mt-&gt;current_language) {
-        $param-&gt;{local_lang_id} ||= lc $lang_id if $lang_id !~ m/^en/i;
+        $param-&gt;{local_lang_id} ||= lc $lang_id;
     }
     $param-&gt;{magic_token} = $mt-&gt;current_magic if $mt-&gt;user;
 
@@ -1959,16 +1959,12 @@ sub build_page {
     $param-&gt;{packs_installed} = \@packs_installed;
     $param-&gt;{portal_url} = $mt-&gt;translate(&quot;http://www.movabletype.com/&quot;);
 
-    my $tmpl_file;
+    my $tmpl_file = '';
     if (UNIVERSAL::isa($file, 'MT::Template')) {
         $tmpl = $file;
-        $tmpl_file = (exists $file-&gt;{__file}) ? '.'.$file-&gt;{__file} : '';
+        $tmpl_file = (exists $file-&gt;{__file}) ? $file-&gt;{__file} : '';
     } else {
         $tmpl = $mt-&gt;load_tmpl($file) or return;
-        $tmpl_file = '.' . $file;
-    }
-    if ($tmpl_file) {
-        $tmpl_file =~ s/\.tmpl$//;
     }
 
     if (($mode &amp;&amp; ($mode !~ m/delete/)) &amp;&amp; ($mt-&gt;{login_again} ||
@@ -1989,6 +1985,12 @@ sub build_page {
     $tmpl-&gt;context()-&gt;stash('blog', $blog) if $blog;
 
     $tmpl-&gt;param($param) if $param;
+
+    if ($tmpl_file) {
+        $tmpl_file = File::Basename::basename($tmpl_file);
+        $tmpl_file =~ s/\.tmpl$//;
+        $tmpl_file = '.' . $tmpl_file;
+    }
     $mt-&gt;run_callbacks('template_param' . $tmpl_file, $mt, $tmpl-&gt;param, $tmpl);
 
     my $output = $mt-&gt;build_page_in_mem($tmpl);
@@ -2409,7 +2411,7 @@ sub handler_to_coderef {
     if ( $hdlr_pkg =~ s/(-&gt;|::)([^:]+)$// ) {    # strip routine name
         $method = $2 if $1 eq '-&gt;';
     }
-    if ( !defined(&amp;$name) &amp;&amp; !UNIVERSAL::can( $hdlr_pkg, 'AUTOLOAD' ) ) {
+    if ( !defined(&amp;$name) &amp;&amp; !$pkg-&gt;can( 'AUTOLOAD' ) ) {
 
         # The delayed option will return a coderef that delays the loading
         # of the package holding the handler routine.
@@ -2460,7 +2462,7 @@ sub handler_to_coderef {
                 no strict 'refs';
                 my $hdlr = (
                     defined &amp;$name ? \&amp;$name
-                    : ( UNIVERSAL::can( $hdlr_pkg, 'AUTOLOAD' ) ? \&amp;$name
+                    : ( $pkg-&gt;can( 'AUTOLOAD' ) ? \&amp;$name
                         : undef )
                 );
                 use strict 'refs';
@@ -2479,7 +2481,7 @@ sub handler_to_coderef {
               (
                 defined &amp;$name
                 ? \&amp;$name
-                : ( UNIVERSAL::can( $hdlr_pkg, 'AUTOLOAD' ) ? \&amp;$name : undef )
+                : ( $hdlr_pkg-&gt;can( 'AUTOLOAD' ) ? \&amp;$name : undef )
               );
         }
     }
@@ -2659,11 +2661,6 @@ configuration settings.
 Registers the standard set of periodic tasks that Movable Type provides
 and then invokes the C&lt;init_tasks&gt; method for each available plugin.
 
-=head2 MT-&gt;add_task
-
-An alias for L&lt;MT::TaskMgr-E&lt;gt&gt;add_task&gt;. Refer to the L&lt;MT::TaskMgr&gt;
-documentation for more information.
-
 =head2 MT-&gt;run_tasks
 
 Initializes the tasks, running C&lt;init_tasks&gt; and invokes the task system
@@ -2874,86 +2871,6 @@ Adds the plugin described by $plugin to the list of plugins displayed
 on the welcome page. The argument should be an object of the
 I&lt;MT::Plugin&gt; class.
 
-=head2 MT-&gt;add_plugin_action($where, $action_link, $link_text)
-
-An alias to the active L&lt;MT::App&gt; instance C&lt;add_plugin_action&gt; method.
-Please refer to the L&lt;MT::App&gt; module for further documentation.
-
-=head2 MT-&gt;add_itemset_action(\%options)
-
-An alias to the active L&lt;MT::App::CMS&gt; instance C&lt;add_itemset_action&gt; method.
-Please refer to the L&lt;MT::App::CMS&gt; module for further documentation.
-
-=head2 MT-&gt;add_text_filter($key, \%options)
-
-Adds a text filter with the short name I&lt;$key&gt; and the options in
-I&lt;\%options&gt;.
-
-The text filter will be added to MT's list of text filtering options in
-the new/edit entry screen, and will be used for filtering all of the entry
-fields, if the user has enabled filtering for those fields in the template
-(for example, by default the entry body and extended text are both run
-through the filter, but the excerpt is not).
-
-I&lt;$key&gt; should be a lower-case identifier containing only
-alphanumerics and C&lt;_&gt; (that is, matching C&lt;/\w+/&gt;). Since I&lt;$key&gt; is
-stored as the filter name on a per-entry basis, it B&lt;should not change&gt;.
-(In other words, don't call if I&lt;foo&gt; in one version and I&lt;foo_bar&gt; in
-the next, if the filter does the same thing in each version.)
-
-The flip side of this, though, is that if your filter acts differently
-from one version to the next, you B&lt;should&gt; change I&lt;$key&gt;, and you
-should also change the filename of your plugin, so that the old
-implementation--which may be associated with all of the entries in the user's
-system--still works as usual. For example, if your C&lt;foo&gt; plugin changes
-semantics drastically so that paragraph breaks are represented as two
-C&lt;E&lt;lt&gt;br /E&lt;gt&gt;&gt; tags, rather than C&lt;E&lt;lt&gt;pE&lt;gt&gt;&gt; tags, you should change
-the key of the new version to C&lt;foo_2&gt; (for example), and the filename to
-F&lt;foo_2.pl&gt;.
-
-I&lt;%options&gt; can contain:
-
-=over 4
-
-=item * label
-
-The short-but-descriptive label for the filter. This will be displayed in
-the Movable Type UI as the name of the text filter.
-
-=item * on_format
-
-A reference to a subroutine that will be executed to filter a string of
-text. The subroutine will always receive one argument, the string of text to
-filter, and should return the filtered string. In some cases--for example,
-when called while building a template--the subroutine will receive a
-second argument, the I&lt;MT::Template::Context&gt; object handling the build.
-
-See the example below.
-
-=item * docs
-
-The URL (or filename) of a document containing documentation on your filter.
-This will be displayed in a popup window when the user selects your filter
-on the New/Edit Entry screen, then clicks the Help link (C&lt;(?)&gt;).
-
-If the value is a full URL (starting with C&lt;http://&gt;), the popup window
-will open with that URL; otherwise, it is treated as a filename, assumed to
-be in the user's F&lt;docs&gt; folder.
-
-=back
-
-Here's an example of adding a text filter for Wiki formatting, using the
-I&lt;Text::WikiFormat&gt; CPAN module:
-
-    MT-&gt;add_text_filter(wiki =&gt; {
-        label =&gt; 'Wiki',
-        on_format =&gt; sub {
-            require Text::WikiFormat;
-            Text::WikiFormat::format($_[0]);
-        },
-        docs =&gt; 'http://www.foo.com/mt/wiki.html',
-    });
-
 =head2 MT-&gt;all_text_filters
 
 Returns a reference to a hash containing the registry of text filters.
@@ -2979,12 +2896,6 @@ I&lt;$entry&gt;, you would use
 
     my $out = MT-&gt;apply_text_filters($entry-&gt;text, $entry-&gt;text_filters);
 
-=head2 MT-&gt;add_log_class($class)
-
-Registers a new L&lt;MT::Log&gt; subclass with MT, which is used for presenting
-specific types of log records in the activity log and activity feeds. See
-L&lt;MT::Log&gt; for further documentation on custom log classes.
-
 =head2 MT-&gt;add_callback($meth, $priority, $plugin, $code)
 
 Registers a new callback handler for a particular registered callback.
@@ -3053,21 +2964,6 @@ Which would execute any handlers that registered in this fashion:
 
     MT-&gt;add_callback('MyClass::frobnitzes', 4, $plugin, \&amp;frobnitz_hdlr);
 
-=head2 MT-&gt;register_junk_filter( $filter )
-
-Registers a new L&lt;MT::JunkFilter&gt; with Movable Type. Junk filters are
-used to identify spam for incoming feedback. Please see documentation
-for L&lt;MT::JunkFilter&gt; for more information.
-
-Example:
-
-    require MT::JunkFilter;
-    MT-&gt;register_junk_filter(new MT::JunkFilter({
-        name =&gt; &quot;My Junk Filter&quot;,
-        code =&gt; sub { $plugin-&gt;my_junk_filter(@_) },
-        plugin =&gt; $plugin,
-    }));
-
 =head2 MT-&gt;run_callback($cb[, $arg1, $arg2, ...])
 
 An internal routine used by C&lt;run_callbacks&gt; to invoke a single</diff>
      <filename>lib/MT.pm.pre</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -11,7 +11,7 @@ use base qw( MT );
 
 use File::Spec;
 use MT::Request;
-use MT::Util qw( encode_html offset_time_list decode_html encode_url is_valid_email is_valid_url );
+use MT::Util qw( encode_html offset_time_list decode_html encode_url is_valid_email is_url );
 use MT::I18N qw( encode_text wrap_text );
 
 my $COOKIE_NAME = 'mt_user';
@@ -176,6 +176,7 @@ sub filter_conditional_list {
         }
         return \%list;
     }
+    return undef;
 }
 
 sub page_actions {
@@ -262,6 +263,7 @@ sub listing {
       || 'list_' . $type . '.tmpl';
     my $iter_method = $opt-&gt;{iterator} || $opt-&gt;{Iterator} || 'load_iter';
     my $param       = $opt-&gt;{params}   || $opt-&gt;{Params}   || {};
+    $param-&gt;{listing_screen} = 1;
     my $add_pseudo_new_user = delete $param-&gt;{pseudo_new_user}
       if exists $param-&gt;{pseudo_new_user};
     my $hasher  = $opt-&gt;{code}    || $opt-&gt;{Code};
@@ -702,6 +704,8 @@ sub init_request {
             $app-&gt;{query} = CGI-&gt;new( $app-&gt;{no_read_body} ? {} : () );
         }
     }
+    $app-&gt;init_query();
+
     $app-&gt;{return_args} = $app-&gt;{query}-&gt;param('return_args');
     $app-&gt;cookies;
 
@@ -714,6 +718,25 @@ sub init_request {
     $app-&gt;{init_request} = 1;
 }
 
+sub init_query {
+    my $app = shift;
+    my $q = $app-&gt;{query};
+    # CGI.pm has this terrible flaw in that if a POST is in effect,
+    # it totally ignores any query parameters.
+    if ($app-&gt;request_method eq 'POST') {
+        my $query_string;
+        if ($ENV{MOD_PERL}) {
+            $query_string = $q-&gt;r-&gt;args;
+        } else {
+            $query_string = $ENV{'QUERY_STRING'} if defined $ENV{'QUERY_STRING'};
+            $query_string ||= $ENV{'REDIRECT_QUERY_STRING'} if defined $ENV{'REDIRECT_QUERY_STRING'};
+        }
+        if (defined($query_string) and $query_string ne '') {
+            $q-&gt;parse_params($query_string);
+        }
+    }
+}
+
 sub registry {
     my $app = shift;
     my $ar = $app-&gt;SUPER::registry(&quot;applications&quot;, $app-&gt;id, @_);
@@ -1230,7 +1253,7 @@ sub _is_commenter {
                 last;
             }
         }
-        return $app-&gt;error($app-&gt;translate('You do not have rights; please contact your Movable Type system administrator for gaining access to this installation.'))
+        return $app-&gt;error($app-&gt;translate('Our apologies, but you do not have permission to access any blogs within this installation. If you feel you have reached this message in error, please contact your Movable Type system administrator.'))
             unless $has_system_permission;
         return -1;
     } 
@@ -1525,7 +1548,7 @@ sub create_user_pending {
         }
 
         $url = $q-&gt;param('url');
-        if ( $url &amp;&amp; !is_valid_url($url) ) {
+        if ( $url &amp;&amp; !is_url($url) ) {
             return $app-&gt;error($app-&gt;translate(&quot;URL is invalid.&quot;));
         }
     }
@@ -1832,7 +1855,7 @@ sub request_method {
         if ($ENV{MOD_PERL}) {
             $app-&gt;{request_method} = Apache-&gt;request-&gt;method;
         } else {
-            $app-&gt;{request_method} = $ENV{REQUEST_METHOD};
+            $app-&gt;{request_method} = $ENV{REQUEST_METHOD} || '';
         }
     }
     $app-&gt;{request_method};</diff>
      <filename>lib/MT/App.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -19,11 +19,16 @@ sub init {
     my $app = shift;
     $app-&gt;SUPER::init(@_) or return;
     $app-&gt;{template_dir} = 'feeds';
-    $app-&gt;{requires_login} = 1;
     $app-&gt;{is_admin} = 1;
     $app-&gt;init_core_callbacks();
 }
 
+sub init_request {
+    my $app = shift;
+    $app-&gt;SUPER::init_request(@_);
+    $app-&gt;{requires_login} = 1;
+}
+
 # Defines the basic MT activity feeds.
 sub init_core_callbacks {
     my $app = shift;
@@ -276,7 +281,12 @@ sub apply_log_filter {
                     $arg{'level'} = \@types;
                 }
             } elsif ($filter_col eq 'class') {
-                $arg{class} = [ split /,/, $val ];
+                if ($val eq 'publish') {
+                    $arg{category} = 'publish';
+                }
+                else {
+                    $arg{class} = [ split /,/, $val ];
+                }
             }
         }
         $arg{blog_id} = [ split /,/, $param-&gt;{blog_id} ]
@@ -509,8 +519,12 @@ sub _feed_system {
     }
 
     my $args = {};
-    $args-&gt;{filter} = $filter || 'class';
-    $args-&gt;{filter_val} = $filter_val || 'system,page,entry,comment,ping,search';
+    unless ($filter &amp;&amp; $filter_val) {
+        $filter = 'class';
+        $filter_val = '*';
+    }
+    $args-&gt;{filter} = $filter;
+    $args-&gt;{filter_val} = $filter_val;
     $args-&gt;{blog_id} = $blog_id if $blog_id;
     my $link = $app-&gt;base . $app-&gt;mt_uri( mode =&gt; 'view_log', args =&gt; $args );
     my $param = {</diff>
      <filename>lib/MT/App/ActivityFeeds.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -15,7 +15,7 @@ use MT::Util qw( encode_html format_ts offset_time_list offset_time epoch2ts
   remove_html get_entry mark_odd_rows first_n_words
   perl_sha1_digest_hex is_valid_email relative_date ts2epoch
   perl_sha1_digest encode_url dirify encode_js is_valid_date
-  archive_file_for is_valid_url );
+  archive_file_for is_url );
 use MT::I18N qw( substr_text const length_text wrap_text encode_text
   break_up_text first_n_text guess_encoding );
 use CGI;
@@ -194,6 +194,8 @@ sub core_methods {
         'restore_premature_cancel' =&gt; \&amp;restore_premature_cancel,
         'adjust_sitepath'          =&gt; \&amp;adjust_sitepath,
         'system_check'             =&gt; \&amp;system_check,
+        'dialog_refresh_templates' =&gt; \&amp;dialog_refresh_templates,
+        'refresh_all_templates'    =&gt; \&amp;refresh_all_templates,
 
         ## Comment Replies
         reply         =&gt; \&amp;reply,
@@ -309,6 +311,31 @@ sub core_blog_stats_tabs {
     };
 }
 
+sub core_page_actions {
+    return {
+        list_templates =&gt; {
+            refresh_all_blog_templates =&gt; {
+                label =&gt; &quot;Refresh Blog Templates&quot;,
+                dialog =&gt; 'dialog_refresh_templates',
+                condition =&gt; sub {
+                    MT-&gt;app-&gt;blog,
+                },
+                order =&gt; 1000,
+            },
+            refresh_global_templates =&gt; {
+                label =&gt; &quot;Refresh Global Templates&quot;,
+                code =&gt; sub {
+                    MT-&gt;app-&gt;param('no_backup', 1);
+                        MT::Plugin::TemplateRefresh-&gt;instance-&gt;refresh_all_templates(@_) },
+                condition =&gt; sub {
+                    ! MT-&gt;app-&gt;blog,
+                },
+                order =&gt; 1000,
+                continue_prompt =&gt; MT-&gt;translate('This action will restore your global templates to factory settings without creating a backup. Click OK to continue or Cancel to abort.'),
+            },
+        },
+    };
+}
 sub js_recent_entries_for_tag {
     my $app          = shift;
     my $user         = $app-&gt;user or return;
@@ -594,6 +621,14 @@ sub init_request {
 
     my $mode = $app-&gt;mode;
 
+    # Global 'blog_id' parameter check; if we get something
+    # other than an integer, die
+    if (my $blog_id = $app-&gt;param('blog_id')) {
+        if ($blog_id ne int($blog_id)) {
+            die $app-&gt;translate(&quot;Invalid request&quot;);
+        }
+    }
+
     if (   ( $mode ne 'logout' )
         &amp;&amp; ( $mode ne 'start_recover' )
         &amp;&amp; ( $mode ne 'recover' )
@@ -684,8 +719,9 @@ sub core_list_actions {
                 code       =&gt; \&amp;publish_entries,
                 permission =&gt; 'manage_pages',
                 condition  =&gt; sub {
+                    return 0 if $app-&gt;mode eq 'view';
                     return $app-&gt;blog &amp;&amp; $app-&gt;blog-&gt;site_path ? 1 : 0;
-                  }
+                },
             },
             'set_draft' =&gt; {
                 label      =&gt; &quot;Unpublish Pages&quot;,
@@ -693,8 +729,9 @@ sub core_list_actions {
                 code       =&gt; \&amp;draft_entries,
                 permission =&gt; 'manage_pages',
                 condition  =&gt; sub {
+                    return 0 if $app-&gt;mode eq 'view';
                     return $app-&gt;blog &amp;&amp; $app-&gt;blog-&gt;site_path ? 1 : 0;
-                  }
+                },
             },
             'add_tags' =&gt; {
                 label       =&gt; &quot;Add Tags...&quot;,
@@ -703,6 +740,9 @@ sub core_list_actions {
                 input       =&gt; 1,
                 input_label =&gt; 'Tags to add to selected pages',
                 permission  =&gt; 'manage_pages',
+                condition   =&gt; sub {
+                    return 0 if $app-&gt;mode eq 'view';
+                },
             },
             'remove_tags' =&gt; {
                 label       =&gt; &quot;Remove Tags...&quot;,
@@ -711,12 +751,16 @@ sub core_list_actions {
                 input       =&gt; 1,
                 input_label =&gt; 'Tags to remove from selected pages',
                 permission  =&gt; 'manage_pages',
+                condition   =&gt; sub {
+                    return 0 if $app-&gt;mode eq 'view';
+                },
             },
             'open_batch_editor' =&gt; {
                 label     =&gt; &quot;Batch Edit Pages&quot;,
                 code      =&gt; \&amp;open_batch_editor,
                 order     =&gt; 500,
                 condition =&gt; sub {
+                    return 0 if $app-&gt;mode eq 'view';
                     $app-&gt;param('blog_id')
                       &amp;&amp; ( $app-&gt;user-&gt;is_superuser()
                         || $app-&gt;permissions-&gt;can_manage_pages );
@@ -822,6 +866,34 @@ sub core_list_actions {
                 },
             },
         },
+        'blog' =&gt; {
+            refresh_blog_templates =&gt; {
+                label =&gt; &quot;Refresh Template(s)&quot;,
+                code =&gt; sub { MT-&gt;app-&gt;refresh_all_templates(@_) },
+            },
+        },
+        'template' =&gt; {
+            refresh_tmpl_templates =&gt; {
+                label =&gt; &quot;Refresh Template(s)&quot;,
+                code =&gt; sub { MT-&gt;app-&gt;refresh_individual_templates(@_) },
+                permission =&gt; 'edit_templates',
+            },
+            publish_index_templates =&gt; {
+                label =&gt; &quot;Publish Template(s)&quot;,
+                code =&gt; sub { MT-&gt;app-&gt;publish_index_templates(@_) },
+                permission =&gt; 'rebuild',
+                condition =&gt; sub {
+                    my $app = MT-&gt;app;
+                    my $tmpl_type = $app-&gt;param('filter_key');
+                    return $app-&gt;mode eq 'itemset_action'  ? 1
+                         : !$app-&gt;blog                     ? 0
+                         : !$tmpl_type                     ? 0
+                         : $tmpl_type eq 'index_templates' ? 1
+                         :                                   0
+                         ;
+                },
+            },
+        },
     };
 }
 
@@ -1277,6 +1349,14 @@ sub core_list_filters {
                     !$app-&gt;param('blog_id');
                 },
             },
+            backup_templates =&gt; {
+                label   =&gt; &quot;Backup Templates&quot;,
+                order   =&gt;  10000,
+                handler =&gt; sub {
+                    my ($terms) = @_;
+                    $terms-&gt;{type} = 'backup';
+                },
+            },
             system_templates =&gt; {
                 label   =&gt; &quot;System Templates&quot;,
                 order   =&gt; 500,
@@ -1829,8 +1909,16 @@ sub init_core_callbacks {
             $pkg . 'not_junk_test' =&gt; \&amp;_cb_notjunktest_filter,
 
             # assets
+            $pkg
+              . 'view_permission_filter.asset' =&gt;
+              \&amp;CMSViewPermissionFilter_asset,
+            $pkg
+              . 'delete_permission_filter.asset' =&gt;
+              \&amp;CMSDeletePermissionFilter_asset,
+            $pkg . 'pre_save.asset'    =&gt; \&amp;CMSPreSave_asset,
             $pkg . 'post_save.asset'   =&gt; \&amp;CMSPostSave_asset,
             $pkg . 'post_delete.asset' =&gt; \&amp;CMSPostDelete_asset,
+            'template_param.edit_asset' =&gt; \&amp;CMSTemplateParam_edit_asset,
         }
     );
 }
@@ -2067,8 +2155,9 @@ sub reset_password {
     my $mail_enc = uc( $app-&gt;config('MailEncoding') || $charset );
     $head{'Content-Type'} = qq(text/plain; charset=&quot;$mail_enc&quot;);
 
-    my $body =
-      $app-&gt;build_email( 'recover-password.tmpl', { user_password =&gt; $pass } );
+    my $body = $app-&gt;build_email( 'recover-password.tmpl',
+        { user_password =&gt; $pass, link_to_login =&gt; $app-&gt;base . $app-&gt;mt_uri } 
+    );
     $body = wrap_text( $body, 72 );
     require MT::Mail;
     MT::Mail-&gt;send( \%head, $body )
@@ -2179,12 +2268,17 @@ sub _merge_default_assignments {
 
 sub build_asset_hasher {
     my $app = shift;
+    my (%param) = @_;
+    my ($default_thumb_width, $default_thumb_height, $default_preview_width,
+        $default_preview_height) =
+        @param{qw( ThumbWidth ThumbHeight PreviewWidth PreviewHeight )};
 
     require File::Basename;
     require JSON;
     my %blogs;
     return sub {
-        my ( $obj, $row ) = @_;
+        my ( $obj, $row, %param ) = @_;
+        my ($thumb_width, $thumb_height) = @param{qw( ThumbWidth ThumbHeight )};
         my $blog = $blogs{ $obj-&gt;blog_id } ||= $obj-&gt;blog;
         $row-&gt;{blog_name} = $blog ? $blog-&gt;name : '-';
         $row-&gt;{url} = $obj-&gt;url; # this has to be called to calculate
@@ -2216,8 +2310,23 @@ sub build_asset_hasher {
         my $meta = $obj-&gt;metadata;
         if ($obj-&gt;has_thumbnail) { 
             $row-&gt;{has_thumbnail} = 1;
-            my ($thumb_file) = $obj-&gt;thumbnail_url( Height =&gt; 240, Width =&gt; 350 );
-            $row-&gt;{thumbnail_url} = $meta-&gt;{thumbnail_url} = $thumb_file;
+            my $height = $thumb_height || $default_thumb_height || 240;
+            my $width  = $thumb_width  || $default_thumb_width  || 350;
+            @$meta{qw( thumbnail_url thumbnail_width thumbnail_height )}
+              = $obj-&gt;thumbnail_url( Height =&gt; $height, Width =&gt; $width );
+
+            $meta-&gt;{thumbnail_width_offset}  = int(($width  - $meta-&gt;{thumbnail_width})  / 2);
+            $meta-&gt;{thumbnail_height_offset} = int(($height - $meta-&gt;{thumbnail_height}) / 2);
+
+            if ($default_preview_width &amp;&amp; $default_preview_height) {
+                @$meta{qw( preview_url preview_width preview_height )}
+                  = $obj-&gt;thumbnail_url(
+                    Height =&gt; $default_preview_height,
+                    Width  =&gt; $default_preview_width,
+                );
+                $meta-&gt;{preview_width_offset}  = int(($default_preview_width  - $meta-&gt;{preview_width})  / 2);
+                $meta-&gt;{preview_height_offset} = int(($default_preview_height - $meta-&gt;{preview_height}) / 2);
+            }
         }
 
         my $ts = $obj-&gt;created_on;
@@ -2232,7 +2341,10 @@ sub build_asset_hasher {
               format_ts( LISTING_TIMESTAMP_FORMAT, $ts, $blog, $app-&gt;user ? $app-&gt;user-&gt;preferred_language : undef );
             $row-&gt;{created_on_relative} = relative_date( $ts, time, $blog );
         }
+
+        @$row{keys %$meta} = values %$meta;
         $row-&gt;{metadata_json} = JSON::objToJson($meta);
+        $row;
     };
 }
 
@@ -2283,7 +2395,8 @@ sub list_assets {
         }
     }
 
-    my $hasher = $app-&gt;build_asset_hasher;
+    my $hasher = $app-&gt;build_asset_hasher( ThumbWidth =&gt; 75, ThumbHeight =&gt; 75,
+        PreviewWidth =&gt; 240, PreviewHeight =&gt; 240 );
 
     if ($class_filter) {
         my $asset_pkg = MT::Asset-&gt;class_handler($class_filter);
@@ -2312,6 +2425,7 @@ sub list_assets {
     my $perms = $app-&gt;permissions;
     my %carry_params = map { $_ =&gt; $app-&gt;param($_) || '' }
         (qw( edit_field upload_mode require_type next_mode asset_select ));
+    $app-&gt;_set_start_upload_params(\%carry_params);
     $app-&gt;listing(
         {
             terms    =&gt; \%terms,
@@ -2425,6 +2539,7 @@ sub list_roles {
                 has_expanded_mode =&gt; 1,
                 search_label      =&gt; $app-&gt;translate('Users'),
                 object_type       =&gt; 'role',
+                screen_id         =&gt; 'list-role',
             },
         }
     );
@@ -2648,6 +2763,7 @@ sub list_associations {
                 search_label =&gt; $app-&gt;translate('Users'),
                 object_type  =&gt; 'association',
                 pt_name =&gt; $app-&gt;translate('User'),
+                screen_id =&gt; &quot;list-associations&quot;,
             },
         }
     );
@@ -2776,7 +2892,8 @@ sub list_tag_for {
     $param{limit}                   = $limit;
     $param{offset}                  = $offset;
     $param{tag_object_type}         = $params{TagObjectType};
-    $param{tag_object_label_plural} = $params{TagObjectLabelPlural};
+    $param{tag_object_label}        = $params{TagObjectLabel} || $pkg-&gt;class_label;
+    $param{tag_object_label_plural} = $params{TagObjectLabelPlural} || $pkg-&gt;class_label_plural;
     $param{object_label}            = $tag_class-&gt;class_label;
     $param{object_label_plural}     = $tag_class-&gt;class_label_plural;
     $param{object_type}             = 'tag';
@@ -2797,6 +2914,7 @@ sub list_tag_for {
     $app-&gt;add_breadcrumb( $app-&gt;translate('Tags') );
     $param{screen_class} = &quot;list-tag&quot;;
     $param{screen_id} = &quot;list-tag&quot;;
+    $param{listing_screen} = 1;
 
     $app-&gt;load_tmpl( 'list_tag.tmpl', \%param );
 }
@@ -3549,73 +3667,20 @@ sub build_menus {
 
 sub get_newsbox_content {
     my $app = shift;
-
     my $newsbox_url = $app-&gt;config('NewsboxURL');
     if ( $newsbox_url &amp;&amp; $newsbox_url ne 'disable' ) {
-        my $NEWSCACHE_TIMEOUT = 60 * 60 * 24;
-        my $sess_class        = $app-&gt;model('session');
-        my ($news_object)     = (&quot;&quot;);
-        my $retries           = 0;
-        $news_object = $sess_class-&gt;load( { id =&gt; 'NW' } );
-        my $refresh_news;
-        if ( $news_object
-            &amp;&amp; ( $news_object-&gt;start() &lt; ( time - $NEWSCACHE_TIMEOUT ) ) )
-        {
-            $refresh_news = 1;
-        }
-        my $last_available_news = encode_text( $news_object-&gt;data(), 'utf-8', undef )
-          if $news_object;
-        return $last_available_news unless $refresh_news || !$news_object;
-
-        # don't block the dashboard for more than 10 seconds to fetch
-        # the news feed...
-        my $ua = $app-&gt;new_ua( { timeout =&gt; 10 } );
-        return $last_available_news unless $ua;
-
-        my $req = new HTTP::Request( GET =&gt; $newsbox_url );
-        my $resp = $ua-&gt;request($req);
-        my $result = $resp-&gt;content();
-        if ( !$resp-&gt;is_success() || !$result ) {
-            # failure; either timeout or worse
-            # if news_object is available, bump up it's expiration
-            # so we don't attempt to hit the server again
-            # for an hour
-            if (! $news_object ) {
-                $news_object = MT::Session-&gt;new;
-                $news_object-&gt;set_values(
-                    {
-                        id    =&gt; 'NW',
-                        kind  =&gt; 'NW',
-                        data  =&gt; ''
-                    }
-                );
-                $last_available_news = '';
-                $refresh_news = 1;
-            }
-            if (defined($last_available_news) &amp;&amp; $refresh_news) {
-                $news_object-&gt;start( ( time - $NEWSCACHE_TIMEOUT ) + 60 * 60 );
-                $news_object-&gt;save;
-            }
-            return $last_available_news;
-        }
-        require MT::Sanitize;
+        return MT::Util::get_newsbox_html($newsbox_url, 'NW');
+    }
+    return q();
+}
 
-        # allowed html
-        my $spec = 'a href,* style class id,ul,li,div,span,br';
-        $result = MT::Sanitize-&gt;sanitize( $result, $spec );
-        $news_object = MT::Session-&gt;new();
-        $news_object-&gt;set_values(
-            {
-                id    =&gt; 'NW',
-                kind  =&gt; 'NW',
-                start =&gt; time(),
-                data  =&gt; $result
-            }
-        );
-        $news_object-&gt;save();
-        $result = encode_text( $result, 'utf-8', undef );
-        return $result;
+sub get_lmt_content {
+    my $app = shift;
+    my $newsbox_url = $app-&gt;config('LearningNewsURL');
+    if ( $newsbox_url &amp;&amp; $newsbox_url ne 'disable' ) {
+        return MT::Util::get_newsbox_html($newsbox_url, 'LW', 1); #cached only
     }
+    return q();
 }
 
 sub make_blog_list {
@@ -3983,6 +4048,7 @@ sub mt_news_widget {
     my ( $tmpl, $param ) = @_;
 
     $param-&gt;{news_html} = $app-&gt;get_newsbox_content() || '';
+    $param-&gt;{learning_mt_news_html} = $app-&gt;get_lmt_content() || '';
 }
 
 sub this_is_you_widget {
@@ -4032,14 +4098,15 @@ sub this_is_you_widget {
     if ($last_post) {
         $param-&gt;{last_post_id}      = $last_post-&gt;id;
         $param-&gt;{last_post_blog_id} = $last_post-&gt;blog_id;
+        $param-&gt;{last_post_blog_name} = $last_post-&gt;blog-&gt;name;
         $param-&gt;{last_post_ts}      = $last_post-&gt;authored_on;
     }
 
     if (my ($url) = $user-&gt;userpic_url()) {
         $param-&gt;{author_userpic_url}    = $url;
-        $param-&gt;{author_userpic_width}  = 50;
-        $param-&gt;{author_userpic_height} = 50;
     }
+    $param-&gt;{author_userpic_width}  = 50;
+    $param-&gt;{author_userpic_height} = 50;
 }
 
 sub list_pref {
@@ -4253,6 +4320,9 @@ sub list_blogs {
     $param{nav_weblogs} = 1;
     $param{object_label} = $blog_class-&gt;class_label;
     $param{object_label_plural} = $blog_class-&gt;class_label_plural;
+    $param{screen_class} = &quot;list-blog&quot;;
+    $param{screen_id} = &quot;list-blog&quot;;
+    $param{listing_screen} = 1;
     return $app-&gt;load_tmpl( 'list_blog.tmpl', \%param );
 }
 
@@ -4361,6 +4431,7 @@ sub list_member {
         $row-&gt;{role_loop} = \@role_loop;
         $row-&gt;{auth_icon_url} = $obj-&gt;auth_icon_url;
     };
+    $param-&gt;{screen_id} = &quot;list-member&quot;;
 
     return $app-&gt;listing(
         {
@@ -4406,8 +4477,7 @@ sub list_authors {
             $terms{$filter_col} = $val;
             $param{filter}      = $filter_col;
             $param{filter_val}  = $val;
-            my $url_val = encode_url($val);
-            $param{filter_args} = &quot;&amp;filter=$filter_col&amp;filter_val=$url_val&quot;;
+            $param{filter_args} = &quot;&amp;filter=&quot; . encode_url($filter_col) . &quot;&amp;filter_val=&quot; . encode_url($val);
         }
     } elsif ($filter_key) {
         my $filters = $app-&gt;registry(&quot;list_filters&quot;, &quot;sys_user&quot;) || {};
@@ -4505,6 +4575,8 @@ sub list_authors {
       $app-&gt;page_actions('list_authors');
 
     $param{nav_authors} = 1;
+    $param{listing_screen} = 1;
+    $param{screen_id} = &quot;list-author&quot;;
     my $tmpl_file = $param{output} || 'list_author.tmpl';
     $app-&gt;load_tmpl( $tmpl_file, \%param );
 }
@@ -4630,7 +4702,12 @@ sub apply_log_filter {
                 }
             }
             elsif ( $filter_col eq 'class' ) {
-                $arg{class} = [ split /,/, $val ];
+                if ($val eq 'publish') {
+                    $arg{category} = 'publish';
+                }
+                else {
+                    $arg{class} = [ split /,/, $val ];
+                }
             }
         }
         $arg{blog_id} = [ split /,/, $param-&gt;{blog_id} ]
@@ -4670,8 +4747,7 @@ sub view_log {
         $param{filter_val} = $val;
         my %filter_arg = %{ $app-&gt;apply_log_filter( \%param ) };
         $terms-&gt;{$_} = $filter_arg{$_} foreach keys %filter_arg;
-        my $url_val = encode_url($val);
-        $param{filter_args} = &quot;&amp;filter=$filter_col&amp;filter_val=$url_val&quot;;
+        $param{filter_args} = &quot;&amp;filter=&quot; . encode_url($filter_col) . &quot;&amp;filter_val=&quot; . encode_url($val);
     }
 
     # all classes of log objects
@@ -4710,6 +4786,10 @@ sub view_log {
       {
         class_name  =&gt; 'search',
         class_label =&gt; $app-&gt;translate(&quot;Search&quot;),
+      },
+      {
+        class_name  =&gt; 'publish',
+        class_label =&gt; $app-&gt;translate(&quot;Publishing&quot;),
       };
     @class_loop = sort { $a-&gt;{class_label} cmp $b-&gt;{class_label} } @class_loop;
     $param{class_loop} = \@class_loop;
@@ -4750,6 +4830,8 @@ sub view_log {
     $param{nav_log}      = 1;
     $param{feed_name}    = $app-&gt;translate(&quot;System Activity Feed&quot;);
     $param{screen_class} = &quot;list-log&quot;;
+    $param{screen_id} = &quot;list-log&quot;;
+    $param{listing_screen} = 1;
     $param{feed_url} =
       $app-&gt;make_feed_link( 'system',
         $blog_id ? { blog_id =&gt; $blog_id } : undef );
@@ -4969,14 +5051,7 @@ sub export_log {
             )
           };
     } else {
-        %terms = %{
-            $app-&gt;apply_log_filter(
-                {
-                    filter     =&gt; 'class',
-                    filter_val =&gt; 'system,page,entry,comment,ping,search'
-                }
-            )
-          };
+        %terms = ( class =&gt; '*' );
     }
     if ($blog) {
         $terms{blog_id} = $blog-&gt;id;
@@ -6281,6 +6356,77 @@ sub edit_object {
             $param{type_author} = 1
               if MT::Author::AUTHOR() == $obj-&gt;type;
         }
+        elsif ( $type eq 'asset' ) {
+            my $asset_class = $app-&gt;model('asset');
+            $param{asset} = $obj;
+            $param{search_label} = $app-&gt;translate('Assets');
+
+            my $hasher = $app-&gt;build_asset_hasher( ThumbWidth =&gt; 75, ThumbHeight =&gt; 75 );
+            $hasher-&gt;($obj, \%param, ThumbWidth =&gt; 240, ThumbHeight =&gt; 240);
+
+            my $tag_delim = chr( $app-&gt;user-&gt;entry_prefs-&gt;{tag_delim} );
+            require MT::Tag;
+            my $tags = MT::Tag-&gt;join( $tag_delim, $obj-&gt;tags );
+            $param{tags} = $tags;
+
+            my @related;
+            if ($obj-&gt;parent) {
+                my $parent = $asset_class-&gt;load($obj-&gt;parent);
+                push @related, $hasher-&gt;($parent, { asset =&gt; $parent, is_parent =&gt; 1 });
+
+                push @related, map { $hasher-&gt;($_, { asset =&gt; $_, is_sibling =&gt; 1 }) }
+                    $asset_class-&gt;search({
+                        id     =&gt; { op =&gt; '!=', value =&gt; $obj-&gt;id },
+                        class  =&gt; '*',
+                        parent =&gt; $obj-&gt;parent
+                    });
+            }
+            push @related, map { $hasher-&gt;($_, { asset =&gt; $_, is_child =&gt; 1 }) }
+                $asset_class-&gt;search({
+                    class  =&gt; '*',
+                    parent =&gt; $obj-&gt;id,
+                });
+            $param{related} = \@related if @related;
+
+            my @appears_in;
+            my $place_class = $app-&gt;model('objectasset');
+            my $place_iter = $place_class-&gt;load_iter({ asset_id =&gt; $obj-&gt;id });
+            while (my $place = $place_iter-&gt;()) {
+                my $entry_class = $app-&gt;model($place-&gt;object_ds);
+                my $entry = $entry_class-&gt;load($place-&gt;object_id);
+                my %entry_data = (
+                    id    =&gt; $place-&gt;object_id,
+                    class =&gt; $place-&gt;object_ds,
+                    entry =&gt; $entry,
+                    title =&gt; $entry-&gt;title,
+                );
+                if (my $ts = $entry-&gt;authored_on) {
+                    $entry_data{authored_on_ts} = $ts;
+                    $entry_data{authored_on_formatted} =
+                      format_ts( LISTING_DATETIME_FORMAT, $ts, undef,
+                        $app-&gt;user ? $app-&gt;user-&gt;preferred_language : undef );
+                }
+                if (my $ts = $entry-&gt;created_on) {
+                    $entry_data{created_on_ts} = $ts;
+                    $entry_data{created_on_formatted} =
+                      format_ts( LISTING_DATETIME_FORMAT, $ts, undef,
+                        $app-&gt;user ? $app-&gt;user-&gt;preferred_language : undef );
+                }
+                push @appears_in, \%entry_data;
+            }
+            $param{appears_in} = \@appears_in if @appears_in;
+
+            my $prev_asset = $obj-&gt;nextprev(
+                direction =&gt; 'previous',
+                terms     =&gt; { class =&gt; '*', blog_id =&gt; $obj-&gt;blog_id },
+            );
+            my $next_asset = $obj-&gt;nextprev(
+                direction =&gt; 'next',
+                terms     =&gt; { class =&gt; '*', blog_id =&gt; $obj-&gt;blog_id },
+            );
+            $param{previous_entry_id} = $prev_asset-&gt;id if $prev_asset;
+            $param{next_entry_id}     = $next_asset-&gt;id if $next_asset;
+        }
 
         if ( $class-&gt;properties-&gt;{audit} ) {
             my $creator = MT::Author-&gt;load(
@@ -6528,6 +6674,7 @@ sub edit_object {
             no warnings;
             @$sets = sort { $a-&gt;{order} &lt;=&gt; $b-&gt;{order} } @$sets;
             $param{'template_set_loop'} = $sets;
+            $param{'template_set_index'} = $#$sets;
         }
     }
 
@@ -6732,6 +6879,20 @@ sub edit_object {
             $param{blog_file_extension} = $ext;
         }
 
+        my $rte;
+        if ($param{convert_breaks} eq 'richtext') {
+            ## Rich Text editor
+            $rte = lc($app-&gt;config('RichTextEditor'));
+        }
+        else {
+            $rte = 'archetype';
+        }
+        my $editors = $app-&gt;registry(&quot;richtext_editors&quot;);
+        my $edit_reg = $editors-&gt;{$rte} || $editors-&gt;{archetype};
+        my $rich_editor_tmpl;
+        $rich_editor_tmpl = $edit_reg-&gt;{plugin}-&gt;load_tmpl($edit_reg-&gt;{template});
+        $param{rich_editor} = $rich_editor_tmpl;
+
         $param{object_type}  = $type;
         $param{quickpost_js} = $app-&gt;quickpost_js($type);
         if ( 'page' eq $type ) {
@@ -6964,6 +7125,7 @@ sub edit_object {
     my $tmpl_file = $param{output} || &quot;edit_${type}.tmpl&quot;;
     $param{object_type} ||= $type;
     unless ( $param{screen_class} ) {
+        $param{screen_id} = &quot;edit-$type&quot;;
         $param{screen_class} = &quot;edit-$type&quot;;
         $param{screen_class} .= &quot; edit-entry&quot;
           if $param{object_type} eq &quot;page&quot;;  # to piggyback on edit-entry styles
@@ -6971,6 +7133,12 @@ sub edit_object {
     return $app-&gt;load_tmpl( $tmpl_file, \%param );
 }
 
+sub CMSTemplateParam_edit_asset {
+    my ($cb, $app, $param, $tmpl) = @_;
+    my $asset = $param-&gt;{asset} or return;
+    $asset-&gt;edit_template_param(@_);
+}
+
 sub load_default_entry_prefs {
     my $app = shift;
     my $prefs;
@@ -7251,6 +7419,12 @@ sub CMSViewPermissionFilter_category {
     return $perms-&gt;can_edit_categories();
 }
 
+sub CMSViewPermissionFilter_asset {
+    my ($eh, $app, $id) = @_;
+    my $perms = $app-&gt;permissions;
+    return $perms-&gt;can_edit_assets();
+}
+
 sub CMSViewPermissionFilter_commenter {
     my $eh = shift;
     my ( $app, $id ) = @_;
@@ -7358,7 +7532,7 @@ sub CMSSaveFilter_author {
     if ( $app-&gt;param('url') ) {
         my $url = $app-&gt;param('url');
         return $eh-&gt;error( MT-&gt;translate(&quot;Website URL is imperfect&quot;) )
-          unless is_valid_url($url);
+          unless is_url($url);
     }
     1;
 }
@@ -7952,9 +8126,11 @@ sub _convert_word_chars {
     return $s if 'utf-8' ne lc( $app-&gt;charset );
 
     my $blog = $app-&gt;blog;
-    return $s if $blog-&gt;smart_replace == 2;
+    my $smart_replace = $blog ? $blog-&gt;smart_replace
+        : MT-&gt;config-&gt;NwcSmartReplace;
+    return $s if $smart_replace == 2;
 
-    if ( $blog-&gt;smart_replace  ) {
+    if ($smart_replace) {
 
         # html character entity replacements
         $s =~ s/\342\200\231/&amp;#8217;/g;
@@ -8022,7 +8198,12 @@ sub CMSPreSave_entry {
         require MT::Tag;
         my $tag_delim = chr( $app-&gt;user-&gt;entry_prefs-&gt;{tag_delim} );
         my @tags = MT::Tag-&gt;split( $tag_delim, $tags );
-        $obj-&gt;set_tags(@tags);
+        if (@tags) {
+            $obj-&gt;set_tags(@tags);
+        }
+        else {
+            $obj-&gt;remove_tags();
+        }
     }
 
     # update text heights if necessary
@@ -8050,6 +8231,33 @@ sub CMSPreSave_entry {
     1;
 }
 
+sub CMSPreSave_asset {
+    my $eh = shift;
+    my ( $app, $obj ) = @_;
+
+    # save tags
+    my $tags = $app-&gt;param('tags');
+    if ( defined $tags ) {
+        my $blog = $app-&gt;blog;
+        my $fields = $blog ? $blog-&gt;smart_replace_fields
+            : MT-&gt;config-&gt;NwcReplaceField;
+        if ( $fields &amp;&amp; $fields =~ m/tags/ig ) {
+            $tags = _convert_word_chars( $app, $tags );
+        }
+
+        require MT::Tag;
+        my $tag_delim = chr( $app-&gt;user-&gt;entry_prefs-&gt;{tag_delim} );
+        my @tags = MT::Tag-&gt;split( $tag_delim, $tags );
+        if (@tags) {
+            $obj-&gt;set_tags(@tags);
+        }
+        else {
+            $obj-&gt;remove_tags();
+        }
+    }
+    1;
+}
+
 sub CMSPostSave_blog {
     my $eh = shift;
     my ( $app, $obj, $original ) = @_;
@@ -8069,7 +8277,8 @@ sub CMSPostSave_blog {
                     $app-&gt;param('dynamic_cache')       ? 1 : 0,
                     $app-&gt;param('dynamic_conditional') ? 1 : 0
                 );
-                $app-&gt;rebuild( BlogID =&gt; $obj-&gt;id, NoStatic =&gt; 1 );
+                $app-&gt;rebuild( BlogID =&gt; $obj-&gt;id, NoStatic =&gt; 1 )
+                    or return $app-&gt;publish_error();
             } else {
                 require MT::Template;
                 my @tmpls = MT::Template-&gt;load({ build_dynamic =&gt; 1});
@@ -8234,7 +8443,8 @@ sub CMSPostSave_comment {
     if ( $obj-&gt;visible
         || ( ( $obj-&gt;visible || 0 ) != ( $original-&gt;visible || 0 ) ) )
     {
-        $app-&gt;rebuild_entry( Entry =&gt; $obj-&gt;entry_id, BuildIndexes =&gt; 1 );
+        $app-&gt;rebuild_entry( Entry =&gt; $obj-&gt;entry_id, BuildIndexes =&gt; 1 )
+            or return $app-&gt;publish_error();
     }
     1;
 }
@@ -8251,7 +8461,8 @@ sub CMSPostSave_ping {
             if ( $obj-&gt;visible
                 || ( ( $obj-&gt;visible || 0 ) != ( $original-&gt;visible || 0 ) ) )
             {
-                $app-&gt;rebuild_entry( Entry =&gt; $entry, BuildIndexes =&gt; 1 );
+                $app-&gt;rebuild_entry( Entry =&gt; $entry, BuildIndexes =&gt; 1 )
+                    or return $app-&gt;publish_error();
             }
         }
         elsif ( $tb-&gt;category_id
@@ -8267,7 +8478,8 @@ sub CMSPostSave_ping {
 sub CMSPostSave_trackback {
     my $eh = shift;
     my ( $app, $obj, $original ) = @_;
-    $app-&gt;rebuild_entry( Entry =&gt; $obj-&gt;entry_id, BuildIndexes =&gt; 1 );
+    $app-&gt;rebuild_entry( Entry =&gt; $obj-&gt;entry_id, BuildIndexes =&gt; 1 )
+        or return $app-&gt;publish_error();
     1;
 }
 
@@ -8316,14 +8528,14 @@ sub CMSPostSave_template {
                 BlogID   =&gt; $obj-&gt;blog_id,
                 Template =&gt; $obj,
                 NoStatic =&gt; 1,
-            );    # XXXX
+            ) or return $app-&gt;publish_error();    # XXXX
         }
         else {
             $app-&gt;rebuild(
                 BlogID     =&gt; $obj-&gt;blog_id,
                 TemplateID =&gt; $obj-&gt;id,
                 NoStatic   =&gt; 1,
-            );
+            ) or return $app-&gt;publish_error();
         }
     }
     1;
@@ -8503,6 +8715,13 @@ sub CMSDeletePermissionFilter_category {
     return $perms &amp;&amp; $perms-&gt;can_edit_categories();
 }
 
+sub CMSDeletePermissionFilter_asset {
+    my ( $eh, $app, $obj ) = @_;
+    return 1 if $app-&gt;user-&gt;is_superuser();
+    my $perms = $app-&gt;permissions;
+    return $perms &amp;&amp; $perms-&gt;can_edit_assets();
+}
+
 sub CMSDeletePermissionFilter_comment {
     my ( $eh, $app, $obj ) = @_;
     my $author = $app-&gt;user;
@@ -9088,6 +9307,8 @@ sub save_object {
         # and template set to the defaults.
         if ( !$obj-&gt;id ) {
             $obj-&gt;language( $app-&gt;user-&gt;preferred_language );
+            $obj-&gt;nofollow_urls(1);
+            $obj-&gt;follow_auth_links(1);
             my @authenticators = qw( MovableType );
             foreach my $auth (qw( Vox LiveJournal )) {
                 my $a = MT-&gt;commenter_authenticator($auth);
@@ -9099,7 +9320,7 @@ sub save_object {
                 push @authenticators, $auth;
             }
             $obj-&gt;commenter_authenticators( join ',', @authenticators );
-            my $set = $app-&gt;param('template_set');
+            my $set = $app-&gt;param('template_set') || 'mt_blog';
             $obj-&gt;template_set( $set );
         }
 
@@ -9311,6 +9532,9 @@ sub list_template {
         elsif ( $type eq 'email' ) {
             $template_type = 'email';
         }
+        elsif ( $type eq 'backup' ) {
+            $template_type = 'backup';
+        }
         else {
             $template_type = 'system';
         }
@@ -9337,6 +9561,8 @@ sub list_template {
     $params-&gt;{page_actions} = $app-&gt;page_actions('list_templates');
     $params-&gt;{search_label} = $app-&gt;translate(&quot;Templates&quot;);
     $params-&gt;{blog_view} = 1;
+    $params-&gt;{refreshed} = $app-&gt;param('refreshed');
+    $params-&gt;{published} = $app-&gt;param('published');
 
     return $app-&gt;listing(
         {
@@ -9812,7 +10038,7 @@ sub delete {
         # FIXME: enumeration of types
         if (   $type eq 'template'
             &amp;&amp; $obj-&gt;type !~
-            /(custom|index|archive|page|individual|category|widget)/o )
+            /(custom|index|archive|page|individual|category|widget|backup)/o )
         {
             $required_items++;
         }
@@ -9829,7 +10055,8 @@ sub delete {
     require MT::Entry;
     for my $entry_id ( keys %rebuild_entries ) {
         my $entry = MT::Entry-&gt;load($entry_id);
-        $app-&gt;rebuild_entry( Entry =&gt; $entry, BuildDependencies =&gt; 1 );
+        $app-&gt;rebuild_entry( Entry =&gt; $entry, BuildDependencies =&gt; 1 )
+            or return $app-&gt;publish_error();
     }
     for my $cat_id (@rebuild_cats) {
 
@@ -9840,7 +10067,7 @@ sub delete {
             Category    =&gt; $cat,
             BlogID      =&gt; $blog_id,
             ArchiveType =&gt; 'Category'
-        );
+        ) or return $app-&gt;publish_error();
     }
     $app-&gt;run_callbacks( 'rebuild', MT::Blog-&gt;load($blog_id) );
     $app-&gt;add_return_arg(
@@ -10527,8 +10754,7 @@ sub list_commenter {
 
             $param{filter}     = $filter_col;
             $param{filter_val} = $val;
-            my $url_val = encode_url($val);
-            $param{filter_args} = &quot;&amp;filter=$filter_col&amp;filter_val=$url_val&quot;;
+            $param{filter_args} = &quot;&amp;filter=&quot; . encode_url($filter_col) . &quot;&amp;filter_val=&quot; . encode_url($val);
         }
     }
     $arg{'offset'} = $offset if $offset;
@@ -11158,7 +11384,7 @@ sub build_plugin_table {
         my $folder =
             $fld
           ? $app-&gt;translate( &quot;Plugin Set: [_1]&quot;, $fld )
-          : $app-&gt;translate(&quot;Plugins&quot;);
+          : $app-&gt;translate(&quot;Individual Plugins&quot;);
         my $row;
         my $icon = $app-&gt;static_path . 'images/plugin.gif';
 
@@ -11471,9 +11697,7 @@ sub list_pings {
                 $terms{$filter_col} = $val;
             }
         }
-        ( my $url_val = $val ) =~
-          s!([^a-zA-Z0-9_.-])!uc sprintf &quot;%%%02x&quot;, ord($1)!eg;
-        $param{filter_args} = &quot;&amp;filter=$filter_col&amp;filter_val=$url_val&quot;;
+        $param{filter_args} = &quot;&amp;filter=&quot; . encode_url($filter_col) . &quot;&amp;filter_val=&quot; . encode_url($val);
         $param{filter}     ||= $filter_col;
         $param{filter_val} ||= $val;
         $param{is_filtered} = 1;
@@ -11567,6 +11791,8 @@ sub list_pings {
           $app-&gt;make_feed_link( 'ping',
             $blog_id ? { blog_id =&gt; $blog_id } : undef );
     }
+    $param{screen_id} = &quot;list-ping&quot;;
+    $param{listing_screen} = 1;
     $app-&gt;add_breadcrumb( $app-&gt;translate('TrackBacks') );
     $app-&gt;load_tmpl( &quot;list_ping.tmpl&quot;, \%param );
 }
@@ -11865,9 +12091,7 @@ sub list_entries {
             else {
                 $terms{$filter_col} = $filter_val;
             }
-            ( my $url_val = $filter_val ) =~
-              s!([^a-zA-Z0-9_.-])!uc sprintf &quot;%%%02x&quot;, ord($1)!eg;
-            $param{filter_args} = &quot;&amp;filter=$filter_col&amp;filter_val=$url_val&quot;;
+            $param{filter_args} = &quot;&amp;filter=&quot; . encode_url($filter_col) . &quot;&amp;filter_val=&quot; . encode_url($filter_val);
 
             if (   ( $filter_col eq 'normalizedtag' )
                 || ( $filter_col eq 'exacttag' ) )
@@ -11990,6 +12214,7 @@ sub list_entries {
     $param{page_actions}        = $app-&gt;page_actions( $app-&gt;mode );
     $param{list_filters}        = $app-&gt;list_filters('entry');
     $param{can_power_edit}      = $blog_id &amp;&amp; !$is_power_edit;
+    $param{can_republish}       = $blog_id ? $perms-&gt;can_rebuild : 1;
     $param{is_power_edit}       = $is_power_edit;
     $param{saved_deleted}       = $q-&gt;param('saved_deleted');
     $param{saved}               = $q-&gt;param('saved');
@@ -12009,6 +12234,7 @@ sub list_entries {
     $param{feed_url} =
       $app-&gt;make_feed_link( $type, $blog_id ? { blog_id =&gt; $blog_id } : undef );
     $app-&gt;add_breadcrumb( $pkg-&gt;class_label_plural );
+    $param{listing_screen} = 1;
 
     unless ($blog_id) {
         $param{system_overview_nav} = 1;
@@ -12017,7 +12243,7 @@ sub list_entries {
     unless ( $param{screen_class} ) {
         $param{screen_class} = &quot;list-$type&quot;;
         $param{screen_class} .= &quot; list-entry&quot;
-          if $param{object_type} eq &quot;page&quot;;  # to piggyback on edit-entry styles
+          if $param{object_type} eq &quot;page&quot;;  # to piggyback on list-entry styles
     }
     $param{mode}            = $app-&gt;mode;
     if ( my $blog = MT::Blog-&gt;load($blog_id) ) {
@@ -12794,10 +13020,6 @@ $ao
     if ( ( $obj-&gt;status || 0 ) == MT::Entry::RELEASE()
         || $status_old eq MT::Entry::RELEASE() )
     {
-        if ( $app-&gt;config('PublishCommenterIcon') ) {
-            $app-&gt;publisher-&gt;make_commenter_icon($blog);
-        }
-
         if ( $app-&gt;config('DeleteFilesAtRebuild') &amp;&amp; $orig_obj ) {
             my $file = archive_file_for( $obj, $blog, $archive_type );
             if ( $file ne $orig_file || $obj-&gt;status != MT::Entry::RELEASE() ) {
@@ -12822,7 +13044,7 @@ $ao
                         ? $previous_old-&gt;id
                         : undef,
                         OldNext =&gt; ($next_old) ? $next_old-&gt;id : undef
-                    ) or return;
+                    ) or return $app-&gt;publish_error();
                     $app-&gt;run_callbacks( 'rebuild', $blog );
                     1;
                 }
@@ -12859,6 +13081,21 @@ $ao
     $app-&gt;_finish_rebuild_ping( $obj, !$id );
 }
 
+sub publish_error {
+    my $app = shift;
+    my ($msg) = @_;
+    if (defined $app-&gt;errstr) {
+        require MT::Log;
+        $app-&gt;log({
+            message =&gt; $app-&gt;translate(&quot;Error during publishing: [_1]&quot;, (defined $msg ? $msg : $app-&gt;errstr)),
+            class =&gt; &quot;system&quot;,
+            level =&gt; MT::Log::ERROR(),
+            category =&gt; &quot;publish&quot;,
+        })
+    }
+    return undef;
+}
+
 sub ping_continuation {
     my $app = shift;
     my ( $entry, $blog, %options ) = @_;
@@ -13061,12 +13298,12 @@ sub list_category {
     my $entry_type;
     if ( $type eq 'category' ) {
         $entry_type = 'entry';
-        return $app-&gt;return_to_dashboard( permission =&gt; 1 )
+        return $app-&gt;return_to_dashboard( redirect =&gt; 1 )
           unless $perms &amp;&amp; $perms-&gt;can_edit_categories;
     }
     elsif ( $type eq 'folder' ) {
         $entry_type = 'page';
-        return $app-&gt;return_to_dashboard( permission =&gt; 1 )
+        return $app-&gt;return_to_dashboard( redirect =&gt; 1 )
           unless $perms &amp;&amp; $perms-&gt;can_manage_pages;
     }
     $entry_class = $app-&gt;model($entry_type);
@@ -13223,6 +13460,53 @@ sub save_category {
     );
 }
 
+sub save_asset {
+    my $app   = shift;
+    my $q     = $app-&gt;param;
+    my $perms = $app-&gt;permissions;
+    my $type  = $q-&gt;param('_type');
+    my $class = $app-&gt;model($type)
+      or return $app-&gt;errtrans(&quot;Invalid request.&quot;);
+
+    $app-&gt;validate_magic() or return;
+
+    return $app-&gt;errtrans(&quot;Permission denied.&quot;)
+      unless $perms &amp;&amp; $perms-&gt;can_edit_assets;
+
+    my $blog_id = $q-&gt;param('blog_id');
+    my $id = $q-&gt;param('id');
+    my $obj = $id ? $class-&gt;load($id) : $class-&gt;new;
+    my $original = $obj-&gt;clone();
+
+    $obj-&gt;set_values_from_query($q);
+
+    $app-&gt;run_callbacks( 'cms_pre_save.' . $type, $app, $obj, $original )
+      || return $app-&gt;errtrans( &quot;Saving [_1] failed: [_2]&quot;, $type,
+        $app-&gt;errstr );
+
+    $obj-&gt;save
+      or return $app-&gt;error(
+        $app-&gt;translate(
+            &quot;Saving [_1] failed: [_2]&quot;,
+            $type, $obj-&gt;errstr
+        )
+      );
+
+    $app-&gt;run_callbacks( 'cms_post_save.' . $type, $app, $obj, $original );
+
+    $app-&gt;redirect(
+        $app-&gt;uri(
+            'mode' =&gt; 'view',
+            args   =&gt; {
+                _type   =&gt; $type,
+                blog_id =&gt; $blog_id,
+                id      =&gt; $obj-&gt;id,
+                saved   =&gt; 1,
+            }
+        )
+    );
+}
+
 sub cfg_blog {
     my $q = $_[0]-&gt;{query};
     $q-&gt;param( '_type', 'blog' );
@@ -14477,12 +14761,13 @@ sub rebuild_pages {
 
         # FIXME: Rebuild the entire blog????
         $app-&gt;rebuild( BlogID =&gt; $blog_id )
-          or return;
+          or return $app-&gt;publish_error();
     }
     elsif ( $type eq 'index' ) {
         return $app-&gt;error( $app-&gt;translate(&quot;Permission denied.&quot;) )
           unless $perms-&gt;can_rebuild;
-        $app-&gt;rebuild_indexes( BlogID =&gt; $blog_id ) or return;
+        $app-&gt;rebuild_indexes( BlogID =&gt; $blog_id )
+            or return $app-&gt;publish_error();
     }
     elsif ( $type =~ /^index-(\d+)$/ ) {
         return $app-&gt;error( $app-&gt;translate(&quot;Permission denied.&quot;) )
@@ -14494,7 +14779,7 @@ sub rebuild_pages {
             BlogID   =&gt; $blog_id,
             Template =&gt; $tmpl_saved,
             Force    =&gt; 1
-        ) or return;
+        ) or return $app-&gt;publish_error();
         $order = $app-&gt;translate( &quot;index template '[_1]'&quot;, $tmpl_saved-&gt;name );
     }
     elsif ( $type =~ /^entry-(\d+)$/ ) {
@@ -14508,7 +14793,7 @@ sub rebuild_pages {
             BuildDependencies =&gt; 1,
             OldPrevious       =&gt; $q-&gt;param('old_previous'),
             OldNext           =&gt; $q-&gt;param('old_next')
-        ) or return;
+        ) or return $app-&gt;publish_error();
         $order = &quot;entry '&quot; . $entry-&gt;title . &quot;'&quot;;
     }
     elsif ( $archiver-&gt;category_based ) {
@@ -14529,7 +14814,7 @@ sub rebuild_pages {
                 NoIndexes      =&gt; 1,
                 Offset         =&gt; $offset,
                 FilterCallback =&gt; $cb,
-            ) or return;
+            ) or return $app-&gt;publish_error();
             $offset += $count;
         }
         if ( $offset &lt; $total ) {
@@ -14568,7 +14853,7 @@ sub rebuild_pages {
                     NoIndexes      =&gt; 1,
                     Offset         =&gt; $offset,
                     FilterCallback =&gt; $cb,
-                ) or return;
+                ) or return $app-&gt;publish_error();
                 $offset += $count;
             }
             if ( $offset &lt; $total ) {
@@ -15087,13 +15372,9 @@ sub send_notify {
     );
 }
 
-sub start_upload {
+sub _set_start_upload_params {
     my $app = shift;
-
-    $app-&gt;add_breadcrumb( $app-&gt;translate('Upload File') );
-    my %param;
-    %param = @_ if @_;
-    my $label_path;
+    my ($param) = @_;
 
     if (my $perms = $app-&gt;permissions) {
         return $app-&gt;error( $app-&gt;translate(&quot;Permission denied.&quot;) )
@@ -15102,10 +15383,11 @@ sub start_upload {
         require MT::Blog;
         my $blog = MT::Blog-&gt;load($blog_id);
 
-        $param{enable_archive_paths} = $blog-&gt;column('archive_path');
-        $param{local_site_path}      = $blog-&gt;site_path;
-        $param{local_archive_path}   = $blog-&gt;archive_path;
-        if ( $param{enable_archive_paths} ) {
+        $param-&gt;{enable_archive_paths} = $blog-&gt;column('archive_path');
+        $param-&gt;{local_site_path}      = $blog-&gt;site_path;
+        $param-&gt;{local_archive_path}   = $blog-&gt;archive_path;
+        my $label_path;
+        if ( $param-&gt;{enable_archive_paths} ) {
             $label_path = $app-&gt;translate('Archive Root');
         }
         else {
@@ -15119,20 +15401,20 @@ sub start_upload {
             label =&gt; '&lt;' . $app-&gt;translate($label_path) . '&gt;' . '/' . $date_stamp,
         };
 
-        if ( exists( $param{middle_path} )
-            &amp;&amp; ( $date_stamp eq $param{middle_path} ) )
+        if ( exists( $param-&gt;{middle_path} )
+            &amp;&amp; ( $date_stamp eq $param-&gt;{middle_path} ) )
         {
             $path_hash-&gt;{selected} = 1;
-            delete $param{archive_path};
+            delete $param-&gt;{archive_path};
         }
         push @extra_paths, $path_hash;
-        $param{extra_paths} = \@extra_paths;
-        $param{refocus}     = 1;
-        $param{missing_paths} =
+        $param-&gt;{extra_paths} = \@extra_paths;
+        $param-&gt;{refocus}     = 1;
+        $param-&gt;{missing_paths} =
           (      ( defined $blog-&gt;site_path || defined $blog-&gt;archive_path )
               &amp;&amp; ( -d $blog-&gt;site_path || -d $blog-&gt;archive_path ) ) ? 0 : 1;
 
-        if ( $param{missing_paths} ) {
+        if ( $param-&gt;{missing_paths} ) {
             if (
                 $app-&gt;user-&gt;is_superuser
                 || $app-&gt;run_callbacks(
@@ -15141,17 +15423,29 @@ sub start_upload {
                 )
               )
             {
-                $param{have_permissions} = 1;
+                $param-&gt;{have_permissions} = 1;
             }
         }
 
-        $param{enable_destination} = 1;
+        $param-&gt;{enable_destination} = 1;
     }
     else {
-        $param{local_site_path}      = '';
-        $param{local_archive_path}   = '';
+        $param-&gt;{local_site_path}      = '';
+        $param-&gt;{local_archive_path}   = '';
     }
 
+    $param;
+}
+
+sub start_upload {
+    my $app = shift;
+
+    $app-&gt;add_breadcrumb( $app-&gt;translate('Upload File') );
+    my %param;
+    %param = @_ if @_;
+
+    $app-&gt;_set_start_upload_params(\%param);
+
     for my $field (qw( entry_insert edit_field upload_mode require_type
       asset_select )) {
         $param{$field} ||= $app-&gt;param($field);
@@ -15530,6 +15824,7 @@ sub _upload_file {
                         &quot;$!&quot;
                     )
                   );
+                close $tmp_fh;
                 my ( $vol, $path, $tmp ) = File::Spec-&gt;splitpath($tmp_file);
                 return $app-&gt;load_tmpl(
                     'dialog/asset_replace.tmpl',
@@ -16050,10 +16345,10 @@ sub do_search_replace {
         $is_dateranged, $ids,         $datefrom_year, $datefrom_month,
         $datefrom_day,  $dateto_year, $dateto_month,  $dateto_day,
         $from,          $to,          $show_all,      $do_search,
-        $orig_search
+        $orig_search,   $quicksearch
       )
       = map scalar $q-&gt;param($_),
-      qw( search replace do_replace case is_regex is_limited _type is_junk is_dateranged replace_ids datefrom_year datefrom_month datefrom_day dateto_year dateto_month dateto_day from to show_all do_search orig_search );
+      qw( search replace do_replace case is_regex is_limited _type is_junk is_dateranged replace_ids datefrom_year datefrom_month datefrom_day dateto_year dateto_month dateto_day from to show_all do_search orig_search quicksearch );
 
 
     if ( !$type || ( 'category' eq $type ) || ( 'folder' eq $type ) ) {
@@ -16099,6 +16394,11 @@ sub do_search_replace {
     else {
         @cols = keys %{ $search_api-&gt;{$type}-&gt;{search_cols} };
     }
+    my $quicksearch_id;
+    if ($quicksearch &amp;&amp; ($search || '') ne '' &amp;&amp; $search !~ m{ \D }xms) {
+        $quicksearch_id = $search;
+        unshift @cols, 'id';
+    }
     foreach (
         $datefrom_year, $datefrom_month, $datefrom_day,
         $dateto_year,   $dateto_month,   $dateto_day
@@ -16153,6 +16453,11 @@ sub do_search_replace {
     if ( ( $do_search &amp;&amp; $search ne '' ) || $show_all || $do_replace ) {
         my %terms;
         my %args;
+        ## we need to search all user/group for 'grant permissions',
+        ## if $blog_id is specified. it affects the setup_terms_args.
+        if ( $app-&gt;param('__mode') eq 'dialog_grant_role' ) {
+            $blog_id = 0;
+        }
         if (exists $api-&gt;{setup_terms_args}) {
             my $code = $app-&gt;handler_to_coderef($api-&gt;{setup_terms_args});
             $code-&gt;(\%terms, \%args, $blog_id);
@@ -16330,6 +16635,30 @@ sub do_search_replace {
             $app-&gt;translate( &quot;Saving object failed: [_2]&quot;, $obj-&gt;errstr ) );
     }
     if (@data) {
+        if ($quicksearch) {
+            my $obj;
+            if (1 == scalar @data) {
+                ($obj) = @data;
+            }
+            elsif (defined $quicksearch_id) {
+                ($obj) = grep { $_-&gt;id == $quicksearch_id } @data;
+            }
+
+            if ($obj) {
+                my %args = (
+                    _type         =&gt; $type,
+                    id            =&gt; $obj-&gt;id,
+                    search_result =&gt; 1,
+                );
+                $args{blog_id} = $obj-&gt;blog_id
+                    if $obj-&gt;has_column('blog_id');
+                return $app-&gt;redirect($app-&gt;uri(
+                    mode =&gt; 'view',
+                    args =&gt; \%args,
+                ));
+            }
+        }
+
         if (my $meth = $search_api-&gt;{$type}{handler}) {
             $meth = $app-&gt;handler_to_coderef($meth);
             $meth-&gt;($app, items =&gt; \@data, param =&gt; \%param, type =&gt; $type );
@@ -16741,7 +17070,7 @@ sub add_map {
         TemplateMap =&gt; $map,
         TemplateID  =&gt; scalar $q-&gt;param('template_id'),
         NoStatic    =&gt; 1
-    );
+    ) or return $app-&gt;publish_error();
     $app-&gt;{no_print_body} = 1;
     $app-&gt;send_http_header(&quot;text/plain&quot;);
     $app-&gt;print($html);
@@ -17291,7 +17620,8 @@ sub rebuild_these {
         my @blogs = $app-&gt;param('blog_ids');
         foreach my $blog_id (@blogs) {
             my $blog = MT::Blog-&gt;load($blog_id) or next;
-            $app-&gt;rebuild_indexes( Blog =&gt; $blog );
+            $app-&gt;rebuild_indexes( Blog =&gt; $blog )
+                or return $app-&gt;publish_error();
         }
         my $this_blog = MT::Blog-&gt;load( $app-&gt;param('blog_id') );
         $app-&gt;run_callbacks( 'rebuild', $this_blog );
@@ -17338,7 +17668,7 @@ sub rebuild_these {
                 Entry             =&gt; $e,
                 BuildDependencies =&gt; 1,
                 BuildIndexes      =&gt; 0
-            );
+            ) or return $app-&gt;publish_error();
         }
         if (@rest) {
             foreach (@rest) {
@@ -18863,12 +19193,14 @@ sub restore_directory {
       ? 'ignore'
       : $app-&gt;config('SchemaVersion');
 
+    my $overwrite_template = $q-&gt;param('overwrite_global_templates') ? 1 : 0;
+
     my @errors;
     my %error_assets;
     require MT::BackupRestore;
     my ( $deferred, $blogs, $assets ) =
       MT::BackupRestore-&gt;restore_directory( $dir, \@errors, \%error_assets,
-        $schema_version, sub { $app-&gt;_progress(@_); } );
+        $schema_version, $overwrite_template, sub { $app-&gt;_progress(@_); } );
 
     if ( scalar @errors ) {
         $$error = $app-&gt;translate('Error occured during restore process.');
@@ -18970,6 +19302,8 @@ sub restore_upload_manifest {
       $q-&gt;param('ignore_schema_conflict')
       ? 'ignore'
       : $app-&gt;config('SchemaVersion');
+    $param-&gt;{overwrite_templates} = $q-&gt;param('overwrite_global_templates') ? 1 : 0;
+
     $param-&gt;{dialog_mode} = 'dialog_restore_upload';
     $param-&gt;{dialog_params} =
         'start=1'
@@ -18985,6 +19319,8 @@ sub restore_upload_manifest {
       . $param-&gt;{'last'}
       . '&amp;amp;schema_version='
       . $param-&gt;{schema_version}
+      . '&amp;amp;overwrite_templates='
+      . $param-&gt;{overwrite_templates}
       . '&amp;amp;redirect=1';
     $app-&gt;load_tmpl( 'restore.tmpl', $param );
 
@@ -19006,6 +19342,7 @@ sub dialog_restore_upload {
     my $is_asset       = $q-&gt;param('is_asset') || 0;
     my $schema_version = $q-&gt;param('schema_version')
       || $app-&gt;config('SchemaVersion');
+    my $overwrite_template = $q-&gt;param('overwrite_templates') ? 1 : 0;
 
     my $objects  = {};
     my $deferred = {};
@@ -19042,6 +19379,7 @@ sub dialog_restore_upload {
     $param-&gt;{deferred_json}  = JSON::objToJson($deferred) if defined($deferred);
     $param-&gt;{blogs_meta}     = $q-&gt;param('blogs_meta');
     $param-&gt;{schema_version} = $schema_version;
+    $param-&gt;{overwrite_templates} = $overwrite_template;
 
     my $uploaded = $q-&gt;param('file');
     if ( defined($uploaded) ) {
@@ -19136,7 +19474,7 @@ sub dialog_restore_upload {
     else {
         ( $blog_ids, $asset_ids ) = eval {
             MT::BackupRestore-&gt;restore_process_single_file( $fh, $objects,
-                $deferred, \@errors, $schema_version,
+                $deferred, \@errors, $schema_version, $overwrite_template,
                 sub { $app-&gt;_progress(@_) } );
         };
         if ($@) {
@@ -19220,6 +19558,7 @@ sub dialog_restore_upload {
             $param-&gt;{next_mode} = 'dialog_restore_upload';
         }
     }
+    MT-&gt;run_callbacks('restore', $objects, $deferred, \@errors, sub { $app-&gt;_progress(@_) });
 
     $app-&gt;print( $app-&gt;build_page( 'dialog/restore_end.tmpl', $param ) );
     close $fh if !$no_upload;
@@ -19663,7 +20002,7 @@ sub do_reply {
     MT::Util::start_background_task(
         sub {
             $app-&gt;rebuild_entry( Entry =&gt; $parent-&gt;entry_id, BuildDependencies =&gt; 1 )
-              or return $app-&gt;errtrans( &quot;Publish failed: [_1]&quot;, $app-&gt;errstr );
+              or return $app-&gt;publish_error( &quot;Publish failed: [_1]&quot;, $app-&gt;errstr );
             $app-&gt;_send_comment_notification( $comment, q(), $entry,
                 $app-&gt;model('blog')-&gt;load( $param-&gt;{blog_id} ), $app-&gt;user );
         }
@@ -19708,7 +20047,7 @@ sub reply_preview {
         type   =&gt; 'scalarref',
         source =&gt; \&quot;&lt;\$MTInclude module=\&quot;$tmpl_name\&quot;\$&gt;&quot;,
     );
-    my $ctx = MT::Template::Context-&gt;new;
+    my $ctx = $tmpl-&gt;context;
     ## Set timestamp as we would usually do in ObjectDriver.
     my @ts = MT::Util::offset_time_list( time, $entry-&gt;blog_id );
     my $ts = sprintf &quot;%04d%02d%02d%02d%02d%02d&quot;, $ts[5] + 1900, $ts[4] + 1,
@@ -19738,6 +20077,411 @@ sub reply_preview {
         { %$param, text =&gt; $q-&gt;param('text'), preview_html =&gt; $html } );
 }
 
+sub dialog_refresh_templates {
+    my $app = shift;
+    $app-&gt;validate_magic or return;
+
+    # permission check
+    my $perms = $app-&gt;permissions;
+    return $app-&gt;errtrans(&quot;Permission denied.&quot;)
+        unless $app-&gt;user-&gt;is_superuser ||
+            $perms-&gt;can_administer_blog ||
+            $perms-&gt;can_edit_templates;
+
+    my $param = {};
+    my $blog = $app-&gt;blog;
+    $param-&gt;{return_args} = $app-&gt;param('return_args');
+
+    if ($blog) {
+        $param-&gt;{blog_id} = $blog-&gt;id;
+
+        my $sets = $app-&gt;registry(&quot;template_sets&quot;);
+        $sets-&gt;{$_}{key} = $_ for keys %$sets;
+        $sets = $app-&gt;filter_conditional_list([ values %$sets ]);
+
+        no warnings; # some sets may not define an order
+        @$sets = sort { $a-&gt;{order} &lt;=&gt; $b-&gt;{order} } @$sets;
+        $param-&gt;{'template_set_loop'} = $sets;
+
+        my $existing_set = $blog-&gt;template_set || 'mt_blog';
+        foreach (@$sets) {
+            if ($_-&gt;{key} eq $existing_set) {
+                $_-&gt;{selected} = 1;
+            }
+        }
+        $param-&gt;{'template_set_index'} = $#$sets;
+
+        $param-&gt;{template_sets} = $sets;
+    }
+
+    # load template sets
+    $app-&gt;build_page('dialog/refresh_templates.tmpl',
+        $param);
+}
+
+sub refresh_all_templates {
+    my ($app) = @_;
+
+    my $backup = 1;
+    if ($app-&gt;param('no_backup')) {
+        $backup = 0;
+    }
+
+    if ($app-&gt;param('backup')) {
+        # refresh templates dialog uses a 'backup' field
+        $backup = 1;
+    }
+
+    my $template_set = $app-&gt;param('template_set');
+    my $refresh_type = $app-&gt;param('refresh_type') || 'refresh';
+
+    my $t = time;
+
+    my @id;
+    if ($app-&gt;param('blog_id')) {
+        @id = ( scalar $app-&gt;param('blog_id') );
+    }
+    else {
+        @id = $app-&gt;param('id');
+        if (! @id) {
+            # refresh global templates
+            @id = ( 0 );
+        }
+    }
+
+    require MT::Template;
+    require MT::Blog;
+    require MT::Permission;
+    require MT::Util;
+
+    foreach my $blog_id (@id) {
+        my $blog;
+        if ($blog_id) {
+            $blog = MT::Blog-&gt;load($blog_id);
+            next unless $blog;
+        }
+        if ( !$app-&gt;user-&gt;is_superuser() ) {
+            my $perms = MT::Permission-&gt;load(
+                { blog_id =&gt; $blog_id, author_id =&gt; $app-&gt;user-&gt;id } );
+            if (
+                !$perms
+                || (   !$perms-&gt;can_edit_templates()
+                    &amp;&amp; !$perms-&gt;can_administer_blog() )
+              )
+            {
+                next;
+            }
+        }
+
+        my $tmpl_list;
+        if ($blog_id) {
+
+
+            if ($refresh_type eq 'clean') {
+                # the user wants to back up all templates and
+                # install the new ones
+
+                my @ts = MT::Util::offset_time_list( $t, ( $blog_id ? $blog_id : undef ) );
+                my $ts = sprintf &quot;%04d-%02d-%02d %02d:%02d:%02d&quot;, $ts[5] + 1900,
+                  $ts[4] + 1, @ts[ 3, 2, 1, 0 ];
+
+                my $tmpl_iter = MT::Template-&gt;load_iter({
+                    blog_id =&gt; $blog_id,
+                    type =&gt; { not =&gt; 'backup' },
+                });
+
+                while (my $tmpl = $tmpl_iter-&gt;()) {
+                    $tmpl-&gt;type('backup');
+                    # zap all template maps
+                    require MT::TemplateMap;
+                    MT::TemplateMap-&gt;remove({
+                        template_id =&gt; $tmpl-&gt;id,
+                    });
+                    $tmpl-&gt;name(
+                        $tmpl-&gt;name . ' (Backup from ' . $ts . ')' );
+                    $tmpl-&gt;identifier(undef);
+                    $tmpl-&gt;rebuild_me(0);
+                    $tmpl-&gt;linked_file(undef);
+                    $tmpl-&gt;outfile('');
+                    $tmpl-&gt;save;
+                }
+
+                # This also creates our template mappings
+                $blog-&gt;create_default_templates( $template_set || $blog-&gt;template_set || 'mt_blog' );
+
+                if ($template_set) {
+                    $blog-&gt;template_set( $template_set );
+                    $blog-&gt;save;
+                }
+
+                next;
+
+            }
+
+            require MT::DefaultTemplates;
+            $tmpl_list = MT::DefaultTemplates-&gt;templates($template_set || $blog-&gt;template_set) || MT::DefaultTemplates-&gt;templates();
+
+        }
+        else {
+            require MT::DefaultTemplates;
+            $tmpl_list = MT::DefaultTemplates-&gt;templates();
+        }
+
+        foreach my $val (@$tmpl_list) {
+            if ($blog_id) {
+                # when refreshing blog templates,
+                # skip over global templates which
+                # specify a blog_id of 0...
+                next if $val-&gt;{global};
+            }
+            else {
+                next unless exists $val-&gt;{global};
+            }
+
+            if ( !$val-&gt;{orig_name} ) {
+                $val-&gt;{orig_name} = $val-&gt;{name};
+                $val-&gt;{name}      = $app-&gt;translate( $val-&gt;{name} );
+                $val-&gt;{text}      = $app-&gt;translate_templatized( $val-&gt;{text} );
+            }
+
+            my $orig_name = $val-&gt;{orig_name};
+
+            my @ts = MT::Util::offset_time_list( $t, ( $blog_id ? $blog_id : undef ) );
+            my $ts = sprintf &quot;%04d-%02d-%02d %02d:%02d:%02d&quot;, $ts[5] + 1900,
+              $ts[4] + 1, @ts[ 3, 2, 1, 0 ];
+
+            my $terms = {};
+            $terms-&gt;{blog_id} = $blog_id;
+            if ( $val-&gt;{type} =~
+                m/^(archive|individual|page|category|index|custom|widget)$/ )
+            {
+                $terms-&gt;{name} = $val-&gt;{name};
+            }
+            else {
+                $terms-&gt;{identifier} = $val-&gt;{identifier};
+                $terms-&gt;{type} = $val-&gt;{type};
+            }
+
+            # this should only return 1 template; we're searching
+            # within a given blog for a specific type of template (for
+            # &quot;system&quot; templates; or for a type + name, which should be
+            # unique for that blog.
+            my $tmpl = MT::Template-&gt;load($terms);
+            if ($tmpl &amp;&amp; $backup) {
+
+                # check for default template text...
+                # if it is a default template, then outright replace it
+                my $text = $tmpl-&gt;text;
+                $text =~ s/\s+//g;
+
+                my $def_text = $val-&gt;{text};
+                $def_text =~ s/\s+//g;
+
+                # if it has been customized, back it up to a new tmpl record
+                if ($def_text ne $text) {
+                    my $backup = $tmpl-&gt;clone;
+                    delete $backup-&gt;{column_values}
+                      -&gt;{id};    # make sure we don't overwrite original
+                    delete $backup-&gt;{changed_cols}-&gt;{id};
+                    $backup-&gt;name(
+                        $backup-&gt;name . ' (Backup from ' . $ts . ')' );
+                    $backup-&gt;type('backup');
+                    # if ( $backup-&gt;type !~
+                    #         m/^(archive|individual|page|category|index|custom|widget)$/ )
+                    # {
+                    #     $backup-&gt;type('custom')
+                    #       ;      # system templates can't be created
+                    # }
+                    $backup-&gt;outfile('');
+                    $backup-&gt;linked_file( $tmpl-&gt;linked_file );
+                    $backup-&gt;identifier(undef);
+                    $backup-&gt;rebuild_me(0);
+                    $backup-&gt;build_dynamic(0);
+                    $backup-&gt;save;
+                }
+            }
+            if ($tmpl) {
+                # we found that the previous template had not been
+                # altered, so replace it with new default template...
+                $tmpl-&gt;text( $val-&gt;{text} );
+                $tmpl-&gt;identifier( $val-&gt;{identifier} );
+                $tmpl-&gt;type( $val-&gt;{type} )
+                  ; # fixes mismatch of types for cases like &quot;archive&quot; =&gt; &quot;individual&quot;
+                $tmpl-&gt;linked_file('');
+                $tmpl-&gt;save;
+            }
+            else {
+                # create this one...
+                my $tmpl = new MT::Template;
+                $tmpl-&gt;build_dynamic(0);
+                $tmpl-&gt;set_values(
+                    {
+                        text       =&gt; $val-&gt;{text},
+                        name       =&gt; $val-&gt;{name},
+                        type       =&gt; $val-&gt;{type},
+                        identifier =&gt; $val-&gt;{identifier},
+                        outfile    =&gt; $val-&gt;{outfile},
+                        rebuild_me =&gt; $val-&gt;{rebuild_me}
+                    }
+                );
+                $tmpl-&gt;blog_id($blog_id);
+                $tmpl-&gt;save
+                  or return $app-&gt;error(
+                        $app-&gt;translate(&quot;Error creating new template: &quot;)
+                      . $tmpl-&gt;errstr );
+            }
+        }
+    }
+
+    $app-&gt;add_return_arg( 'refreshed' =&gt; 1 );
+    $app-&gt;call_return;
+}
+
+sub refresh_individual_templates {
+    my ($app) = @_;
+
+    require MT::Util;
+
+    my $user = $app-&gt;user;
+    my $perms = $app-&gt;permissions;
+    return $app-&gt;error(
+        $app-&gt;translate(
+            &quot;Permission denied.&quot;)
+      )
+      #TODO: system level-designer permission
+      unless $user-&gt;is_superuser() || $user-&gt;can_edit_templates()
+      || ( $perms
+        &amp;&amp; ( $perms-&gt;can_edit_templates()
+          || $perms-&gt;can_administer_blog ) );
+
+    my $set;
+    if ( my $blog_id = $app-&gt;param('blog_id') ) {
+        my $blog = $app-&gt;model('blog')-&gt;load($blog_id);
+        $set = $blog-&gt;template_set()
+            if $blog;
+    }
+
+    require MT::DefaultTemplates;
+    my $tmpl_list = MT::DefaultTemplates-&gt;templates($set) or return;
+
+    my $trnames    = {};
+    my $tmpl_types = {};
+    my $tmpl_ids   = {};
+    my $tmpls      = {};
+    foreach my $tmpl (@$tmpl_list) {
+        $tmpl-&gt;{text} = $app-&gt;translate_templatized( $tmpl-&gt;{text} );
+        $tmpl_ids-&gt;{ $tmpl-&gt;{identifier} } = $tmpl
+            if $tmpl-&gt;{identifier};
+        $trnames-&gt;{ $app-&gt;translate( $tmpl-&gt;{name} ) } = $tmpl-&gt;{name};
+        if ( $tmpl-&gt;{type} !~ m/^(archive|individual|page|category|index|custom|widget)$/ )
+        {
+            $tmpl_types-&gt;{ $tmpl-&gt;{type} } = $tmpl;
+        }
+        else {
+            $tmpls-&gt;{ $tmpl-&gt;{type} }{ $tmpl-&gt;{name} } = $tmpl;
+        }
+    }
+
+    my $t = time;
+
+    my @msg;
+    my @id = $app-&gt;param('id');
+    require MT::Template;
+    foreach my $tmpl_id (@id) {
+        my $tmpl = MT::Template-&gt;load($tmpl_id);
+        next unless $tmpl;
+        my $blog_id = $tmpl-&gt;blog_id;
+
+        # FIXME: permission check -- for this blog_id
+
+        my @ts = MT::Util::offset_time_list( $t, $blog_id );
+        my $ts = sprintf &quot;%04d-%02d-%02d %02d:%02d:%02d&quot;, $ts[5] + 1900,
+          $ts[4] + 1, @ts[ 3, 2, 1, 0 ];
+
+        my $orig_name = $trnames-&gt;{ $tmpl-&gt;name } || $tmpl-&gt;name;
+        my $val = ( $tmpl-&gt;identifier ? $tmpl_ids-&gt;{ $tmpl-&gt;identifier() } : undef )
+          || $tmpl_types-&gt;{ $tmpl-&gt;type() }
+          || $tmpls-&gt;{ $tmpl-&gt;type() }{$orig_name};
+        if ( !$val ) {
+            push @msg,
+              $app-&gt;translate(
+&quot;Skipping template '[_1]' since it appears to be a custom template.&quot;,
+                $tmpl-&gt;name
+              );
+            next;
+        }
+
+        my $text = $tmpl-&gt;text;
+        $text =~ s/\s+//g;
+
+        my $def_text = $val-&gt;{text};
+        $def_text =~ s/\s+//g;
+
+        if ($text ne $def_text) {
+            # if it has been customized, back it up to a new tmpl record
+            my $backup = $tmpl-&gt;clone;
+            delete $backup-&gt;{column_values}
+              -&gt;{id};    # make sure we don't overwrite original
+            delete $backup-&gt;{changed_cols}-&gt;{id};
+            $backup-&gt;name( $backup-&gt;name . ' (Backup from ' . $ts . ')' );
+            if ( $backup-&gt;type !~
+                m/^(archive|individual|page|category|index|custom|widget)$/ )
+            {
+                $backup-&gt;type('custom');    # system templates can't be created
+            }
+            $backup-&gt;outfile('');
+            $backup-&gt;linked_file( $tmpl-&gt;linked_file );
+            $backup-&gt;rebuild_me(0);
+            $backup-&gt;build_dynamic(0);
+            $backup-&gt;identifier(undef);
+            $backup-&gt;save;
+            push @msg,
+              $app-&gt;translate(
+    'Refreshing template &lt;strong&gt;[_3]&lt;/strong&gt; with &lt;a href=&quot;?__mode=view&amp;amp;blog_id=[_1]&amp;amp;_type=template&amp;amp;id=[_2]&quot;&gt;backup&lt;/a&gt;',
+                  $blog_id, $backup-&gt;id, $tmpl-&gt;name );
+
+            # we found that the previous template had not been
+            # altered, so replace it with new default template...
+            $tmpl-&gt;text( $val-&gt;{text} );
+            $tmpl-&gt;identifier( $val-&gt;{identifier} );
+            $tmpl-&gt;linked_file('');
+            $tmpl-&gt;save;
+        } else {
+            push @msg, $app-&gt;translate(&quot;Skipping template '[_1]' since it has not been changed.&quot;, $tmpl-&gt;name);
+        }
+    }
+    my @msg_loop;
+    push @msg_loop, { message =&gt; $_ } foreach @msg;
+
+    $app-&gt;build_page( 'refresh_results.tmpl',
+        { message_loop =&gt; \@msg_loop, return_url =&gt; $app-&gt;return_uri } );
+}
+
+sub publish_index_templates {
+    my $app = shift;
+    $app-&gt;validate_magic or return;
+
+    # permission check
+    my $perms = $app-&gt;permissions;
+    return $app-&gt;errtrans(&quot;Permission denied.&quot;)
+        unless $app-&gt;user-&gt;is_superuser ||
+            $perms-&gt;can_administer_blog ||
+            $perms-&gt;can_rebuild;
+
+    my $blog = $app-&gt;blog;
+    my $templates = MT-&gt;model('template')-&gt;lookup_multi([ $app-&gt;param('id') ]);
+    TEMPLATE: for my $tmpl (@$templates) {
+        next TEMPLATE if !defined $tmpl;
+        next TEMPLATE if $tmpl-&gt;blog_id != $blog-&gt;id;
+        $app-&gt;rebuild_indexes(
+            Blog     =&gt; $blog,
+            Template =&gt; $tmpl,
+        );
+    }
+
+    $app-&gt;call_return( published =&gt; 1 );
+}
+
 1;
 __END__
 </diff>
      <filename>lib/MT/App/CMS.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -13,7 +13,7 @@ use MT::App;
 use MT::Comment;
 use MT::I18N qw( wrap_text encode_text );
 use MT::Util
-  qw( remove_html encode_html encode_url decode_url is_valid_email is_valid_url escape_unicode format_ts encode_js );
+  qw( remove_html encode_html encode_url decode_url is_valid_email is_valid_url is_url escape_unicode format_ts encode_js );
 use MT::Entry qw(:constants);
 use MT::Author;
 use MT::JunkFilter qw(:constants);
@@ -868,7 +868,7 @@ sub post {
         }
     }
     if ( $comment-&gt;url ) {
-        if ( my $fixed = is_valid_url( $comment-&gt;url, 'stringent' ) ) {
+        if ( my $fixed = is_valid_url( $comment-&gt;url ) ) {
             $comment-&gt;url($fixed);
         }
         else {
@@ -1021,30 +1021,24 @@ sub eval_comment {
 
     my $commenter_status;
     if ($commenter) {
-        if ( MT::Author::COMMENTER() eq $commenter-&gt;type ) {
-            $commenter_status = $commenter-&gt;commenter_status( $entry-&gt;blog_id );
-            if ( $commenter_status == MT::Author::APPROVED() ) {
-                if ( $blog-&gt;publish_trusted_commenters ) {
-                    $comment-&gt;approve;
-                    return $comment;
-                }
-                else {
-                    $comment-&gt;moderate;
-                    return $comment;
-                }
-            }
-            if ( $commenter_status == MT::Author::PENDING() ) {
-
-                # just in case record doesn't exist...
-                $commenter-&gt;pending( $entry-&gt;blog_id );
+        $commenter_status = $commenter-&gt;commenter_status( $entry-&gt;blog_id );
+        if ( $commenter_status == MT::Author::APPROVED() ) {
+            if ( $blog-&gt;publish_trusted_commenters ) {
+                $comment-&gt;approve;
+                return $comment;
             }
-            if ( $commenter_status == MT::Author::BANNED() ) {
-                return undef;
+            else {
+                $comment-&gt;moderate;
+                return $comment;
             }
         }
-        elsif ( MT::Author::AUTHOR() eq $commenter-&gt;type ) {
-            $comment-&gt;approve;
-            return $comment;
+        if ( $commenter_status == MT::Author::PENDING() ) {
+
+            # just in case record doesn't exist...
+            $commenter-&gt;pending( $entry-&gt;blog_id );
+        }
+        if ( $commenter_status == MT::Author::BANNED() ) {
+            return undef;
         }
     }
 
@@ -1237,7 +1231,7 @@ sub _make_comment {
     $comment-&gt;entry_id( $entry-&gt;id );
     $comment-&gt;author( remove_html($nick) );
     $comment-&gt;email( remove_html($email) );
-    $url = is_valid_url( $url, 'stringent' );
+    $url = is_valid_url( $url );
     $comment-&gt;url( $url eq 'http://' ? '' : $url );
     $comment-&gt;text($text);
 
@@ -1732,7 +1726,7 @@ sub save_commenter_profile {
         $param{error} = $app-&gt;translate('Email Address is invalid.');
         return $app-&gt;build_page( 'profile.tmpl', \%param );
     }
-    if ( $param{url} &amp;&amp; !is_valid_url( $param{url} ) ) {
+    if ( $param{url} &amp;&amp; !is_url( $param{url} ) ) {
         $param{error} = $app-&gt;translate('URL is invalid.');
         return $app-&gt;build_page( 'profile.tmpl', \%param );
     }</diff>
      <filename>lib/MT/App/Comments.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/App/NotifyList.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,11 @@
-# Original Copyright 2001-2002 Jay Allen.
-# Modifications and integration Copyright 2001-2007 Six Apart.
-# This code cannot be redistributed without permission from www.sixapart.com.
-# For more information, consult your Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
-## todo:
-## optimize by combining query into a compiled sub
+# Original Copyright 2001-2002 Jay Allen.
+# Modifications and integration Copyright 2001-2007 Six Apart.
 
 package MT::App::Search;
 </diff>
      <filename>lib/MT/App/Search.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/App/Trackback.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -305,6 +305,7 @@ sub init_blog {
     no warnings;
     @$sets = sort { $a-&gt;{order} &lt;=&gt; $b-&gt;{order} } @$sets;
     $param{'template_set_loop'} = $sets;
+    $param{'template_set_index'} = $#$sets;
 
     if ($app-&gt;param('back')) {
         return $app-&gt;init_user;
@@ -364,7 +365,7 @@ sub init_blog {
         blog_url =&gt; uri_escape($param{blog_url}),
         blog_path =&gt; uri_escape($param{blog_path}),
         blog_timezone =&gt; $param{blog_timezone},
-        blog_template_set =&gt; $param{blog_template_set},
+        blog_template_set =&gt; $param{blog_template_set} || 'mt_blog',
     };
 
     my $steps;</diff>
      <filename>lib/MT/App/Upgrader.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/App/Viewer.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,8 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.movabletype.org.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
-# $Id: Wizard.pm 32597 2006-06-28 02:51:44Z ytakayama $
+# $Id$
 
 package MT::App::Wizard;
 
@@ -87,7 +88,7 @@ sub init_core_registry {
             start =&gt; {
                 order =&gt; 0,
                 handler =&gt; \&amp;start,
-                params =&gt; ['set_static_uri_to'],
+                params =&gt; [qw(set_static_uri_to set_static_file_to)],
             },
             configure =&gt; {
                 order =&gt; 100,
@@ -222,7 +223,6 @@ sub run_step {
     my $h = $steps-&gt;{$curr_step}{handler};
 
     my %param = $app-&gt;unserialize_config;
-
     my $keys = $app-&gt;config_keys;
     if ($curr_step) {
         foreach (@{ $keys-&gt;{$curr_step} }) {
@@ -268,15 +268,18 @@ sub pre_start {
     my %param;
 
     eval { use File::Spec; };
-    my ($cfg, $cfg_exists);
+    my ($cfg, $cfg_exists, $static_file_path);
     if (!$@) {
         $cfg = File::Spec-&gt;catfile($app-&gt;{mt_dir}, 'mt-config.cgi');
         $cfg_exists |= 1 if -f $cfg;
+
+        $static_file_path = File::Spec-&gt;catfile($app-&gt;static_file_path);
     }
 
     $param{cfg_exists} = $cfg_exists;
     $param{valid_static_path} = 1 if $app-&gt;is_valid_static_path($app-&gt;static_path);
-    $param{mt_static_exists} = $app-&gt;mt_static_exists; 
+    $param{mt_static_exists} = $app-&gt;mt_static_exists;
+    $param{static_file_path} = $static_file_path;
 
     return $app-&gt;build_page(&quot;start.tmpl&quot;, \%param);
 }
@@ -319,11 +322,17 @@ sub build_page {
 
 sub start {
     my $app = shift;
+    my %param = @_;
 
-    # test for static_path
     my $static_path = $app-&gt;param('set_static_uri_to');
+    my $static_file_path = defined $param{set_static_file_to} ?
+        $param{set_static_file_to} :
+        $app-&gt;param('set_static_file_to');
+    $param{set_static_file_to} = $static_file_path;
+
+    # test for static_path
     unless ($app-&gt;param('set_static_uri_to')) {
-        my %param = ('uri_invalid' =&gt; 1 );
+        $param{uri_invalid} = 1;
         return $app-&gt;build_page(&quot;start.tmpl&quot;, \%param);
     }
 
@@ -333,12 +342,27 @@ sub start {
     $static_path .= '/' unless $static_path =~ m!/$!;
 
     unless ($app-&gt;is_valid_static_path($static_path)) {
-        my %param = ('uri_invalid' =&gt; 1, set_static_uri_to =&gt; $app-&gt;param('set_static_uri_to') );
+        $param{uri_invalid} = 1;
+        $param{set_static_uri_to} = $app-&gt;param('set_static_uri_to');
         return $app-&gt;build_page(&quot;start.tmpl&quot;, \%param);
     }
 
     $app-&gt;config-&gt;set('StaticWebPath', $static_path);
 
+    # test for static_file_path
+    unless ($static_file_path) {
+        $param{file_invalid} = 1;
+        return $app-&gt;build_page(&quot;start.tmpl&quot;, \%param);
+    }
+    
+    if (!(-d $static_file_path) || !(-f File::Spec-&gt;catfile($static_file_path, &quot;mt.js&quot;))) {
+        $param{file_invalid} = 1;
+        $param{set_static_uri_to} = $app-&gt;param('set_static_uri_to');
+        return $app-&gt;build_page(&quot;start.tmpl&quot;, \%param);
+    }
+    $param{config} = $app-&gt;serialize_config(%param);
+    $param{static_file} = $static_file_path;
+
     # test for required packages...
     my $req = $app-&gt;registry(&quot;required_packages&quot;);
     my @REQ;
@@ -348,7 +372,7 @@ sub start {
     }
     my ($needed) = $app-&gt;module_check(\@REQ);
     if (@$needed) {
-        my %param = ( 'package_loop' =&gt; $needed );
+        $param{package_loop} = $needed;
         $param{required} = 1;
         return $app-&gt;build_page(&quot;packages.tmpl&quot;, \%param);
     }
@@ -366,7 +390,7 @@ sub start {
     }
     my ($db_missing) = $app-&gt;module_check(\@DATA);
     if ((scalar @$db_missing) == (scalar @DATA)) {
-        my %param = ( 'package_loop' =&gt; $db_missing );
+        $param{package_loop} = $db_missing;
         $param{missing_db_or_optional} = 1;
         $param{missing_db} = 1;
         return $app-&gt;build_page(&quot;packages.tmpl&quot;, \%param);
@@ -381,13 +405,13 @@ sub start {
     my ($opt_missing) = $app-&gt;module_check(\@OPT);
     push @$opt_missing, @$db_missing;
     if (@$opt_missing) {
-        my %param = ( 'package_loop' =&gt; $opt_missing );
+        $param{package_loop} = $opt_missing;
         $param{missing_db_or_optional} = 1;
         $param{optional} = 1;
         return $app-&gt;build_page(&quot;packages.tmpl&quot;, \%param);
     }
 
-    my %param = ( 'success' =&gt; 1 );
+    $param{success} = 1;
     return $app-&gt;build_page(&quot;packages.tmpl&quot;, \%param);
 }
 
@@ -662,6 +686,8 @@ sub seed {
         $param{config} = $app-&gt;serialize_config(%param);
     }
 
+    $param{static_file_path} = $param{set_static_file_to};
+
     require URI;
     my $uri = URI-&gt;new($app-&gt;cgipath);
     $param{cgi_path} = $uri-&gt;path;</diff>
      <filename>lib/MT/App/Wizard.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
-# $Id: Asset.pm 969 2006-12-21 01:47:02Z bchoate $
+# $Id$
 
 package MT::Asset;
 
@@ -334,6 +334,29 @@ sub on_upload {
     1;
 }
 
+sub edit_template_param {
+    my $asset = shift;
+    my ($cb, $app, $param, $tmpl) = @_;
+    return;
+}
+
+sub set_values_from_query {
+    my $asset = shift;
+    my ($q) = @_;
+
+    # Set the known columns from the form, if they're set. Subclasses can
+    # opt out or decorate this behavior by overriding the method.
+    my $names = $asset-&gt;column_names;
+    my %values;
+    for my $field (@$names) {
+        $values{$field} = $q-&gt;param($field)
+            if defined $q-&gt;param($field);
+    }
+    $asset-&gt;set_values(\%values);
+
+    1;
+}
+
 # $pseudo parameter causes function to return '%r' as
 # root instead of blog site path
 sub _make_cache_path {</diff>
      <filename>lib/MT/Asset.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Asset/Audio.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
-# $Id: Image.pm 987 2006-12-27 07:25:12Z fumiakiy $
+# $Id$
 
 package MT::Asset::Image;
 
@@ -26,10 +26,15 @@ sub class_label_plural {
 sub metadata {
     my $obj  = shift;
     my $meta = $obj-&gt;SUPER::metadata(@_);
+
+    my $width  = $obj-&gt;image_width;
+    my $height = $obj-&gt;image_height;
+    $meta-&gt;{image_width}  = $width  if defined $width;
+    $meta-&gt;{image_height} = $height if defined $height;
     $meta-&gt;{ MT-&gt;translate(&quot;Actual Dimensions&quot;) } =
-      MT-&gt;translate( &quot;[_1] x [_2] pixels&quot;,
-        $obj-&gt;image_width, $obj-&gt;image_height )
-      if defined $obj-&gt;image_width &amp;&amp; defined $obj-&gt;image_height;
+      MT-&gt;translate( &quot;[_1] x [_2] pixels&quot;, $width, $height )
+      if defined $width &amp;&amp; defined $height;
+
     $meta;
 }
 
@@ -304,7 +309,7 @@ q|&lt;a href=&quot;%s&quot; onclick=&quot;window.open('%s','popup','width=%d,height=%d,scrollbars=
         else {
             if ( $param-&gt;{thumb} ) {
                 $text = sprintf(
-                    '&lt;a href=&quot;%s&quot;&gt;&lt;img alt=&quot;%s&quot; src=&quot;%s&quot; %s %s/&gt;&lt;/a&gt;',
+                    '&lt;a href=&quot;%s&quot;&gt;&lt;img alt=&quot;%s&quot; src=&quot;%s&quot; %s %s /&gt;&lt;/a&gt;',
                     MT::Util::encode_html( $asset-&gt;url ),
                     MT::Util::encode_html( $asset-&gt;label ),
                     MT::Util::encode_html( $thumb-&gt;url ),
@@ -314,7 +319,7 @@ q|&lt;a href=&quot;%s&quot; onclick=&quot;window.open('%s','popup','width=%d,height=%d,scrollbars=
             }
             else {
                 $text = sprintf(
-                    '&lt;img alt=&quot;%s&quot; src=&quot;%s&quot; %s %s/&gt;',
+                    '&lt;img alt=&quot;%s&quot; src=&quot;%s&quot; %s %s /&gt;',
                     MT::Util::encode_html( $asset-&gt;label ),
                     MT::Util::encode_html( $asset-&gt;url ),
                     $dimensions, $wrap_style,
@@ -645,6 +650,14 @@ sub on_upload {
     1;
 }
 
+sub edit_template_param {
+    my $asset = shift;
+    my ($cb, $app, $param, $tmpl) = @_;
+
+    $param-&gt;{image_height} = $asset-&gt;image_height;
+    $param-&gt;{image_width}  = $asset-&gt;image_width;
+}
+
 1;
 
 __END__</diff>
      <filename>lib/MT/Asset/Image.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Asset/Video.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Association.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Atom.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/AtomServer.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Auth.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Auth/BasicAuth.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Auth/LiveJournal.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Auth/MT.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Auth/OpenID.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Auth/TypeKey.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Auth/Vox.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Author.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,13 @@
-# Copyright 2001-2006 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
 package MT::BackupRestore;
 use strict;
 
+use MT::Util qw( encode_url );
 use Symbol;
 use base qw( MT::ErrorHandler );
 
@@ -15,6 +16,16 @@ use constant NS_MOVABLETYPE =&gt; 'http://www.sixapart.com/ns/movabletype';
 use File::Spec;
 use File::Copy;
 
+MT-&gt;add_callback('restore', 3, MT-&gt;instance, sub {
+    my ($cb, $objects, $deferred, $errors, $callback) = @_;
+    MT::BackupRestore-&gt;cb_restore_objects( $objects, $callback );
+});
+
+MT-&gt;add_callback('restore_asset', 3, MT-&gt;instance, sub {
+    my ($cb, $asset, $callback) = @_;
+    MT::BackupRestore-&gt;cb_restore_asset( $asset, $callback );
+});
+
 sub _populate_obj_to_backup {
     my $pkg = shift;
     my ($blog_ids, $skip, $later) = @_;
@@ -229,13 +240,9 @@ sub restore_file {
     my ($blog_ids, $asset_ids) = eval { $class-&gt;restore_process_single_file(
         $fh, $objects, $deferred, $errors, $schema_version, $overwrite, $callback
     ); };
+
+    MT-&gt;run_callbacks('restore', $objects, $deferred, $errors, $callback);
     $$errormsg = join('; ', @$errors);
-    #my @blog_ids;
-    #while (my ($key, $value) = each %$objects) {
-    #    if ($key =~ /MT::Blog#/) {
-    #        push @blog_ids, $value-&gt;id;
-    #    }
-    #}
     ($deferred, $blog_ids);
 }
  
@@ -285,7 +292,7 @@ sub restore_process_single_file {
 
 sub restore_directory {
     my $class = shift;
-    my ($dir, $errors, $error_assets, $schema_version, $callback) = @_;
+    my ($dir, $errors, $error_assets, $schema_version, $overwrite, $callback) = @_;
 
     my $manifest;
     my @files;
@@ -324,7 +331,7 @@ sub restore_directory {
         open $fh, &quot;&lt;$filepath&quot; or push @$errors, MT-&gt;translate(&quot;Can't open [_1].&quot;), next;
 
         my ($tmp_blog_ids, $tmp_asset_ids) = eval { __PACKAGE__-&gt;restore_process_single_file(
-            $fh, \%objects, $deferred, $errors, $schema_version, $callback); };
+            $fh, \%objects, $deferred, $errors, $schema_version, $overwrite, $callback); };
 
         close $fh;
         last if $@;
@@ -332,6 +339,8 @@ sub restore_directory {
         push @blog_ids, @$tmp_blog_ids if defined $tmp_blog_ids;
         push @asset_ids, @$tmp_asset_ids if defined $tmp_asset_ids;
     }
+
+    MT-&gt;run_callbacks('restore', \%objects, $deferred, $errors, $callback);
     my $blog_ids = scalar(@blog_ids) ? \@blog_ids : undef;
     my $asset_ids = scalar(@asset_ids) ? \@asset_ids : undef;
     ($deferred, $blog_ids, $asset_ids);
@@ -395,11 +404,170 @@ sub restore_asset {
             or $errors-&gt;{$id} = $!;
     }
 
-    $callback-&gt;(exists($errors-&gt;{$id}) ?
-        MT-&gt;translate('Failed: ') . $errors-&gt;{$id} :
-        MT-&gt;translate(&quot;Done.&quot;)
+    if ( exists $errors-&gt;{$id} ) {
+        return $callback-&gt;( MT-&gt;translate('Failed: ') . $errors-&gt;{$id} . &quot;\n&quot; );
+    }
+
+    $callback-&gt;( MT-&gt;translate(&quot;Done.&quot;) . &quot;\n&quot; );
+
+    MT-&gt;run_callbacks('restore_asset', $asset, $callback);
+    
+    1;
+}
+
+sub _sync_asset_id {
+    my ($text, $related) = @_;
+
+    $text =~ s!&lt;form([^&gt;]*?\s)mt:asset-id=([&quot;'])(\d+)([&quot;'])([^&gt;]*?)&gt;(.+?)&lt;/form&gt;!
+        my $old_id = $3;
+        my $asset = $related-&gt;{$old_id};
+        my $result = '&lt;form' . $1 . 'mt:asset-id=' . $2 . $asset-&gt;id . $4 . $5 . '&gt;';
+        my $html = $6;
+        my $filename = quotemeta(encode_url($asset-&gt;file_name));
+        my $url = $asset-&gt;url;
+        my @children = MT-&gt;model('asset')-&gt;load(
+            { parent =&gt; $asset-&gt;id, blog_id =&gt; $asset-&gt;blog_id, class =&gt; '*' }
+        );
+        my %children = map {
+            $_-&gt;id =&gt; {
+                'filename' =&gt; quotemeta(encode_url($_-&gt;file_name)),
+                'url' =&gt; $_-&gt;url
+            }
+        } @children;
+        $result .= $html . '&lt;/form&gt;';
+        $result;
+    !igem;
+    $text;
+}
+
+sub cb_restore_objects {
+    my $pkg = shift;
+    my ($all_objects, $callback) = @_;
+
+    my %entries;
+    my %assets;
+    my %old_ids;
+    for my $key ( keys %$all_objects ) {
+        if ( $key =~ /^MT::Entry#(\d+)$/ ) {
+            my $new_id = $all_objects-&gt;{$key}-&gt;id;
+            $entries{$new_id} = $all_objects-&gt;{$key};
+        } elsif ( $key =~ /^MT::Asset#(\d+)$/ ) {
+            my $old_id = $1;
+            my $new_id = $all_objects-&gt;{$key}-&gt;id;
+            $assets{$new_id} = {
+                object =&gt; $all_objects-&gt;{$key},
+                old_id =&gt; $old_id,
+            };
+        }
+    }
+
+    my $i = 0;
+    $callback-&gt;(
+        MT-&gt;translate(&quot;Restoring asset associations ... ( [_1] )&quot;, $i++),
+        'cb-restore-entry-asset'
+    );
+    for my $obj_id ( keys %entries ) {
+        my $entry = $entries{$obj_id};
+
+        my @placements = MT-&gt;model('objectasset')-&gt;load( {
+            object_id =&gt; $obj_id, 
+            object_ds =&gt; 'entry', 
+            blog_id =&gt; $entry-&gt;blog_id
+        });
+        next unless @placements;
+
+        my %related;
+        for my $placement ( @placements ) {
+            my $asset_hash = $assets{$placement-&gt;asset_id};
+            next unless $asset_hash;
+            $related{ $asset_hash-&gt;{old_id} } = $asset_hash-&gt;{object};
+        }
+
+        $callback-&gt;(
+            MT-&gt;translate(&quot;Restoring asset associations in [lc,_1] ... ( [_2] )&quot;, $entry-&gt;class_label, $i++),
+            'cb-restore-entry-asset'
+        );
+        for my $col ( qw( text text_more ) ) {
+            my $text = $entry-&gt;$col;
+            next unless $text;
+            $text = _sync_asset_id( $text, \%related ); 
+            $entry-&gt;$col($text);
+        }
+        $entry-&gt;update();  # directly call update to bypass processing in save()
+    }
+    $callback-&gt;( MT-&gt;translate(&quot;Done.&quot;) . &quot;\n&quot; );
+    1;
+}
+
+sub _sync_asset_url {
+    my ($text, $asset) = @_;
+
+    my $filename = quotemeta(encode_url($asset-&gt;file_name));
+    my $url = $asset-&gt;url;
+    my $id = $asset-&gt;id;
+    my @children = MT-&gt;model('asset')-&gt;load(
+        { parent =&gt; $asset-&gt;id, blog_id =&gt; $asset-&gt;blog_id, class =&gt; '*' }
     );
-    $callback-&gt;(&quot;\n&quot;);
+    my %children = map {
+        $_-&gt;id =&gt; {
+            'filename' =&gt; quotemeta(encode_url($_-&gt;file_name)),
+            'url' =&gt; $_-&gt;url
+        }
+    } @children;
+
+    $text =~ s!&lt;form([^&gt;]*?\s)mt:asset-id=([&quot;'])$id([&quot;'])([^&gt;]*?)&gt;(.+?)&lt;/form&gt;!
+        my $result = '&lt;form' . $1 . 'mt:asset-id=' . $2 . $id . $3 . $4 . '&gt;';
+        my $html = $5;
+        $html =~ s#&lt;a([^&gt;]*? )href=([&quot;'])[^&gt;]+?/$filename([&quot;'])([^&gt;]*?)&gt;#&lt;a$1href=$2$url$3$4&gt;#gim;
+        $html =~ s#&lt;img([^&gt;]*? )src=([&quot;'])[^&gt;]+?/$filename([&quot;'])([^&gt;]*?)(/? *)&gt;#&lt;img$1src=$2$url$3$4$5&gt;#gim;
+        if ( %children ) {
+            for my $child (values %children) {
+                my $child_filename = $child-&gt;{filename};
+                my $child_url = $child-&gt;{url};
+                $html =~ s#&lt;img([^&gt;]*? )src=([&quot;'])[^&gt;]+?/$child_filename([&quot;'])([^&gt;]*?)&gt;#&lt;img$1src=$2$child_url$3$4&gt;#gim;
+                $html =~ s#&lt;a([^&gt;]*? )href=([&quot;'])[^&gt;]+?/$child_filename([&quot;'])([^&gt;]*?)&gt;#&lt;a$1href=$2$child_url$3$4&gt;#gim;
+                $html =~ s#&lt;a([^&gt;]*? )onclick=([&quot;'])[^&gt;]+?/$child_filename([&quot;'])([^&gt;]*?)&gt;#&lt;a$1onclick=$2$child_url$3$4&gt;#gim;
+            }
+        }
+        $result .= $html . '&lt;/form&gt;';
+        $result;
+    !igem;
+    $text;
+}
+
+sub cb_restore_asset {
+    my $pkg = shift;
+    my ($asset, $callback) = @_;
+    
+    my @placements = MT-&gt;model('objectasset')-&gt;load( {
+        asset_id =&gt; $asset-&gt;id, 
+        blog_id =&gt; $asset-&gt;blog_id
+    });
+
+    my $i = 0;
+    $callback-&gt;(
+        MT-&gt;translate('Restoring url of the assets ( [_1] )...', $i++),
+        'cb-restore-asset-url'
+    );
+    for my $placement (@placements) {  
+        next unless 'entry' eq $placement-&gt;object_ds;  
+        my $entry = MT-&gt;model('entry')-&gt;load( $placement-&gt;object_id );  
+        next unless $entry;  
+        
+        $callback-&gt;(
+            MT-&gt;translate('Restoring url of the assets in [lc,_1] ( [_2] )...', $entry-&gt;class_label, $i++),
+            'cb-restore-asset-url'
+        );
+        for my $col ( qw( text text_more ) ) {
+            my $text = $entry-&gt;$col;
+            next unless $text;
+            $text = _sync_asset_url( $text, $asset );
+            $entry-&gt;$col($text);
+        }
+        $entry-&gt;update();  # directly call update to bypass processing in save()
+    }
+    $callback-&gt;( MT-&gt;translate(&quot;Done.&quot;) . &quot;\n&quot; );
+    1;
 }
 
 sub _restore_asset_multi {
@@ -966,6 +1134,12 @@ which are restored in the very session, and hash of asset_ids.
 TODO A method which reads specified directory, find a manifest file,
 and do the multi-file restore operation directed by the manifest file.
 
+=head2 restore_object_asset
+
+Accepts an asset object just restored, populate associated entries,
+and scan text and text_more for each entry.  If association marker
+(&lt;form&gt; tag) is found, replace asset id and URL to the new ones.
+
 =head2 restore_asset
 
 TODO A method which restores the assets' actual files to the
@@ -1005,7 +1179,7 @@ a callback to Backup callback, and Backup process will call the callbacks
 to give plugins a chance to add their own data to the backup file.
 Otherwise, plugin's object classes is likely be ignored in backup operation.
 
-=item Restore
+=item Restore.&lt;element_name&gt;:&lt;xmlnamespace&gt;
 
 Restore callbacks are called in convention like below:
 
@@ -1037,6 +1211,53 @@ parameters described above.  XML Namespace is required to be registered,
 so an xml node can be resolved into what plugins to be called back, 
 and can be distinguished the same element name with each other.
 
+=item restore
+    
+Calling convention is:
+
+    callback($cb, $objects, $deferred, $errors, $callback);
+
+This callback is called when all of the XML files in the particular
+restore session are restored, thus, when $objects and $deferred
+would not have any more objects in them.  This callback is useful
+for object classes which have relationships with other classes,
+for the kind of classes may not be able to handle relationship
+correctly until the associated objects would be successfully
+restored.
+
+NOTE that this callback is called BEFORE blogs' site_path and
+site_url are updated.  Therefore, blog objects and other objects
+which contains path information such as assets still have old
+url and path in I&lt;$objects&gt;.
+
+$objects is an hash reference which contains all the restored objects
+in the restore session.  The hash keys are stored in the format
+MT::ObjectClassName#old_id, and hash values are object reference
+of the actually restored objects (with new id).  Old ids are ids
+which are stored in the XML files, while new ids are ids which
+are restored.
+
+$deferred is an hash reference which contains information about
+restore-deferred objects.  Deferred objects are those objects
+which appeared in the XMl file but could not be restored because
+any parent objects are missing.  The hash keys are stored in
+the format MT::ObjectClassName#old_id and hash values are 1.
+
+$callback is a code reference which will print out the passed paramter.
+Callback method can use this to communicate with users.
+
+=item restore_asset
+    
+Calling convention is:
+
+    callback($cb, $asset, $callback);
+
+This callback is called when asset's actual file is restored.
+$asset has new url and path.
+
+$callback is a code reference which will print out the passed paramter.
+Callback method can use this to communicate with users.
+
 =head1 AUTHOR &amp; COPYRIGHT
 
 Please see L&lt;MT/AUTHOR &amp; COPYRIGHT&gt;.</diff>
      <filename>lib/MT/BackupRestore.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2006 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -262,7 +262,14 @@ sub end_element {
                 $exists = 1 if $perm;
             }
             unless ($exists) {
-                if ($obj-&gt;save()) {
+                my $result;
+                if ( $obj-&gt;id ) {
+                    $result = $obj-&gt;update();
+                }
+                else {
+                    $result = $obj-&gt;insert();
+                }
+                if ( $result ) {
                     if ($class =~ /MT::Asset(::.+)*/) {
                         $class = 'MT::Asset';
                     }</diff>
      <filename>lib/MT/BackupRestore/BackupFileHandler.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
-# Copyright 2001-2006 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
-# $Id: ManifestFileHandler.pm 962 2006-12-20 11:49:08Z fumiakiy $
+# $Id$
 
 package MT::BackupRestore::ManifestFileHandler;
 </diff>
      <filename>lib/MT/BackupRestore/ManifestFileHandler.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::BasicAuthor;
 
 # fake out the require for this package since we're</diff>
      <filename>lib/MT/BasicAuthor.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::BasicSession;
 
 # fake out the require for this package since we're</diff>
      <filename>lib/MT/BasicSession.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Blocklist.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Blog.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Bootstrap.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -145,10 +145,11 @@ sub compile {
             }
         }
         if ($is_container) {
-            if ($whole_tag !~ m|/&gt;|) {
+            if ($whole_tag !~ m|/&gt;$|) {
                 my ($sec_end, $tag_end) = _consume_up_to(\$text,$sec_start,$tag);
                 if ($sec_end) {
-                    my $sec = substr $text, $sec_start, $sec_end - $sec_start;
+                    my $sec = $tag =~ m/ignore/i ? '' # ignore MTIgnore blocks
+                            : substr $text, $sec_start, $sec_end - $sec_start;
                     if ($sec !~ m/&lt;\$?MT/i) {
                         $rec-&gt;[2] = [ ($sec ne '' ? ['TEXT', $sec ] : ()) ];
                     }</diff>
      <filename>lib/MT/Builder.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Callback.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Category.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Comment.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Compat/v3.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Component.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Config.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ConfigMgr.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::Core;
 
 use strict;
@@ -173,7 +179,7 @@ BEGIN {
                 order =&gt; 300,
             },
             'blog.edit_all_posts' =&gt; {
-                label =&gt; trans('Manage Entries'),
+                label =&gt; trans('Edit All Entries'),
                 group =&gt; 'auth_pub',
                 order =&gt; 400,
             },
@@ -272,6 +278,7 @@ BEGIN {
             'AllowedTextFilters' =&gt; undef,
             'Serializer'    =&gt; { default =&gt; 'MT', },
             'SendMailPath'  =&gt; { default =&gt; '/usr/lib/sendmail', },
+            'RsyncPath'     =&gt; undef,
             'TimeOffset'    =&gt; { default =&gt; 0, },
             'WSSETimeout'   =&gt; { default =&gt; 120, },
             'StaticWebPath' =&gt; { default =&gt; '', },
@@ -302,6 +309,7 @@ BEGIN {
             'UploadPerms'           =&gt; { default =&gt; '0666', },
             'NoTempFiles'           =&gt; { default =&gt; 0, },
             'TempDir'               =&gt; { default =&gt; '/tmp', },
+            'RichTextEditor'        =&gt; { default =&gt; 'archetype', },
             'EntriesPerRebuild'     =&gt; { default =&gt; 40, },
             'UseNFSSafeLocking'     =&gt; { default =&gt; 0, },
             'NoLocking'             =&gt; { default =&gt; 0, },
@@ -389,9 +397,9 @@ BEGIN {
             # 'MTNewsURL' =&gt; {
             #     default =&gt; 'http://www.sixapart.com/movabletype/news/mt4_news_widget.html',
             # },
-            # 'LearningNewsURL' =&gt; {
-            #     default =&gt; 'http://learning.movabletype.org/newsbox.html',
-            # },
+            'LearningNewsURL' =&gt; {
+                default =&gt; 'http://learning.movabletype.org/newsbox.html',
+            },
             # 'HackingNewsURL' =&gt; {
             #     default =&gt; 'http://hacking.movabletype.org/newsbox.html',
             # },
@@ -404,7 +412,6 @@ BEGIN {
             'TypeKeyVersion'        =&gt; { default =&gt; '1.1' },
             'TransparentProxyIPs'   =&gt; { default =&gt; 0, },
             'DebugMode'             =&gt; { default =&gt; 0, },
-            'PublishCommenterIcon'  =&gt; { default =&gt; 1, },
             'ShowIPInformation'     =&gt; { default =&gt; 0, },
             'AllowComments'         =&gt; { default =&gt; 1, },
             'AllowPings'            =&gt; { default =&gt; 1, },
@@ -462,6 +469,7 @@ BEGIN {
             'FuturePostFrequency'       =&gt; { default =&gt; 1 },
             'AssetCacheDir'             =&gt; { default =&gt; 'assets_c', },
             'MemcachedServers'          =&gt; { type    =&gt; 'ARRAY', },
+            'MemcachedNamespace'        =&gt; undef,
             'CommenterRegistration'     =&gt; {
                 type    =&gt; 'HASH',
                 default =&gt; {
@@ -530,6 +538,12 @@ BEGIN {
                 },
             },
         },
+        richtext_editors =&gt; {
+            'archetype' =&gt; {
+                label =&gt; 'Movable Type Default',
+                template =&gt; 'archetype_editor.tmpl',
+            },
+        },
         ping_servers  =&gt; {
             'weblogs' =&gt; {
                 label =&gt; 'weblogs.com',
@@ -675,7 +689,7 @@ sub load_junk_filters {
 
 sub load_core_tasks {
     my $cfg = MT-&gt;config;
-    return {
+    my $tasks = {
         'FuturePost' =&gt; {
             label     =&gt; 'Publish Scheduled Entries',
             frequency =&gt; $cfg-&gt;FuturePostFrequency * 60,    # once per minute
@@ -706,6 +720,18 @@ sub load_core_tasks {
             },
         },
     };
+    if ( my $newsbox_url = $cfg-&gt;LearningNewsURL ) {
+        if ( $newsbox_url ne 'disable' ) {
+            $tasks-&gt;{LearningNewsRetrieval} = {
+                label =&gt; 'Retrieve Learning MT Updates',
+                frequency =&gt; 60 * 60 * 24,   # once a day
+                code =&gt; sub {
+                    MT::Util::get_newsbox_html($newsbox_url, 'LW');
+                },
+            };
+        }
+    }
+    $tasks;
 }
 
 sub remove_temporary_files {</diff>
      <filename>lib/MT/Core.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
+
 # Adapted from DateTime package to avoid requirement of DateTime package.
 
 package MT::DateTime;</diff>
      <filename>lib/MT/DateTime.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more details, consult 
-# your Movable Type license for details.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -161,6 +161,9 @@ BEGIN {
             'sidebar_3col' =&gt; {
                 label =&gt; 'Sidebar - 3 Column Layout',
             },
+            'sidebar' =&gt; {
+                label =&gt; 'Sidebar',
+            },
             'trackbacks' =&gt; {
                 label =&gt; 'TrackBacks',
             },</diff>
      <filename>lib/MT/DefaultTemplates.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -176,82 +176,20 @@ sub _nextprev {
     $label .= ':category='. $terms-&gt;{category_id} if exists $terms-&gt;{category_id};
     return $obj-&gt;{$label} if $obj-&gt;{$label};
 
-    # Selecting the adjacent object can be tricky since timestamps
-    # are not necessarily unique for entries. If we find that the
-    # next/previous object has a matching timestamp, keep selecting entries
-    # to select all entries with the same timestamp, then compare them using
-    # id as a secondary sort column.
-
-    my ($id, $ts) = ($obj-&gt;id, $obj-&gt;authored_on);
-    my $args = {
-        'sort' =&gt; 'authored_on',
-        'direction' =&gt; $next ? 'ascend' : 'descend',
-        'range_incl' =&gt; { 'authored_on' =&gt; 1 },
-    };
+    my $args = {};
     if (my $cat_id = delete $terms-&gt;{category_id}) {
         my $join = MT::Placement-&gt;join_on('entry_id',
             { category_id =&gt; $cat_id }
         );
-        if (exists $args-&gt;{join}) {
-            $args-&gt;{join} = [ $args-&gt;{join}, -and =&gt; $join ];
-        } else {
-            $args-&gt;{join} = $join;
-        }
+        $args-&gt;{join} = $join;
     }
-    my $iter = $class-&gt;load_iter({
-        blog_id =&gt; $obj-&gt;blog_id,
-        class =&gt; $obj-&gt;class,
-        authored_on =&gt; ($next ? [ $ts, undef ] : [ undef, $ts ]),
-        %{$terms}
-    }, $args);
-
-    # This selection should always succeed, but handle situation if
-    # it fails by returning undef.
-    return unless $iter;
-
-    # The 'same' array will hold any entries that have matching
-    # timestamps; we will then sort those by id to find the correct
-    # adjacent object.
-    my @same;
-    while (my $e = $iter-&gt;()) {
-        # Don't consider the object that is 'current'
-        next if $e-&gt;id == $id;
-        my $e_ts = $e-&gt;authored_on;
-        if ($e_ts eq $ts) {
-            # An object with the same timestamp should only be
-            # considered if the id is in the scope we're looking for
-            # (greater than for the 'next' object; less than for
-            # the 'previous' object).
-            push @same, $e
-                if $next &amp;&amp; $e-&gt;id &gt; $id or !$next &amp;&amp; $e-&gt;id &lt; $id;
-        } else {
-            # We found an object with a timestamp different than
-            # the 'current' object.
-            if (!@same) {
-                push @same, $e;
-                # We should check to see if this new timestamped object also
-                # has entries adjacent to _it_ that have the same timestamp.
-                while (my $e = $iter-&gt;()) {
-                    push(@same, $e), next if $e-&gt;authored_on eq $e_ts;
-                    $iter-&gt;('finish'), last;
-                }
-            } else {
-                $iter-&gt;('finish');
-            }
-            return $obj-&gt;{$label} = $e unless @same;
-            last;
-        }
-    }
-    if (@same) {
-        # If we only have 1 element in @same, return that.
-        return $obj-&gt;{$label} = $same[0] if @same == 1;
-        # Sort remaining elements in @same by id.
-        @same = sort { $a-&gt;id &lt;=&gt; $b-&gt;id } @same;
-        # Return front of list (smallest id) if selecting 'next'
-        # object. Return tail of list (largest id) if selection 'previous'.
-        return $obj-&gt;{$label} = $same[$next ? 0 : $#same];
-    }
-    return;
+
+    return $obj-&gt;{$label} = $obj-&gt;nextprev(
+        direction =&gt; $direction,
+        terms     =&gt; { blog_id =&gt; $obj-&gt;blog_id, class =&gt; $obj-&gt;class, %$terms },
+        args      =&gt; $args,
+        by        =&gt; 'authored_on',
+    );
 }
 
 sub trackback {</diff>
      <filename>lib/MT/Entry.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ErrorHandler.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/FileInfo.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -23,8 +23,7 @@ sub new {
 
 sub init {
     my $fmgr = shift;
-    $fmgr-&gt;{cfg} = MT-&gt;config;
-    return $fmgr;
+    $fmgr;
 }
 
 sub get_data;</diff>
      <filename>lib/MT/FileMgr.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/FileMgr/DAV.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/FileMgr/FTP.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -59,7 +59,7 @@ sub _write_file {
     my($from, $to, $type) = @_;
     local *FH;
     my($umask, $perms);
-    my $cfg = $fmgr-&gt;{cfg};
+    my $cfg = MT-&gt;config;
     if ($type &amp;&amp; $type eq 'upload') {
         $umask = $cfg-&gt;UploadUmask;
         $perms = $cfg-&gt;UploadPerms;
@@ -76,7 +76,7 @@ sub _write_file {
         binmode($from) if $fmgr-&gt;is_handle($from);
     }
     ## Lock file unless NoLocking specified.
-    flock FH, LOCK_EX unless $fmgr-&gt;{cfg}-&gt;NoLocking;
+    flock FH, LOCK_EX unless $cfg-&gt;NoLocking;
     seek FH, 0, 0;
     truncate FH, 0;
     my $bytes = 0;
@@ -102,7 +102,7 @@ sub mkpath {
     my $fmgr = shift;
     my($path) = @_;
     require File::Path;
-    my $umask = oct $fmgr-&gt;{cfg}-&gt;DirUmask;
+    my $umask = oct MT-&gt;config-&gt;DirUmask;
     my $old = umask($umask);
     eval { File::Path::mkpath([$path], 0, 0777) };
     return $fmgr-&gt;error($@) if $@;</diff>
      <filename>lib/MT/FileMgr/Local.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/FileMgr/SFTP.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Folder.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -23,9 +23,7 @@ BEGIN {
             _handle(decode =&gt; @_);
         };
     } else {
-        *decode = sub {
-            Encode::decode(@_);
-        };
+        *decode = \&amp;Encode::decode;
     }
 };
 </diff>
      <filename>lib/MT/I18N.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.movabletype.org
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/I18N/default.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.movabletype.org
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/I18N/en_us.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/I18N/ja.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/IPBanList.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Image.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Import.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ImportExport.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/JunkFilter.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -22,6 +22,18 @@ sub language_name {
 sub encoding { 'iso-8859-1' }   ## Latin-1
 sub ascii_only { 0 }
 
+sub lc {
+    my $lh = shift;
+    require MT::I18N;
+    MT::I18N::lowercase(@_);
+}
+
+sub uc {
+    my $lh = shift;
+    require MT::I18N;
+    MT::I18N::uppercase(@_);
+}
+
 1;
 __END__
 </diff>
      <filename>lib/MT/L10N.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-	# Copyright 2003-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -58,8 +59,8 @@ use vars qw( @ISA %Lexicon );
 	'Entry' =&gt; 'Eintrag',
 
 ## default_templates/notify-entry.mtml
-	'A new [_3] entitled \'[_1]\' has been published to [_2].' =&gt; 'Ein neuer Eintrag namens \'[_1]\' wurde in [_2] ver&#246;ffentlicht.',
-	'View [_1]:' =&gt; '[_1] ansehen:',
+	'A new [lc,_3] entitled \'[_1]\' has been published to [_2].' =&gt; 'Ein neuer Eintrag namens \'[_1]\' wurde in [_2] ver&#246;ffentlicht.',
+	'View [lc,_1]:' =&gt; '[_1] ansehen:',
 	'[_1] Title: [_2]' =&gt; 'Titel: [_2]',
 	'Publish Date: [_1]' =&gt; 'Ver&#246;ffentlichungsdatum:',
 	'Message from Sender:' =&gt; 'Nachricht des Absenders:',
@@ -186,7 +187,7 @@ use vars qw( @ISA %Lexicon );
 ## default_templates/javascript.mtml
 	'Thanks for signing in,' =&gt; 'Danke f&#252;r Ihre Anmeldung, ',
 	'. Now you can comment.' =&gt; '. Sie k&#246;nnen jetzt Ihren Kommentar verfassen.',
-	'sign out' =&gt; 'Abmelden',
+	'sign out' =&gt; 'abmelden',
 	'You do not have permission to comment on this blog.' =&gt; 'Sie haben nicht die notwendige Berechtigung, um in diesem Blog Kommentare zu schreiben.',
 	'Sign in' =&gt; 'Anmelden',
 	' to comment on this entry.' =&gt; ' um diesen Eintrag zu kommentieren.',
@@ -239,7 +240,7 @@ use vars qw( @ISA %Lexicon );
 	'[_1] ([_2])' =&gt; '[_1] ([_2])',
 	'About this Entry' =&gt; '&#220;ber diese Seite',
 	'About this Archive' =&gt; '&#220;ber dieses Archiv',
-	'About Archives' =&gt; '&#220;ber das Archiv',
+	'About Archives' =&gt; '&#220;ber die Archive',
 	'This page contains links to all the archived content.' =&gt; 'Diese Seite enth&#228;lt Links zu allen archivierten Eintr&#228;gen.',
 	'This page contains a single entry by [_1] published on &lt;em&gt;[_2]&lt;/em&gt;.' =&gt; 'Diese Seite enth&#228;lt einen einen einzelnen Eintrag von [_1] vom &lt;em&gt;[_2]&lt;/em&gt;.',
 	'&lt;a href=&quot;[_1]&quot;&gt;[_2]&lt;/a&gt; was the previous entry in this blog.' =&gt; '&lt;a href=&quot;[_1]&quot;&gt;[_2]&lt;/a&gt; ist der vorherige Eintrag in diesem Blog.',
@@ -430,35 +431,35 @@ use vars qw( @ISA %Lexicon );
 	'Can\'t load template' =&gt; 'Kann Vorlage nicht laden',
 	'Can\'t find template \'[_1]\'' =&gt; 'Kann Vorlage \'[_1]\' nicht finden',
 	'Can\'t find entry \'[_1]\'' =&gt; 'Kann Eintrag \'[_1]\' nicht finden',
-	'You used a [_1] tag without any arguments.' =&gt; 'Sie haben einen [_1]-Befehl ohne Argument verwendet.',
-	'You used an \'[_1]\' tag outside of the context of a author; perhaps you mistakenly placed it outside of an \'MTAuthors\' container?' =&gt; 'Sie haben ein \'[_1]\'-Befehl au&#223;erhalb eines Autoren-Kontexts verwendet - \'MTAuthors\'-Container erforderlich',
+	'You used a [_1] tag without any arguments.' =&gt; 'Sie haben einen [_1]-Tag ohne Argument verwendet.',
+	'You used an \'[_1]\' tag outside of the context of a author; perhaps you mistakenly placed it outside of an \'MTAuthors\' container?' =&gt; 'Sie haben ein \'[_1]\'-Tag au&#223;erhalb eines Autoren-Kontexts verwendet - \'MTAuthors\'-Container erforderlich',
 	'You have an error in your \'[_2]\' attribute: [_1]' =&gt; 'Fehler im \'[_2]\'-Attribut: [_1]',
 	'You have an error in your \'tag\' attribute: [_1]' =&gt; 'Fehler im \'tag\'-Attribut: [_1]',
 	'No such user \'[_1]\'' =&gt; 'Kein Benutzer \'[_1]\'',
-	'You used an \'[_1]\' tag outside of the context of an entry; perhaps you mistakenly placed it outside of an \'MTEntries\' container?' =&gt; '\'[_1]\'-Befehl au&#223;erhalb eines Eintrags-Kontexts verwendet - \'MTEntries\'-Container erforderlich.',
+	'You used an \'[_1]\' tag outside of the context of an entry; perhaps you mistakenly placed it outside of an \'MTEntries\' container?' =&gt; '\'[_1]\'-Tag au&#223;erhalb eines Eintrags-Kontexts verwendet - \'MTEntries\'-Container erforderlich.',
 	'You used &lt;$MTEntryFlag$&gt; without a flag.' =&gt; 'Sie haben &lt;$MTEntryFlag$&gt; ohne Flag verwendet.',
-	'You used an [_1] tag for linking into \'[_2]\' archives, but that archive type is not published.' =&gt; 'Sie haben mit einem [_1]-Befehl \'[_2]\'-Archive verlinkt, ohne diese vorher zu ver&#246;ffentlichen.',
+	'You used an [_1] tag for linking into \'[_2]\' archives, but that archive type is not published.' =&gt; 'Sie haben mit einem [_1]-Tag \'[_2]\'-Archive verlinkt, ohne diese vorher zu ver&#246;ffentlichen.',
 	'Could not create atom id for entry [_1]' =&gt; 'Konnte keine ATOM-ID f&#252;r Eintrag [_1] erzeugen',
 	'To enable comment registration, you need to add a TypeKey token in your weblog config or user profile.' =&gt; 'Um die Registrierung von Kommentarautoren zu erm&#246;glichen, geben Sie ein TypeKey-Token in den Weblogeinstellungen oder dem Benutzerenprofil an.',
 	'The MTCommentFields tag is no longer available; please include the [_1] template module instead.' =&gt; 'Der MTCommentFields-Befehl ist nicht mehr verf&#252;gbar. Bitte verwenden Sie stattdessen das [_1]-Vorlagenmodul.',
-	'You used an [_1] tag without a date context set up.' =&gt; 'Sie haben einen [_1]-Befehl ohne Datumskontext verwendet.',
-	'You used an \'[_1]\' tag outside of the context of a comment; perhaps you mistakenly placed it outside of an \'MTComments\' container?' =&gt; '\'[_1]\'-Befehl au&#223;erhalb eines Kommentar-Kontexts verwendet - \'MTComments\'-Container erforderlich.',
+	'You used an [_1] tag without a date context set up.' =&gt; 'Sie haben einen [_1]-Tag ohne Datumskontext verwendet.',
+	'You used an \'[_1]\' tag outside of the context of a comment; perhaps you mistakenly placed it outside of an \'MTComments\' container?' =&gt; '\'[_1]\'-Tag au&#223;erhalb eines Kommentar-Kontexts verwendet - \'MTComments\'-Container erforderlich.',
 	'[_1] can be used only with Daily, Weekly, or Monthly archives.' =&gt; '[_1] kann nur mit Tages-, Wochen- oder Monatsarchiven verwendet werden.',
 	'Group iterator failed.' =&gt; 'Gruppeniterator fehlgeschlagen.',
-	'You used an [_1] tag outside of the proper context.' =&gt; 'Sie haben ein [_1]-Befehl au&#223;erhalb seines Kontexts verwendet.',
+	'You used an [_1] tag outside of the proper context.' =&gt; 'Sie haben ein [_1]-Tag au&#223;erhalb seines Kontexts verwendet.',
 	'Could not determine entry' =&gt; 'Konnte Eintrag nicht bestimmen',
 	'Invalid month format: must be YYYYMM' =&gt; 'Ung&#252;ltiges Datumsformat: richtig ist JJJJMM',
 	'No such category \'[_1]\'' =&gt; 'Keine Kategorie \'[_1]\'',
-	'&lt;\$MTCategoryTrackbackLink\$&gt; must be used in the context of a category, or with the \'category\' attribute to the tag.' =&gt; '&lt;\$MTCategoryTrackbackLink\$&gt; muss im Kategoriekontext stehen oder mit dem \'category\'-Attribut des Befehls.',
-	'You failed to specify the label attribute for the [_1] tag.' =&gt; 'Kein Label-Attribut f&#252;r den [_1]-Befehl angegeben.',
-	'You used an \'[_1]\' tag outside of the context of a ping; perhaps you mistakenly placed it outside of an \'MTPings\' container?' =&gt; '\'[_1]\'-Befehl au&#223;erhalb eines Ping-Kontextes verwendet - \'MTPings\'-Container erforderlich.',
+	'&lt;\$MTCategoryTrackbackLink\$&gt; must be used in the context of a category, or with the \'category\' attribute to the tag.' =&gt; '&lt;\$MTCategoryTrackbackLink\$&gt; muss im Kategoriekontext stehen oder mit dem \'category\'-Attribut des Tags.',
+	'You failed to specify the label attribute for the [_1] tag.' =&gt; 'Kein Label-Attribut des [_1]-Tags angegeben.',
+	'You used an \'[_1]\' tag outside of the context of a ping; perhaps you mistakenly placed it outside of an \'MTPings\' container?' =&gt; '\'[_1]\'-Tag au&#223;erhalb eines Ping-Kontextes verwendet - \'MTPings\'-Container erforderlich.',
 	'[_1] used outside of [_2]' =&gt; '[_1] au&#223;erhalb [_2] verwendet',
 	'MT[_1] must be used in a [_2] context' =&gt; 'MT[_1] muss in einem [_2]-Kontext stehen',
 	'Cannot find package [_1]: [_2]' =&gt; 'Kann Paket [_1] nicht finden: [_2]',
 	'Error sorting [_2]: [_1]' =&gt; 'Fehler beim Sortieren von [_2]: [_1]',
 	'Edit' =&gt; 'Bearbeiten',
-	'You used an \'[_1]\' tag outside of the context of an asset; perhaps you mistakenly placed it outside of an \'MTAssets\' container?' =&gt; '\'[_1]\'-Befehl au&#223;erhalb eines Asset-Kontexts verwendet - m&#246;glicherweise au&#223;erhalb eines \'MTAssets\'-Containers?',
-	'You used an \'[_1]\' tag outside of the context of an page; perhaps you mistakenly placed it outside of an \'MTPages\' container?' =&gt; '\'[_1]\'-Befehl au&#223;erhalb eines Seiten-Kontexts verwendet - m&#246;glicherweise au&#223;erhalb eines \'MTPages\'-Containers?',
+	'You used an \'[_1]\' tag outside of the context of an asset; perhaps you mistakenly placed it outside of an \'MTAssets\' container?' =&gt; '\'[_1]\'-Tag au&#223;erhalb eines Asset-Kontexts verwendet - m&#246;glicherweise au&#223;erhalb eines \'MTAssets\'-Containers?',
+	'You used an \'[_1]\' tag outside of the context of an page; perhaps you mistakenly placed it outside of an \'MTPages\' container?' =&gt; '\'[_1]\'-Tag au&#223;erhalb eines Seiten-Kontexts verwendet - m&#246;glicherweise au&#223;erhalb eines \'MTPages\'-Containers?',
 	'You used an [_1] without a author context set up.' =&gt; '[_1] ohne vorhandenen Autorenkontext verwendet.',
 	'Can\'t load user.' =&gt; 'Kann Benutzerkonto nicht laden.',
 
@@ -507,7 +508,7 @@ use vars qw( @ISA %Lexicon );
 	'Invalid URL \'[_1]\'' =&gt; 'Ung&#252;ltige Web-Adresse (URL) \'[_1]\'',
 	'Text entered was wrong.  Try again.' =&gt; 'Der eingegebene Text ist falsch. Bitte versuchen Sie es erneut.',
 	'Comment save failed with [_1]' =&gt; 'Der Kommentar konnte nicht gespeichert werden: [_1]',
-	'Comment on &quot;[_1]&quot; by [_2].' =&gt; 'Kommentar zu &quot;[_1]&quot; von [_2]',
+	'Comment on &quot;[_1]&quot; by [_2].' =&gt; 'Kommentar zu &quot;[_1]&quot; von [_2].',
 	'Commenter save failed with [_1]' =&gt; 'Beim Speichern des Kommentarautors ist ein Fehler aufgetreten: [_1]',
 	'Publish failed: [_1]' =&gt; 'Ver&#246;ffentlichung fehlgeschlagen: [_1]',
 	'Failed comment attempt by pending registrant \'[_1]\'' =&gt; 'Fehlgeschlagener Kommentierungsversuch durch schwebenden Kommentarautoren \'[_1]\'',
@@ -625,7 +626,7 @@ use vars qw( @ISA %Lexicon );
 	'Comments posted since [_1]' =&gt; 'Seit [_1] ver&#246;ffentlichte Kommentare',
 	'Comments posted on or before [_1]' =&gt; 'Bis [_1] ver&#246;ffentlichte Kommentare',
 	'Invalid blog' =&gt; 'Ung&#252;ltiges Blog',
-	'Password Recovery' =&gt; 'Erinnerungssatz zur Passwortanforderung',
+	'Password Recovery' =&gt; 'Neues Passwort anfordern',
 	'Invalid password recovery attempt; can\'t recover password in this configuration' =&gt; 'Ung&#252;ltiger Versuch der Passwortanforderung. Passw&#246;rter k&#246;nnen in dieser Konfiguration nicht angefordert werden.',
 	'Invalid author_id' =&gt; 'Ung&#252;ltige Autoren-ID',
 	'Can\'t recover password in this configuration' =&gt; 'Passw&#246;rter k&#246;nnen in dieser Konfiguration nicht angefordert werden',
@@ -658,7 +659,7 @@ use vars qw( @ISA %Lexicon );
 	'Blog Activity Feed' =&gt; 'Aktivit&#228;tsfeed',
 	'*User deleted*' =&gt; 'Benutzer gel&#246;scht',
 	'All Feedback' =&gt; 'Feedback',
-	'Activity Log' =&gt; 'Aktivit&#228;tsprotokoll',
+	'Activity Log' =&gt; 'Aktivit&#228;ten',
 	'System Activity Feed' =&gt; 'Systemfeed',
 	'Activity log for blog \'[_1]\' (ID:[_2]) reset by \'[_3]\'' =&gt; 'Aktivit&#228;tsprotokoll von \'[_1]\' (ID:[_2]) on \'[_3]\' zur&#252;ckgesetzt',
 	'Activity log reset by \'[_1]\'' =&gt; 'Aktivit&#228;tsprotokoll zur&#252;ckgesetzt von \'[_1]\'',
@@ -902,7 +903,7 @@ use vars qw( @ISA %Lexicon );
 	'Role Name' =&gt; 'Rollenname',
 	'Roles Selected' =&gt; 'Gew&#228;hlte Rollen',
 	'' =&gt; ' ',
-	'Grant Permissions' =&gt; 'Berechtigungen zuweisen',
+	'Grant Permissions' =&gt; 'Rechte zuweisen',
 	'Backup' =&gt; 'Sichern',
 	'Backup &amp; Restore' =&gt; 'Sichern &amp; Wiederherstellen',
 	'Temporary directory needs to be writable for backup to work correctly.  Please check TempDir configuration directive.' =&gt; 'Das tempor&#228;re Verzeichnis muss zur Durchf&#252;hrung der Sicherung beschreibbar sein. Bitte &#252;berpr&#252;fen Sie Ihre TempDir-Einstellung.',
@@ -944,7 +945,7 @@ use vars qw( @ISA %Lexicon );
 	'You can\'t reply to unpublished comment.' =&gt; 'Sie k&#246;nnen nicht auf Kommentare antworten, die noch nicht ver&#246;ffentlicht wurden.',
 	'entries' =&gt; 'Eintr&#228;ge',
 	'This is You' =&gt; 'Das sind Sie',
-	'Handy Shortcuts' =&gt; 'Schnellzugriff',
+	'Handy Shortcuts' =&gt; 'N&#252;tzliche Abk&#252;rzungen',
 	'Movable Type News' =&gt; 'News von Movable Type',
 	'Blog Stats' =&gt; 'Statistik',
 	'Publish Entries' =&gt; 'Eintr&#228;ge ver&#246;ffentlichen',
@@ -1841,27 +1842,26 @@ use vars qw( @ISA %Lexicon );
 	'comment' =&gt; 'Kommentar',
 	'comments' =&gt; 'Kommentare',
 	'to publish' =&gt; 'zu Ver&#246;ffentlichen',
-	'Publish selected [_1] (a)' =&gt; 'Gew&#228;hlte [_1] ver&#246;ffentlichen',
-	'Delete selected [_1] (x)' =&gt; 'Gew&#228;hlte [_1] l&#246;schen (x)',
-	'Report selected [_1] as Spam (j)' =&gt; 'Ausgew&#228;hlte [_1] als Spam melden (j)',
+	'Publish selected [lc,_1] (a)' =&gt; 'Gew&#228;hlte [_1] ver&#246;ffentlichen',
+	'Delete selected [lc,_1] (x)' =&gt; 'Gew&#228;hlte [_1] l&#246;schen (x)',
+	'Report selected [lc,_1] as Spam (j)' =&gt; 'Ausgew&#228;hlte [_1] als Spam melden (j)',
 	'Spam' =&gt; 'Spam',
-	'Report selected [_1] as Not Spam and Publish (j)' =&gt; 'Ausgew&#228;hlte [_1] als spamfrei melden und ver&#246;ffentlichen',
+	'Report selected [lc,_1] as Not Spam and Publish (j)' =&gt; 'Ausgew&#228;hlte [_1] als spamfrei melden und ver&#246;ffentlichen',
 	'Not Spam' =&gt; 'Nicht Spam',
 	'Are you sure you want to remove all comments reported as spam?' =&gt; 'Wirklich alle als Spam gemeldeten Kommentare l&#246;schen?',
-	'Deletes all [_1] reported as Spam' =&gt; 'Alle als Spam gemeldeten [_1] l&#246;schen',
+	'Deletes all [lc,_1] reported as Spam' =&gt; 'Alle als Spam gemeldeten [_1] l&#246;schen',
 	'Empty' =&gt; 'Leer',
 	'Ban This IP' =&gt; 'Diese IP-Adresse sperren',
 	'Status' =&gt; 'Status',
 	'Entry/Page' =&gt; 'Eintrag/Seite',
-	'Date' =&gt; 'Zeitpunkt',
+	'Date' =&gt; 'Datum',
 	'IP' =&gt; 'IP',
 	'Only show published comments' =&gt; 'Nur ver&#246;ffentlichte Kommentare anzeigen',
 	'Published' =&gt; 'Ver&#246;ffentlichen',
 	'Only show pending comments' =&gt; 'Nur nicht ver&#246;ffentlichte Kommentare anzeigen',
 	'Pending' =&gt; 'Auf Moderation wartend',
 	'Edit this comment' =&gt; 'Kommentar bearbeiten',
-	'(1 reply)' =&gt; '(1 Antwort)',
-	'([_1] replies)' =&gt; '([_1] Antworten)',
+	'([quant,_1,reply,replies])' =&gt; '([quant,_1,Antwort,Antworten])',
 	'Reply' =&gt; 'Antworten',
 	'Trusted' =&gt; 'vertraut',
 	'Blocked' =&gt; 'Gesperrt',
@@ -1869,7 +1869,7 @@ use vars qw( @ISA %Lexicon );
 	'Edit this [_1] commenter' =&gt; '[_1] Kommentarautor bearbeiten',
 	'Search for comments by this commenter' =&gt; 'Nach Kommentaren von diesem Kommentarautor suchen',
 	'Anonymous' =&gt; 'Anonym',
-	'View this [_1]' =&gt; '[_1] ansehen',
+	'View this [lc,_1]' =&gt; '[_1] ansehen',
 	'Search for all comments from this IP address' =&gt; 'Nach Kommentaren von dieser IP-Adresse suchen',
 
 ## tmpl/cms/include/member_table.tmpl
@@ -1986,21 +1986,21 @@ use vars qw( @ISA %Lexicon );
 	'View the [_1] for this TrackBack' =&gt; '[_1] zu dem TrackBack ansehen',
 
 ## tmpl/cms/include/entry_table.tmpl
-	'Save these [_1] (s)' =&gt; '[_1] speichern (s)',
+	'Save these [lc,_1] (s)' =&gt; '[_1] speichern (s)',
 	'to republish' =&gt; 'zur erneuten Ver&#246;ffentlichung',
-	'Republish selected [_1] (r)' =&gt; 'Gew&#228;hlte [_1] erneut ver&#246;ffentlichen (r)',
+	'Republish selected [lc,_1] (r)' =&gt; 'Gew&#228;hlte [_1] erneut ver&#246;ffentlichen (r)',
 	'Republish' =&gt; 'Seite',
 	'Last Modified' =&gt; 'Zuletzt ge&#228;ndert',
 	'Created' =&gt; 'Angelegt',
 	'Unpublished (Draft)' =&gt; 'Unver&#246;ffentlicht (Entwurf)',
 	'Unpublished (Review)' =&gt; 'Unver&#246;ffentlicht (Pr&#252;fung)',
 	'Scheduled' =&gt; 'Zu bestimmtem Zeitpunkt',
-	'Only show unpublished [_1]' =&gt; 'Nur nicht ver&#246;ffentlichte [_1] zeigen',
-	'Only show published [_1]' =&gt; 'Nur ver&#246;ffentlichte [_1] zeigen',
-	'Only show [_1] for review' =&gt; 'Nur zu pr&#252;fende [_1] zeigen',
-	'Only show scheduled [_1]' =&gt; 'Nur zeitgeplante [_1] zeigen',
-	'Edit [_1]' =&gt; '[_1] bearbeiten',
-	'View [_1]' =&gt; 'Zeige [_1]',
+	'Only show unpublished [lc,_1]' =&gt; 'Nur nicht ver&#246;ffentlichte [_1] zeigen',
+	'Only show published [lc,_1]' =&gt; 'Nur ver&#246;ffentlichte [_1] zeigen',
+	'Only show [lc,_1] for review' =&gt; 'Nur zu pr&#252;fende [_1] zeigen',
+	'Only show scheduled [lc,_1]' =&gt; 'Nur zeitgeplante [_1] zeigen',
+	'Edit [lc,_1]' =&gt; '[_1] bearbeiten',
+	'View [lc,_1]' =&gt; 'Zeige [_1]',
 
 ## tmpl/cms/include/login_mt.tmpl
 
@@ -2143,7 +2143,7 @@ use vars qw( @ISA %Lexicon );
 ## tmpl/cms/include/blog-left-nav.tmpl
 	'Creating' =&gt; 'Anlegen',
 	'Create Entry' =&gt; 'Neuen Eintrag schreiben',
-	'Community' =&gt; 'Community',
+	'Community' =&gt; 'Feedback',
 	'List Commenters' =&gt; 'Kommentarautoren auflisten',
 	'Edit Address Book' =&gt; 'Adressbuch bearbeiten',
 	'List Users &amp;amp; Groups' =&gt; 'Benutzer und Gruppen auflisten',
@@ -2198,9 +2198,9 @@ use vars qw( @ISA %Lexicon );
 	'Upload New Image' =&gt; 'Neues Bild hochladen',
 	'Asset Name' =&gt; 'Assetname',
 	'View Asset' =&gt; 'Asset ansehen',
-	'Next (s)' =&gt; 'Weiter (s)',
+	'Next (s)' =&gt; 'N&#228;chstes (s)',
 	'Insert (s)' =&gt; 'Einf&#252;gen (s)',
-	'Next' =&gt; 'Weiter',
+	'Next' =&gt; 'N&#228;chstes',
 	'Insert' =&gt; 'Einf&#252;gen',
 	'No assets could be found.' =&gt; 'Keine Assets gefunden.',
 
@@ -2416,7 +2416,7 @@ use vars qw( @ISA %Lexicon );
 	'Commenting' =&gt; 'Kommentieren',
 	'Duplicate Roles' =&gt; 'Rollen duplizieren',
 	'These roles have the same privileges as this role' =&gt; 'Folgende Rollen haben die gleichen Berechtigungen wie diese Rolle',
-	'Save changes to this [_1] (s)' =&gt; '&#196;nderungen an [_1] speichern (s)',
+	'Save changes to this [lc,_1] (s)' =&gt; '&#196;nderungen an [_1] speichern (s)',
 
 ## tmpl/cms/cfg_plugin.tmpl
 	'System Plugin Settings' =&gt; 'System: Plugin-Einstellungen',
@@ -2485,7 +2485,7 @@ use vars qw( @ISA %Lexicon );
 	'Save (s)' =&gt; 'Sichern (s)',
 	'Save and Publish this template (r)' =&gt; 'Vorlage speichern und ver&#246;ffentlichen (r)',
 	'Save &amp;amp; Publish' =&gt; 'Speichern und ver&#246;ffentlichen',
-	'You have unsaved changes to your [_1] that will be lost.' =&gt; 'Es liegen nicht gespeicherte &#196;nderungen vor, die verloren gehen werden.',
+	'You have unsaved changes to your [lc,_1] that will be lost.' =&gt; 'Es liegen nicht gespeicherte &#196;nderungen vor, die verloren gehen werden.',
 	'You must set the Template Name.' =&gt; 'Sie m&#252;ssen einen Vorlagennamen angeben.',
 	'You must set the template Output File.' =&gt; 'Sie m&#252;ssen einen Dateinamen angeben.',
 	'Please wait...' =&gt; 'Bitte warten...',
@@ -2553,7 +2553,7 @@ use vars qw( @ISA %Lexicon );
 	'All [_1]' =&gt; 'Alle [_1]',
 	'change' =&gt; '&#228;ndern',
 	'[_1] where [_2] is [_3]' =&gt; '[_1] mit [_2] [_3]',
-	'Show only [_1] where' =&gt; 'Zeige nur [_1] mit ',
+	'Show only [lc,_1] where' =&gt; 'Zeige nur [_1] mit ',
 	'status' =&gt; 'Status',
 	'tag (exact match)' =&gt; 'Tag (genau)',
 	'tag (fuzzy match)' =&gt; 'Tag (unscharf)',
@@ -2572,13 +2572,13 @@ use vars qw( @ISA %Lexicon );
 	'Comments from [_1]' =&gt; 'Kommentare von [_1]',
 	'commenter' =&gt; 'Kommentarautor',
 	'commenters' =&gt; 'Kommentarautoren',
-	'Trust [_1] (t)' =&gt; '[_1] vertrauen (t)',
+	'Trust [lc,_1] (t)' =&gt; '[_1] vertrauen (t)',
 	'Trust' =&gt; 'Vertrauen',
-	'Untrust [_1] (t)' =&gt; '[_1] nicht mehr vertrauen (t)',
+	'Untrust [lc,_1] (t)' =&gt; '[_1] nicht mehr vertrauen (t)',
 	'Untrust' =&gt; 'Nicht vertrauen',
-	'Ban [_1] (b)' =&gt; '[_1] sperren (b)',
+	'Ban [lc,_1] (b)' =&gt; '[_1] sperren (b)',
 	'Ban' =&gt; 'Sperren',
-	'Unban [_1] (b)' =&gt; '[_1] entsperren (b)',
+	'Unban [lc,_1] (b)' =&gt; '[_1] entsperren (b)',
 	'Unban' =&gt; 'Entsperren',
 	'The Name of the commenter' =&gt; 'Name des Kommentarautors',
 	'View all comments with this name' =&gt; 'Alle Kommentare mit diesem Autorennamen anzeigen',
@@ -2668,7 +2668,7 @@ use vars qw( @ISA %Lexicon );
 	'folder' =&gt; 'Ordner',
 	'folders' =&gt; 'Ordner',
 	'categories' =&gt; 'Kategorien',
-	'Create [_1]' =&gt; '[_1] anlegen',
+	'Create [lc,_1]' =&gt; '[_1] anlegen',
 	'Your [_1] has been saved.' =&gt; '[_1] gespeichert.',
 	'One or more errors occurred when sending update pings or TrackBacks.' =&gt; 'Es sind ein oder mehrere Fehler beim Senden von TrackBacks aufgetreten.',
 	'_USAGE_VIEW_LOG' =&gt; 'N&#228;here Informationen zum aufgetretenen Fehler finden Sie im &lt;a href=&quot;[_1]&quot;&gt;Aktivit&#228;tsprotokoll&lt;/a&gt;.',
@@ -2697,13 +2697,12 @@ use vars qw( @ISA %Lexicon );
 	'Publish Date' =&gt; 'Ver&#246;ffent- lichungs- zeitpunkt',
 	'Make primary' =&gt; 'Als Hauptkategorie',
 	'Add sub category' =&gt; 'Unterkategorie hinzuf&#252;gen',
-	'Add [_1] name' =&gt; '[_1]-Name hinzuf&#252;gen',
-	'Add new parent [_1]' =&gt; 'Neue Eltern-[_1] hinzuf&#252;gen',
+	'Add [lc,_1] name' =&gt; '[_1]-Name hinzuf&#252;gen',
+	'Add new parent [lc,_1]' =&gt; 'Neue Eltern-[_1] hinzuf&#252;gen',
 	'Add new' =&gt; 'Neue',
-	'Save this [_1] (s)' =&gt; '[_1] speichern (s)',
-	'Preview this [_1] (v)' =&gt; 'Vorschau auf [_1]',
-	'Delete this [_1] (v)' =&gt; '[_1] l&#246;schen (v)',
-	'Share this [_1]' =&gt; 'Benachrichtigung versenden',
+	'Save this [lc,_1] (s)' =&gt; '[_1] speichern (s)',
+	'Preview this [lc,_1] (v)' =&gt; 'Vorschau auf [_1]',
+	'Share this [lc,_1]' =&gt; 'Benachrichtigung versenden',
 	'View published [_1]' =&gt; '[_1] ansehen',
 	'&amp;laquo; Previous' =&gt; '&amp;laquo; Vorheriger',
 	'Next &amp;raquo;' =&gt; 'N&#228;chster &amp;raquo;',
@@ -2713,10 +2712,10 @@ use vars qw( @ISA %Lexicon );
 	'(comma-delimited list)' =&gt; '(Liste mit Kommatrennung)',
 	'(space-delimited list)' =&gt; '(Liste mit Leerzeichentrennung)',
 	'(delimited by \'[_1]\')' =&gt; '(Trennung durch \'[_1]\')',
-	'Change [_1]' =&gt; '[_1] &#228;ndern',
-	'Add [_1]' =&gt; '[_1] w&#228;hlen',
+	'Change [lc,_1]' =&gt; '[_1] &#228;ndern',
+	'Add [lc,_1]' =&gt; '[_1] w&#228;hlen',
 	'Unpublished' =&gt; 'Nicht ver&#246;ffentlichen',
-	'You must configure blog before you can publish this [_1].' =&gt; 'Vor dem Ver&#246;ffentlichen m&#252;ssen Sie das Blog konfigurieren.',
+	'You must configure this blog before you can publish this [lc,_1].' =&gt; 'Vor dem Ver&#246;ffentlichen m&#252;ssen Sie das Blog konfigurieren.',
 	'Select entry date' =&gt; 'Eintragsdatum w&#228;hlen',
 	'Unlock this entry&amp;rsquo;s output filename for editing' =&gt; 'Dateinamen manuell bearbeiten',
 	'Warning: If you set the basename manually, it may conflict with another entry.' =&gt; 'Warnung: Wenn Sie den Basisnamen manuell einstellen, ist es nicht auszuschlie&#223;en, da&#223; der gew&#228;hlte Name bereits existiert.',
@@ -2831,7 +2830,7 @@ use vars qw( @ISA %Lexicon );
 
 ## tmpl/cms/export.tmpl
 	'You must select a blog to export.' =&gt; 'Sie m&#252;ssen w&#228;hlen, welches Blog exportiert werden soll.',
-	'_USAGE_EXPORT_1' =&gt; 'Eintr&#228;ge, Kommentare und TrackBacks eines Blogs in einem Austauschformat speichern. Ein Export stellt &lt;em&gt;keine&lt;/em&gt; komplette Sicherungskopie eines Blogs dar.',
+	'_USAGE_EXPORT_1' =&gt; 'Hier k&#246;nnen Sie die Eintr&#228;ge, Kommentare und TrackBacks des ausgew&#228;hlten Blogs exportieren. Ein Export stellt &lt;em&gt;keine&lt;/em&gt; komplette Sicherungskopie eines Blogs dar.',
 	'Blog to Export' =&gt; 'Zu exportierendes Blog',
 	'Select a blog for exporting.' =&gt; 'Zu exportierendes Blog',
 	'Change blog' =&gt; 'Anderes Blog w&#228;hlen',
@@ -3026,13 +3025,13 @@ use vars qw( @ISA %Lexicon );
 	'System Permissions' =&gt; 'Berechtigungen',
 	'Options' =&gt; 'Optionen',
 	'Create personal blog for user' =&gt; 'Pers&#246;nliches Blog f&#252;r den Benutzer anlegen',
-	'Create [_1] (s)' =&gt; '[_1] anlegen (s)',
+	'Create [lc,_1] (s)' =&gt; '[_1] anlegen (s)',
 	'_USAGE_PASSWORD_RESET' =&gt; 'Hier k&#246;nnen Sie das Passwort dieses Benutzers zur&#252;cksetzen. Dazu wird ein zuf&#228;lliges neues Passwort erzeugt und an &lt;strong&gt;[_1]&lt;/strong&gt; verschickt werden.',
 	'Initiate Password Recovery' =&gt; 'Passwort wiederherstellen',
 
 ## tmpl/cms/edit_comment.tmpl
 	'The comment has been approved.' =&gt; 'Kommentar freigeschaltet.',
-	'Delete this [_1] (x)' =&gt; '[_1] l&#246;schen (x)',
+	'Delete this [lc,_1] (x)' =&gt; '[_1] l&#246;schen (x)',
 	'Previous Comment' =&gt; 'Vorheriger Kommentar',
 	'Next Comment' =&gt; 'N&#228;chster Kommentar',
 	'Manage Comments' =&gt; 'Kommentare verwalten',
@@ -3079,7 +3078,7 @@ use vars qw( @ISA %Lexicon );
 
 ## tmpl/cms/import.tmpl
 	'You must select a blog to import.' =&gt; 'W&#228;hlen Sie, in welches Blog importiert werden soll',
-	'Transfer weblog entries into Movable Type from other Movable Type installations or even other blogging tools or export your entries to create a backup or copy.' =&gt; 'Eintr&#228;ge aus anderen Movable Type-Installationen oder aus anderen Weblog-Systemen &#252;bernehmen',
+	'Transfer weblog entries into Movable Type from other Movable Type installations or even other blogging tools or export your entries to create a backup or copy.' =&gt; 'Mit der Import/Export-Funktionen k&#246;nnen Eintr&#228;ge aus anderen Movable Type-Installationen oder aus anderen Weblog-Systemen &#252;bernommen werden. Bestehende Eintr&#228;ge k&#246;nnen in einem Austauschformat gesichert werden.',
 	'Blog to Import' =&gt; 'Importziel',
 	'Select a blog to import.' =&gt; 'W&#228;hlen Sie, in welches Blog importiert werden soll',
 	'Importing from' =&gt; 'Importieren aus',
@@ -3119,7 +3118,7 @@ use vars qw( @ISA %Lexicon );
 	'Number of users in this system.' =&gt; 'Anzahl der Benutzer dieses Systems',
 	'Total Users' =&gt; 'Benutzer insgesamt',
 	'Active Users' =&gt; 'Aktive Benutzer',
-	'Users who have logged in within 90 days are considered &lt;strong&gt;active&lt;/strong&gt; in Movable Type license agreement.' =&gt; 'Als &lt;strong&gt;aktiv&lt;/strong&gt; gelten nach den Movable Type-Lizenzbedingungen Benutzer, die sich innerhalb der letzten 90 Tage eingeloggt haben.',
+	'Users who have logged in within 90 days are considered &lt;strong&gt;active&lt;/strong&gt; in Movable Type license agreement.' =&gt; 'Benutzer, die sich innerhalb der letzten 90 Tage eingeloggt haben, gelten nach den Movable Type-Lizenzbedingungen als &lt;strong&gt;aktiv&lt;/strong&gt;.',
 	'Movable Type could not find the script named \'mt-check.cgi\'. To resolve this issue, please ensure that the mt-check.cgi script exists and/or the CheckScript configuration parameter references it properly.' =&gt; 'Movable Type konnte die Datei \'mt-check.cgi\' nicht finden. Stellen Sie sicher, da&#223; die Datei vorhanden ist und MTCheckScript die richtigen Pfadangaben enth&#228;lt.',
 
 ## tmpl/cms/restore.tmpl
@@ -3235,12 +3234,12 @@ use vars qw( @ISA %Lexicon );
 	'Cancel (c)' =&gt; 'Abbrechen (c)',
 
 ## tmpl/cms/list_folder.tmpl
-	'Your [_1] changes and additions have been made.' =&gt; '&#196;nderungen &#252;bernommen.',
-	'You have successfully deleted the selected [_1].' =&gt; '&#196;nderungen &#252;bernommen.',
-	'Create top level [_1]' =&gt; 'Neue Haupt[_1] anlegen',
+	'Your [lc,_1] changes and additions have been made.' =&gt; '&#196;nderungen &#252;bernommen.',
+	'You have successfully deleted the selected [lc,_1].' =&gt; '&#196;nderungen &#252;bernommen.',
+	'Create top level [lc,_1]' =&gt; 'Neue Haupt[_1] anlegen',
 	'New Parent [_1]' =&gt; 'Neue Mutter[_1]',
 	'Top Level' =&gt; 'Hauptebene',
-	'Move [_1]' =&gt; '[_1] verschieben',
+	'Move [lc,_1]' =&gt; '[_1] verschieben',
 	'Move' =&gt; 'Verschieben',
 	'[quant,_1,page,pages]' =&gt; '[quant,_1,Seite,Seiten]',
 
@@ -3249,13 +3248,13 @@ use vars qw( @ISA %Lexicon );
 	'permissions' =&gt; 'Berechtigungen',
 	'Remove selected assocations (x)' =&gt; 'Gew&#228;hlte Zuweisungen l&#246;schen',
 	'Revoke Permission' =&gt; 'Berechtigung entziehen',
-	'Grant Permission' =&gt; 'Berechtigung zuweisen',
+	'Grant Permission' =&gt; 'Berechtigungen vergeben',
 	'You can not create associations for disabled users.' =&gt; 'Deaktivierte Benutzerkonten k&#246;nnen nicht zugewiesen werden.',
 	'Assign Role to User' =&gt; 'Rolle an Benutzer zuweisen',
 	'Grant permission to a user' =&gt; 'Berechtigung an Benutzer vergeben',
 	'[_1] &lt;em&gt;[_2]&lt;/em&gt; is currently disabled.' =&gt; '[_1] &lt;em&gt;[_2]&lt;/em&gt; ist derzeit deaktiviert.',
 	'You have successfully revoked the given permission(s).' =&gt; 'Berechtigungen erfolgreich entzogen',
-	'You have successfully granted the given permission(s).' =&gt; 'Berechtigungen erfolgreich zugewiesen',
+	'You have successfully granted the given permission(s).' =&gt; 'Berechtigungen erfolgreich vergeben',
 
 ## tmpl/cms/login.tmpl
 	'Your Movable Type session has ended.' =&gt; 'Ihre Movable Type-Sitzung ist abgelaufen oder Sie haben sich abgemeldet.',
@@ -3413,7 +3412,7 @@ use vars qw( @ISA %Lexicon );
 	'[quant,_1,result,results] found' =&gt; '[quant,_1,Treffer,Treffer] gefunden',
 
 ## tmpl/cms/preview_strip.tmpl
-	'You are previewing the [_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; 'Sie sehen eine Vorschau auf den [_1] namens &amp;ldquo;[_2]&amp;rdquo;',
+	'You are previewing the [lc,_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; 'Sie sehen eine Vorschau auf den [_1] namens &amp;ldquo;[_2]&amp;rdquo;',
 
 ## tmpl/cms/edit_ping.tmpl
 	'The TrackBack has been approved.' =&gt; 'TrackBack wurde freigeschaltet.',
@@ -3600,7 +3599,7 @@ use vars qw( @ISA %Lexicon );
 	'Simple Footer' =&gt; 'Einfache Fu&#223;zeile',
 
 ## addons/Community.pack/templates/global/profile_edit_form.mtml
-	'Go &lt;a href=&quot;[_1]&quot;&gt;back to the previous page&lt;/a&gt; or &lt;a href=&quot;[_2]&quot;&gt;view your profile&lt;/a&gt;.' =&gt; '&lt;a href=&quot;[_1]&quot;&gt;Zur&#252;ck zur Ausgangsseite&lt;/a&gt; oder &lt;a href=&quot;[_2]&quot;&gt;Profil ansehen&lt;/a&gt;.',
+	'Go &lt;a href=&quot;[_1]&quot;&gt;back to the previous page&lt;/a&gt; or &lt;a href=&quot;[_2]&quot;&gt;view your profile&lt;/a&gt;.' =&gt; '&lt;a href=&quot;[_1]&gt;Zur&#252;ck zur Ausgangsseite&lt;/a&gt; oder &lt;a href=&quot;[_2]&gt;Profil ansehen&lt;/a&gt;.',
 	'Form Field' =&gt; 'Formularfeld',
 	'User Name' =&gt; 'Benutzername',
 	'Upload New Userpic' =&gt; 'Neues Benutzerbild hochladen',
@@ -3671,17 +3670,17 @@ use vars qw( @ISA %Lexicon );
 	'Blog Home' =&gt; 'Startseite',
 
 ## addons/Community.pack/templates/blog/entry_summary.mtml
-	'A favorite' =&gt; 'Mein Favorit',
+	'A favorite' =&gt; 'Ein Favorit',
 	'Favorite' =&gt; 'Favorit',
 
 ## addons/Community.pack/templates/blog/entry_response.mtml
-	'Thank you for posting an entry.' =&gt; 'Danke f&#252;r Ihren Beitrag!',
+	'Thank you for posting an entry.' =&gt; 'Danke, da&#223; Sie einen Eintrag geschrieben haben.',
 	'Entry Pending' =&gt; 'Eintrag noch nicht freigegeben',
 	'Your entry has been received and held for approval by the blog owner.' =&gt; 'Ihr Eintrag ist eingegangen und muss nun vom Blogbetreiber freigeschaltet werden.',
 	'Entry Posted' =&gt; 'Eintrag ver&#246;ffentlicht',
 	'Your entry has been posted.' =&gt; 'Ihr Eintrag wurde ver&#246;ffentlicht.',
 	'Your entry has been received.' =&gt; 'Ihr Eintrag ist eingegangen.',
-	'Return to the &lt;a href=&quot;[_1]&quot;&gt;blog\'s main index&lt;/a&gt;.' =&gt; 'Zur&#252;ck zur &lt;a href=&quot;[_1]&quot;&gt;Indexseite&lt;/a&gt;.',
+	'Return to the &lt;a href=&quot;[_1]&quot;&gt;blog\'s main index&lt;/a&gt;.' =&gt; 'Zur&#252;ck zur &lt;a href=&quot;[_1]&quot;&gt;Startseite&lt;/a&gt;.',
 
 ## addons/Community.pack/templates/blog/comment_response.mtml
 
@@ -3739,7 +3738,7 @@ use vars qw( @ISA %Lexicon );
 	'Start Topic' =&gt; 'Thema er&#246;ffnen',
 
 ## addons/Community.pack/templates/forum/entry_response.mtml
-	'Thank you for posting a new topic to the forums.' =&gt; 'Danke f&#252;r Ihren Beitrag!',
+	'Thank you for posting a new topic to the forums.' =&gt; 'Danke, da&#223; Sie ein neues Thema er&#246;ffnet haben!',
 	'Topic Pending' =&gt; 'Thema noch nicht freigegeben',
 	'The topic you posted has been received and held for approval by the forum administrators.' =&gt; 'Ihr Thema  ist eingegangen und muss nun vom Forenadministrator freigeschaltet werden.',
 	'Topic Posted' =&gt; 'Thema ver&#246;ffentlicht',
@@ -3749,7 +3748,7 @@ use vars qw( @ISA %Lexicon );
 ## addons/Community.pack/templates/forum/comment_response.mtml
 	'Reply Submitted' =&gt; 'Antwort eingegangen',
 	'Your reply has been accepted' =&gt; 'Ihre Antwort ist eingegangen.',
-	'Thank you for your reply. It has been accepted and should appear momentarily.' =&gt; 'Vielen Dank f&#252;r Ihre Antwort. Sie wird sofort ver&#246;ffentlicht.',
+	'Thank you for your reply. It has been accepted and should appear momentarily.' =&gt; 'Vielen Dank f&#252;r Ihre Antwort. Sie erscheint sofort ohne weitere Moderation.',
 	'Reply Pending' =&gt; 'Moderation',
 	'Your reply has been received' =&gt; 'Ihre Antwort ist eingegangen.',
 	'Thank you for your reply. However, your reply is currently being held for approval by the forum\'s administrator.' =&gt; 'Vielen Dank f&#252;r Ihre Antwort. Sie muss noch vom Forenadministrator freigeschaltet werden.',
@@ -3783,8 +3782,8 @@ use vars qw( @ISA %Lexicon );
 
 ## addons/Community.pack/templates/forum/javascript.mtml
 	'. Now you can reply to this topic.' =&gt; '. Sie k&#246;nnen nun Ihre Antwort schreiben.',
-	' to comment on this topic.' =&gt; ' um dieses Thema zu kommentieren.',
-	' to comment on this topic,' =&gt; ' um dieses Thema zu kommentieren,',
+	' to comment on this topic.' =&gt; 'um dieses Thema zu kommentieren.',
+	' to comment on this topic,' =&gt; 'um dieses Thema zu kommentieren,',
 
 ## addons/Community.pack/templates/forum/rss.mtml
 
@@ -3806,7 +3805,7 @@ use vars qw( @ISA %Lexicon );
 
 ## addons/Community.pack/templates/forum/comments.mtml
 	'[_1] Replies' =&gt; '[_1] Antworten',
-	'_NUM_FAVORITES' =&gt; 'Favoriten', # Translate - New # OK
+	'_NUM_FAVORITES' =&gt; 'Favorit', # Translate - New # OK
 	'Favorite This' =&gt; 'Zum Favoriten machen',
 
 ## addons/Community.pack/templates/forum/search_results.mtml
@@ -3895,7 +3894,7 @@ use vars qw( @ISA %Lexicon );
 	'Unlock this for editing' =&gt; 'Zur Bearbeitung freischalten',
 	'Warning: Changing this field\'s basename may cause serious data loss.' =&gt; 'Achtung: &#196;nderungen des Basisnamens eines Feldes kann zu erheblichen Datenverlusten f&#252;hren!',
 	'Template Tag' =&gt; 'Vorlagenbefehl',
-	'Create a custom template tag for this field.' =&gt; 'Einen eigenen Vorlagenbefehl f&#252;r dieses Feld anlegen',
+	'Create a custom template tag for this field.' =&gt; 'Einen eigenen Vorlagenbefehl f&#252;r dieses Feld anlegen.',
 	'Example Template Code' =&gt; 'Beispiel-Vorlagencode',
 	'field' =&gt; 'Feld',
 	'fields' =&gt; 'Felder',
@@ -4053,9 +4052,9 @@ use vars qw( @ISA %Lexicon );
 ## addons/Enterprise.pack/tmpl/include/group_table.tmpl
 	'group' =&gt; 'Gruppe',
 	'groups' =&gt; 'Gruppen',
-	'Enable selected [_1] (e)' =&gt; 'Gew&#228;hlte [_1] aktivieren (e)',
-	'Disable selected [_1] (d)' =&gt; 'Gew&#228;hlte [_1] deaktivieren (d)',
-	'Remove selected [_1] (d)' =&gt; 'Gew&#228;hlte [_1] entfernen (d)',
+	'Enable selected [lc,_1] (e)' =&gt; 'Gew&#228;hlte [_1] aktivieren (e)',
+	'Disable selected [lc,_1] (d)' =&gt; 'Gew&#228;hlte [_1] deaktivieren (d)',
+	'Remove selected [lc,_1] (d)' =&gt; 'Gew&#228;hlte [_1] entfernen (d)',
 	'Only show enabled groups' =&gt; 'Nur aktivierte Gruppen zeigen',
 	'Only show disabled groups' =&gt; 'Nur deaktivierte Gruppen zeigen',
 
@@ -4293,7 +4292,7 @@ use vars qw( @ISA %Lexicon );
 	'Invalid URL: [_1]' =&gt; 'Ung&#252;ltige URL: [_1]',
 
 ## plugins/StyleCatcher/tmpl/view.tmpl
-	'Select a Style' =&gt; 'Stilvorlage w&#228;hlen',
+	'Select a Style' =&gt; 'Design w&#228;hlen',
 	'3-Columns, Wide, Thin, Thin' =&gt; 'Dreispaltig: breit - schmal - schmal',
 	'3-Columns, Thin, Wide, Thin' =&gt; 'Dreispaltig: schmal - breit - schmal',
 	'2-Columns, Thin, Wide' =&gt; 'Zweispaltig: schmal - breit',
@@ -4308,9 +4307,9 @@ use vars qw( @ISA %Lexicon );
 	'Stylesheet or Repository URL' =&gt; 'URL des Stylesheets oder der Sammlung',
 	'Stylesheet or Repository URL:' =&gt; 'URL des Stylesheets oder der Sammlung:',
 	'Download Styles' =&gt; 'Designs herunterladen',
-	'Current theme for your weblog' =&gt; 'Aktuelles Thema Ihres Weblogs',
-	'Current Style' =&gt; 'Derzeitiges Design',
-	'Locally saved themes' =&gt; 'Lokal gespeicherte Themen',
+	'Current theme for your weblog' =&gt; 'Aktuelles Theme Ihres Weblogs',
+	'Current Style' =&gt; 'Derzeitige Design',
+	'Locally saved themes' =&gt; 'Lokal gespeicherte Themes',
 	'Saved Styles' =&gt; 'Gespeicherte Designs',
 	'Default Styles' =&gt; 'Standarddesigns',
 	'Single themes from the web' =&gt; 'Einzelne Themes aus dem Web',
@@ -4545,7 +4544,7 @@ use vars qw( @ISA %Lexicon );
 	'Recent posts' =&gt; 'Aktuelle Eintr&#228;ge',
 	'Search form' =&gt; 'Suche',
 	'Recent comments' =&gt; 'Aktuelle Kommentare',
-	'Tag cloud (sidebar)' =&gt; 'Tag-Wolke (Seitenleiste)',
+	'Tag cloud (sidebar)' =&gt; 'Tag Cloud (Seitenleiste)',
 	'Monthly archive dropdown' =&gt; 'Monatsarchive (Dropdown)',
 	'Pages list (nested)' =&gt; 'Seitenliste (geschachtelt)',
 	'Photos' =&gt; 'Fotos',</diff>
      <filename>lib/MT/L10N/de.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
 package MT::L10N::en_us;   # American English
+
 use strict;
 use MT::L10N;
 use vars qw( @ISA %Lexicon );
@@ -32,7 +33,7 @@ sub ascii_only { ((ref $_[0]) || $_[0]) eq __PACKAGE__ }
     '_USAGE_VIEW_LOG' =&gt; 'Check the &lt;a href=&quot;[_1]&quot;&gt;Activity Log&lt;/a&gt; for the error.',
 
     '_USAGE_FORGOT_PASSWORD_1' =&gt; 'You requested recovery of your Movable Type password. Your password has been changed in the system; here is the new password:',
-    '_USAGE_FORGOT_PASSWORD_2' =&gt; 'You should be able to log in to Movable Type using this new password. Once you have logged in, you should change your password to something more memorable.',
+    '_USAGE_FORGOT_PASSWORD_2' =&gt; 'You should be able to log in to Movable Type using this new password from the URL below. Once you have logged in, you should change your password to something more memorable.',
 
     '_BACKUP_TEMPDIR_WARNING' =&gt; 'Requested data has been backed up successfully in the [_1] directory.  Make sure that you download and &lt;strong&gt;then delete&lt;/strong&gt; files listed above from [_1] &lt;strong&gt;immediately&lt;/strong&gt; because backup files contain sensitive information.',
     '_BACKUP_DOWNLOAD_MESSAGE' =&gt; 'Downloading of the backup file will start automatically in a few seconds.  If for some reason it does not, click &lt;a href=&quot;javascript:(void)&quot; onclick=&quot;submit_form()&quot;&gt;here&lt;/a&gt; to start downloading manually.  Please note that you can download the backup file only once for a session.',</diff>
      <filename>lib/MT/L10N/en_us.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2003-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -58,8 +59,8 @@ use vars qw( @ISA %Lexicon );
 	'Entry' =&gt; 'Entrada',
 
 ## default_templates/notify-entry.mtml
-	'A new [_3] entitled \'[_1]\' has been published to [_2].' =&gt; 'Un nuevo [_3] titulado \'[_1]\' ha sido publicado en [_2].',
-	'View [_1]:' =&gt; 'Ver [_1]',
+	'A new [lc,_3] entitled \'[_1]\' has been published to [_2].' =&gt; 'Un nuevo [lc,_3] titulado \'[_1]\' ha sido publicado en [_2].',
+	'View [lc,_1]:' =&gt; 'Ver [lc,_1]',
 	'[_1] Title: [_2]' =&gt; '[_1] T&#237;tulo: [_2]',
 	'Publish Date: [_1]' =&gt; 'Fecha de publicaci&#243;n: [_1]',
 	'Message from Sender:' =&gt; 'Mensaje del expeditor',
@@ -1843,14 +1844,14 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'comment' =&gt; 'comentario',
 	'comments' =&gt; 'comentarios',
 	'to publish' =&gt; 'para publicar',
-	'Publish selected [_1] (a)' =&gt; 'Publicar [_1] seleccionado [_1]',
-	'Delete selected [_1] (x)' =&gt; 'Borrar [_1] seleccionadas (x)',
-	'Report selected [_1] as Spam (j)' =&gt; 'Marcar como spam [_1] seleccionados (j)',
+	'Publish selected [lc,_1] (a)' =&gt; 'Publicar [lc,_1] seleccionado [lc,_1]',
+	'Delete selected [lc,_1] (x)' =&gt; 'Borrar [lc,_1] seleccionadas (x)',
+	'Report selected [lc,_1] as Spam (j)' =&gt; 'Marcar como spam [lc,_1] seleccionados (j)',
 	'Spam' =&gt; 'Spam',
-	'Report selected [_1] as Not Spam and Publish (j)' =&gt; 'Marcar como no spam y publicar [_1] seleccionados (j)',
+	'Report selected [lc,_1] as Not Spam and Publish (j)' =&gt; 'Marcar como no spam y publicar [lc,_1] seleccionados (j)',
 	'Not Spam' =&gt; 'No es spam',
 	'Are you sure you want to remove all comments reported as spam?' =&gt; '&#191;Est&#225; seguro de que desea borrar todos los comentarios marcados como spam?',
-	'Deletes all [_1] reported as Spam' =&gt; 'Borra todos los [_1] marcados como spam',
+	'Deletes all [lc,_1] reported as Spam' =&gt; 'Borra todos los [lc,_1] marcados como spam',
 	'Empty' =&gt; 'Vac&#237;o',
 	'Ban This IP' =&gt; 'Bloquear esta IP',
 	'Status' =&gt; 'Estado',
@@ -1862,8 +1863,7 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'Only show pending comments' =&gt; 'Mostrar solo comentarios pendientes',
 	'Pending' =&gt; 'Pendiente',
 	'Edit this comment' =&gt; 'Editar este comentario',
-	'(1 reply)' =&gt; '(1 respuesta)',
-	'([_1] replies)' =&gt; '([_1] respuestas)',
+	'([quant,_1,reply,replies])' =&gt; '([quant,_1,respuesta,respuestas])',
 	'Reply' =&gt; 'Responder',
 	'Trusted' =&gt; 'Confiado',
 	'Blocked' =&gt; 'Bloqueado',
@@ -1871,7 +1871,7 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'Edit this [_1] commenter' =&gt; 'Editar comentarista [_1]',
 	'Search for comments by this commenter' =&gt; 'Buscar comentarios de este comentarista',
 	'Anonymous' =&gt; 'An&#243;nimo',
-	'View this [_1]' =&gt; 'Mostrar [_1]',
+	'View this [lc,_1]' =&gt; 'Mostrar [lc,_1]',
 	'Search for all comments from this IP address' =&gt; 'Buscar todos los comentarios enviados desde esta direcci&#243;n IP',
 
 ## tmpl/cms/include/member_table.tmpl
@@ -1988,21 +1988,21 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'View the [_1] for this TrackBack' =&gt; 'Mostrar [_1] de este TrackBack',
 
 ## tmpl/cms/include/entry_table.tmpl
-	'Save these [_1] (s)' =&gt; 'Guardar [_1] (s)',
+	'Save these [lc,_1] (s)' =&gt; 'Guardar [lc,_1] (s)',
 	'to republish' =&gt; 'para reconstruir',
-	'Republish selected [_1] (r)' =&gt; 'Reconstruir [_1] seleccionado (r)',
+	'Republish selected [lc,_1] (r)' =&gt; 'Reconstruir [lc,_1] seleccionado (r)',
 	'Republish' =&gt; 'Reconstruir',
 	'Last Modified' =&gt; '&#218;ltima modificaci&#243;n',
 	'Created' =&gt; 'Creado',
 	'Unpublished (Draft)' =&gt; 'No publicado (Borrador)',
 	'Unpublished (Review)' =&gt; 'No publicado (Revisi&#243;n)',
 	'Scheduled' =&gt; 'Programado',
-	'Only show unpublished [_1]' =&gt; 'Mostrar solo las [_1] no publicadas',
-	'Only show published [_1]' =&gt; 'Mostrar solo las [_1] publicadas',
-	'Only show [_1] for review' =&gt; 'Mostrar solo las [_1] a revisar',
-	'Only show scheduled [_1]' =&gt; 'Mostrar solo las [_1] programadas',
-	'Edit [_1]' =&gt; 'Editar [_1]',
-	'View [_1]' =&gt; 'Ver [_1]',
+	'Only show unpublished [lc,_1]' =&gt; 'Mostrar solo las [lc,_1] no publicadas',
+	'Only show published [lc,_1]' =&gt; 'Mostrar solo las [lc,_1] publicadas',
+	'Only show [lc,_1] for review' =&gt; 'Mostrar solo las [lc,_1] a revisar',
+	'Only show scheduled [lc,_1]' =&gt; 'Mostrar solo las [lc,_1] programadas',
+	'Edit [lc,_1]' =&gt; 'Editar [lc,_1]',
+	'View [lc,_1]' =&gt; 'Ver [lc,_1]',
 
 ## tmpl/cms/include/login_mt.tmpl
 
@@ -2010,7 +2010,7 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'_USER_DISABLED' =&gt; 'Deshabilitado',
 
 ## tmpl/cms/include/calendar.tmpl
-	'_LOCALE_WEEK_START' =&gt; '_LOCALE_WEEK_START',
+	'_LOCALE_WEEK_START' =&gt; '0',
 	'Sunday' =&gt; 'Domingo',
 	'Monday' =&gt; 'Lunes',
 	'Tuesday' =&gt; 'Martes',
@@ -2418,7 +2418,7 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'Commenting' =&gt; 'Comentar',
 	'Duplicate Roles' =&gt; 'Duplicar roles',
 	'These roles have the same privileges as this role' =&gt; 'Estos roles tienen privilegios parecidos a este rol',
-	'Save changes to this [_1] (s)' =&gt; 'Guardar cambios al [_1] (s)',
+	'Save changes to this [lc,_1] (s)' =&gt; 'Guardar cambios al [lc,_1] (s)',
 
 ## tmpl/cms/cfg_plugin.tmpl
 	'System Plugin Settings' =&gt; 'Sistema de configuraci&#243;n de la extensi&#243;n',
@@ -2487,7 +2487,7 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'Save (s)' =&gt; 'Guardar (s)',
 	'Save and Publish this template (r)' =&gt; 'Guardar y publicar esta plantilla (r)',
 	'Save &amp;amp; Publish' =&gt; 'Guardar &amp;amp; Publicar',
-	'You have unsaved changes to your [_1] that will be lost.' =&gt; 'Tiene cambios sin guardar en [_1] que se perder&#225;n.',
+	'You have unsaved changes to your [lc,_1] that will be lost.' =&gt; 'Tiene cambios sin guardar en [lc,_1] que se perder&#225;n.',
 	'You must set the Template Name.' =&gt; 'Debe indicar el nombre de la plantilla.',
 	'You must set the template Output File.' =&gt; 'Debe indicar el fichero de salida de la plantilla.',
 	'Please wait...' =&gt; 'Por favor, espere...',
@@ -2555,7 +2555,7 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'All [_1]' =&gt; 'Todos los [_1]',
 	'change' =&gt; 'cambiar',
 	'[_1] where [_2] is [_3]' =&gt; '[_1] donde [_2] es [_3]',
-	'Show only [_1] where' =&gt; 'Mostrar solo [_1] donde',
+	'Show only [lc,_1] where' =&gt; 'Mostrar solo [lc,_1] donde',
 	'status' =&gt; 'estado',
 	'tag (exact match)' =&gt; 'etiqueta (coincidencia exacta)',
 	'tag (fuzzy match)' =&gt; 'etiqueta (coincidencia difusa)',
@@ -2574,13 +2574,13 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'Comments from [_1]' =&gt; 'Comentarios de [_1]',
 	'commenter' =&gt; 'comentarista',
 	'commenters' =&gt; 'comentaristas',
-	'Trust [_1] (t)' =&gt; 'Confiar en [_1] (t)',
+	'Trust [lc,_1] (t)' =&gt; 'Confiar en [lc,_1] (t)',
 	'Trust' =&gt; 'Confianza',
-	'Untrust [_1] (t)' =&gt; 'Desconfiar de [_1] (t)',
+	'Untrust [lc,_1] (t)' =&gt; 'Desconfiar de [lc,_1] (t)',
 	'Untrust' =&gt; 'Desconfiar',
-	'Ban [_1] (b)' =&gt; 'Bloquear [_1] (b)',
+	'Ban [lc,_1] (b)' =&gt; 'Bloquear [lc,_1] (b)',
 	'Ban' =&gt; 'Bloquear',
-	'Unban [_1] (b)' =&gt; 'Desbloquear [_1] (b)',
+	'Unban [lc,_1] (b)' =&gt; 'Desbloquear [lc,_1] (b)',
 	'Unban' =&gt; 'Desbloquear',
 	'The Name of the commenter' =&gt; 'El nombre del comentarista',
 	'View all comments with this name' =&gt; 'Mostrar todos los comentarios con este nombre',
@@ -2670,7 +2670,7 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'folder' =&gt; 'carpeta',
 	'folders' =&gt; 'carpetas',
 	'categories' =&gt; 'categor&#237;as',
-	'Create [_1]' =&gt; 'Crear [_1]',
+	'Create [lc,_1]' =&gt; 'Crear [lc,_1]',
 	'Your [_1] has been saved.' =&gt; 'Su [_1] ha sido guardada.',
 	'One or more errors occurred when sending update pings or TrackBacks.' =&gt; 'Ocurrieron uno o m&#225;s errores durante el env&#237;o de pings o TrackBacks.',
 	'_USAGE_VIEW_LOG' =&gt; 'Compruebe el error en el &lt;a href=&quot;[_1]&quot;&gt;Registro de actividad&lt;/a&gt;.',
@@ -2698,13 +2698,12 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'Publish Date' =&gt; 'Fecha de publicaci&#243;n',
 	'Make primary' =&gt; 'Hacer primario',
 	'Add sub category' =&gt; 'A&#241;adir sub categor&#237;a',
-	'Add [_1] name' =&gt; 'A&#241;adir nombre de [_1]',
-	'Add new parent [_1]' =&gt; 'A&#241;adir nuevo padre [_1]',
+	'Add [lc,_1] name' =&gt; 'A&#241;adir nombre de [lc,_1]',
+	'Add new parent [lc,_1]' =&gt; 'A&#241;adir nuevo padre [lc,_1]',
 	'Add new' =&gt; 'A&#241;adir nuevo',
-	'Save this [_1] (s)' =&gt; 'Guardar [_1] (s)',
-	'Preview this [_1] (v)' =&gt; 'Pre-ver [_1] (v)',
-	'Delete this [_1] (v)' =&gt; 'Borrar [_1] (v)',
-	'Share this [_1]' =&gt; 'Compartir [_1]',
+	'Save this [lc,_1] (s)' =&gt; 'Guardar [lc,_1] (s)',
+	'Preview this [lc,_1] (v)' =&gt; 'Pre-ver [lc,_1] (v)',
+	'Share this [lc,_1]' =&gt; 'Compartir [lc,_1]',
 	'View published [_1]' =&gt; 'Ver [_1] publicada',
 	'&amp;laquo; Previous' =&gt; '&amp;laquo; Anterior',
 	'Next &amp;raquo;' =&gt; 'Siguiente &amp;raquo;',
@@ -2714,10 +2713,10 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'(comma-delimited list)' =&gt; '(lista separada por comas)',
 	'(space-delimited list)' =&gt; '(lista separada por espacios)',
 	'(delimited by \'[_1]\')' =&gt; '(separado por \'[_1]\')',
-	'Change [_1]' =&gt; 'Modificar [_1]',
-	'Add [_1]' =&gt; 'A&#241;adir [_1]',
+	'Change [lc,_1]' =&gt; 'Modificar [lc,_1]',
+	'Add [lc,_1]' =&gt; 'A&#241;adir [lc,_1]',
 	'Unpublished' =&gt; 'No publicado',
-	'You must configure blog before you can publish this [_1].' =&gt; 'Debe configurar el blog antes de poder publicar este [_1].',
+	'You must configure this blog before you can publish this [lc,_1].' =&gt; 'Debe configurar el blog antes de poder publicar este [lc,_1].',
 	'Select entry date' =&gt; 'Seleccionar fecha de la entrada',
 	'Unlock this entry&amp;rsquo;s output filename for editing' =&gt; 'Desbloquear el nombre del fichero de salida de la entrada para su edici&#243;n',
 	'Warning: If you set the basename manually, it may conflict with another entry.' =&gt; 'Atenci&#243;n: Si introduce el nombre base manualmente, podr&#237;a entrar en conflicto con otra entrada.',
@@ -3027,13 +3026,13 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'System Permissions' =&gt; 'Permisos del sistema',
 	'Options' =&gt; 'Opciones',
 	'Create personal blog for user' =&gt; 'Crear blog personal para el usuario',
-	'Create [_1] (s)' =&gt; 'Crear [_1] (s)',
+	'Create [lc,_1] (s)' =&gt; 'Crear [lc,_1] (s)',
 	'_USAGE_PASSWORD_RESET' =&gt; 'Puede iniciar la recuperaci&#243;n de la contrase&#241;a en nombre de este usuario. Si lo hace, se enviar&#225; un correo a &lt;strong&gt;[_1]&lt;/strong&gt; con una nueva contrase&#241;a aleatoria.',
 	'Initiate Password Recovery' =&gt; 'Iniciar recuperaci&#243;n de contrase&#241;a',
 
 ## tmpl/cms/edit_comment.tmpl
 	'The comment has been approved.' =&gt; 'Se ha aprobado el comentario.',
-	'Delete this [_1] (x)' =&gt; 'Borrar [_1] (x)',
+	'Delete this [lc,_1] (x)' =&gt; 'Borrar [lc,_1] (x)',
 	'Previous Comment' =&gt; 'Comentario anterior',
 	'Next Comment' =&gt; 'Comentario siguiente',
 	'Manage Comments' =&gt; 'Administrar comentarios',
@@ -3236,12 +3235,12 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'Cancel (c)' =&gt; 'Cancelar (c)',
 
 ## tmpl/cms/list_folder.tmpl
-	'Your [_1] changes and additions have been made.' =&gt; 'Se han realizado los cambios y a&#241;adidos a la [_1].',
-	'You have successfully deleted the selected [_1].' =&gt; 'Se han borrado con &#233;xito las [_1] seleccionadas.',
+	'Your [lc,_1] changes and additions have been made.' =&gt; 'Se han realizado los cambios y a&#241;adidos a la [lc,_1].',
+	'You have successfully deleted the selected [lc,_1].' =&gt; 'Se han borrado con &#233;xito las [lc,_1] seleccionadas.',
 	'Create top level [_1]' =&gt; 'Crear nueva [_1] de primer nivel',
 	'New Parent [_1]' =&gt; 'Nueva [_1] padre',
 	'Top Level' =&gt; 'Nivel superior',
-	'Move [_1]' =&gt; 'Trasladar [_1]',
+	'Move [lc,_1]' =&gt; 'Trasladar [lc,_1]',
 	'Move' =&gt; 'Trasladar',
 	'[quant,_1,page,pages]' =&gt; '[quant,_1,p&#225;gina,p&#225;ginas]',
 
@@ -3414,7 +3413,7 @@ que la direcci&#243;n provista es correcta y le pertenece.',
 	'[quant,_1,result,results] found' =&gt; '[quant,_1,resultado]',
 
 ## tmpl/cms/preview_strip.tmpl
-	'You are previewing the [_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; 'Esta es la vista previa del [_1] titulado &amp;ldquo;[_2]&amp;rdquo;',
+	'You are previewing the [lc,_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; 'Esta es la vista previa del [lc,_1] titulado &amp;ldquo;[_2]&amp;rdquo;',
 
 ## tmpl/cms/edit_ping.tmpl
 	'The TrackBack has been approved.' =&gt; 'Se aprob&#243; el TrackBack.',
@@ -4056,9 +4055,9 @@ B&#250;squeda base: [_2]&quot;,
 ## addons/Enterprise.pack/tmpl/include/group_table.tmpl
 	'group' =&gt; 'grupo',
 	'groups' =&gt; 'grupos',
-	'Enable selected [_1] (e)' =&gt; 'Active el [_1] seleccionado (e)',
-	'Disable selected [_1] (d)' =&gt; 'Desactive el [_1] seleccionado (d)',
-	'Remove selected [_1] (d)' =&gt; 'Borre el [_1] seleccionado (d)',
+	'Enable selected [lc,_1] (e)' =&gt; 'Active el [lc,_1] seleccionado (e)',
+	'Disable selected [lc,_1] (d)' =&gt; 'Desactive el [lc,_1] seleccionado (d)',
+	'Remove selected [lc,_1] (d)' =&gt; 'Borre el [lc,_1] seleccionado (d)',
 	'Only show enabled groups' =&gt; 'Solo muestra los grupos activados',
 	'Only show disabled groups' =&gt; 'Solo muestra los grupos desactivados',
 </diff>
      <filename>lib/MT/L10N/es.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2003-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -58,8 +59,8 @@ use vars qw( @ISA %Lexicon );
 	'Entry' =&gt; 'Note',
 
 ## default_templates/notify-entry.mtml
-	'A new [_3] entitled \'[_1]\' has been published to [_2].' =&gt; 'Une nouvelle [_3] intitul&#233;e \'[_1]\' a &#233;t&#233; publi&#233;e sur [_2].',
-	'View [_1]:' =&gt; 'Voir  [_1]',
+	'A new [lc,_3] entitled \'[_1]\' has been published to [_2].' =&gt; 'Une nouvelle [lc,_3] intitul&#233;e \'[_1]\' a &#233;t&#233; publi&#233;e sur [_2].',
+	'View [lc,_1]:' =&gt; 'Voir  [lc,_1]',
 	'[_1] Title: [_2]' =&gt; 'Titre du [_1] : [_2]',
 	'Publish Date: [_1]' =&gt; 'Date de publication : [_1]',
 	'Message from Sender:' =&gt; 'Message de l\'exp&#233;diteur :',
@@ -1841,14 +1842,14 @@ use vars qw( @ISA %Lexicon );
 	'comment' =&gt; 'commentaire',
 	'comments' =&gt; 'commentaires',
 	'to publish' =&gt; 'pour publier',
-	'Publish selected [_1] (a)' =&gt; 'Publier le [_1] s&#233;lectionn&#233; (a)',
-	'Delete selected [_1] (x)' =&gt; 'Effacer [_1] s&#233;lectionn&#233; (x)',
-	'Report selected [_1] as Spam (j)' =&gt; 'Notifier le [_1] s&#233;lectionn&#233; comme spam (j)',
+	'Publish selected [lc,_1] (a)' =&gt; 'Publier le [lc,_1] s&#233;lectionn&#233; (a)',
+	'Delete selected [lc,_1] (x)' =&gt; 'Effacer [lc,_1] s&#233;lectionn&#233; (x)',
+	'Report selected [lc,_1] as Spam (j)' =&gt; 'Notifier le [lc,_1] s&#233;lectionn&#233; comme spam (j)',
 	'Spam' =&gt; 'Spam',
-	'Report selected [_1] as Not Spam and Publish (j)' =&gt; 'Notifier le [_1] s&#233;lectionn&#233; comme n\'&#233;tant pas du spam et le publier (j)',
+	'Report selected [lc,_1] as Not Spam and Publish (j)' =&gt; 'Notifier le [lc,_1] s&#233;lectionn&#233; comme n\'&#233;tant pas du spam et le publier (j)',
 	'Not Spam' =&gt; 'Non-spam',
 	'Are you sure you want to remove all comments reported as spam?' =&gt; '&#202;tes-vous s&#251;r(e) de vouloir supprimer tous les commentaires notifi&#233;s comme spam ?',
-	'Deletes all [_1] reported as Spam' =&gt; 'Efface tous les [_1] notifi&#233;s comme spam',
+	'Deletes all [lc,_1] reported as Spam' =&gt; 'Efface tous les [lc,_1] notifi&#233;s comme spam',
 	'Empty' =&gt; 'Vide',
 	'Ban This IP' =&gt; 'Bannir cette adresse IP',
 	'Status' =&gt; 'Statut',
@@ -1860,8 +1861,7 @@ use vars qw( @ISA %Lexicon );
 	'Only show pending comments' =&gt; 'N\'afficher que les commentaires en attente',
 	'Pending' =&gt; 'En attente',
 	'Edit this comment' =&gt; 'Editer ce commentaire',
-	'(1 reply)' =&gt; '(1 r&#233;ponse)',
-	'([_1] replies)' =&gt; '([_1] r&#233;ponses)',
+	'([quant,_1,reply,replies])' =&gt; '([quant,_1,r&#233;ponse,r&#233;ponses])',
 	'Reply' =&gt; 'R&#233;pondre',
 	'Trusted' =&gt; 'Fiable',
 	'Blocked' =&gt; 'Bloqu&#233;s',
@@ -1869,7 +1869,7 @@ use vars qw( @ISA %Lexicon );
 	'Edit this [_1] commenter' =&gt; 'Modifier l\'auteur de commentaires de cette [_1]',
 	'Search for comments by this commenter' =&gt; 'Chercher les commentaires de cet auteur de commentaires',
 	'Anonymous' =&gt; 'Anonyme',
-	'View this [_1]' =&gt; 'Voir ce(tte) [_1]',
+	'View this [lc,_1]' =&gt; 'Voir ce(tte) [lc,_1]',
 	'Search for all comments from this IP address' =&gt; 'Rechercher tous les commentaires associ&#233;s &#224; cette adresse IP',
 
 ## tmpl/cms/include/member_table.tmpl
@@ -1986,21 +1986,21 @@ use vars qw( @ISA %Lexicon );
 	'View the [_1] for this TrackBack' =&gt; 'Voir [_1] pour ce trackback',
 
 ## tmpl/cms/include/entry_table.tmpl
-	'Save these [_1] (s)' =&gt; 'Enregistrer ces [_1] (s)',
+	'Save these [lc,_1] (s)' =&gt; 'Enregistrer ces [lc,_1] (s)',
 	'to republish' =&gt; 'pour republier',
-	'Republish selected [_1] (r)' =&gt; 'Republier les [_1] s&#233;lectionn&#233;es',
+	'Republish selected [lc,_1] (r)' =&gt; 'Republier les [lc,_1] s&#233;lectionn&#233;es',
 	'Republish' =&gt; 'Republier',
 	'Last Modified' =&gt; 'Derni&#232;re modification',
 	'Created' =&gt; 'Cr&#233;&#233;',
 	'Unpublished (Draft)' =&gt; 'Non publi&#233; (Brouillon)',
 	'Unpublished (Review)' =&gt; 'Non publi&#233; (V&#233;rification)',
 	'Scheduled' =&gt; 'Planifi&#233;',
-	'Only show unpublished [_1]' =&gt; 'Afficher uniquement les [_1] non publi&#233;es.',
-	'Only show published [_1]' =&gt; 'Afficher uniquement les [_1] publi&#233;s',
-	'Only show [_1] for review' =&gt; 'Afficher uniquement les [_1] &#224; v&#233;rifier',
-	'Only show scheduled [_1]' =&gt; 'Afficher uniquement les [_1] programm&#233;es',
-	'Edit [_1]' =&gt; 'Modifier une [_1]',
-	'View [_1]' =&gt; 'Voir [_1]',
+	'Only show unpublished [lc,_1]' =&gt; 'Afficher uniquement les [lc,_1] non publi&#233;es.',
+	'Only show published [lc,_1]' =&gt; 'Afficher uniquement les [lc,_1] publi&#233;s',
+	'Only show [lc,_1] for review' =&gt; 'Afficher uniquement les [lc,_1] &#224; v&#233;rifier',
+	'Only show scheduled [lc,_1]' =&gt; 'Afficher uniquement les [lc,_1] programm&#233;es',
+	'Edit [lc,_1]' =&gt; 'Modifier une [lc,_1]',
+	'View [lc,_1]' =&gt; 'Voir [lc,_1]',
 
 ## tmpl/cms/include/login_mt.tmpl
 
@@ -2416,7 +2416,7 @@ use vars qw( @ISA %Lexicon );
 	'Commenting' =&gt; 'Commenter',
 	'Duplicate Roles' =&gt; 'Dupliquer les r&#244;les',
 	'These roles have the same privileges as this role' =&gt; 'Ces r&#244;les ont les m&#234;me privil&#232;ges que ce r&#244;le',
-	'Save changes to this [_1] (s)' =&gt; 'Enregistrer les modifications de ce [_1] (s)',
+	'Save changes to this [lc,_1] (s)' =&gt; 'Enregistrer les modifications de ce [lc,_1] (s)',
 
 ## tmpl/cms/cfg_plugin.tmpl
 	'System Plugin Settings' =&gt; 'Param&#232;tres du syst&#232;me de plugins',
@@ -2485,7 +2485,7 @@ use vars qw( @ISA %Lexicon );
 	'Save (s)' =&gt; 'Enregistrer (s)',
 	'Save and Publish this template (r)' =&gt; 'Enregistrer et publier ce gabarit (r)',
 	'Save &amp;amp; Publish' =&gt; 'Enregistrer &amp;amp; publier',
-	'You have unsaved changes to your [_1] that will be lost.' =&gt; 'Vous avez des modifications non sauvegard&#233;es dans votre [_1] qui seront perdues.',
+	'You have unsaved changes to your [lc,_1] that will be lost.' =&gt; 'Vous avez des modifications non sauvegard&#233;es dans votre [lc,_1] qui seront perdues.',
 	'You must set the Template Name.' =&gt; 'Vous devez mettre un nom de gabarit.',
 	'You must set the template Output File.' =&gt; 'Vous devez configurer le fichier de sortie du gabarit.',
 	'Please wait...' =&gt; 'Merci de patienter...',
@@ -2553,7 +2553,7 @@ use vars qw( @ISA %Lexicon );
 	'All [_1]' =&gt; 'Tous(tes) les [_1]',
 	'change' =&gt; 'modifier',
 	'[_1] where [_2] is [_3]' =&gt; '[_1] o&#249; [_2] est [_3]',
-	'Show only [_1] where' =&gt; 'Afficher uniquement les [_1] o&#249;',
+	'Show only [lc,_1] where' =&gt; 'Afficher uniquement les [lc,_1] o&#249;',
 	'status' =&gt; 'le statut',
 	'tag (exact match)' =&gt; 'le tag (exact)',
 	'tag (fuzzy match)' =&gt; 'le tag (fuzzy match)',
@@ -2572,13 +2572,13 @@ use vars qw( @ISA %Lexicon );
 	'Comments from [_1]' =&gt; 'Commentaires de [_1]',
 	'commenter' =&gt; 'l\'auteur de commentaires',
 	'commenters' =&gt; 'Auteurs de commentaire',
-	'Trust [_1] (t)' =&gt; 'Marquer comme fiable [_1] (t)',
+	'Trust [lc,_1] (t)' =&gt; 'Marquer comme fiable [lc,_1] (t)',
 	'Trust' =&gt; 'Fiable',
-	'Untrust [_1] (t)' =&gt; 'Marquer comme non-fiable [_1] (t)',
+	'Untrust [lc,_1] (t)' =&gt; 'Marquer comme non-fiable [lc,_1] (t)',
 	'Untrust' =&gt; 'Non Fiable',
-	'Ban [_1] (b)' =&gt; 'Bannir [_1] (b)',
+	'Ban [lc,_1] (b)' =&gt; 'Bannir [lc,_1] (b)',
 	'Ban' =&gt; 'Bannir',
-	'Unban [_1] (b)' =&gt; 'Ne pas bannir [_1] (b)',
+	'Unban [lc,_1] (b)' =&gt; 'Ne pas bannir [lc,_1] (b)',
 	'Unban' =&gt; 'Non banni',
 	'The Name of the commenter' =&gt; 'Le nom de l\'auteur de commentaires',
 	'View all comments with this name' =&gt; 'Afficher tous les commentaires associ&#233;s &#224; ce nom',
@@ -2668,7 +2668,7 @@ use vars qw( @ISA %Lexicon );
 	'folder' =&gt; 'R&#233;pertoire',
 	'folders' =&gt; 'R&#233;pertoires',
 	'categories' =&gt; 'Cat&#233;gories',
-	'Create [_1]' =&gt; 'Cr&#233;er une [_1]',
+	'Create [lc,_1]' =&gt; 'Cr&#233;er une [lc,_1]',
 	'Your [_1] has been saved.' =&gt; 'Votre [_1] a &#233;t&#233; enregistr&#233;e.',
 	'One or more errors occurred when sending update pings or TrackBacks.' =&gt; 'Erreur lors de l\'envoi des pings ou des trackbacks.',
 	'_USAGE_VIEW_LOG' =&gt; 'L\'erreur est enregistr&#233;e dans le &lt;a href=&quot;[_1]&quot;&gt;journal (logs)&lt;/a&gt;.',
@@ -2696,13 +2696,12 @@ use vars qw( @ISA %Lexicon );
 	'Publish Date' =&gt; 'Date de publication',
 	'Make primary' =&gt; 'Rendre principal',
 	'Add sub category' =&gt; 'Ajouter une sous-cat&#233;gorie',
-	'Add [_1] name' =&gt; 'Ajouter le nom [_1]',
-	'Add new parent [_1]' =&gt; 'Ajouter un nouveau [_1] parent',
+	'Add [lc,_1] name' =&gt; 'Ajouter le nom [lc,_1]',
+	'Add new parent [lc,_1]' =&gt; 'Ajouter un nouveau [lc,_1] parent',
 	'Add new' =&gt; 'Cr&#233;er',
-	'Save this [_1] (s)' =&gt; 'Enregistrer cette [_1] (s)',
-	'Preview this [_1] (v)' =&gt; 'Pr&#233; visualiser ce [_1] (v)',
-	'Delete this [_1] (v)' =&gt; 'Effacer ce [_1] (v)',
-	'Share this [_1]' =&gt; 'Partager cette [_1]',
+	'Save this [lc,_1] (s)' =&gt; 'Enregistrer cette [lc,_1] (s)',
+	'Preview this [lc,_1] (v)' =&gt; 'Pr&#233; visualiser ce [lc,_1] (v)',
+	'Share this [lc,_1]' =&gt; 'Partager cette [lc,_1]',
 	'View published [_1]' =&gt; 'Voir la [_1] publi&#233;',
 	'&amp;laquo; Previous' =&gt; '&amp;laquo; Pr&#233;c&#233;dent',
 	'Next &amp;raquo;' =&gt; 'Suivant &amp;raquo;',
@@ -2712,10 +2711,10 @@ use vars qw( @ISA %Lexicon );
 	'(comma-delimited list)' =&gt; '(liste d&#233;limit&#233;e par virgule)',
 	'(space-delimited list)' =&gt; '(liste d&#233;limit&#233;e par espace)',
 	'(delimited by \'[_1]\')' =&gt; '(d&#233;limit&#233;e par \'[_1]\')',
-	'Change [_1]' =&gt; 'Modifier le [_1]',
-	'Add [_1]' =&gt; 'Ajouter une [_1]',
+	'Change [lc,_1]' =&gt; 'Modifier le [lc,_1]',
+	'Add [lc,_1]' =&gt; 'Ajouter une [lc,_1]',
 	'Unpublished' =&gt; 'Non publi&#233;',
-	'You must configure blog before you can publish this [_1].' =&gt; 'Vous devez configurer votre blog avant de pouvoir publier ce [_1].',
+	'You must configure this blog before you can publish this [lc,_1].' =&gt; 'Vous devez configurer votre blog avant de pouvoir publier ce [lc,_1].',
 	'Select entry date' =&gt; 'Choisir la date de la note',
 	'Unlock this entry&amp;rsquo;s output filename for editing' =&gt; 'D&#233;verrouiller le nom de fichier de la note pour le modifier',
 	'Warning: If you set the basename manually, it may conflict with another entry.' =&gt; 'ATTENTION : Editer le nom de base manuellement peut cr&#233;er des conflits avec d\'autres notes.',
@@ -3025,13 +3024,13 @@ use vars qw( @ISA %Lexicon );
 	'System Permissions' =&gt; 'Autorisations syst&#232;me',
 	'Options' =&gt; 'Options',
 	'Create personal blog for user' =&gt; 'Cr&#233;er le blog personnel de l\'utilisateur',
-	'Create [_1] (s)' =&gt; 'Cr&#233;er [_1] (s)',
+	'Create [lc,_1] (s)' =&gt; 'Cr&#233;er [lc,_1] (s)',
 	'_USAGE_PASSWORD_RESET' =&gt; 'Ci-dessous, vous pouvez r&#233;-initialiser le mot de passe pour cet utilisateur. Si vous faites cela un mot de passe g&#233;n&#233;r&#233; al&#233;atoirement sera cr&#233;&#233; et envoy&#233; par e-mail &#224; : [_1].',
 	'Initiate Password Recovery' =&gt; 'R&#233;cup&#233;rer le mot de passe',
 
 ## tmpl/cms/edit_comment.tmpl
 	'The comment has been approved.' =&gt; 'Ce commentaire a &#233;t&#233; approuv&#233;.',
-	'Delete this [_1] (x)' =&gt; 'Effacer cet [_1] (x)',
+	'Delete this [lc,_1] (x)' =&gt; 'Effacer cet [lc,_1] (x)',
 	'Previous Comment' =&gt; 'Commentaire pr&#233;c&#233;dent',
 	'Next Comment' =&gt; 'Commentaire suivant',
 	'Manage Comments' =&gt; 'G&#233;rer les commentaires',
@@ -3234,12 +3233,12 @@ use vars qw( @ISA %Lexicon );
 	'Cancel (c)' =&gt; 'Annuler (c)',
 
 ## tmpl/cms/list_folder.tmpl
-	'Your [_1] changes and additions have been made.' =&gt; 'Les modifications ont &#233;t&#233; enregistr&#233;es.',
-	'You have successfully deleted the selected [_1].' =&gt; 'Vous avez supprim&#233; avec succ&#232;s les [_1] s&#233;lectionn&#233;(e)s.',
-	'Create top level [_1]' =&gt; 'Cr&#233;er un(e) [_1] &#224; la racine',
+	'Your [lc,_1] changes and additions have been made.' =&gt; 'Les modifications ont &#233;t&#233; enregistr&#233;es.',
+	'You have successfully deleted the selected [lc,_1].' =&gt; 'Vous avez supprim&#233; avec succ&#232;s les [lc,_1] s&#233;lectionn&#233;(e)s.',
+	'Create top level [lc,_1]' =&gt; 'Cr&#233;er un(e) [lc,_1] &#224; la racine',
 	'New Parent [_1]' =&gt; 'Nouveau [_1] parent',
 	'Top Level' =&gt; 'Niveau racine',
-	'Move [_1]' =&gt; 'D&#233;placer [_1]',
+	'Move [lc,_1]' =&gt; 'D&#233;placer [lc,_1]',
 	'Move' =&gt; 'D&#233;placer',
 	'[quant,_1,page,pages]' =&gt; '[quant,_1,page,pages]',
 
@@ -3412,7 +3411,7 @@ use vars qw( @ISA %Lexicon );
 	'[quant,_1,result,results] found' =&gt; '[quant,_1,r&#233;sultat trouv&#233;,r&#233;sultats trouv&#233;s]',
 
 ## tmpl/cms/preview_strip.tmpl
-	'You are previewing the [_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; 'Vous pr&#233;-visualisez la [_1] titr&#233;e &amp;ldquo;[_2]&amp;rdquo;',
+	'You are previewing the [lc,_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; 'Vous pr&#233;-visualisez la [lc,_1] titr&#233;e &amp;ldquo;[_2]&amp;rdquo;',
 
 ## tmpl/cms/edit_ping.tmpl
 	'The TrackBack has been approved.' =&gt; 'Le trackback a &#233;t&#233; approuv&#233;.',
@@ -4052,9 +4051,9 @@ use vars qw( @ISA %Lexicon );
 ## addons/Enterprise.pack/tmpl/include/group_table.tmpl
 	'group' =&gt; 'groupe',
 	'groups' =&gt; 'Groupes',
-	'Enable selected [_1] (e)' =&gt; 'Activer [_1] s&#233;lectionn&#233; (e)',
-	'Disable selected [_1] (d)' =&gt; 'D&#233;sactiver [_1] s&#233;lectionn&#233; (d)',
-	'Remove selected [_1] (d)' =&gt; 'Supprimer [_1] s&#233;lectionn&#233; (d)',
+	'Enable selected [lc,_1] (e)' =&gt; 'Activer [lc,_1] s&#233;lectionn&#233; (e)',
+	'Disable selected [lc,_1] (d)' =&gt; 'D&#233;sactiver [lc,_1] s&#233;lectionn&#233; (d)',
+	'Remove selected [lc,_1] (d)' =&gt; 'Supprimer [lc,_1] s&#233;lectionn&#233; (d)',
 	'Only show enabled groups' =&gt; 'Afficher uniquement les groupes activ&#233;s',
 	'Only show disabled groups' =&gt; 'Afficher uniquement les groupes d&#233;sactiv&#233;s',
 </diff>
      <filename>lib/MT/L10N/fr.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,11 @@
-# Copyright 2003-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
 package MT::L10N::ja;
+
 use strict;
 use MT::L10N;
 use MT::L10N::en_us;
@@ -126,8 +128,8 @@ use vars qw( @ISA %Lexicon );
 	'Return to the &lt;a href=&quot;[_1]&quot;&gt;original entry&lt;/a&gt;.' =&gt; '&lt;a href=&quot;[_1]&quot;&gt;&#20803;&#12398;&#12502;&#12525;&#12464;&#35352;&#20107;&lt;/a&gt;&#12395;&#25147;&#12427;',
 
 ## default_templates/notify-entry.mtml
-	'A new [_3] entitled \'[_1]\' has been published to [_2].' =&gt; '&#26032;&#12375;&#12356;[_3]&#12300;[_1]&#12301;&#12434;[_2]&#12391;&#20844;&#38283;&#12375;&#12414;&#12375;&#12383;&#12290;',
-	'View [_1]:' =&gt; '[_1]&#12434;&#35211;&#12427;',
+	'A new [lc,_3] entitled \'[_1]\' has been published to [_2].' =&gt; '&#26032;&#12375;&#12356;[_3]&#12300;[_1]&#12301;&#12434;[_2]&#12391;&#20844;&#38283;&#12375;&#12414;&#12375;&#12383;&#12290;',
+	'View [lc,_1]:' =&gt; '[_1]&#12434;&#35211;&#12427;',
 	'[_1] Title: [_2]' =&gt; '&#12479;&#12452;&#12488;&#12523;: [_2]',
 	'Publish Date: [_1]' =&gt; '&#26085;&#20184;: [_1]',
 	'Message from Sender:' =&gt; '&#12513;&#12483;&#12475;&#12540;&#12472;: ',
@@ -239,7 +241,7 @@ use vars qw( @ISA %Lexicon );
 
 ## default_templates/recover-password.mtml
 	'_USAGE_FORGOT_PASSWORD_1' =&gt; '&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#20877;&#35373;&#23450;&#12375;&#12414;&#12375;&#12383;&#12290;&#26032;&#12375;&#12356;&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#36890;&#30693;&#12375;&#12414;&#12377;&#12290;',
-	'_USAGE_FORGOT_PASSWORD_2' =&gt; '&#26032;&#12375;&#12356;&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#20351;&#12387;&#12390;Movable Type&#12395;&#12525;&#12464;&#12452;&#12531;&#12375;&#12289;&#12377;&#12368;&#12395;&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#22793;&#26356;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;',
+	'_USAGE_FORGOT_PASSWORD_2' =&gt; '&#20197;&#19979;&#12398;URL&#12363;&#12425;&#12289;&#26032;&#12375;&#12356;&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#20351;&#12387;&#12390;Movable Type&#12395;&#12525;&#12464;&#12452;&#12531;&#12375;&#12289;&#12377;&#12368;&#12395;&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#22793;&#26356;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;',
 	'Mail Footer' =&gt; '&#12513;&#12540;&#12523;&#12501;&#12483;&#12479;&#12540;',
 
 ## default_templates/javascript.mtml
@@ -739,7 +741,7 @@ use vars qw( @ISA %Lexicon );
 	'Settings' =&gt; '&#35373;&#23450;',
 	'Edit Comment' =&gt; '&#12467;&#12513;&#12531;&#12488;&#12398;&#32232;&#38598;',
 	'Authenticated Commenters' =&gt; '&#35469;&#35388;&#12373;&#12428;&#12390;&#12356;&#12427;&#12467;&#12513;&#12531;&#12488;&#25237;&#31295;&#32773;',
-	'Commenter Details' =&gt; '&#12467;&#12513;&#12531;&#12488;&#12398;&#35443;&#32048;',
+	'Commenter Details' =&gt; '&#12467;&#12513;&#12531;&#12488;&#25237;&#31295;&#32773;&#12398;&#35443;&#32048;',
 	'New Entry' =&gt; '&#26032;&#12375;&#12356;&#12502;&#12525;&#12464;&#35352;&#20107;',
 	'New Page' =&gt; '&#26032;&#12375;&#12356;&#12454;&#12455;&#12502;&#12506;&#12540;&#12472;',
 	'Create template requires type' =&gt; '&#12486;&#12531;&#12503;&#12524;&#12540;&#12488;&#12434;&#20316;&#25104;&#12377;&#12427;&#12383;&#12417;&#12398;type&#12497;&#12521;&#12513;&#12540;&#12479;&#12364;&#25351;&#23450;&#12373;&#12428;&#12390;&#12356;&#12414;&#12379;&#12435;&#12290;',
@@ -1895,14 +1897,14 @@ use vars qw( @ISA %Lexicon );
 	'comment' =&gt; '&#12467;&#12513;&#12531;&#12488;',
 	'comments' =&gt; '&#12467;&#12513;&#12531;&#12488;',
 	'to publish' =&gt; '&#20844;&#38283;',
-	'Publish selected [_1] (a)' =&gt; '&#36984;&#25246;&#12373;&#12428;&#12383;[_1]&#12434;&#20844;&#38283;&#12377;&#12427; (a)',
-	'Delete selected [_1] (x)' =&gt; '[_1]&#12434;&#21066;&#38500;&#12377;&#12427;(x)',
-	'Report selected [_1] as Spam (j)' =&gt; '&#36984;&#25246;&#12373;&#12428;&#12383;[_1]&#12434;&#12473;&#12497;&#12512;&#12392;&#12375;&#12390;&#22577;&#21578;&#12377;&#12427; (j)',
+	'Publish selected [lc,_1] (a)' =&gt; '&#36984;&#25246;&#12373;&#12428;&#12383;[_1]&#12434;&#20844;&#38283;&#12377;&#12427; (a)',
+	'Delete selected [lc,_1] (x)' =&gt; '[_1]&#12434;&#21066;&#38500;&#12377;&#12427;(x)',
+	'Report selected [lc,_1] as Spam (j)' =&gt; '&#36984;&#25246;&#12373;&#12428;&#12383;[_1]&#12434;&#12473;&#12497;&#12512;&#12392;&#12375;&#12390;&#22577;&#21578;&#12377;&#12427; (j)',
 	'Spam' =&gt; '&#12473;&#12497;&#12512;',
-	'Report selected [_1] as Not Spam and Publish (j)' =&gt; '&#36984;&#25246;&#12373;&#12428;&#12383;[_1]&#12434;&#12473;&#12497;&#12512;&#12363;&#12425;&#25147;&#12375;&#12390;&#20844;&#38283;&#12377;&#12427; (j)',
+	'Report selected [lc,_1] as Not Spam and Publish (j)' =&gt; '&#36984;&#25246;&#12373;&#12428;&#12383;[_1]&#12434;&#12473;&#12497;&#12512;&#12363;&#12425;&#25147;&#12375;&#12390;&#20844;&#38283;&#12377;&#12427; (j)',
 	'Not Spam' =&gt; '&#12473;&#12497;&#12512;&#35299;&#38500;',
 	'Are you sure you want to remove all comments reported as spam?' =&gt; '&#12473;&#12497;&#12512;&#12467;&#12513;&#12531;&#12488;&#12434;&#12377;&#12409;&#12390;&#21066;&#38500;&#12375;&#12414;&#12377;&#12363;?',
-	'Deletes all [_1] reported as Spam' =&gt; '&#12473;&#12497;&#12512;&#12392;&#12375;&#12390;&#22577;&#21578;&#12373;&#12428;&#12383;[_1]&#12434;&#12377;&#12409;&#12390;&#21066;&#38500;',
+	'Deletes all [lc,_1] reported as Spam' =&gt; '&#12473;&#12497;&#12512;&#12392;&#12375;&#12390;&#22577;&#21578;&#12373;&#12428;&#12383;[_1]&#12434;&#12377;&#12409;&#12390;&#21066;&#38500;',
 	'Empty' =&gt; '&#12377;&#12409;&#12390;&#21066;&#38500;',
 	'Ban This IP' =&gt; '&#12371;&#12398;IP&#12434;&#31105;&#27490;',
 	'Status' =&gt; '&#20844;&#38283;&#29366;&#24907;',
@@ -1914,8 +1916,7 @@ use vars qw( @ISA %Lexicon );
 	'Only show pending comments' =&gt; '&#20445;&#30041;&#20013;&#12398;&#12467;&#12513;&#12531;&#12488;&#12384;&#12369;&#12434;&#34920;&#31034;',
 	'Pending' =&gt; '&#20445;&#30041;&#20013;',
 	'Edit this comment' =&gt; '&#12371;&#12398;&#12467;&#12513;&#12531;&#12488;&#12434;&#32232;&#38598;',
-	'(1 reply)' =&gt; '(&#36820;&#20449;&#25968; 1)',
-	'([_1] replies)' =&gt; '(&#36820;&#20449;&#25968; [_1])',
+	'([quant,_1,reply,replies])' =&gt; '(&#36820;&#20449;&#25968; [_1])',
 	'Reply' =&gt; '&#36820;&#20449;',
 	'Trusted' =&gt; '&#25215;&#35469;&#28168;&#12415;',
 	'Blocked' =&gt; '&#31105;&#27490;&#20013;',
@@ -1923,7 +1924,7 @@ use vars qw( @ISA %Lexicon );
 	'Edit this [_1] commenter' =&gt; '&#12371;&#12398;&#12467;&#12513;&#12531;&#12488;&#25237;&#31295;&#32773;([_1])&#12434;&#32232;&#38598;',
 	'Search for comments by this commenter' =&gt; '&#12371;&#12398;&#12467;&#12513;&#12531;&#12488;&#25237;&#31295;&#32773;&#12398;&#12467;&#12513;&#12531;&#12488;&#12434;&#26908;&#32034;',
 	'Anonymous' =&gt; '&#21311;&#21517;',
-	'View this [_1]' =&gt; '[_1]&#12434;&#34920;&#31034;&#12377;&#12427;',
+	'View this [lc,_1]' =&gt; '[_1]&#12434;&#34920;&#31034;&#12377;&#12427;',
 	'Search for all comments from this IP address' =&gt; '&#12371;&#12398;IP&#12450;&#12489;&#12524;&#12473;&#12363;&#12425;&#12398;&#12377;&#12409;&#12390;&#12398;&#12467;&#12513;&#12531;&#12488;&#12434;&#26908;&#32034;',
 
 ## tmpl/cms/include/copyright.tmpl
@@ -2049,9 +2050,9 @@ use vars qw( @ISA %Lexicon );
 	'View the [_1] for this TrackBack' =&gt; '&#12488;&#12521;&#12483;&#12463;&#12496;&#12483;&#12463;&#12373;&#12428;&#12383;[_1]&#12434;&#35211;&#12427;',
 
 ## tmpl/cms/include/entry_table.tmpl
-	'Save these [_1] (s)' =&gt; '&#12371;&#12428;&#12425;&#12398;[_1]&#12434;&#20445;&#23384;&#12377;&#12427;(s)',
+	'Save these [lc,_1] (s)' =&gt; '&#12371;&#12428;&#12425;&#12398;[_1]&#12434;&#20445;&#23384;&#12377;&#12427;(s)',
 	'to republish' =&gt; '&#20877;&#27083;&#31689;',
-	'Republish selected [_1] (r)' =&gt; '&#36984;&#25246;&#12373;&#12428;&#12383;[_1]&#12434;&#20877;&#27083;&#31689;&#12377;&#12427; (r)',
+	'Republish selected [lc,_1] (r)' =&gt; '&#36984;&#25246;&#12373;&#12428;&#12383;[_1]&#12434;&#20877;&#27083;&#31689;&#12377;&#12427; (r)',
 	'Republish' =&gt; '&#20877;&#27083;&#31689;',
 	'page' =&gt; '&#12454;&#12455;&#12502;&#12506;&#12540;&#12472;',
 	'Last Modified' =&gt; '&#26368;&#32066;&#26356;&#26032;',
@@ -2059,12 +2060,12 @@ use vars qw( @ISA %Lexicon );
 	'Unpublished (Draft)' =&gt; '&#26410;&#20844;&#38283;(&#21407;&#31295;)',
 	'Unpublished (Review)' =&gt; '&#26410;&#20844;&#38283;(&#25215;&#35469;&#24453;&#12385;)',
 	'Scheduled' =&gt; '&#26085;&#26178;&#25351;&#23450;',
-	'Only show unpublished [_1]' =&gt; '&#19979;&#26360;&#12365;&#12398;[_1]&#12384;&#12369;&#12434;&#34920;&#31034;',
-	'Only show published [_1]' =&gt; '&#20844;&#38283;&#12373;&#12428;&#12383;[_1]&#12384;&#12369;&#12434;&#34920;&#31034;',
-	'Only show [_1] for review' =&gt; '&#12524;&#12499;&#12517;&#12540;&#20013;&#12398;[_1]&#12384;&#12369;&#12434;&#34920;&#31034;',
-	'Only show scheduled [_1]' =&gt; '&#26085;&#26178;&#25351;&#23450;&#12373;&#12428;&#12383;[_1]&#12384;&#12369;&#12434;&#34920;&#31034;',
-	'Edit [_1]' =&gt; '[_1]&#12398;&#32232;&#38598;',
-	'View [_1]' =&gt; '[_1]&#12434;&#35211;&#12427;',
+	'Only show unpublished [lc,_1]' =&gt; '&#19979;&#26360;&#12365;&#12398;[_1]&#12384;&#12369;&#12434;&#34920;&#31034;',
+	'Only show published [lc,_1]' =&gt; '&#20844;&#38283;&#12373;&#12428;&#12383;[_1]&#12384;&#12369;&#12434;&#34920;&#31034;',
+	'Only show [lc,_1] for review' =&gt; '&#12524;&#12499;&#12517;&#12540;&#20013;&#12398;[_1]&#12384;&#12369;&#12434;&#34920;&#31034;',
+	'Only show scheduled [lc,_1]' =&gt; '&#26085;&#26178;&#25351;&#23450;&#12373;&#12428;&#12383;[_1]&#12384;&#12369;&#12434;&#34920;&#31034;',
+	'Edit [lc,_1]' =&gt; '[_1]&#12398;&#32232;&#38598;',
+	'View [lc,_1]' =&gt; '[_1]&#12434;&#35211;&#12427;',
 
 ## tmpl/cms/include/login_mt.tmpl
 
@@ -2476,7 +2477,7 @@ use vars qw( @ISA %Lexicon );
 	'Save (s)' =&gt; '&#20445;&#23384;',
 	'Save and Publish this template (r)' =&gt; '&#12371;&#12398;&#12486;&#12531;&#12503;&#12524;&#12540;&#12488;&#12434;&#20445;&#23384;&#12375;&#12390;&#20877;&#27083;&#31689; (r)',
 	'Save &amp;amp; Publish' =&gt; '&#20445;&#23384;&#12392;&#20877;&#27083;&#31689;',
-	'You have unsaved changes to your [_1] that will be lost.' =&gt; '&#20445;&#23384;&#12373;&#12428;&#12390;&#12356;&#12394;&#12356;[_1]&#12408;&#12398;&#22793;&#26356;&#12399;&#22833;&#12431;&#12428;&#12414;&#12377;&#12290;',
+	'You have unsaved changes to your [lc,_1] that will be lost.' =&gt; '&#20445;&#23384;&#12373;&#12428;&#12390;&#12356;&#12394;&#12356;[_1]&#12408;&#12398;&#22793;&#26356;&#12399;&#22833;&#12431;&#12428;&#12414;&#12377;&#12290;',
 	'You must set the Template Name.' =&gt; '&#12486;&#12531;&#12503;&#12524;&#12540;&#12488;&#21517;&#12434;&#35373;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;',
 	'You must set the template Output File.' =&gt; '&#12486;&#12531;&#12503;&#12524;&#12540;&#12488;&#12398;&#20986;&#21147;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#35373;&#23450;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;',
 	'Please wait...' =&gt; '&#12362;&#24453;&#12385;&#12367;&#12384;&#12373;&#12356;...',
@@ -2516,7 +2517,7 @@ use vars qw( @ISA %Lexicon );
 	'Commenting' =&gt; '&#12467;&#12513;&#12531;&#12488;&#25237;&#31295;',
 	'Duplicate Roles' =&gt; '&#21516;&#12376;&#27177;&#38480;&#12398;&#12525;&#12540;&#12523;',
 	'These roles have the same privileges as this role' =&gt; '&#12371;&#12398;&#12525;&#12540;&#12523;&#12392;&#21516;&#12376;&#27177;&#38480;&#12434;&#35373;&#23450;&#12373;&#12428;&#12383;&#12525;&#12540;&#12523;',
-	'Save changes to this [_1] (s)' =&gt; '[_1]&#12408;&#12398;&#22793;&#26356;&#12434;&#20445;&#23384; (s)',
+	'Save changes to this [lc,_1] (s)' =&gt; '[_1]&#12408;&#12398;&#22793;&#26356;&#12434;&#20445;&#23384; (s)',
 
 ## tmpl/cms/cfg_plugin.tmpl
 	'System Plugin Settings' =&gt; '&#12471;&#12473;&#12486;&#12512;&#12503;&#12521;&#12464;&#12452;&#12531;&#35373;&#23450;',
@@ -2606,13 +2607,13 @@ use vars qw( @ISA %Lexicon );
 	'Comments from [_1]' =&gt; '[_1]&#12363;&#12425;&#12398;&#12467;&#12513;&#12531;&#12488;',
 	'commenter' =&gt; '&#12467;&#12513;&#12531;&#12488;&#25237;&#31295;&#32773;',
 	'commenters' =&gt; '&#12467;&#12513;&#12531;&#12488;&#25237;&#31295;&#32773;',
-	'Trust [_1] (t)' =&gt; '[_1]&#12434;&#25215;&#35469; (t)',
+	'Trust [lc,_1] (t)' =&gt; '[_1]&#12434;&#25215;&#35469; (t)',
 	'Trust' =&gt; '&#25215;&#35469;',
-	'Untrust [_1] (t)' =&gt; '[_1]&#12398;&#25215;&#35469;&#12434;&#35299;&#38500;',
+	'Untrust [lc,_1] (t)' =&gt; '[_1]&#12398;&#25215;&#35469;&#12434;&#35299;&#38500;',
 	'Untrust' =&gt; '&#25215;&#35469;&#12434;&#35299;&#38500;',
-	'Ban [_1] (b)' =&gt; '[_1]&#12434;&#31105;&#27490; (b)',
+	'Ban [lc,_1] (b)' =&gt; '[_1]&#12434;&#31105;&#27490; (b)',
 	'Ban' =&gt; '&#31105;&#27490;',
-	'Unban [_1] (b)' =&gt; '[_1]&#12398;&#31105;&#27490;&#12434;&#35299;&#38500; (b)',
+	'Unban [lc,_1] (b)' =&gt; '[_1]&#12398;&#31105;&#27490;&#12434;&#35299;&#38500; (b)',
 	'Unban' =&gt; '&#31105;&#27490;&#12434;&#35299;&#38500;',
 	'The Name of the commenter' =&gt; '&#12467;&#12513;&#12531;&#12488;&#25237;&#31295;&#32773;&#12398;&#21517;&#21069;',
 	'View all comments with this name' =&gt; '&#12371;&#12398;&#21517;&#21069;&#12398;&#12377;&#12409;&#12390;&#12398;&#12467;&#12513;&#12531;&#12488;&#12434;&#35211;&#12427;',
@@ -2636,7 +2637,7 @@ use vars qw( @ISA %Lexicon );
 	'All [_1]' =&gt; '&#12377;&#12409;&#12390;&#12398;[_1]',
 	'change' =&gt; '&#32094;&#12426;&#36796;&#12415;',
 	'[_1] where [_2] is [_3]' =&gt; '[_2]&#12364;[_3]&#12398;[_1]',
-	'Show only [_1] where' =&gt; '&#34920;&#31034;:[_1]',
+	'Show only [lc,_1] where' =&gt; '&#34920;&#31034;:[_1]',
 	'status' =&gt; '&#12473;&#12486;&#12540;&#12479;&#12473;',
 	'tag (exact match)' =&gt; '&#12479;&#12464;&#65288;&#23436;&#20840;&#19968;&#33268;&#65289;',
 	'tag (fuzzy match)' =&gt; '&#12479;&#12464;&#65288;&#12354;&#12356;&#12414;&#12356;&#26908;&#32034;&#65289;',
@@ -2726,7 +2727,7 @@ use vars qw( @ISA %Lexicon );
 	'folder' =&gt; '&#12501;&#12457;&#12523;&#12480;',
 	'folders' =&gt; '&#12501;&#12457;&#12523;&#12480;',
 	'categories' =&gt; '&#12459;&#12486;&#12468;&#12522;',
-	'Create [_1]' =&gt; '[_1]&#12434;&#20316;&#25104;',
+	'Create [lc,_1]' =&gt; '[_1]&#12434;&#20316;&#25104;',
 	'Your [_1] has been saved.' =&gt; '[_1]&#12434;&#20445;&#23384;&#12375;&#12414;&#12375;&#12383;&#12290;',
 	'One or more errors occurred when sending update pings or TrackBacks.' =&gt; '&#26356;&#26032;&#36890;&#30693;&#12363;&#12488;&#12521;&#12483;&#12463;&#12496;&#12483;&#12463;&#36865;&#20449;&#12391;&#12402;&#12392;&#12388;&#20197;&#19978;&#12398;&#12456;&#12521;&#12540;&#12364;&#30330;&#29983;&#12375;&#12414;&#12375;&#12383;&#12290;',
 	'_USAGE_VIEW_LOG' =&gt; '&#12456;&#12521;&#12540;&#12398;&#22580;&#21512;&#12399;&#12289;&lt;a href=&quot;[_1]&quot;&gt;&#12525;&#12464;&lt;/a&gt;&#12434;&#12481;&#12455;&#12483;&#12463;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;',
@@ -2754,13 +2755,12 @@ use vars qw( @ISA %Lexicon );
 	'Publish Date' =&gt; '&#20844;&#38283;&#26085;',
 	'Make primary' =&gt; '&#12513;&#12452;&#12531;&#12459;&#12486;&#12468;&#12522;&#12395;&#12377;&#12427;',
 	'Add sub category' =&gt; '&#12469;&#12502;&#12459;&#12486;&#12468;&#12522;&#12434;&#36861;&#21152;',
-	'Add [_1] name' =&gt; '[_1]&#12398;&#21517;&#21069;&#12434;&#36861;&#21152;',
-	'Add new parent [_1]' =&gt; '&#26032;&#12375;&#12356;&#12488;&#12483;&#12503;&#12524;&#12505;&#12523;&#12459;&#12486;&#12468;&#12522;[_1]&#12434;&#36861;&#21152;',
+	'Add [lc,_1] name' =&gt; '[_1]&#12398;&#21517;&#21069;&#12434;&#36861;&#21152;',
+	'Add new parent [lc,_1]' =&gt; '&#26032;&#12375;&#12356;&#12488;&#12483;&#12503;&#12524;&#12505;&#12523;&#12459;&#12486;&#12468;&#12522;[_1]&#12434;&#36861;&#21152;',
 	'Add new' =&gt; '&#26032;&#35215;&#36861;&#21152;',
-	'Save this [_1] (s)' =&gt; '&#12371;&#12398;[_1]&#12434;&#20445;&#23384;(s)',
-	'Preview this [_1] (v)' =&gt; '&#12371;&#12398;[_1]&#12434;&#12503;&#12524;&#12499;&#12517;&#12540;(v)',
-	'Delete this [_1] (v)' =&gt; '&#12371;&#12398;[_1]&#12434;&#21066;&#38500;(v)',
-	'Share this [_1]' =&gt; '&#12371;&#12398;[_1]&#12434;&#20849;&#26377;',
+	'Save this [lc,_1] (s)' =&gt; '&#12371;&#12398;[_1]&#12434;&#20445;&#23384;(s)',
+	'Preview this [lc,_1] (v)' =&gt; '&#12371;&#12398;[_1]&#12434;&#12503;&#12524;&#12499;&#12517;&#12540;(v)',
+	'Share this [lc,_1]' =&gt; '&#12371;&#12398;[_1]&#12434;&#20849;&#26377;',
 	'View published [_1]' =&gt; '&#20844;&#38283;&#12373;&#12428;&#12383;[_1]&#12434;&#34920;&#31034;',
 	'&amp;laquo; Previous' =&gt; '&amp;laquo; &#21069;',
 	'Next &amp;raquo;' =&gt; '&#27425; &amp;raquo;',
@@ -2770,10 +2770,10 @@ use vars qw( @ISA %Lexicon );
 	'(comma-delimited list)' =&gt; '&#65288;&#12459;&#12531;&#12510;&#21306;&#20999;&#12426;&#12522;&#12473;&#12488;&#65289;',
 	'(space-delimited list)' =&gt; '&#65288;&#12473;&#12506;&#12540;&#12473;&#21306;&#20999;&#12426;&#12522;&#12473;&#12488;&#65289;',
 	'(delimited by \'[_1]\')' =&gt; '&#65288;[_1]&#12391;&#21306;&#20999;&#12427;&#65289;',
-	'Change [_1]' =&gt; '[_1]&#12434;&#22793;&#26356;',
-	'Add [_1]' =&gt; '[_1]&#12434;&#36861;&#21152;',
+	'Change [lc,_1]' =&gt; '[_1]&#12434;&#22793;&#26356;',
+	'Add [lc,_1]' =&gt; '[_1]&#12434;&#36861;&#21152;',
 	'Unpublished' =&gt; '&#19979;&#26360;&#12365;',
-	'You must configure blog before you can publish this [_1].' =&gt; '[_1]&#12434;&#20844;&#38283;&#12377;&#12427;&#21069;&#12395;&#12502;&#12525;&#12464;&#12398;&#35373;&#23450;&#12434;&#34892;&#12387;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;',
+	'You must configure this blog before you can publish this [lc,_1].' =&gt; '[_1]&#12434;&#20844;&#38283;&#12377;&#12427;&#21069;&#12395;&#12502;&#12525;&#12464;&#12398;&#35373;&#23450;&#12434;&#34892;&#12387;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;',
 	'Select entry date' =&gt; '&#20316;&#25104;&#26085;&#12434;&#36984;&#25246;',
 	'Unlock this entry&amp;rsquo;s output filename for editing' =&gt; '&#20986;&#21147;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#32232;&#38598;&#12377;&#12427;&#12395;&#12399;&#12525;&#12483;&#12463;&#12434;&#35299;&#38500;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;',
 	'Warning: If you set the basename manually, it may conflict with another entry.' =&gt; '&#35686;&#21578;: &#20986;&#21147;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#25163;&#21205;&#12391;&#35373;&#23450;&#12377;&#12427;&#12392;&#12289;&#20182;&#12398;&#12502;&#12525;&#12464;&#35352;&#20107;&#12392;&#34909;&#31361;&#12434;&#36215;&#12371;&#12377;&#21487;&#33021;&#24615;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;',
@@ -3087,13 +3087,13 @@ use vars qw( @ISA %Lexicon );
 	'System Permissions' =&gt; '&#12471;&#12473;&#12486;&#12512;&#27177;&#38480;',
 	'Options' =&gt; '&#12458;&#12503;&#12471;&#12519;&#12531;',
 	'Create personal blog for user' =&gt; '&#20491;&#20154;&#29992;&#12398;&#12502;&#12525;&#12464;&#12434;&#20316;&#25104;&#12377;&#12427;',
-	'Create [_1] (s)' =&gt; '[_1]&#12398;&#20316;&#25104; (s)',
+	'Create [lc,_1] (s)' =&gt; '[_1]&#12398;&#20316;&#25104; (s)',
 	'_USAGE_PASSWORD_RESET' =&gt; '&#12518;&#12540;&#12470;&#12540;&#12398;&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#20877;&#35373;&#23450;&#12391;&#12365;&#12414;&#12377;&#12290;&#12497;&#12473;&#12527;&#12540;&#12489;&#12364;&#12521;&#12531;&#12480;&#12512;&#12395;&#29983;&#25104;&#12373;&#12428;&#12289;[_1]&#12395;&#12513;&#12540;&#12523;&#12391;&#36865;&#20449;&#12373;&#12428;&#12414;&#12377;&#12290;',
 	'Initiate Password Recovery' =&gt; '&#12497;&#12473;&#12527;&#12540;&#12489;&#12398;&#20877;&#35373;&#23450;',
 
 ## tmpl/cms/edit_comment.tmpl
 	'The comment has been approved.' =&gt; '&#12467;&#12513;&#12531;&#12488;&#12434;&#20844;&#38283;&#12375;&#12414;&#12375;&#12383;&#12290;',
-	'Delete this [_1] (x)' =&gt; '&#12371;&#12398;[_1]&#12434;&#21066;&#38500;(x)',
+	'Delete this [lc,_1] (x)' =&gt; '&#12371;&#12398;[_1]&#12434;&#21066;&#38500;(x)',
 	'Previous Comment' =&gt; '&#21069;&#12398;&#12467;&#12513;&#12531;&#12488;',
 	'Next Comment' =&gt; '&#27425;&#12398;&#12467;&#12513;&#12531;&#12488;',
 	'Manage Comments' =&gt; '&#12467;&#12513;&#12531;&#12488;&#12398;&#31649;&#29702;',
@@ -3191,7 +3191,7 @@ use vars qw( @ISA %Lexicon );
 	'Check this and files backed up from newer versions can be restored to this system.  NOTE: Ignoring Schema Version can damage Movable Type permanently.' =&gt; '&#12481;&#12455;&#12483;&#12463;&#12377;&#12427;&#12392;&#29694;&#22312;&#12398;&#12471;&#12473;&#12486;&#12512;&#12424;&#12426;&#26032;&#12375;&#12356;&#12471;&#12473;&#12486;&#12512;&#12363;&#12425;&#12496;&#12483;&#12463;&#12450;&#12483;&#12503;&#12373;&#12428;&#12383;&#12487;&#12540;&#12479;&#12434;&#12371;&#12398;&#12471;&#12473;&#12486;&#12512;&#12395;&#24489;&#20803;&#12391;&#12365;&#12414;&#12377;&#12290;&#27880;&#24847;: &#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#34909;&#31361;&#12434;&#28961;&#35222;&#12377;&#12427;&#12392;&#12289;Movable Type&#12398;&#12471;&#12473;&#12486;&#12512;&#12395;&#22238;&#24489;&#19981;&#21487;&#33021;&#12394;&#12480;&#12513;&#12540;&#12472;&#12434;&#19982;&#12360;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;',
 	'Ignore schema version conflicts' =&gt; '&#12496;&#12540;&#12472;&#12519;&#12531;&#12398;&#34909;&#31361;&#12434;&#28961;&#35222;&#12377;&#12427;',
 	'Check this and existing global templates will be overwritten from the backup file.' =&gt; '&#12481;&#12455;&#12483;&#12463;&#12377;&#12427;&#12392;&#26082;&#23384;&#12398;&#12464;&#12525;&#12540;&#12496;&#12523;&#12486;&#12531;&#12503;&#12524;&#12540;&#12488;&#12399;&#12496;&#12483;&#12463;&#12450;&#12483;&#12503;&#12395;&#21547;&#12414;&#12428;&#12390;&#12356;&#12427;&#12418;&#12398;&#12391;&#19978;&#26360;&#12365;&#12373;&#12428;&#12414;&#12377;&#12290;',
-	'Overwrite global templates.' =&gt; '&#12464;&#12525;&#12540;&#12496;&#12523;&#12486;&#12531;&#12503;&#12524;&#12540;&#12488;&#12434;&#19978;&#26360;&#12365;',
+	'Overwrite global templates.' =&gt; '&#12464;&#12525;&#12540;&#12496;&#12523;&#12486;&#12531;&#12503;&#12524;&#12540;&#12488;&#12434;&#19978;&#26360;&#12365;&#12377;&#12427;',
 	'Restore (r)' =&gt; '&#24489;&#20803;',
 
 ## tmpl/cms/cfg_archives.tmpl
@@ -3296,12 +3296,12 @@ use vars qw( @ISA %Lexicon );
 	'Cancel (c)' =&gt; '&#21462;&#12426;&#28040;&#12375;',
 
 ## tmpl/cms/list_folder.tmpl
-	'Your [_1] changes and additions have been made.' =&gt; '[_1]&#12398;&#22793;&#26356;&#12392;&#36861;&#21152;&#12434;&#34892;&#12356;&#12414;&#12375;&#12383;&#12290;',
-	'You have successfully deleted the selected [_1].' =&gt; '[_1]&#12434;&#21066;&#38500;&#12375;&#12414;&#12375;&#12383;&#12290;',
-	'Create top level [_1]' =&gt; '&#12488;&#12483;&#12503;&#12524;&#12505;&#12523;[_1]&#12434;&#20316;&#25104;',
+	'Your [lc,_1] changes and additions have been made.' =&gt; '[_1]&#12398;&#22793;&#26356;&#12392;&#36861;&#21152;&#12434;&#34892;&#12356;&#12414;&#12375;&#12383;&#12290;',
+	'You have successfully deleted the selected [lc,_1].' =&gt; '[_1]&#12434;&#21066;&#38500;&#12375;&#12414;&#12375;&#12383;&#12290;',
+	'Create top level [lc,_1]' =&gt; '&#12488;&#12483;&#12503;&#12524;&#12505;&#12523;[_1]&#12434;&#20316;&#25104;',
 	'New Parent [_1]' =&gt; '&#26032;&#12375;&#12356;&#12488;&#12483;&#12503;&#12524;&#12505;&#12523;&#12398;[_1]',
 	'Top Level' =&gt; '&#12523;&#12540;&#12488;',
-	'Move [_1]' =&gt; '[_1]&#12434;&#31227;&#21205;',
+	'Move [lc,_1]' =&gt; '[_1]&#12434;&#31227;&#21205;',
 	'Move' =&gt; '&#31227;&#21205;',
 	'[quant,_1,page,pages]' =&gt; '[quant,_1,&#20214;,&#20214;]',
 
@@ -3469,7 +3469,7 @@ use vars qw( @ISA %Lexicon );
 	'[quant,_1,result,results] found' =&gt; '[quant,_1,&#20214;,&#20214;]&#35211;&#12388;&#12363;&#12426;&#12414;&#12375;&#12383;&#12290;',
 
 ## tmpl/cms/preview_strip.tmpl
-	'You are previewing the [_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; '[_1] &amp;ldquo;[_2]&amp;rdquo;&#12398;&#12503;&#12524;&#12499;&#12517;&#12540;',
+	'You are previewing the [lc,_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; '[_1] &amp;ldquo;[_2]&amp;rdquo;&#12398;&#12503;&#12524;&#12499;&#12517;&#12540;',
 
 ## tmpl/cms/edit_ping.tmpl
 	'The TrackBack has been approved.' =&gt; '&#12488;&#12521;&#12483;&#12463;&#12496;&#12483;&#12463;&#12434;&#20844;&#38283;&#12375;&#12414;&#12375;&#12383;&#12290;',</diff>
      <filename>lib/MT/L10N/ja.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,11 @@
-# Copyright 2003-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
 package MT::L10N::nl;
+
 use strict;
 use MT::L10N;
 use MT::L10N::en_us;
@@ -53,8 +55,8 @@ use vars qw( @ISA %Lexicon );
 ## php/lib/function.mtauthordisplayname.php
 
 ## default_templates/notify-entry.mtml
-	'A new [_3] entitled \'[_1]\' has been published to [_2].' =&gt; 'Een [_3] getiteld \'[_1]\' is gepubliceerd op [_2].',
-	'View [_1]:' =&gt; '[_1] bekijken:',
+	'A new [lc,_3] entitled \'[_1]\' has been published to [_2].' =&gt; 'Een [lc,_3] getiteld \'[_1]\' is gepubliceerd op [_2].',
+	'View [lc,_1]:' =&gt; '[lc,_1] bekijken:',
 	'[_1] Title: [_2]' =&gt; '[_1] titel: [_2]',
 	'Publish Date: [_1]' =&gt; 'Publicatiedatum: [_1]',
 	'Message from Sender:' =&gt; 'Boodschap van afzender:',
@@ -1838,14 +1840,14 @@ use vars qw( @ISA %Lexicon );
 	'comment' =&gt; 'reactie',
 	'comments' =&gt; 'reacties',
 	'to publish' =&gt; 'om te publiceren',
-	'Publish selected [_1] (a)' =&gt; 'Publiceer geselecteerde [_1] (a)',
-	'Delete selected [_1] (x)' =&gt; 'Geselecteerde [_1] verwijderen (x)',
-	'Report selected [_1] as Spam (j)' =&gt; 'Geselecteerde [_1] rapporteren als spam (j)',
+	'Publish selected [lc,_1] (a)' =&gt; 'Publiceer geselecteerde [lc,_1] (a)',
+	'Delete selected [lc,_1] (x)' =&gt; 'Geselecteerde [lc,_1] verwijderen (x)',
+	'Report selected [lc,_1] as Spam (j)' =&gt; 'Geselecteerde [lc,_1] rapporteren als spam (j)',
 	'Spam' =&gt; 'Spam',
-	'Report selected [_1] as Not Spam and Publish (j)' =&gt; 'Geselecteerde [_1] rapporteren als niet-spam en publiceren (j)',
+	'Report selected [lc,_1] as Not Spam and Publish (j)' =&gt; 'Geselecteerde [lc,_1] rapporteren als niet-spam en publiceren (j)',
 	'Not Spam' =&gt; 'Geen spam',
 	'Are you sure you want to remove all comments reported as spam?' =&gt; 'Bent u zeker dat u alle reacties die als spam gemarkeerd zijn wenst te verwijderen?',
-	'Deletes all [_1] reported as Spam' =&gt; 'Verwijdert alle [_1] gerapporteerd als spam',
+	'Deletes all [lc,_1] reported as Spam' =&gt; 'Verwijdert alle [lc,_1] gerapporteerd als spam',
 	'Empty' =&gt; 'Leeg',
 	'Ban This IP' =&gt; 'Dit IP-adres verbannen',
 	'Status' =&gt; 'Status',
@@ -1857,8 +1859,7 @@ use vars qw( @ISA %Lexicon );
 	'Only show pending comments' =&gt; 'Enkel hangende reacties tonen',
 	'Pending' =&gt; 'In afwachting',
 	'Edit this comment' =&gt; 'Deze reactie bewerken',
-	'(1 reply)' =&gt; '(1 antwoord)',
-	'([_1] replies)' =&gt; '([_1] antwoorden)',
+	'([quant,_1,reply,replies])' =&gt; '([quant,_1,antwoord,antwoorden])',
 	'Reply' =&gt; 'Antwoorden',
 	'Trusted' =&gt; 'Vertrouwde',
 	'Blocked' =&gt; 'Geblokkeerd',
@@ -1866,7 +1867,7 @@ use vars qw( @ISA %Lexicon );
 	'Edit this [_1] commenter' =&gt; '[_1] reageerder bewerken',
 	'Search for comments by this commenter' =&gt; 'Zoek naar reacties door deze reageerder',
 	'Anonymous' =&gt; 'Anonieme',
-	'View this [_1]' =&gt; '[_1] bekijken',
+	'View this [lc,_1]' =&gt; '[lc,_1] bekijken',
 	'Search for all comments from this IP address' =&gt; 'Zoek naar alle reacties van dit IP adres',
 
 ## tmpl/cms/include/member_table.tmpl
@@ -1983,9 +1984,9 @@ use vars qw( @ISA %Lexicon );
 	'View the [_1] for this TrackBack' =&gt; 'De [_1] bekijken voor deze TrackBack',
 
 ## tmpl/cms/include/entry_table.tmpl
-	'Save these [_1] (s)' =&gt; 'Sla deze [_1] op (s)',
+	'Save these [lc,_1] (s)' =&gt; 'Sla deze [lc,_1] op (s)',
 	'to republish' =&gt; 'om opnieuw te publiceren',
-	'Republish selected [_1] (r)' =&gt; 'Herpubliceer geselecteerde [_1] (r)',
+	'Republish selected [lc,_1] (r)' =&gt; 'Herpubliceer geselecteerde [lc,_1] (r)',
 	'Republish' =&gt; 'Herpubliceren',
 	'page' =&gt; 'pagina',
 	'Last Modified' =&gt; 'Laatst aangepast',
@@ -1993,12 +1994,12 @@ use vars qw( @ISA %Lexicon );
 	'Unpublished (Draft)' =&gt; 'Niet gepubliceerd (klad)',
 	'Unpublished (Review)' =&gt; 'Niet gepubliceerd (na te kijken)',
 	'Scheduled' =&gt; 'Gepland',
-	'Only show unpublished [_1]' =&gt; 'Enkel niet gepubliceerde [_1] tonen',
-	'Only show published [_1]' =&gt; 'Enkel gepubliceerde [_1] tonen',
-	'Only show [_1] for review' =&gt; 'Enkel [_1] tonen om te beoordelen',
-	'Only show scheduled [_1]' =&gt; 'Enkel geplande [_1] tonen',
-	'Edit [_1]' =&gt; '[_1] bewerken',
-	'View [_1]' =&gt; 'Toon [_1]',
+	'Only show unpublished [lc,_1]' =&gt; 'Enkel niet gepubliceerde [lc,_1] tonen',
+	'Only show published [lc,_1]' =&gt; 'Enkel gepubliceerde [_1] tonen',
+	'Only show [lc,_1] for review' =&gt; 'Enkel [lc,_1] tonen om te beoordelen',
+	'Only show scheduled [lc,_1]' =&gt; 'Enkel geplande [lc,_1] tonen',
+	'Edit [lc,_1]' =&gt; '[lc,_1] bewerken',
+	'View [lc,_1]' =&gt; 'Toon [lc,_1]',
 
 ## tmpl/cms/include/login_mt.tmpl
 
@@ -2414,7 +2415,7 @@ use vars qw( @ISA %Lexicon );
 	'Commenting' =&gt; 'Reageren',
 	'Duplicate Roles' =&gt; 'Dubbele rollen',
 	'These roles have the same privileges as this role' =&gt; 'Deze rollen hebben dezelfde rechten als deze rol',
-	'Save changes to this [_1] (s)' =&gt; 'Wijzigingen aan deze [_1] opslaan (s)',
+	'Save changes to this [lc,_1] (s)' =&gt; 'Wijzigingen aan deze [lc,_1] opslaan (s)',
 
 ## tmpl/cms/cfg_plugin.tmpl
 	'System Plugin Settings' =&gt; 'Systeeminstellingen plugins',
@@ -2483,7 +2484,7 @@ use vars qw( @ISA %Lexicon );
 	'Save (s)' =&gt; 'Opslaan (s)',
 	'Save and Publish this template (r)' =&gt; 'Dit sjabloon opslaan en publiceren (r)',
 	'Save &amp;amp; Publish' =&gt; 'Opslaan &amp;amp; publiceren',
-	'You have unsaved changes to your [_1] that will be lost.' =&gt; 'Er zijn niet opgeslagen wijzigingen aan uw [_1] die verloren zullen gaan',
+	'You have unsaved changes to your [lc,_1] that will be lost.' =&gt; 'Er zijn niet opgeslagen wijzigingen aan uw [lc,_1] die verloren zullen gaan',
 	'You must set the Template Name.' =&gt; 'U moet de naam van het sjabloon instellen',
 	'You must set the template Output File.' =&gt; 'U moet het uitvoerbestand van het sjabloon instellen.',
 	'Please wait...' =&gt; 'Even wachten...',
@@ -2551,7 +2552,7 @@ use vars qw( @ISA %Lexicon );
 	'All [_1]' =&gt; 'Alle [_1]',
 	'change' =&gt; 'wijzig',
 	'[_1] where [_2] is [_3]' =&gt; '[_1] waar [_2] gelijk is aan [_3]',
-	'Show only [_1] where' =&gt; 'Toon enkel [_1] waar',
+	'Show only [lc,_1] where' =&gt; 'Toon enkel [lc,_1] waar',
 	'status' =&gt; 'status',
 	'tag (exact match)' =&gt; 'tag (exacte overeenkomst)',
 	'tag (fuzzy match)' =&gt; 'tag (fuzzy overeenkomst)',
@@ -2570,13 +2571,13 @@ use vars qw( @ISA %Lexicon );
 	'Comments from [_1]' =&gt; 'Reacties van [_1]',
 	'commenter' =&gt; 'reageerder',
 	'commenters' =&gt; 'reageerders',
-	'Trust [_1] (t)' =&gt; 'Vertrouw [_1] (t)',
+	'Trust [lc,_1] (t)' =&gt; 'Vertrouw [lc,_1] (t)',
 	'Trust' =&gt; 'Vertrouw',
-	'Untrust [_1] (t)' =&gt; 'Wantrouw [_1] (t)',
+	'Untrust [lc,_1] (t)' =&gt; 'Wantrouw [lc,_1] (t)',
 	'Untrust' =&gt; 'Wantrouw',
-	'Ban [_1] (b)' =&gt; 'Verban [_1] (b)',
+	'Ban [lc,_1] (b)' =&gt; 'Verban [lc,_1] (b)',
 	'Ban' =&gt; 'Verban',
-	'Unban [_1] (b)' =&gt; 'Ontban [_1] (b)',
+	'Unban [lc,_1] (b)' =&gt; 'Ontban [lc,_1] (b)',
 	'Unban' =&gt; 'Ontban',
 	'The Name of the commenter' =&gt; 'Naam van de reageerder',
 	'View all comments with this name' =&gt; 'Alle reacties met deze naam bekijken',
@@ -2666,7 +2667,7 @@ use vars qw( @ISA %Lexicon );
 	'folder' =&gt; 'map',
 	'folders' =&gt; 'mappen',
 	'categories' =&gt; 'categorie&#235;n',
-	'Create [_1]' =&gt; '[_1] aanmaken',
+	'Create [lc,_1]' =&gt; '[lc,_1] aanmaken',
 	'Your [_1] has been saved.' =&gt; 'Uw [_1] is opgeslagen.',
 	'One or more errors occurred when sending update pings or TrackBacks.' =&gt; 'E&#233;n of meer problemen deden zich voor bij het versturen van update pings of TrackBacks.',
 	'_USAGE_VIEW_LOG' =&gt; 'Controleer het &lt;a href=\&quot;[_1]\&quot;&gt;Activiteitenlog&lt;/a&gt; op deze fout.',
@@ -2694,13 +2695,12 @@ use vars qw( @ISA %Lexicon );
 	'Publish Date' =&gt; 'Datum publicatie',
 	'Make primary' =&gt; 'Maak dit een hoofdcategorie',
 	'Add sub category' =&gt; 'Subcategorie toevoegen',
-	'Add [_1] name' =&gt; 'Voeg [_1] naam toe',
-	'Add new parent [_1]' =&gt; 'Voeg nieuwe hoofd[_1] toe',
+	'Add [lc,_1] name' =&gt; 'Voeg [lc,_1] naam toe',
+	'Add new parent [lc,_1]' =&gt; 'Voeg nieuwe hoofd[lc,_1] toe',
 	'Add new' =&gt; 'Nieuw toevogen',
-	'Save this [_1] (s)' =&gt; '[_1] bewaren (s)',
-	'Preview this [_1] (v)' =&gt; '[_1] voorbeeld (v)',
-	'Delete this [_1] (v)' =&gt; '[_1] verwijderen (v)',
-	'Share this [_1]' =&gt; '[_1] delen',
+	'Save this [lc,_1] (s)' =&gt; '[lc,_1] bewaren (s)',
+	'Preview this [lc,_1] (v)' =&gt; '[lc,_1] voorbeeld (v)',
+	'Share this [lc,_1]' =&gt; '[lc,_1] delen',
 	'View published [_1]' =&gt; '[_1] bekijken',
 	'&amp;laquo; Previous' =&gt; '&amp;laquo; Vorige',
 	'Next &amp;raquo;' =&gt; 'Volgende &amp;raquo;',
@@ -2710,10 +2710,10 @@ use vars qw( @ISA %Lexicon );
 	'(comma-delimited list)' =&gt; '(lijst gescheiden met komma\'s)',
 	'(space-delimited list)' =&gt; '(lijst gescheiden met spaties)',
 	'(delimited by \'[_1]\')' =&gt; '(gescheiden door \'[_1]\')',
-	'Change [_1]' =&gt; 'Wijzig [_1]',
-	'Add [_1]' =&gt; '[_1] toevoegen',
+	'Change [lc,_1]' =&gt; 'Wijzig [_1]',
+	'Add [lc,_1]' =&gt; '[_1] toevoegen',
 	'Unpublished' =&gt; 'Ongepubliceerd',
-	'You must configure blog before you can publish this [_1].' =&gt; 'U moet uw blog configureren voor u deze [_1] kunt publiceren.',
+	'You must configure this blog before you can publish this [lc,_1].' =&gt; 'U moet uw blog configureren voor u deze [lc,_1] kunt publiceren.',
 	'Select entry date' =&gt; 'Selecteer berichtdatum',
 	'Unlock this entry&amp;rsquo;s output filename for editing' =&gt; 'Maak het mogelijk om de uitvoerbestandsnaam te wijzigen',
 	'Warning: If you set the basename manually, it may conflict with another entry.' =&gt; 'Waarschuwing: de basisnaam van het bericht met de hand aanpassen kan een conflict met een ander bericht veroorzaken.',
@@ -3023,13 +3023,13 @@ use vars qw( @ISA %Lexicon );
 	'System Permissions' =&gt; 'Systeempermissies',
 	'Options' =&gt; 'Opties',
 	'Create personal blog for user' =&gt; 'Persoonlijke blog aanmaken voor gebruiker',
-	'Create [_1] (s)' =&gt; '[_1] aanmaken (s)',
+	'Create [lc,_1] (s)' =&gt; '[lc,_1] aanmaken (s)',
 	'_USAGE_PASSWORD_RESET' =&gt; 'Hieronder kunt u een nieuw wachtwoord laten instellen voor deze gebruiker.  Als u ervoor kiest om dit te doen, zal een willekeurig gegenereerd wachtwoord worden aangemaakt en rechtstreeks naar volgend e-mail adres worden verstuurd: [_1].',
 	'Initiate Password Recovery' =&gt; 'Procedure starten om wachtwoord terug te halen',
 
 ## tmpl/cms/edit_comment.tmpl
 	'The comment has been approved.' =&gt; 'De reactie is goedgekeurd.',
-	'Delete this [_1] (x)' =&gt; 'Verwijder [_1] (x)',
+	'Delete this [lc,_1] (x)' =&gt; 'Verwijder [lc,_1] (x)',
 	'Previous Comment' =&gt; 'Vorige reactie',
 	'Next Comment' =&gt; 'Volgende reactie',
 	'Manage Comments' =&gt; 'Reacties beheren',
@@ -3232,12 +3232,12 @@ use vars qw( @ISA %Lexicon );
 	'Cancel (c)' =&gt; 'Annuleer (c)',
 
 ## tmpl/cms/list_folder.tmpl
-	'Your [_1] changes and additions have been made.' =&gt; 'De wijzigingen en toevoegingen aan uw [_1] zijn uitgevoerd.',
-	'You have successfully deleted the selected [_1].' =&gt; 'U heeft met succes de geselecteerde [_1] verwijderd.',
-	'Create top level [_1]' =&gt; 'Maak een nieuwe [_1] aan op topniveau',
+	'Your [lc,_1] changes and additions have been made.' =&gt; 'De wijzigingen en toevoegingen aan uw [lc,_1] zijn uitgevoerd.',
+	'You have successfully deleted the selected [lc,_1].' =&gt; 'U heeft met succes de geselecteerde [_1] verwijderd.',
+	'Create top level [lc,_1]' =&gt; 'Maak een nieuwe [lc,_1] aan op topniveau',
 	'New Parent [_1]' =&gt; 'Nieuwe ouder-[_1]',
 	'Top Level' =&gt; 'Topniveau',
-	'Move [_1]' =&gt; '[_1] verplaatsen',
+	'Move [lc,_1]' =&gt; '[lc,_1] verplaatsen',
 	'Move' =&gt; 'Verplaatsen',
 	'[quant,_1,page,pages]' =&gt; '[quant,_1,pagina,pagina\'s]',
 
@@ -3410,7 +3410,7 @@ use vars qw( @ISA %Lexicon );
 	'[quant,_1,result,results] found' =&gt; '[quant,_1,resultaat,resultaten] found',
 
 ## tmpl/cms/preview_strip.tmpl
-	'You are previewing the [_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; 'U bekijkt een voorbeeld van een [_1] met de titel &amp;ldquo;[_2]&amp;rdquo;',
+	'You are previewing the [lc,_1] titled &amp;ldquo;[_2]&amp;rdquo;' =&gt; 'U bekijkt een voorbeeld van een [lc,_1] met de titel &amp;ldquo;[_2]&amp;rdquo;',
 
 ## tmpl/cms/edit_ping.tmpl
 	'The TrackBack has been approved.' =&gt; 'De TrackBack is goedgekeurd.',
@@ -4050,9 +4050,9 @@ use vars qw( @ISA %Lexicon );
 ## addons/Enterprise.pack/tmpl/include/group_table.tmpl
 	'group' =&gt; 'groep',
 	'groups' =&gt; 'groepen',
-	'Enable selected [_1] (e)' =&gt; 'Activeer geselecteerde [_1] (e)',
-	'Disable selected [_1] (d)' =&gt; 'Deactiveer geselecteerde [_1] (d)',
-	'Remove selected [_1] (d)' =&gt; 'Verwijder geselecteerde [_1] (d)',
+	'Enable selected [lc,_1] (e)' =&gt; 'Activeer geselecteerde [lc,_1] (e)',
+	'Disable selected [lc,_1] (d)' =&gt; 'Deactiveer geselecteerde [lc,_1] (d)',
+	'Remove selected [lc,_1] (d)' =&gt; 'Verwijder geselecteerde [lc,_1] (d)',
 	'Only show enabled groups' =&gt; 'Enkel actieve groepen tonen',
 	'Only show disabled groups' =&gt; 'Enkel niet-actieve groepen tonen',
 
@@ -4581,923 +4581,10 @@ use vars qw( @ISA %Lexicon );
 	'Maintain your blog\'s widget content using a handy drag and drop interface.' =&gt; 'Beheer de widget-inhoud van uw weblog via een handige klik-en-sleep interface.',
 	'Widgets' =&gt; 'Widgets',
 
-## php/lib/archive_lib.php
-
-## php/lib/function.mtremotesigninlink.php
-
-## php/lib/function.mtproductname.php
-
-## php/lib/captcha_lib.php
-
-## php/lib/block.mtassets.php
-
-## php/lib/block.mtentries.php
-
-## php/lib/MTUtil.php
-
-## php/lib/function.mtauthordisplayname.php
-
-## default_templates/notify-entry.mtml
-
-## lib/MT/Asset/Video.pm
-
-## lib/MT/Asset/Audio.pm
-
-## lib/MT/Asset/Image.pm
-
-## lib/MT/Util/Archive/Tgz.pm
-
-## lib/MT/Util/Archive/Zip.pm
-
-## search_templates/default.tmpl
-
-## tmpl/wizard/optional.tmpl
-
-## addons/Community.pack/lib/MT/App/Community.pm
-
-## php/lib/archive_lib.php
-
-## php/lib/function.mtremotesigninlink.php
-
-## php/lib/function.mtproductname.php
-
-## php/lib/captcha_lib.php
-
-## php/lib/block.mtassets.php
-
-## php/lib/block.mtentries.php
-
-## php/lib/MTUtil.php
-
-## php/lib/function.mtauthordisplayname.php
-
-## default_templates/notify-entry.mtml
-
-## default_templates/main_index.mtml
-
-## default_templates/page.mtml
-
-## default_templates/entry_summary.mtml
-
-## default_templates/comment_response.mtml
-
-## default_templates/commenter_notify.mtml
-
-## default_templates/footer-email.mtml
-
-## default_templates/entry_detail.mtml
-
-## default_templates/verify-subscribe.mtml
-
-## default_templates/new-ping.mtml
-
-## default_templates/comment_detail.mtml
-
-## default_templates/comment_form.mtml
-
-## default_templates/comment_throttle.mtml
-
-## default_templates/new-comment.mtml
-
-## default_templates/entry_listing.mtml
-
-## default_templates/footer.mtml
-
-## default_templates/tags.mtml
-
-## default_templates/entry_metadata.mtml
-
-## default_templates/entry.mtml
-
-## default_templates/recover-password.mtml
-
-## default_templates/javascript.mtml
-
-## default_templates/rss.mtml
-
-## default_templates/archive_index.mtml
-
-## default_templates/trackbacks.mtml
-
-## default_templates/categories.mtml
-
-## default_templates/comments.mtml
-
-## default_templates/search_results.mtml
-
-## default_templates/sidebar_2col.mtml
-
-## default_templates/sidebar_3col.mtml
-
-## default_templates/dynamic_error.mtml
-
-## default_templates/comment_preview.mtml
-
-## default_templates/commenter_confirm.mtml
-
-## lib/MT/Asset/Video.pm
-
-## lib/MT/Asset/Audio.pm
-
-## lib/MT/Asset/Image.pm
-
-## lib/MT/Util/Archive/Tgz.pm
-
-## lib/MT/Util/Archive/Zip.pm
-
-## lib/MT/Util/Archive.pm
-
-## lib/MT/Util/Captcha.pm
-
-## lib/MT/Plugin/JunkFilter.pm
-
-## lib/MT/Auth/TypeKey.pm
-
-## lib/MT/Auth/OpenID.pm
-
-## lib/MT/Auth/MT.pm
-
-## lib/MT/TheSchwartz/Error.pm
-
-## lib/MT/TheSchwartz/FuncMap.pm
-
-## lib/MT/TheSchwartz/Job.pm
-
-## lib/MT/TheSchwartz/ExitStatus.pm
-
-## lib/MT/ObjectDriver/Driver/DBD/SQLite.pm
-
-## lib/MT/Compat/v3.pm
-
-## lib/MT/FileMgr/FTP.pm
-
-## lib/MT/FileMgr/DAV.pm
-
-## lib/MT/FileMgr/Local.pm
-
-## lib/MT/FileMgr/SFTP.pm
-
-## lib/MT/BackupRestore/ManifestFileHandler.pm
-
-## lib/MT/BackupRestore/BackupFileHandler.pm
-
-## lib/MT/Template/Context.pm
-
-## lib/MT/Template/ContextHandlers.pm
-
-## lib/MT/App/NotifyList.pm
-
-## lib/MT/App/Comments.pm
-
-## lib/MT/App/Search.pm
-
-## lib/MT/App/Trackback.pm
-
-## lib/MT/App/Upgrader.pm
-
-## lib/MT/App/Wizard.pm
-
-## lib/MT/App/Viewer.pm
-
-## lib/MT/App/CMS.pm
-	'' =&gt; '', # Translate - New
-
-## lib/MT/App/ActivityFeeds.pm
-
-## lib/MT/BasicAuthor.pm
-
-## lib/MT/Placement.pm
-
-## lib/MT/TaskMgr.pm
-
-## lib/MT/Page.pm
-
-## lib/MT/Bootstrap.pm
-
-## lib/MT/Category.pm
-
-## lib/MT/Asset.pm
-
-## lib/MT/Image.pm
-
-## lib/MT/Session.pm
-
-## lib/MT/Trackback.pm
-
-## lib/MT/Notification.pm
-
-## lib/MT/Upgrade.pm
-
-## lib/MT/Core.pm
-
-## lib/MT/ObjectTag.pm
-
-## lib/MT/Author.pm
-
-## lib/MT/XMLRPC.pm
-
-## lib/MT/ObjectAsset.pm
-
-## lib/MT/BackupRestore.pm
-
-## lib/MT/TemplateMap.pm
-
-## lib/MT/ConfigMgr.pm
-
-## lib/MT/Association.pm
-
-## lib/MT/Blog.pm
-
-## lib/MT/TBPing.pm
-
-## lib/MT/Builder.pm
-
-## lib/MT/ObjectScore.pm
-
-## lib/MT/Import.pm
-
-## lib/MT/Folder.pm
-
-## lib/MT/Tag.pm
-
-## lib/MT/App.pm
-
-## lib/MT/Log.pm
-
-## lib/MT/IPBanList.pm
-
-## lib/MT/AtomServer.pm
-
-## lib/MT/PluginData.pm
-
-## lib/MT/Plugin.pm
-
-## lib/MT/Role.pm
-
-## lib/MT/Entry.pm
-
-## lib/MT/Config.pm
-
-## lib/MT/Template.pm
-
-## lib/MT/ImportExport.pm
-
-## lib/MT/JunkFilter.pm
-
-## lib/MT/Util.pm
-
-## lib/MT/Mail.pm
-
-## lib/MT/Permission.pm
-
-## lib/MT/Scorable.pm
-
-## lib/MT/XMLRPCServer.pm
-
-## lib/MT/WeblogPublisher.pm
-
-## lib/MT/Auth.pm
-
-## lib/MT/Comment.pm
-
-## lib/MT/Component.pm
-
-## lib/MT/DefaultTemplates.pm
-
-## lib/MT.pm.pre
-
-## mt-static/js/dialog.js
-
-## mt-static/js/assetdetail.js
-
-## mt-static/mt.js
-
-## search_templates/default.tmpl
-
-## search_templates/results_feed.tmpl
-
-## search_templates/comments.tmpl
-
-## search_templates/results_feed_rss2.tmpl
-
-## tmpl/wizard/optional.tmpl
-
-## tmpl/wizard/complete.tmpl
-
-## tmpl/wizard/cfg_dir.tmpl
-
-## tmpl/wizard/start.tmpl
-
-## tmpl/wizard/packages.tmpl
-
-## tmpl/wizard/configure.tmpl
-
-## tmpl/wizard/blog.tmpl
-
-## tmpl/cms/include/list_associations/page_title.tmpl
-
-## tmpl/cms/include/copyright.tmpl
-
-## tmpl/cms/include/comment_table.tmpl
-
-## tmpl/cms/include/member_table.tmpl
-
-## tmpl/cms/include/feed_link.tmpl
-
-## tmpl/cms/include/overview-left-nav.tmpl
-
-## tmpl/cms/include/asset_table.tmpl
-
-## tmpl/cms/include/import_start.tmpl
-
-## tmpl/cms/include/log_table.tmpl
-
-## tmpl/cms/include/pagination.tmpl
-
-## tmpl/cms/include/backup_end.tmpl
-
-## tmpl/cms/include/cfg_content_nav.tmpl
-
-## tmpl/cms/include/notification_table.tmpl
-
-## tmpl/cms/include/footer.tmpl
-
-## tmpl/cms/include/tools_content_nav.tmpl
-
-## tmpl/cms/include/commenter_table.tmpl
-
-## tmpl/cms/include/ping_table.tmpl
-
-## tmpl/cms/include/entry_table.tmpl
-
-## tmpl/cms/include/login_mt.tmpl
-
-## tmpl/cms/include/author_table.tmpl
-
-## tmpl/cms/include/calendar.tmpl
-
-## tmpl/cms/include/itemset_action_widget.tmpl
-
-## tmpl/cms/include/anonymous_comment.tmpl
-
-## tmpl/cms/include/display_options.tmpl
-
-## tmpl/cms/include/backup_start.tmpl
-
-## tmpl/cms/include/chromeless_footer.tmpl
-
-## tmpl/cms/include/template_table.tmpl
-
-## tmpl/cms/include/listing_panel.tmpl
-
-## tmpl/cms/include/header.tmpl
-
-## tmpl/cms/include/archetype_editor.tmpl
-
-## tmpl/cms/include/blog_table.tmpl
-
-## tmpl/cms/include/blog-left-nav.tmpl
-
-## tmpl/cms/include/users_content_nav.tmpl
-
-## tmpl/cms/include/import_end.tmpl
-
-## tmpl/cms/include/archive_maps.tmpl
-
-## tmpl/cms/include/cfg_system_content_nav.tmpl
-
-## tmpl/cms/dialog/recover.tmpl
-
-## tmpl/cms/dialog/restore_end.tmpl
-
-## tmpl/cms/dialog/asset_replace.tmpl
-
-## tmpl/cms/dialog/asset_list.tmpl
-
-## tmpl/cms/dialog/comment_reply.tmpl
-
-## tmpl/cms/dialog/asset_upload.tmpl
-
-## tmpl/cms/dialog/restore_upload.tmpl
-
-## tmpl/cms/dialog/entry_notify.tmpl
-
-## tmpl/cms/dialog/asset_options.tmpl
-
-## tmpl/cms/dialog/adjust_sitepath.tmpl
-
-## tmpl/cms/dialog/asset_options_image.tmpl
-
-## tmpl/cms/dialog/create_association.tmpl
-
-## tmpl/cms/dialog/restore_start.tmpl
-
-## tmpl/cms/widget/new_user.tmpl
-
-## tmpl/cms/widget/blog_stats_recent_entries.tmpl
-
-## tmpl/cms/widget/mt_news.tmpl
-
-## tmpl/cms/widget/custom_message.tmpl
-
-## tmpl/cms/widget/mt_shortcuts.tmpl
-
-## tmpl/cms/widget/new_version.tmpl
-
-## tmpl/cms/widget/this_is_you.tmpl
-
-## tmpl/cms/widget/new_install.tmpl
-
-## tmpl/cms/widget/blog_stats.tmpl
-
-## tmpl/cms/widget/blog_stats_entry.tmpl
-
-## tmpl/cms/widget/blog_stats_tag_cloud.tmpl
-
-## tmpl/cms/widget/blog_stats_comment.tmpl
-
-## tmpl/cms/popup/rebuilt.tmpl
-
-## tmpl/cms/popup/pinged_urls.tmpl
-
-## tmpl/cms/popup/rebuild_confirm.tmpl
-
-## tmpl/cms/edit_role.tmpl
-
-## tmpl/cms/cfg_plugin.tmpl
-
-## tmpl/cms/list_blog.tmpl
-
-## tmpl/cms/edit_template.tmpl
-
-## tmpl/cms/dashboard.tmpl
-
-## tmpl/cms/cfg_trackbacks.tmpl
-
-## tmpl/cms/list_entry.tmpl
-
-## tmpl/cms/edit_commenter.tmpl
-
-## tmpl/cms/cfg_system_general.tmpl
-
-## tmpl/cms/list_member.tmpl
-
-## tmpl/cms/cfg_comments.tmpl
-
-## tmpl/cms/backup.tmpl
-
-## tmpl/cms/edit_entry.tmpl
-
-## tmpl/cms/view_log.tmpl
-
-## tmpl/cms/setup_initial_blog.tmpl
-
-## tmpl/cms/cfg_spam.tmpl
-
-## tmpl/cms/edit_folder.tmpl
-
-## tmpl/cms/list_notification.tmpl
-
-## tmpl/cms/export.tmpl
-
-## tmpl/cms/edit_category.tmpl
-
-## tmpl/cms/list_banlist.tmpl
-
-## tmpl/cms/list_ping.tmpl
-
-## tmpl/cms/error.tmpl
-
-## tmpl/cms/list_role.tmpl
-
-## tmpl/cms/list_comment.tmpl
-
-## tmpl/cms/cfg_web_services.tmpl
-
-## tmpl/cms/list_template.tmpl
-
-## tmpl/cms/list_tag.tmpl
-
-## tmpl/cms/install.tmpl
-
-## tmpl/cms/cfg_system_feedback.tmpl
-
-## tmpl/cms/edit_author.tmpl
-
-## tmpl/cms/edit_comment.tmpl
-
-## tmpl/cms/restore_end.tmpl
-
-## tmpl/cms/list_asset.tmpl
-
-## tmpl/cms/import.tmpl
-
-## tmpl/cms/upgrade_runner.tmpl
-
-## tmpl/cms/system_check.tmpl
-
-## tmpl/cms/restore.tmpl
-
-## tmpl/cms/cfg_archives.tmpl
-
-## tmpl/cms/rebuilding.tmpl
-
-## tmpl/cms/upgrade.tmpl
-
-## tmpl/cms/edit_blog.tmpl
-
-## tmpl/cms/pinging.tmpl
-
-## tmpl/cms/cfg_prefs.tmpl
-
-## tmpl/cms/restore_start.tmpl
-
-## tmpl/cms/preview_entry.tmpl
-
-## tmpl/cms/list_folder.tmpl
-
-## tmpl/cms/list_association.tmpl
-
-## tmpl/cms/login.tmpl
-
-## tmpl/cms/list_category.tmpl
-
-## tmpl/cms/cfg_entry.tmpl
-
-## tmpl/cms/cfg_system_users.tmpl
-
-## tmpl/cms/recover_password_result.tmpl
-
-## tmpl/cms/cfg_registration.tmpl
-
-## tmpl/cms/list_author.tmpl
-
-## tmpl/cms/import_others.tmpl
-
-## tmpl/cms/search_replace.tmpl
-
-## tmpl/cms/preview_strip.tmpl
-
-## tmpl/cms/edit_ping.tmpl
-
-## tmpl/comment/register.tmpl
-
-## tmpl/comment/signup.tmpl
-
-## tmpl/comment/login.tmpl
-
-## tmpl/comment/error.tmpl
-
-## tmpl/comment/signup_thanks.tmpl
-
-## tmpl/comment/profile.tmpl
-
-## tmpl/feeds/feed_entry.tmpl
-
-## tmpl/feeds/feed_comment.tmpl
-
-## tmpl/feeds/login.tmpl
-
-## tmpl/feeds/error.tmpl
-
-## tmpl/feeds/feed_page.tmpl
-
-## tmpl/feeds/feed_ping.tmpl
-
-## tmpl/error.tmpl
-
-## addons/Community.pack/lib/MT/App/Community.pm
-
-## addons/Community.pack/lib/MT/Community/Tags.pm
-
-## addons/Community.pack/lib/MT/Community/CMS.pm
-
-## addons/Community.pack/php/function.mtentryrecommendvotelink.php
-
-## addons/Community.pack/tmpl/widget/blog_stats_registration.mtml
-
-## addons/Community.pack/tmpl/widget/most_popular_entries.mtml
-
-## addons/Community.pack/tmpl/widget/recent_submissions.mtml
-
-## addons/Community.pack/tmpl/widget/recent_favorites.mtml
-
-## addons/Community.pack/tmpl/cfg_community_prefs.tmpl
-
-## addons/Community.pack/templates/global/register_form.mtml
-
-## addons/Community.pack/templates/global/simple_footer.mtml
-
-## addons/Community.pack/templates/global/profile_error.mtml
-
-## addons/Community.pack/templates/global/profile_feed_rss.mtml
-
-## addons/Community.pack/templates/global/userpic.mtml
-
-## addons/Community.pack/templates/global/new_entry_email.mtml
-
-## addons/Community.pack/templates/global/password_reset_form.mtml
-
-## addons/Community.pack/templates/global/profile_edit_form.mtml
-
-## addons/Community.pack/templates/global/header.mtml
-
-## addons/Community.pack/templates/global/profile_view.mtml
-
-## addons/Community.pack/templates/global/login_form.mtml
-
-## addons/Community.pack/templates/global/register_confirmation.mtml
-
-## addons/Community.pack/templates/global/user_navigation.mtml
-
-## addons/Community.pack/templates/global/footer.mtml
-
-## addons/Community.pack/templates/global/navigation.mtml
-
-## addons/Community.pack/templates/global/login_form_module.mtml
-
-## addons/Community.pack/templates/global/email_verification_email.mtml
-
-## addons/Community.pack/templates/global/register_notification_email.mtml
-
-## addons/Community.pack/templates/global/search.mtml
-
-## addons/Community.pack/templates/blog/rss.mtml
-
-## addons/Community.pack/templates/blog/archive_index.mtml
-
-## addons/Community.pack/templates/blog/trackbacks.mtml
-
-## addons/Community.pack/templates/blog/main_index.mtml
-
-## addons/Community.pack/templates/blog/page.mtml
-
-## addons/Community.pack/templates/blog/content_nav.mtml
-
-## addons/Community.pack/templates/blog/entry_summary.mtml
-
-## addons/Community.pack/templates/blog/entry_response.mtml
-
-## addons/Community.pack/templates/blog/comment_response.mtml
-
-## addons/Community.pack/templates/blog/entry_detail.mtml
-
-## addons/Community.pack/templates/blog/entry_form.mtml
-
-## addons/Community.pack/templates/blog/entry_create.mtml
-
-## addons/Community.pack/templates/blog/comment_detail.mtml
-
-## addons/Community.pack/templates/blog/comments.mtml
-
-## addons/Community.pack/templates/blog/comment_form.mtml
-
-## addons/Community.pack/templates/blog/categories.mtml
-
-## addons/Community.pack/templates/blog/search_results.mtml
-
-## addons/Community.pack/templates/blog/sidebar_2col.mtml
-
-## addons/Community.pack/templates/blog/sidebar_3col.mtml
-
-## addons/Community.pack/templates/blog/entry_listing.mtml
-
-## addons/Community.pack/templates/blog/dynamic_error.mtml
-
-## addons/Community.pack/templates/blog/tags.mtml
-
-## addons/Community.pack/templates/blog/entry_metadata.mtml
-
-## addons/Community.pack/templates/blog/entry.mtml
-
-## addons/Community.pack/templates/blog/comment_preview.mtml
-
-## addons/Community.pack/templates/blog/javascript.mtml
-
-## addons/Community.pack/templates/forum/main_index.mtml
-
-## addons/Community.pack/templates/forum/page.mtml
-
-## addons/Community.pack/templates/forum/entry_summary.mtml
-
-## addons/Community.pack/templates/forum/content_nav.mtml
-
-## addons/Community.pack/templates/forum/entry_response.mtml
-
-## addons/Community.pack/templates/forum/comment_response.mtml
-
-## addons/Community.pack/templates/forum/content_header.mtml
-
-## addons/Community.pack/templates/forum/entry_detail.mtml
-
-## addons/Community.pack/templates/forum/entry_form.mtml
-
-## addons/Community.pack/templates/forum/comment_detail.mtml
-
-## addons/Community.pack/templates/forum/entry_create.mtml
-
-## addons/Community.pack/templates/forum/comment_form.mtml
-
-## addons/Community.pack/templates/forum/entry_listing.mtml
-
-## addons/Community.pack/templates/forum/entry_metadata.mtml
-
-## addons/Community.pack/templates/forum/entry.mtml
-
-## addons/Community.pack/templates/forum/javascript.mtml
-
-## addons/Community.pack/templates/forum/rss.mtml
-
-## addons/Community.pack/templates/forum/entry_table.mtml
-
-## addons/Community.pack/templates/forum/archive_index.mtml
-
-## addons/Community.pack/templates/forum/category_groups.mtml
-
-## addons/Community.pack/templates/forum/comments.mtml
-
-## addons/Community.pack/templates/forum/search_results.mtml
-
-## addons/Community.pack/templates/forum/dynamic_error.mtml
-
-## addons/Community.pack/templates/forum/entry_popular.mtml
-
-## addons/Community.pack/templates/forum/comment_preview.mtml
-
-## addons/Community.pack/config.yaml
-
-## addons/Commercial.pack/lib/CustomFields/App/CMS.pm
-
-## addons/Commercial.pack/lib/CustomFields/Template/ContextHandlers.pm
-
-## addons/Commercial.pack/lib/CustomFields/Util.pm
-
-## addons/Commercial.pack/lib/CustomFields/Field.pm
-
-## addons/Commercial.pack/tmpl/date-picker.tmpl
-
-## addons/Commercial.pack/tmpl/edit_field.tmpl
-
-## addons/Commercial.pack/tmpl/reorder_fields.tmpl
-
-## addons/Commercial.pack/tmpl/list_field.tmpl
-
-## addons/Commercial.pack/tmpl/asset-chooser.tmpl
-
-## addons/Commercial.pack/config.yaml
-
-## addons/Enterprise.pack/lib/MT/Enterprise/Upgrade.pm
-
-## addons/Enterprise.pack/lib/MT/Enterprise/Wizard.pm
-
-## addons/Enterprise.pack/lib/MT/Enterprise/BulkCreation.pm
-
-## addons/Enterprise.pack/lib/MT/Enterprise/CMS.pm
-
 ## addons/Enterprise.pack/lib/MT/Auth/LDAP.pm
 	&quot;Failed login attempt by user \'[_1]\'. A user with that\nusername already exists in the system with a different UUID.&quot; =&gt; &quot;Mislukte aanmeldpoging door gebruiker \'[_1]\'. Er bestaat al een gebruiker met die gebruikersnaam in het systeem met een andere UUID&quot;,
 	&quot;Filter used to search for groups: [_1]\nSearch base: [_2]&quot; =&gt; &quot;Filter gebruikt om naar groepen te zoeken: [_1]\nZoekbasis: [_2]&quot;,
 
-## addons/Enterprise.pack/lib/MT/ObjectDriver/Driver/DBD/MSSQLServer.pm
-
-## addons/Enterprise.pack/lib/MT/ObjectDriver/Driver/DBD/UMSSQLServer.pm
-
-## addons/Enterprise.pack/lib/MT/Group.pm
-
-## addons/Enterprise.pack/lib/MT/LDAP.pm
-
-## addons/Enterprise.pack/tmpl/dialog/select_groups.tmpl
-
-## addons/Enterprise.pack/tmpl/include/list_associations/page_title.group.tmpl
-
-## addons/Enterprise.pack/tmpl/include/users_content_nav.tmpl
-
-## addons/Enterprise.pack/tmpl/include/group_table.tmpl
-
-## addons/Enterprise.pack/tmpl/list_group.tmpl
-
-## addons/Enterprise.pack/tmpl/create_author_bulk_end.tmpl
-
-## addons/Enterprise.pack/tmpl/list_group_member.tmpl
-
-## addons/Enterprise.pack/tmpl/author_bulk.tmpl
-
-## addons/Enterprise.pack/tmpl/cfg_ldap.tmpl
-
-## addons/Enterprise.pack/tmpl/create_author_bulk_start.tmpl
-
-## addons/Enterprise.pack/tmpl/edit_group.tmpl
-
-## addons/Enterprise.pack/app-wizard.yaml
-
-## addons/Enterprise.pack/app-cms.yaml
-
-## addons/Enterprise.pack/config.yaml
-
-## plugins/feeds-app-lite/lib/MT/Feeds/Lite.pm
-
-## plugins/feeds-app-lite/lib/MT/Feeds/Tags.pm
-
-## plugins/feeds-app-lite/tmpl/config.tmpl
-
-## plugins/feeds-app-lite/tmpl/msg.tmpl
-
-## plugins/feeds-app-lite/tmpl/start.tmpl
-
-## plugins/feeds-app-lite/tmpl/select.tmpl
-
-## plugins/feeds-app-lite/mt-feeds.pl
-
-## plugins/Cloner/cloner.pl
-
-## plugins/Markdown/SmartyPants.pl
-
-## plugins/Markdown/Markdown.pl
-
-## plugins/WXRImporter/lib/WXRImporter/Import.pm
-
-## plugins/WXRImporter/lib/WXRImporter/WXRHandler.pm
-
-## plugins/WXRImporter/tmpl/options.tmpl
-
-## plugins/WXRImporter/WXRImporter.pl
-
-## plugins/StyleCatcher/lib/StyleCatcher/CMS.pm
-
-## plugins/StyleCatcher/tmpl/view.tmpl
-
-## plugins/StyleCatcher/stylecatcher.pl
-
-## plugins/TemplateRefresh/tmpl/results.tmpl
-
-## plugins/TemplateRefresh/TemplateRefresh.pl
-
-## plugins/spamlookup/lib/spamlookup.pm
-
-## plugins/spamlookup/tmpl/url_config.tmpl
-
-## plugins/spamlookup/tmpl/lookup_config.tmpl
-
-## plugins/spamlookup/tmpl/word_config.tmpl
-
-## plugins/spamlookup/spamlookup_words.pl
-
-## plugins/spamlookup/spamlookup.pl
-
-## plugins/spamlookup/spamlookup_urls.pl
-
-## plugins/MultiBlog/lib/MultiBlog/Tags.pm
-
-## plugins/MultiBlog/lib/MultiBlog.pm
-
-## plugins/MultiBlog/tmpl/dialog_create_trigger.tmpl
-
-## plugins/MultiBlog/tmpl/blog_config.tmpl
-
-## plugins/MultiBlog/tmpl/system_config.tmpl
-
-## plugins/MultiBlog/multiblog.pl
-
-## plugins/Textile/textile2.pl
-
-## plugins/WidgetManager/lib/WidgetManager/Plugin.pm
-
-## plugins/WidgetManager/lib/WidgetManager/CMS.pm
-
-## plugins/WidgetManager/default_widgets/search.tmpl
-
-## plugins/WidgetManager/default_widgets/subscribe_to_feed.tmpl
-
-## plugins/WidgetManager/default_widgets/tag_cloud_module.tmpl
-
-## plugins/WidgetManager/default_widgets/monthly_archive_dropdown.tmpl
-
-## plugins/WidgetManager/default_widgets/recent_posts.tmpl
-
-## plugins/WidgetManager/default_widgets/category_archive_list.tmpl
-
-## plugins/WidgetManager/default_widgets/calendar.tmpl
-
-## plugins/WidgetManager/default_widgets/recent_comments.tmpl
-
-## plugins/WidgetManager/default_widgets/technorati_search.tmpl
-
-## plugins/WidgetManager/default_widgets/monthly_archive_list.tmpl
-
-## plugins/WidgetManager/default_widgets/signin.tmpl
-
-## plugins/WidgetManager/default_widgets/widgets.cfg
-
-## plugins/WidgetManager/default_widgets/creative_commons.tmpl
-
-## plugins/WidgetManager/default_widgets/powered_by.tmpl
-
-## plugins/WidgetManager/tmpl/edit.tmpl
-
-## plugins/WidgetManager/tmpl/list.tmpl
-
-## plugins/WidgetManager/WidgetManager.pl
-
 );
 
 ## New words: 174</diff>
      <filename>lib/MT/L10N/nl.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Log.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Mail.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -13,9 +13,11 @@ sub new {
 
     if (my @servers = $cfg-&gt;MemcachedServers) {
         require Cache::Memcached;
+        my $ns = $cfg-&gt;MemcachedNamespace;
         return bless {
             memcached =&gt; Cache::Memcached-&gt;new({
                 servers =&gt; \@servers,
+                ( $ns ? ( namespace =&gt; $ns ) : () ),
                 debug   =&gt; 0,
             })
         }, $class;</diff>
      <filename>lib/MT/Memcached.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Notification.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -194,14 +194,17 @@ sub install_properties {
 
     # Special handling for 'Taggable' objects; automatic saving
     # and removal of tags.
-    if ($class-&gt;isa('MT::Taggable')) {
-        # synchronize tags if necessary
-        $class-&gt;add_trigger( post_save =&gt; \&amp;post_save_tags );
-        $class-&gt;add_trigger( pre_remove =&gt; \&amp;pre_remove_tags );
+    my @isa;
+    {
+        no strict 'refs';
+        @isa = @{ $class . '::ISA' };
     }
-
-    if ($class-&gt;isa('MT::Scorable')) {
-        $class-&gt;add_trigger( post_remove =&gt; \&amp;post_remove_score );
+    foreach my $isa_pkg ( @isa ) {
+        next unless $isa_pkg =~ /able$/;
+        next if $isa_pkg eq $class;
+        if ($isa_pkg-&gt;can('install_properties')) {
+            $isa_pkg-&gt;install_properties($class);
+        }
     }
 
     # install legacy date translation
@@ -218,29 +221,6 @@ sub install_properties {
     return $props;
 }
 
-# post_save trigger for MT::Taggable objects to synchronize tags upon save.
-sub post_save_tags {
-    my $class = shift;
-    my ($obj) = @_;
-    $obj-&gt;save_tags;
-}
-
-sub pre_remove_tags {
-    my $class = shift;
-    my ($obj) = @_;
-    $obj-&gt;remove_tags if ref $obj;
-}
-
-sub post_remove_score {
-    my $class = shift;
-    my ($obj) = @_;
-    require MT::ObjectScore;
-    MT::ObjectScore-&gt;remove({
-        object_ds =&gt; $obj-&gt;datasource,
-        object_id =&gt; $obj-&gt;id,
-    });
-}
-
 # A post-load trigger for classed objects
 sub post_load_rebless_object {
     my $obj = shift;
@@ -508,6 +488,83 @@ sub translate_audited_fields {
     return;
 }
 
+sub nextprev {
+    my $obj = shift;
+    my $class = ref($obj);
+    my %param = @_;
+    my ($direction, $terms, $args, $by_field)
+        = @param{qw( direction terms args by )};
+    return undef unless ($direction eq 'next' || $direction eq 'previous');
+    my $next = $direction eq 'next';
+
+    if (!$by_field) {
+        return if !$class-&gt;properties-&gt;{audit};
+        $by_field = 'created_on';
+    }
+
+    # Selecting the adjacent object can be tricky since timestamps
+    # are not necessarily unique for entries. If we find that the
+    # next/previous object has a matching timestamp, keep selecting entries
+    # to select all entries with the same timestamp, then compare them using
+    # id as a secondary sort column.
+
+    my ($id, $ts) = ($obj-&gt;id, $obj-&gt;$by_field());
+    local @$args{qw( sort direction range_incl )}
+        = ($by_field, $next ? 'ascend' : 'descend', { $by_field =&gt; 1 });
+    my $iter = $class-&gt;load_iter({
+        $by_field =&gt; ($next ? [ $ts, undef ] : [ undef, $ts ]),
+        %{$terms}
+    }, $args);
+
+    # This selection should always succeed, but handle situation if
+    # it fails by returning undef.
+    return unless $iter;
+
+    # The 'same' array will hold any entries that have matching
+    # timestamps; we will then sort those by id to find the correct
+    # adjacent object.
+    my @same; 
+    while (my $e = $iter-&gt;()) {
+        # Don't consider the object that is 'current'
+        next if $e-&gt;id == $id;
+        my $e_ts = $e-&gt;$by_field();
+        if ($e_ts eq $ts) {
+            # An object with the same timestamp should only be
+            # considered if the id is in the scope we're looking for
+            # (greater than for the 'next' object; less than for
+            # the 'previous' object).
+            push @same, $e
+                if $next &amp;&amp; $e-&gt;id &gt; $id or !$next &amp;&amp; $e-&gt;id &lt; $id;
+        } else {
+            # We found an object with a timestamp different than
+            # the 'current' object.
+            if (!@same) {
+                push @same, $e;
+                # We should check to see if this new timestamped object also
+                # has entries adjacent to _it_ that have the same timestamp.
+                while (my $e = $iter-&gt;()) {
+                    push(@same, $e), next if $e-&gt;$by_field() eq $e_ts;
+                    $iter-&gt;('finish'), last;
+                }
+            } else {
+                $iter-&gt;('finish');
+            }
+            return $e unless @same;
+            last;
+        }
+    }
+    if (@same) {
+        # If we only have 1 element in @same, return that.
+        return $same[0] if @same == 1;
+        # Sort remaining elements in @same by id.
+        @same = sort { $a-&gt;id &lt;=&gt; $b-&gt;id } @same;
+        # Return front of list (smallest id) if selecting 'next'
+        # object. Return tail of list (largest id) if selection 'previous'.
+        return $same[$next ? 0 : $#same];
+    }
+    return;
+}
+
 ## Drivers.
 
 # Note: Removed methods: set_driver
@@ -817,7 +874,9 @@ sub set_by_key {
 # the content to cache if caching is enabled. Thus, we must ensure any
 # metadata is serialized prior to caching.
 sub column_values {
-    if ($_[0]-&gt;properties-&gt;{meta_column}) {
+    my $props = $_[0]-&gt;properties;
+    if ($props-&gt;{meta_column}
+        &amp;&amp; $_[0]-&gt;{changed_cols}{$props-&gt;{meta_column}}) {
         $_[0]-&gt;pre_save_serialize_metadata;
     }
     return $_[0]-&gt;SUPER::column_values(@_);
@@ -849,6 +908,12 @@ sub column_def {
     return $def;
 }
 
+sub index_defs {
+    my $obj = shift;
+    my $props = $obj-&gt;properties;
+    $props-&gt;{indexes};
+}
+
 sub column_defs {
     my $obj = shift;
     my $props = $obj-&gt;properties;</diff>
      <filename>lib/MT/Object.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ObjectAsset.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -13,6 +13,7 @@ use DBI qw(:sql_types);
 
 # Must be implemented!
 sub column_defs;
+sub index_defs {}
 
 sub can_add_column { 0 }
 sub can_alter_column { 0 }
@@ -40,7 +41,7 @@ sub add_column {
     push @stmts, $ddl-&gt;index_column_sql(@_);
     return @stmts; 
 }
-    
+
 sub alter_column {
     my $ddl = shift;
     return $ddl-&gt;alter_column_sql(@_);
@@ -51,6 +52,11 @@ sub drop_column {
     return $ddl-&gt;drop_column_sql(@_);
 }
 
+sub index_column {
+    my $ddl = shift;
+    return $ddl-&gt;drop_index_sql(@_), $ddl-&gt;index_column_sql(@_);
+}
+
 sub fix_class {
     my $ddl = shift;
     my ($class) = @_;
@@ -184,6 +190,25 @@ sub drop_table_sql {
     return &quot;DROP TABLE $table_name&quot;;
 }
 
+sub drop_index_sql {
+    my $ddl = shift;
+    my ($class, $key) = @_;
+    my $table_name = $class-&gt;table_name;
+
+    my $props = $class-&gt;properties;
+    my $indexes = $props-&gt;{indexes};
+    return q() unless exists($indexes-&gt;{$key});
+
+    if (ref $indexes-&gt;{$key} eq 'HASH') {
+        my $idx_info = $indexes-&gt;{$key};
+        if ($idx_info-&gt;{unique} &amp;&amp; $ddl-&gt;can_add_constraint) {
+            return &quot;ALTER TABLE $table_name DROP CONSTRAINT ${table_name}_$key&quot;;
+        }
+    }
+
+    return &quot;DROP INDEX ${table_name}_$key ON $table_name&quot;;
+}
+
 sub create_table_as_sql {
     my $ddl = shift;
     my ($class) = @_;
@@ -236,30 +261,7 @@ sub index_table_sql {
         my $pk = $props-&gt;{primary_key};
         foreach my $name (keys %$indexes) {
             next if $pk &amp;&amp; $name eq $pk;
-            if (!ref($indexes-&gt;{$name})) {
-                # Simple, single column index
-                push @stmts, &quot;CREATE INDEX ${table_name}_$name ON $table_name (${field_prefix}_$name)&quot;;
-            }
-            elsif (ref $indexes-&gt;{$name} eq 'HASH') {
-                my $idx_info = $indexes-&gt;{$name};
-                my $column_list = $idx_info-&gt;{columns} || [ $name ];
-                my $columns = '';
-                foreach my $col (@$column_list) {
-                    $columns .= ',' unless $columns eq '';
-                    $columns .= $field_prefix . '_' . $col;
-                }
-                if ($columns) {
-                    if ($idx_info-&gt;{unique} &amp;&amp; $ddl-&gt;can_add_constraint) {
-                        push @stmts, &quot;ALTER TABLE $table_name ADD CONSTRAINT ${table_name}_$name UNIQUE ($columns)&quot;;
-                    }
-                    else {
-                        push @stmts, &quot;CREATE INDEX ${table_name}_$name ON $table_name ($columns)&quot;;
-                    }
-                }
-                else {
-                    die &quot;Invalid definition of unique index for class $class: no columns were identified&quot;;
-                }
-            }
+            push @stmts, $ddl-&gt;index_column_sql($class, $name);
         }
     }
 </diff>
      <filename>lib/MT/ObjectDriver/DDL.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -14,6 +14,85 @@ sub can_add_column { 1 }
 sub can_drop_column { 1 }
 sub can_alter_column { 0 }
 
+sub index_defs {
+    my $ddl = shift;
+    my ($class) = @_;
+    my $driver = $class-&gt;driver;
+    my $dbh = $driver-&gt;r_handle;
+    my $field_prefix = $class-&gt;datasource;
+    my $table_name = $class-&gt;table_name;
+    my $sth = $dbh-&gt;prepare(&lt;&lt;SQL)
+SELECT cidx.relname as index_name, idx.indisunique, idx.indisprimary, idx.indnatts, idx.indkey, am.amname
+FROM pg_index idx
+INNER JOIN pg_class cidx ON idx.indexrelid = cidx.oid
+INNER JOIN pg_class ctbl ON idx.indrelid = ctbl.oid
+INNER JOIN pg_am am ON cidx.relam = am.oid
+WHERE ctbl.relname = '$table_name'
+SQL
+        or return undef;
+    $sth-&gt;execute or return undef;
+
+    my $defs = {};
+    while (my $row = $sth-&gt;fetchrow_hashref) {
+        next if 1 == $row-&gt;{'indisprimary'};
+
+        my $key = $row-&gt;{'index_name'};
+        next unless $key =~ m/^(mt_)?\Q$field_prefix\E_/;
+        $key = 'mt_' . $key unless $key =~ m/^mt_/;
+
+        my $type = $row-&gt;{'amname'};
+        # ignore fulltext or other unrecognized indexes for now
+        next unless $type eq 'btree';
+
+        my $is_unique = $row-&gt;{'indisunique'};
+        $key =~ s/^mt_\Q$field_prefix\E_//;
+
+        my $indkeys = $row-&gt;{'indkey'};
+        $indkeys =~ s/\s+/,/g;
+
+        my $sth_att = $dbh-&gt;prepare(&lt;&lt;ATTSQL)
+SELECT attnum, attname
+FROM pg_attribute att
+INNER JOIN pg_class ctbl ON att.attrelid = ctbl.oid
+WHERE att.attnum IN ($indkeys)
+AND ctbl.relname = '$table_name'
+ATTSQL
+            or next;
+        $sth_att-&gt;execute or next;
+        my $row_att = $sth_att-&gt;fetchall_hashref('attnum');
+        $sth_att-&gt;finish;
+
+        my $cols;
+        if ( 1 == $row-&gt;{'indnatts'} ) {
+            # $indkeys have column's attnum
+            my $col = $row_att-&gt;{$indkeys}-&gt;{'attname'};
+            $col =~ s/^\Q$field_prefix\E_//;
+            $cols = [ $col ];
+        }
+        else {
+            my @cols;
+            for my $indkey ( split ',', $indkeys ) {
+                my $col = $row_att-&gt;{$indkey}-&gt;{'attname'};
+                $col =~ s/^\Q$field_prefix\E_//;
+                push @cols, $col;
+            }
+            $cols = \@cols;
+        }
+        if ( $is_unique ) {
+            $defs-&gt;{$key} = { 'unique' =&gt; 1, 'columns' =&gt; $cols };
+        }
+        else {
+            if ((@$cols == 1) &amp;&amp; ($key eq $cols-&gt;[0])) {
+                $defs-&gt;{$key} = 1;
+            } else {
+                $defs-&gt;{$key} = { 'columns' =&gt; $cols };
+            }
+        }
+    }
+    $sth-&gt;finish;
+    return $defs;
+}
+
 sub column_defs {
     my $ddl = shift;
     my ($class) = @_;</diff>
      <filename>lib/MT/ObjectDriver/DDL/Pg.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,85 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::ObjectDriver::DDL::SQLite;
 
 use strict;
 use warnings;
 use base qw( MT::ObjectDriver::DDL );
 
+sub index_defs {
+    my $ddl = shift;
+    my ($class) = @_;
+    my $driver = $class-&gt;driver;
+    my $dbh = $driver-&gt;r_handle;
+    my $field_prefix = $class-&gt;datasource;
+    my $table_name = $class-&gt;table_name;
+    my $sth = $dbh-&gt;prepare(&lt;&lt;SQL)
+SELECT name, sql
+FROM sqlite_master
+WHERE type = &quot;index&quot;
+AND tbl_name=&quot;$table_name&quot;
+SQL
+        or return undef;
+    $sth-&gt;execute or return undef;
+
+    my $defs = {};
+    while (my $row = $sth-&gt;fetchrow_hashref) {
+        my $key = $row-&gt;{'name'};
+        next unless $key =~ m/^(mt_)?\Q$field_prefix\E_/;
+        next if $key =~ m/(.+autoindex)/;
+        my $sql = $row-&gt;{'sql'}
+            or next;
+
+        $key =~ s/^mt_\Q$field_prefix\E_//;
+        my $cols = [];
+        my $is_unique = 0;
+        my $idx_columns;
+        if ( $sql =~ m/CREATE( UNIQUE)? INDEX (?:.+?) ON $table_name \((.+?)\)/i ) {
+            $is_unique = $1 ? 'unique' eq lc($1) : 0;
+            $idx_columns = $2;
+            for my $col ( split ',', $idx_columns ) {
+                $col =~ s/^\Q$field_prefix\E_//;
+                push @$cols, $col;
+            }
+        }
+        unless ( $is_unique ) {
+            # Check constraints to identify unique index
+            my $sth_tbl = $dbh-&gt;prepare(&lt;&lt;TBLSQL);
+SELECT name, sql FROM sqlite_master
+WHERE type = &quot;table&quot; AND name = &quot;$table_name&quot;
+TBLSQL
+            $sth_tbl-&gt;execute or next;
+            my $rows_tbl = $sth_tbl-&gt;fetchall_hashref('name');
+            $sth_tbl-&gt;finish;
+            my $sql_tbl = $rows_tbl-&gt;{$table_name}-&gt;{'sql'}
+                or next;
+            my $idx_name = $row-&gt;{'name'};
+            if ( $sql_tbl =~ m/CONSTRAINT\s+$idx_name\s+UNIQUE\s+\(\s*$idx_columns\s*\)/im ) {
+                $is_unique = 1;
+            }
+        }
+
+        if ( $is_unique ) {
+            $defs-&gt;{$key} = { 'unique' =&gt; 1, 'columns' =&gt; $cols };
+        }
+        else {
+            if ((@$cols == 1) &amp;&amp; ($key eq $cols-&gt;[0])) {
+                $defs-&gt;{$key} = 1;
+            } else {
+                $defs-&gt;{$key} = { 'columns' =&gt; $cols };
+            }
+        }
+
+    }
+    $sth-&gt;finish;
+
+    return $defs;
+}
+
 sub column_defs {
     my $ddl = shift; 
     my ($class) = @_;
@@ -120,4 +196,16 @@ sub unique_constraint_sql {
     return q();
 }
 
+sub drop_index_sql {
+    my $ddl = shift;
+    my ($class, $key) = @_;
+    my $table_name = $class-&gt;table_name;
+
+    my $props = $class-&gt;properties;
+    my $indexes = $props-&gt;{indexes};
+    return q() unless exists($indexes-&gt;{$key});
+
+    return &quot;DROP INDEX ${table_name}_$key&quot;;
+}
+
 1;</diff>
      <filename>lib/MT/ObjectDriver/DDL/SQLite.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -14,6 +14,62 @@ sub can_add_column { 1 }
 sub can_drop_column { 1 }
 sub can_alter_column { 1 }
 
+sub index_defs {
+    my $ddl = shift;
+    my ($class) = @_;
+    my $driver = $class-&gt;driver;
+    my $dbh = $driver-&gt;r_handle;
+    my $field_prefix = $class-&gt;datasource;
+    my $table_name = $class-&gt;table_name;
+    my $sth = $dbh-&gt;prepare('SHOW INDEX FROM ' . $table_name)
+        or return undef;
+    $sth-&gt;execute or return undef;
+
+    my $bags = {};
+    my $unique = {};
+    while (my $row = $sth-&gt;fetchrow_hashref) {
+        my $key = $row-&gt;{'Key_name'};
+        next unless $key =~ m/^(mt_)?\Q$field_prefix\E_/;
+        $key = 'mt_' . $key unless $key =~ m/^mt_/;
+
+        my $type = $row-&gt;{'Index_type'};
+
+        # ignore fulltext or other unrecognized indexes for now
+        next unless $type eq 'BTREE';
+
+        my $seq = $row-&gt;{'Seq_in_index'};
+        my $col = $row-&gt;{'Column_name'};
+        my $non_unique = $row-&gt;{'Non_unique'};
+        my $null = $row-&gt;{'Null'};
+        $key =~ s/^mt_\Q$field_prefix\E_//;
+        $col =~ s/^\Q$field_prefix\E_//;
+        $unique-&gt;{$key} = 1 unless $non_unique;
+        my $idx_bag = $bags-&gt;{$key} ||= [];
+        $idx_bag-&gt;[$seq - 1] = $col;
+    }
+    $sth-&gt;finish;
+    if (!%$bags) {
+        return undef;
+    }
+
+    my $defs = {};
+    foreach my $key (keys %$bags) {
+        my $cols = $bags-&gt;{$key};
+        if ($unique-&gt;{$key}) {
+            $defs-&gt;{$key} = { columns =&gt; $cols, unique =&gt; 1 };
+        }
+        else {
+            if ((@$cols == 1) &amp;&amp; ($key eq $cols-&gt;[0])) {
+                $defs-&gt;{$key} = 1;
+            } else {
+                $defs-&gt;{$key} = { columns =&gt; $cols };
+            }
+        }
+    }
+
+    return $defs;
+}
+
 sub column_defs {
     my $ddl = shift; 
     my ($class) = @_;</diff>
      <filename>lib/MT/ObjectDriver/DDL/mysql.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ObjectDriver/Driver/DBD/Legacy.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ObjectDriver/Driver/DBD/Pg.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ObjectDriver/Driver/DBD/SQLite.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ObjectDriver/Driver/DBD/mysql.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -194,7 +194,12 @@ sub _select_aggregate {
     }
 
     ## Convert $terms and $args like we would for a search.
-    my $terms = $orig_terms ? { %$orig_terms } : undef;
+    my $terms;
+    if (ref($orig_terms) eq 'HASH') {
+        $terms = { %$orig_terms };
+    } elsif (ref($orig_terms) eq 'ARRAY') {
+        $terms = [ @$orig_terms ];
+    }
     my $args  = $orig_args  ? { %$orig_args  } : undef;
     $class-&gt;call_trigger('pre_search', $terms, $args);
 
@@ -324,10 +329,19 @@ sub prepare_statement {
         $stmt-&gt;from([ $tbl ]);
 
         if (defined($terms)) {
-            for my $col (keys %$terms) {
-                my $db_col = $dbd-&gt;db_column_name($tbl, $col);
-                $stmt-&gt;add_where($db_col, $terms-&gt;{$col});
+            $stmt-&gt;column_mutator(sub {
+                my ($col) = @_;
+                return $dbd-&gt;db_column_name($tbl, $col);
+            });
+            if (ref $terms eq 'ARRAY') {
+                $stmt-&gt;add_complex_where($terms);
+            }
+            else {
+                for my $col (keys %$terms) {
+                    $stmt-&gt;add_where(join('.', $tbl, $col), $terms-&gt;{$col});
+                }
             }
+            $stmt-&gt;column_mutator(undef);
         }
 
         ## Set statement's ORDER clause if any.</diff>
      <filename>lib/MT/ObjectDriver/Driver/DBI.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -127,7 +127,6 @@ sub as_sql {
     }
 
     $stmt-&gt;select($old_sel) if $old_sel;
-
     return $sql;
 }
 
@@ -135,75 +134,156 @@ sub _mk_term {
     my $stmt = shift;
     my ($col, $val) = @_;
 
-    ## Rearrange the value into an inclusive range.
-    my $range_incl = $stmt-&gt;range_incl;
-    my $range      = $stmt-&gt;range;
     $col =~ s/ \A [\w\.]+? \. //x;
-    ## We may recurse, so let us empty range inclusions in our scope.
-    local $range_incl-&gt;{$col} = $range_incl-&gt;{$col};
-    local $range-&gt;{$col}      = $range-&gt;{$col};
-    if($range_incl-&gt;{$col} || $range-&gt;{$col}) {
-        my ($lt, $gt) = $range_incl-&gt;{$col} ? ('&lt;=', '&gt;=') : ('&lt;', '&gt;');
-        my @vals;
-
-        my ($first_val, $last_val) = @$val;
-        ## Ignore first value if it's zero (right-bounded range, eg [0, 20050101000000] )
-        if($first_val) {
-            push @vals, { op =&gt; $gt, value =&gt; $first_val };
-        }
-        ## Ignore last value if it's not defined (left-bounded range, eg [20050101000000] )
-        if(defined $last_val) {
-            push @vals, { op =&gt; $lt, value =&gt; $last_val  };
-        }
-        if(2 == scalar @vals) {
-            $val = [ '-and', @vals ];
-        } else {
-            ($val) = @vals;
-        }
 
-        ## Because the new value is an arrayref, we're about to get
-        ## called recursively with each of those hashrefs inside it.
-        ## So ignore that we're using an inclusive range within this
-        ## call's scope.
-        undef ($range_incl-&gt;{$col} ? $range_incl-&gt;{$col} : $range-&gt;{$col});
+    ## Any last-minute property -&gt; field name manipulation
+    if (my $m = $stmt-&gt;column_mutator) {
+        $col = $m-&gt;($col);
     }
 
-    ## Translate dates from app to database format.
-    if($stmt-&gt;date_columns-&gt;{$col}) {
-        my $realval = $val;
-        if(ref($val) eq 'HASH') {
-            $val-&gt;{value} = ts2db($val-&gt;{value});
-        } elsif(!ref($val)) {
-            $val = ts2db($val);
+    if (ref $val eq 'HASH') {
+        if (!exists $val-&gt;{op}) {
+            # hash-style value, containing hints on operation
+            if (exists $val-&gt;{like}) {
+                $val = { op =&gt; 'LIKE', value =&gt; $val-&gt;{like} };
+            }
+            elsif (exists $val-&gt;{not_null}) {
+                $val = \'is not null';
+            }
+            elsif (exists $val-&gt;{not}) {
+                my $v = $val-&gt;{not};
+                if ('ARRAY' eq ref($v)) {
+                    my $v = 'NOT IN (' . join(',', @$v) . ')';
+                    $val = \$v;
+                } elsif (ref $v) {
+                    die &quot;Unsupported value in 'not' column&quot;;
+                } else {
+                    $val = { value =&gt; $v,
+                             op    =&gt; '!=' };
+                }
+            }
+            elsif (exists $val-&gt;{between}) {
+                my $low = @{$val-&gt;{between}}[0];
+                my $high = @{$val-&gt;{between}}[1];
+                if($stmt-&gt;date_columns-&gt;{$col}) {
+                    $low = ts2db($low);
+                    $high = ts2db($high);
+                }
+                $val = [ '-and', { op =&gt; '&gt;=', value =&gt; $low },
+                    { op =&gt; '&lt;=', value =&gt; $high } ];
+            }
+            elsif (exists $val-&gt;{'&gt;='}) {
+                $val = { op =&gt; '&gt;=', value =&gt; $val-&gt;{'&gt;='} };
+            }
+            elsif (exists $val-&gt;{'&gt;'}) {
+                $val = { op =&gt; '&gt;', value =&gt; $val-&gt;{'&gt;'} };
+            }
+            elsif (exists $val-&gt;{'&lt;='}) {
+                $val = { op =&gt; '&lt;=', value =&gt; $val-&gt;{'&lt;='} };
+            }
+            elsif (exists $val-&gt;{'&lt;'}) {
+                $val = { op =&gt; '&lt;', value =&gt; $val-&gt;{'&lt;'} };
+            }
+            elsif (exists $val-&gt;{'!='}) {
+                $val = { op =&gt; '!=', value =&gt; $val-&gt;{'!='} };
+            }
         }
-    }
 
-    if($stmt-&gt;not-&gt;{$col}) {
-        if ('ARRAY' eq ref($val)) {
-            my $v = 'NOT IN (' . join(',', @$val) . ')';
-            $val = \$v;
-        } elsif (ref $val) {
-            die &quot;Unsupported value in 'not' column&quot;;
-        } else {
-            $val = { value =&gt; $val,
-                     op    =&gt; '!=', };
+        ## Translate dates from app to database format.
+        if(($stmt-&gt;date_columns-&gt;{$col}) &amp;&amp; (ref($val) eq 'HASH')) {
+            my $v = $val-&gt;{value};
+            if (ref($v) eq 'ARRAY') {
+                $v-&gt;[$_] = ts2db($v-&gt;[$_]) for @$v;
+            }
+            else {
+                $val-&gt;{value} = ts2db($v);
+            }
         }
     }
+    else {
+        ## Rearrange the value into an inclusive range.
+        my $range_incl = $stmt-&gt;range_incl;
+        my $range      = $stmt-&gt;range;
+
+        ## We may recurse, so let us empty range inclusions in our scope.
+        local $range_incl-&gt;{$col} = $range_incl-&gt;{$col};
+        local $range-&gt;{$col}      = $range-&gt;{$col};
+        if ($range_incl-&gt;{$col} || $range-&gt;{$col}) {
+            my ($lt, $gt) = $range_incl-&gt;{$col} ? ('&lt;=', '&gt;=') : ('&lt;', '&gt;');
+            my @vals;
+
+            my ($first_val, $last_val) = @$val;
+            if ($stmt-&gt;date_columns-&gt;{$col}) {
+                $first_val = ts2db($first_val) if defined $first_val;
+                $last_val = ts2db($last_val) if defined $last_val;
+            }
+
+            ## Ignore first value if it's undef (right-bounded range, eg [undef, 20050101000000] )
+            if (defined $first_val) {
+                push @vals, { op =&gt; $gt, value =&gt; $first_val };
+            }
+            ## Ignore last value if it's defined (left-bounded range, eg [20050101000000] )
+            if (defined $last_val) {
+                push @vals, { op =&gt; $lt, value =&gt; $last_val  };
+            }
+            if (2 == scalar @vals) {
+                $val = [ '-and', @vals ];
+            }
+            else {
+                ($val) = @vals;
+            }
+
+            ## Because the new value is an arrayref, we're about to get
+            ## called recursively with each of those hashrefs inside it.
+            ## So ignore that we're using an inclusive range within this
+            ## call's scope.
+            undef ($range_incl-&gt;{$col} ? $range_incl-&gt;{$col} : $range-&gt;{$col});
+        }
 
-    if($stmt-&gt;null-&gt;{$col}) {
-        $val = \'is null';
-    }
+        ## Translate dates from app to database format.
+        if ($stmt-&gt;date_columns-&gt;{$col}) {
+            if (ref($val) eq 'HASH') {
+                my $v = $val-&gt;{value};
+                if (ref($v) eq 'ARRAY') {
+                    $v-&gt;[$_] = ts2db($v-&gt;[$_]) for @$v;
+                }
+                else {
+                    $val-&gt;{value} = ts2db($v);
+                }
+            } elsif (!ref($val)) {
+                $val = ts2db($val);
+            }
+        }
 
-    if($stmt-&gt;not_null-&gt;{$col}) {
-        $val = \'is not null';
-    }
+        if ($stmt-&gt;not-&gt;{$col}) {
+            if ('ARRAY' eq ref($val)) {
+                my $v = 'NOT IN (' . join(',', @$val) . ')';
+                $val = \$v;
+            }
+            elsif (ref $val) {
+                die &quot;Unsupported value in 'not' column&quot;;
+            }
+            else {
+                $val = { value =&gt; $val,
+                         op    =&gt; '!=', };
+            }
+        }
+
+        if ($stmt-&gt;null-&gt;{$col}) {
+            $val = \'is null';
+        }
 
-    if($stmt-&gt;like-&gt;{$col}) {
-        if(ref($val) eq 'HASH') {
-            $val-&gt;{op} = 'LIKE';
-        } elsif(!ref($val)) {
-            $val = { op    =&gt; 'LIKE',
-                     value =&gt; $val,   };
+        if ($stmt-&gt;not_null-&gt;{$col}) {
+            $val = \'is not null';
+        }
+
+        if ($stmt-&gt;like-&gt;{$col}) {
+            if (ref($val) eq 'HASH') {
+                $val-&gt;{op} = 'LIKE';
+            } elsif (!ref($val)) {
+                $val = { op    =&gt; 'LIKE',
+                         value =&gt; $val,   };
+            }
         }
     }
 
@@ -211,8 +291,11 @@ sub _mk_term {
     if(my $transformed_column = $stmt-&gt;transform-&gt;{$col}) {
         $col = $transformed_column;
     }
-    
-    return $stmt-&gt;SUPER::_mk_term($col, $val);
+
+    ## Prevent D::OD from re-mutating, since we've done it here
+    local $stmt-&gt;{column_mutator} = undef;
+
+    $stmt-&gt;SUPER::_mk_term($col, $val);
 }
 
 sub make_subselect {</diff>
      <filename>lib/MT/ObjectDriver/SQL.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::ObjectDriver::SQL::Pg;
 
 use strict;</diff>
      <filename>lib/MT/ObjectDriver/SQL/Pg.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ObjectDriver/SQL/SQLite.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::ObjectDriver::SQL::mysql;
 
 use strict;</diff>
      <filename>lib/MT/ObjectDriver/SQL/mysql.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ObjectDriverFactory.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/ObjectScore.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::ObjectTag;
 
 use strict;</diff>
      <filename>lib/MT/ObjectTag.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Page.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Permission.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Placement.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -38,7 +38,15 @@ sub plugin_link { &amp;MT::Component::_getset(shift, 'plugin_link', @_) }
 sub config_link { &amp;MT::Component::_getset(shift, 'config_link', @_) }
 sub doc_link { &amp;MT::Component::_getset(shift, 'doc_link', @_) }
 sub description { &amp;MT::Component::_getset_translate(shift, 'description', @_) }
-sub settings { &amp;MT::Component::_getset(shift, 'settings', @_) }
+sub settings {
+    my $plugin = shift;
+    my $s = &amp;MT::Component::_getset($plugin, 'settings', @_);
+    unless (ref($s) eq 'MT::PluginSettings') {
+        $s = MT::PluginSettings-&gt;new($s);
+        &amp;MT::Component::_getset($plugin, 'settings', $s);
+    }
+    return $s;
+}
 sub icon { &amp;MT::Component::_getset(shift, 'icon', @_) }
 
 # Plugin-specific: configuration settings and data
@@ -87,7 +95,11 @@ sub config_template {
     } else {
         $scope = 'system';
     }
-    if (my $tmpl = $plugin-&gt;{&quot;${scope}_config_template&quot;} || $plugin-&gt;{'config_template'}) {
+    my $r = $plugin-&gt;registry;
+    if (my $tmpl = $r-&gt;{&quot;${scope}_config_template&quot;} ||
+        $r-&gt;{&quot;config_template&quot;} ||
+        $plugin-&gt;{&quot;${scope}_config_template&quot;} ||
+        $plugin-&gt;{'config_template'}) {
         return $tmpl-&gt;($plugin, @_) if ref $tmpl eq 'CODE';
         if ($tmpl =~ /\s/) {
             return $tmpl;
@@ -106,7 +118,7 @@ sub config_vars {
     if (my $s = $plugin-&gt;settings) {
         foreach my $setting (@$s) {
             my ($name, $param) = @$setting;
-            next if $scope &amp;&amp; $param-&gt;{Scope} &amp;&amp; $param-&gt;{Scope} ne $scope;
+            next if $scope &amp;&amp; $param-&gt;{scope} &amp;&amp; $param-&gt;{scope} ne $scope;
             push @settings, $name;
         }
     }
@@ -202,6 +214,22 @@ sub new {
     my $pkg = shift;
     my ($self) = @_;
     $self ||= [];
+    if (ref $self eq 'HASH') {
+        # convert a hash-style setting structure into what PluginSettings
+        # expects
+        my $settings = [];
+        foreach my $key (keys %$self) {
+            if (defined $self-&gt;{$key}) {
+                push @$settings, [ $key, $self-&gt;{$key} ];
+            }
+            else {
+                push @$settings, [ $key ];
+            }
+        }
+        @$settings = sort { ( $a-&gt;[1] ? $a-&gt;[1]-&gt;{order} || 0 : 0 )
+            &lt;=&gt; ( $b-&gt;[1] ? $b-&gt;[1]-&gt;{order} || 0 : 0 ) } @$settings;
+        $self = $settings;
+    }
     # Lowercase all settings keys
     foreach my $setting (@$self) {
         my ($name, $param) = @$setting;
@@ -406,63 +434,6 @@ modes and their handlers. For example:
         }
     }
 
-=item * app_action_links
-
-Used to register plugin action links that are displayed on various pages
-within the MT::App::CMS application. The format for this key is:
-
-    app_action_links =&gt; {
-        'MT::App::CMS' =&gt; {   # application the action applies to
-            'type' =&gt; {
-                link =&gt; 'myplugin.cgi',
-                link_text =&gt; 'Configure MyPlugin'
-            }
-        }
-    }
-
-This is an alternative to using C&lt;MT-E&lt;gt&gt;add_plugin_action&gt;.
-
-=item * app_itemset_actions
-
-Used to register plugin itemset action links that are displayed on various
-listings within the MT::App::CMS application. The format for this key is:
-
-    app_itemset_actions =&gt; {
-        'MT::App::CMS' =&gt; {   # application the action applies to
-            $type =&gt; {
-                key =&gt; 'unique_action_name',
-                label =&gt; 'Uppercase text',
-                code =&gt; \&amp;itemset_handler
-            }
-        }
-    }
-
-Where C&lt;$type&gt; should be an MT item such as 'entry', 'asset', 'ping',
-etc.
-
-Please see the full documentation of these C&lt;type&gt; options in the
-L&lt;MT::App::CMS&gt; add_itemset_action section.
-
-In the event that you need to register multiple actions for a single type,
-you can use the alternate format:
-
-    app_itemset_actions =&gt; {
-        'MT::App::CMS' =&gt; [   # application the action applies to
-            {   type =&gt; 'type',
-                key =&gt; 'unique_action_name',
-                label =&gt; 'Uppercase text',
-                code =&gt; \&amp;itemset_handler_upper
-            },
-            {   type =&gt; 'type',
-                key =&gt; 'unique_action_name2',
-                label =&gt; 'Lowercase text',
-                code =&gt; \&amp;itemset_handler_lower
-            }
-        ]
-    }
-
-This is an alternative to using C&lt;MT::App::CMS-E&lt;gt&gt;add_itemset_action&gt;.
-
 =item * callbacks
 
 Used to register object or application callbacks with the callback</diff>
      <filename>lib/MT/Plugin.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Plugin/JunkFilter.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Plugin/L10N.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/PluginData.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Promise.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Request.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.movabletype.org.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Role.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,11 @@
-# ---------------------------------------------------------------------------
-# This software is provided as-is.
-# You may use it for commercial or personal use.
-# If you distribute it, please keep this notice intact.
-#
-# Original Copyright (c) 2002 Brad Choate
-# ---------------------------------------------------------------------------
-# Modifications and integration Copyright 2002-2007 Six Apart.
-# This code cannot be redistributed without permission from www.sixapart.com.
-# For more information, consult your Movable Type license.
+# Movable Type (r) Open Source (C) 2002-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original Copyright (c) 2002 Brad Choate
+
 package MT::Sanitize;
 use strict;
 </diff>
      <filename>lib/MT/Sanitize.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -14,6 +14,22 @@ use MT::Memcached;
 
 use constant SCORE_CACHE_TIME =&gt; 7 * 24 * 60 * 60;    ## 1 week
 
+sub install_properties {
+    my $pkg = shift;
+    my ($class) = @_;
+    $class-&gt;add_trigger( post_remove =&gt; \&amp;post_remove_score );
+}
+
+sub post_remove_score {
+    my $class = shift;
+    my ($obj) = @_;
+    require MT::ObjectScore;
+    MT::ObjectScore-&gt;remove({
+        object_ds =&gt; $obj-&gt;datasource,
+        object_id =&gt; $obj-&gt;id,
+    });
+}
+
 sub get_score {
     my $obj = shift;
     my ( $namespace, $user ) = @_;</diff>
      <filename>lib/MT/Scorable.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Serialize.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Session.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/TBPing.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -293,6 +293,28 @@ package MT::Taggable;
 
 use constant TAG_CACHE_TIME =&gt; 7 * 24 * 60 * 60;  ## 1 week
 
+sub install_properties {
+    my $pkg = shift;
+    my ($class) = @_;
+
+    # synchronize tags if necessary
+    $class-&gt;add_trigger( post_save =&gt; \&amp;post_save_tags );
+    $class-&gt;add_trigger( pre_remove =&gt; \&amp;pre_remove_tags );
+}
+
+# post_save trigger for MT::Taggable objects to synchronize tags upon save.
+sub post_save_tags {
+    my $class = shift;
+    my ($obj) = @_;
+    $obj-&gt;save_tags;
+}
+
+sub pre_remove_tags {
+    my $class = shift;
+    my ($obj) = @_;
+    $obj-&gt;remove_tags if ref $obj;
+}
+
 sub tag_cache_key {
     my $obj = shift;
     return undef unless $obj-&gt;id;
@@ -439,6 +461,7 @@ sub remove_tags {
     my @et = MT::ObjectTag-&gt;load({ object_id =&gt; $obj-&gt;id,
                                    object_datasource =&gt; $obj-&gt;datasource });
     $_-&gt;remove for @et;
+    $obj-&gt;{__tags} = [];
     delete $obj-&gt;{__save_tags};
     MT::Tag-&gt;clear_cache(datasource =&gt; $obj-&gt;datasource,
         ($obj-&gt;blog_id ? (blog_id =&gt; $obj-&gt;blog_id) : ())) if @et;</diff>
      <filename>lib/MT/Tag.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::Task;
 
 use strict;</diff>
      <filename>lib/MT/Task.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/TaskMgr.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Template.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -276,6 +276,19 @@ sub set_blog_load_context {
                 || $attr-&gt;{include_blogs}
                 || $attr-&gt;{exclude_blogs};
 
+    if (defined($blog_ids) &amp;&amp; ($blog_ids =~ m/-/)) {
+        my @list = split /\s*,\s*/, $blog_ids;
+        my @ids;
+        foreach my $id (@list) {
+            if ($id =~ m/^(\d+)-(\d+)$/) {
+                push @ids, $_ for $1..$2;
+            } else {
+                push @ids, $id;
+            }
+        }
+        $blog_ids = join &quot;,&quot;, @ids;
+    }
+
     # If no blog IDs specified, use the current blog
     if ( ! $blog_ids ) {
         $terms-&gt;{$col} = $blog_id if $col eq 'blog_id';</diff>
      <filename>lib/MT/Template/Context.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -88,6 +88,8 @@ sub core_tags {
 
             'IfBlog?' =&gt; \&amp;_hdlr_blog_id,
             'IfAuthor?' =&gt; \&amp;_hdlr_if_author,
+            'AuthorHasEntry?' =&gt; \&amp;_hdlr_author_has_entry,
+            'AuthorHasPage?' =&gt; \&amp;_hdlr_author_has_page,
             Authors =&gt; \&amp;_hdlr_authors,
 
             Blogs =&gt; \&amp;_hdlr_blogs,
@@ -692,12 +694,12 @@ sub _fltr_regex_replace {
     return $str unless ref($val) eq 'ARRAY';
     my $patt = $val-&gt;[0];
     my $replace = $val-&gt;[1];
-    if ($patt =~ m!^(/)(.+?)\1([A-Za-z\s]+)?$!) {
+    if ($patt =~ m!^(/)(.+)\1([A-Za-z]+)?$!) {
         $patt = $2;
         my $global;
         if (my $opt = $3) {
             $global = 1 if $opt =~ m/g/;
-            $opt =~ s/[ge\s]+//g;
+            $opt =~ s/[ge]+//g;
             $patt = &quot;(?$opt)&quot; . $patt;
         }
         my $re = eval { qr/$patt/ };
@@ -1104,10 +1106,8 @@ sub _hdlr_app_page_actions {
     &lt;mtapp:widget
         id=&quot;page_actions&quot;
         label=&quot;&lt;__trans phrase=&quot;Actions&quot;&gt;&quot;&gt;
-        &lt;mt:loop name=&quot;page_actions&quot;&gt;
-            &lt;mt:if name=&quot;__first__&quot;&gt;
                 &lt;ul&gt;
-            &lt;/mt:if&gt;
+        &lt;mt:loop name=&quot;page_actions&quot;&gt;
             &lt;mt:if name=&quot;page&quot;&gt;
                     &lt;li class=&quot;icon-left icon&lt;mt:unless name=&quot;core&quot;&gt;-plugin&lt;/mt:unless&gt;-action&quot;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;page&quot; escape=&quot;html&quot;&gt;&lt;mt:if name=&quot;page_has_params&quot;&gt;&amp;amp;&lt;/mt:if&gt;from=$from&lt;mt:if name=&quot;id&quot;&gt;&amp;amp;id=&lt;mt:var name=&quot;id&quot;&gt;&lt;/mt:if&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&lt;/mt:if&gt;$mt&amp;amp;return_args=&lt;mt:var name=&quot;return_args&quot; escape=&quot;url&quot;&gt;&quot;&lt;mt:if name=&quot;continue_prompt&quot;&gt; onclick=&quot;return confirm('&lt;mt:var name=&quot;continue_prompt&quot; escape=&quot;js&quot;&gt;');&quot;&lt;/mt:if&gt;&gt;&lt;mt:var name=&quot;label&quot;&gt;&lt;/a&gt;&lt;/li&gt;
             &lt;mt:else&gt;&lt;mt:if name=&quot;link&quot;&gt;
@@ -1115,10 +1115,8 @@ sub _hdlr_app_page_actions {
             &lt;/mt:if&gt;&lt;mt:if name=&quot;dialog&quot;&gt;
                     &lt;li class=&quot;icon-left icon&lt;mt:unless name=&quot;core&quot;&gt;-plugin&lt;/mt:unless&gt;-action&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;&lt;mt:if name=&quot;continue_prompt&quot;&gt;if(!confirm('&lt;mt:var name=&quot;continue_prompt&quot; escape=&quot;js&quot;&gt;'))return false;&lt;/mt:if&gt;return openDialog(false, '&lt;mt:var name=&quot;dialog&quot;&gt;', '&lt;mt:if name=&quot;dialog_args&quot;&gt;&lt;mt:var name=&quot;dialog_args&quot; escape=&quot;url&quot;&gt;&amp;amp;&lt;/mt:if&gt;from=$from&lt;mt:if name=&quot;id&quot;&gt;&amp;amp;id=&lt;mt:var name=&quot;id&quot;&gt;&lt;/mt:if&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&lt;/mt:if&gt;$mt&amp;amp;return_args=&lt;mt:var name=&quot;return_args&quot; escape=&quot;url&quot;&gt;')&quot;&gt;&lt;mt:var name=&quot;label&quot;&gt;&lt;/a&gt;&lt;/li&gt;
             &lt;/mt:if&gt;&lt;/mt:if&gt;
-            &lt;mt:if name=&quot;__last__&quot;&gt;
-                &lt;/ul&gt;
-            &lt;/mt:if&gt;
         &lt;/mt:loop&gt;
+                &lt;/ul&gt;
     &lt;/mtapp:widget&gt;
 EOT
 }
@@ -1241,11 +1239,13 @@ sub _hdlr_app_setting {
 
     return $ctx-&gt;build(&lt;&lt;&quot;EOT&quot;);
 &lt;div id=&quot;$id-field&quot; class=&quot;field$req_class $label_class pkg $class&quot;$indent_css&gt;
-    &lt;div class=&quot;field-header&quot;&gt;
-        &lt;label id=&quot;$id-label&quot; for=&quot;$id&quot;&gt;$label$req&lt;/label&gt;
-    &lt;/div&gt;
-    &lt;div class=&quot;field-content $content_class&quot;&gt;
-        $insides$hint$warning
+    &lt;div class=&quot;field-inner&quot;&gt;
+        &lt;div class=&quot;field-header&quot;&gt;
+            &lt;label id=&quot;$id-label&quot; for=&quot;$id&quot;&gt;$label$req&lt;/label&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;field-content $content_class&quot;&gt;
+            $insides$hint$warning
+        &lt;/div&gt;
     &lt;/div&gt;
 &lt;/div&gt;
 EOT
@@ -1299,13 +1299,33 @@ sub _hdlr_if {
     my $var = $args-&gt;{name} || $args-&gt;{var};
     my $value;
     if (defined $var) {
+        # pick off any {...} or [...] from the name.
+        my ($index, $key);
+        if ($var =~ m/^(.+)([\[\{])(.+)[\]\}]$/) {
+            $var = $1;
+            my $br = $2;
+            my $ref = $3;
+            if ($ref =~ m/^\$(.+)/) {
+                $ref = $ctx-&gt;var($1);
+            }
+            $br eq '[' ? $index = $ref : $key = $ref;
+        } else {
+            $index = $args-&gt;{index} if exists $args-&gt;{index};
+            $key = $args-&gt;{key} if exists $args-&gt;{key};
+        }
+
         $value = $ctx-&gt;var($var);
         if (ref($value)) {
             if (UNIVERSAL::isa($value, 'MT::Template')) {
+                local $value-&gt;{context} = $ctx;
                 $value = $value-&gt;output();
             } elsif (UNIVERSAL::isa($value, 'MT::Template::Tokens')) {
                 local $ctx-&gt;{__stash}{tokens} = $value;
                 $value = _hdlr_pass_tokens(@_) or return;
+            } elsif (ref($value) eq 'ARRAY') {
+                $value = $value-&gt;[$index] if defined $index;
+            } elsif (ref($value) eq 'HASH') {
+                $value = $value-&gt;{$key} if defined $key;
             }
         }
     }
@@ -1324,6 +1344,13 @@ sub _hdlr_if {
         }
     }
 
+    if ( my $op = $args-&gt;{op} ) {
+        my $rvalue = $args-&gt;{'value'};
+        if ( $op &amp;&amp; (defined $value) &amp;&amp; !ref($value) ) {
+            $value = _math_operation($ctx, $op, $value, $rvalue);
+        }
+    }
+
     my $numeric = qr/^[-]?\d+(\.\d+)?$/;
     no warnings;
     if (exists $args-&gt;{eq}) {
@@ -1432,7 +1459,41 @@ sub _hdlr_loop {
     my ($ctx, $args, $cond) = @_;
     my $name = $args-&gt;{name} || $args-&gt;{var};
     my $var = $ctx-&gt;var($name);
-    return '' unless $var &amp;&amp; (ref($var) eq 'ARRAY') &amp;&amp; (scalar @$var);
+    return '' unless $var
+      &amp;&amp; ( (ref($var) eq 'ARRAY') &amp;&amp; (scalar @$var) )
+        || ( (ref($var) eq 'HASH') &amp;&amp; (scalar(keys %$var)) );
+
+    my $hash_var;
+    if ( 'HASH' eq ref($var) ) {
+        $hash_var = $var;
+        my @keys = keys %$var;
+        $var = \@keys;
+    }
+    if (my $sort = $args-&gt;{sort_by}) {
+        $sort = lc $sort;
+        if ($sort =~ m/\bkey\b/) {
+            @$var = sort {$a cmp $b} @$var;
+        } elsif ($sort =~ m/\bvalue\b/) {
+            no warnings;
+            if ($sort =~ m/\bnumeric\b/) {
+                no warnings;
+                if (defined $hash_var) {
+                    @$var = sort {$hash_var-&gt;{$a} &lt;=&gt; $hash_var-&gt;{$b}} @$var;
+                } else {
+                    @$var = sort {$a &lt;=&gt; $b} @$var;
+                }
+            } else {
+                if (defined $hash_var) {
+                    @$var = sort {$hash_var-&gt;{$a} cmp $hash_var-&gt;{$b}} @$var;
+                } else {
+                    @$var = sort {$a cmp $b} @$var;
+                }
+            }
+        }
+        if ($sort =~ m/\breverse\b/) {
+            @$var = reverse @$var;
+        }
+    }
 
     my $builder = $ctx-&gt;stash('builder');
     my $tokens = $ctx-&gt;stash('tokens');
@@ -1453,6 +1514,8 @@ sub _hdlr_loop {
         } else {
             if (ref($item) eq 'HASH') {
                 @names = keys %$item;
+            } elsif ( $hash_var ) {
+                @names = ( '__key__', '__value__' );
             } else {
                 @names = '__value__';
             }
@@ -1464,6 +1527,9 @@ sub _hdlr_loop {
             $vars-&gt;{lc($_)} = $item-&gt;column($_) for @names;
         } elsif (ref($item) eq 'HASH') {
             $vars-&gt;{lc($_)} = $item-&gt;{$_} for @names;
+        } elsif ( $hash_var ) {
+            $vars-&gt;{'__key__'} = $item;
+            $vars-&gt;{'__value__'} = $hash_var-&gt;{$item};
         } else {
             $vars-&gt;{'__value__'} = $item;
         }
@@ -1478,24 +1544,125 @@ sub _hdlr_loop {
 
 sub _hdlr_get_var {
     my ($ctx, $args, $cond) = @_;
-    if (exists $args-&gt;{value}) {
+    if ( exists( $args-&gt;{value} )
+      &amp;&amp; !exists( $args-&gt;{op} ) ) {
         return &amp;_hdlr_set_var(@_);
     }
-    my $value = $ctx-&gt;var($args-&gt;{name} || $args-&gt;{var});
-    if (ref($value) eq 'CODE') { # handle coderefs
-        $value = $value-&gt;(@_);
+    my $name = $args-&gt;{name} || $args-&gt;{var};
+    return $ctx-&gt;error(MT-&gt;translate(
+        &quot;You used a [_1] tag without a valid name attribute.&quot;, &quot;&lt;MT&quot; . $ctx-&gt;stash('tag') . &quot;&gt;&quot; ))
+        unless defined $name;
+
+    my ($func, $key, $index, $value);
+    if ($name =~ m/^(\w+)\((.+)\)$/) {
+        $func = $1;
+        $name = $2;
+    } else {
+        $func = $args-&gt;{function} if exists $args-&gt;{function};
     }
-    if (ref($value)) {
-        if (UNIVERSAL::isa($value, 'MT::Template')) {
-            local $args-&gt;{name} = undef;
-            local $args-&gt;{var} = undef;
-            $value = $value-&gt;output($args);
-        } elsif (UNIVERSAL::isa($value, 'MT::Template::Tokens')) {
-            local $ctx-&gt;{__stash}{tokens} = $value;
-            local $args-&gt;{name} = undef;
-            local $args-&gt;{var} = undef;
-            $ctx-&gt;var($_, $args-&gt;{$_}) for keys %{$args || {}};
-            $value = _hdlr_pass_tokens(@_) or return;
+
+    # pick off any {...} or [...] from the name.
+    if ($name =~ m/^(.+)([\[\{])(.+)[\]\}]$/) {
+        $name = $1;
+        my $br = $2;
+        my $ref = $3;
+        if ($ref =~ m/^\$(.+)/) {
+            $ref = $ctx-&gt;var($1);
+            $ref = chr(0) unless defined $ref;
+        }
+        $br eq '[' ? $index = $ref : $key = $ref;
+    } else {
+        $index = $args-&gt;{index} if exists $args-&gt;{index};
+        $key = $args-&gt;{key} if exists $args-&gt;{key};
+    }
+
+    if ($name =~ m/^$/) {
+        $name = $ctx-&gt;var($name);
+    }
+
+    if (defined $name) {
+        $value = $ctx-&gt;var($name);
+        if (ref($value) eq 'CODE') { # handle coderefs
+            $value = $value-&gt;(@_);
+        }
+        if (ref($value)) {
+            if (UNIVERSAL::isa($value, 'MT::Template')) {
+                local $args-&gt;{name} = undef;
+                local $args-&gt;{var} = undef;
+                local $value-&gt;{context} = $ctx;
+                $value = $value-&gt;output($args);
+            } elsif (UNIVERSAL::isa($value, 'MT::Template::Tokens')) {
+                local $ctx-&gt;{__stash}{tokens} = $value;
+                local $args-&gt;{name} = undef;
+                local $args-&gt;{var} = undef;
+                $ctx-&gt;var($_, $args-&gt;{$_}) for keys %{$args || {}};
+                $value = _hdlr_pass_tokens(@_) or return;
+            } elsif (ref($value) eq 'ARRAY') {
+                if ( defined $index ) {
+                    if ($index =~ /^\d+$/) {
+                        $value = $value-&gt;[ $index ];
+                    } else {
+                        $value = undef; # fall through to any 'default'
+                    }
+                }
+                elsif ( defined $func ) {
+                    $func = lc $func;
+                    if ( 'pop' eq $func ) {
+                        $value = @$value ? pop @$value : undef;
+                    }
+                    elsif ( 'shift' eq $func ) {
+                        $value = @$value ? shift @$value : undef;
+                    }
+                    elsif ( 'count' eq $func ) {
+                        $value = scalar @$value;
+                    }
+                    else {
+                        return $ctx-&gt;error(
+                            MT-&gt;translate(&quot;'[_1]' is not a valid function for an array.&quot;, $func)
+                        );
+                    }
+                }
+                else {
+                    unless ($args-&gt;{to_json}) {
+                        my $glue = exists $args-&gt;{glue} ? $args-&gt;{glue} : &quot;&quot;;
+                        $value = join $glue, @$value;
+                    }
+                }
+            } elsif ( ref($value) eq 'HASH' ) {
+                if ( defined $key ) {
+                    if ( defined $func ) {
+                        if ( 'delete' eq lc($func) ) {
+                            $value = delete $value-&gt;{$key};
+                        } else {
+                            return $ctx-&gt;error(
+                                MT-&gt;translate(&quot;'[_1]' is not a valid function for a hash.&quot;, $func)
+                            );
+                        }
+                    } else {
+                        if ($key ne chr(0)) {
+                            $value = $value-&gt;{$key};
+                        } else {
+                            $value = undef;
+                        }
+                    }
+                }
+                elsif ( defined $func ) {
+                    if ( 'count' eq lc($func) ) {
+                        $value = scalar( keys %$value );
+                    }
+                    else {
+                        return $ctx-&gt;error(
+                            MT-&gt;translate(&quot;'[_1]' is not a valid function for a hash.&quot;, $func)
+                        );
+                    }
+                }
+            }
+        }
+        if ( my $op = $args-&gt;{op} ) {
+            my $rvalue = $args-&gt;{'value'};
+            if ( $op &amp;&amp; (defined $value) &amp;&amp; !ref($value) ) {
+                $value = _math_operation($ctx, $op, $value, $rvalue);
+            }
         }
     }
     if ((!defined $value) || ($value eq '')) {
@@ -1503,12 +1670,10 @@ sub _hdlr_get_var {
             $value = $args-&gt;{default};
         }
     }
+
     if (ref($value) &amp;&amp; $args-&gt;{to_json}) {
         require JSON;
         return JSON::objToJson($value);
-    } elsif (ref($value) eq 'ARRAY') {
-        my $glue = exists $args-&gt;{glue} ? $args-&gt;{glue} : &quot;&quot;;
-        $value = join $glue, @$value;
     }
     return defined $value ? $value : &quot;&quot;;
 }
@@ -1526,9 +1691,8 @@ sub _hdlr_entry_if_tagged {
     my ($ctx, $args, $cond) = @_;
     my $entry = $ctx-&gt;stash('entry');
     return 0 unless $entry;
-    if (exists $args-&gt;{tag}) {
-        my $tag = defined $args-&gt;{tag} ? $args-&gt;{tag} : '';
-        return 0 unless $tag ne '';
+    my $tag = defined $args-&gt;{name} ? $args-&gt;{name} : (defined $args-&gt;{tag} ? $args-&gt;{tag} : '');
+    if ($tag ne '') {
         $entry-&gt;has_tag($tag);
     } else {
         my @tags = $entry-&gt;tags;
@@ -1818,6 +1982,10 @@ sub _hdlr_tag_rank {
         $ctx-&gt;stash('tag_entry_count', $count);
     }
 
+    if ($count - $min + 1 == 0) {
+        return 0;
+    }
+
     my $level = int(log($count - $min + 1) * $factor);
     $max_level - $level;
 }
@@ -2104,10 +2272,22 @@ sub _hdlr_include {
         my $tmpl = MT-&gt;instance-&gt;load_tmpl($app_file);
         if ($tmpl) {
             $tmpl-&gt;name($app_file);
+
+            my $tmpl_file = $app_file;
+            if ($tmpl_file) {
+                $tmpl_file = File::Basename::basename($tmpl_file);
+                $tmpl_file =~ s/\.tmpl$//;
+                $tmpl_file = '.' . $tmpl_file;
+            }
+            my $mt = MT-&gt;instance;
+            $mt-&gt;run_callbacks('template_param' . $tmpl_file, $mt, $tmpl-&gt;param, $tmpl);
+
             # propagate our context
             local $tmpl-&gt;{context} = $ctx;
             my $out = $tmpl-&gt;output();
             return $ctx-&gt;error($tmpl-&gt;errstr) unless defined $out;
+
+            $mt-&gt;run_callbacks('template_output' . $tmpl_file, $mt, \$out, $tmpl-&gt;param, $tmpl);
             return $out;
         } else {
             return defined $arg-&gt;{default} ? $arg-&gt;{default} : '';
@@ -2119,7 +2299,7 @@ sub _hdlr_include {
 sub _hdlr_file_template {
     my ($ctx, $args, $cond) = @_;
 
-    my $at = $ctx-&gt;{archive_type} || $ctx-&gt;{current_archive_type};
+    my $at = $ctx-&gt;{current_archive_type} || $ctx-&gt;{archive_type};
     $at = 'Category' if $ctx-&gt;{inside_mt_categories};
     my $format = $args-&gt;{format};
     unless ($format) {
@@ -2328,30 +2508,139 @@ sub _hdlr_set_var {
     my($ctx, $args) = @_;
     my $tag = lc $ctx-&gt;stash('tag');
     my $name = $args-&gt;{name} || $args-&gt;{var};
+
     return $ctx-&gt;error(MT-&gt;translate(
-        &quot;You used a [_1] tag without any arguments.&quot;, &quot;&lt;MT$tag&gt;&quot; ))
+        &quot;You used a [_1] tag without a valid name attribute.&quot;, &quot;&lt;MT$tag&gt;&quot; ))
         unless defined $name;
+
+    my ($func, $key, $index, $value);
+    if ($name =~ m/^(\w+)\((.+)\)$/) {
+        $func = $1;
+        $name = $2;
+    } else {
+        $func = $args-&gt;{function} if exists $args-&gt;{function};
+    }
+
+    # pick off any {...} or [...] from the name.
+    if ($name =~ m/^(.+)([\[\{])(.+)[\]\}]$/) {
+        $name = $1;
+        my $br = $2;
+        my $ref = $3;
+        if ($ref =~ m/^\$(.+)/) {
+            $ref = $ctx-&gt;var($1);
+            $ref = chr(0) unless defined $ref;
+        }
+        $br eq '[' ? $index = $ref : $key = $ref;
+    } else {
+        $index = $args-&gt;{index} if exists $args-&gt;{index};
+        $key = $args-&gt;{key} if exists $args-&gt;{key};
+    }
+
+    if ($name =~ m/^$/) {
+        $name = $ctx-&gt;var($name);
+        return $ctx-&gt;error(MT-&gt;translate(
+            &quot;You used a [_1] tag without a valid name attribute.&quot;, &quot;&lt;MT$tag&gt;&quot; ))
+            unless defined $name;
+    }
+
     my $val;
+    my $data = $ctx-&gt;var($name);
     if (($tag eq 'setvar') || ($tag eq 'var')) {
         $val = defined $args-&gt;{value} ? $args-&gt;{value} : '';
     } elsif ($tag eq 'setvarblock') {
-        $val = _hdlr_pass_tokens(@_);
-        return unless defined($val);
+        my $vars = $ctx-&gt;{__stash}{vars};
+        {
+            # local $ctx-&gt;{__stash}{vars};
+            # my %local_vars = map { $_ =&gt; $vars-&gt;{$_} } keys %$vars;
+            # $ctx-&gt;{__stash}{vars} = \%local_vars;
+            $val = _hdlr_pass_tokens(@_);
+            return unless defined($val);
+            # $data = {} unless defined($data);
+            # if ( 'HASH' eq ref($data) ) {
+            #     while ( my ($inner_key, $inner_value) = each %local_vars ) {
+            #         if ( !exists($vars-&gt;{$inner_key})
+            #           || ( $vars-&gt;{$inner_key} ne $inner_value ) )
+            #         {
+            #             $data-&gt;{$inner_key} = $inner_value;
+            #         }
+            #     }
+            # }
+        }
     } elsif ($tag eq 'setvartemplate') {
         $val = $ctx-&gt;stash('tokens');
         return unless defined($val);
         $val = bless $val, 'MT::Template::Tokens';
     }
+
+    my $existing = $ctx-&gt;var($name);
+    $existing = '' unless defined $existing;
+    if ( 'HASH' eq ref($existing) ) {
+        $existing = $existing-&gt;{ $key };
+    }
+    elsif ( 'ARRAY' eq ref($existing) ) {
+        $existing = ( defined $index &amp;&amp; ( $index =~ /^\d+$/ ) )
+          ? $existing-&gt;[ $index ] 
+          : undef;
+    }
+
     if ($args-&gt;{prepend}) {
-        my $existing = $ctx-&gt;var($name);
-        $existing = '' unless defined $existing;
         $val = $val . $existing;
-    } elsif ($args-&gt;{append}) {
-        my $existing = $ctx-&gt;var($name);
-        $existing = '' unless defined $existing;
+    }
+    elsif ($args-&gt;{append}) {
         $val = $existing . $val;
     }
-    $ctx-&gt;var($name, $val);
+    elsif ( $existing &amp;&amp; ( my $op = $args-&gt;{op} ) ) {
+        $val = _math_operation($ctx, $op, $existing, $val);
+    }
+
+    if ( defined $key ) {
+        $data ||= {};
+        return $ctx-&gt;error( MT-&gt;translate(&quot;'[_1]' is not a hash.&quot;, $name) )
+            unless 'HASH' eq ref($data);
+
+        if ( ( defined $func )
+          &amp;&amp; ( 'delete' eq lc( $func ) ) ) {
+            delete $data-&gt;{ $key };
+        }
+        else {
+            $data-&gt;{ $key } = $val;
+        }
+    }
+    elsif ( defined $index ) {
+        $data ||= [];
+        return $ctx-&gt;error( MT-&gt;translate(&quot;'[_1]' is not an array.&quot;, $name) )
+            unless 'ARRAY' eq ref($data);
+        return $ctx-&gt;error( MT-&gt;translate(&quot;Invalid index.&quot;) )
+            unless $index =~ /^\d+$/;
+        $data-&gt;[ $index ] = $val;
+    }
+    elsif ( defined $func ) {
+        if ( 'undef' eq lc( $func ) ) {
+            $data = undef;
+        }
+        else {
+            $data ||= [];
+            return $ctx-&gt;error( MT-&gt;translate(&quot;'[_1]' is not an array.&quot;, $name) )
+                unless 'ARRAY' eq ref($data);
+            if ( 'push' eq lc( $func ) ) {
+                push @$data, $val;
+            }
+            elsif ( 'unshift' eq lc( $func ) ) {
+                $data ||= [];
+                unshift @$data, $val;
+            }
+            else {
+                return $ctx-&gt;error(
+                    MT-&gt;translate(&quot;'[_1]' is not a valid function.&quot;, $func)
+                );
+            }
+        }
+    }
+    else {
+        $data = $val;
+    }
+
+    $ctx-&gt;var($name, $data);
     return '';
 }
 
@@ -2483,6 +2772,36 @@ sub _hdlr_if_author {
     return $_[0]-&gt;stash('author') ? 1 : 0;
 }
 
+sub _hdlr_author_has_entry {
+    my ($ctx)   = @_;
+    my $author  = $ctx-&gt;stash('author')
+      or return $ctx-&gt;_no_author_error( $ctx-&gt;stash('tag') );
+
+    my %terms;
+    $terms{blog_id}   = $ctx-&gt;stash('blog_id');
+    $terms{author_id} = $author-&gt;id;
+    $terms{class}     = 'entry';
+    $terms{status}    = MT::Entry::RELEASE();
+
+    my $class = MT-&gt;model('entry');
+    $class-&gt;count( \%terms );
+}
+
+sub _hdlr_author_has_page {
+    my ($ctx)   = @_;
+    my $author  = $ctx-&gt;stash('author')
+      or return $ctx-&gt;_no_author_error( $ctx-&gt;stash('tag') );
+
+    my %terms;
+    $terms{blog_id}   = $ctx-&gt;stash('blog_id');
+    $terms{author_id} = $author-&gt;id;
+    $terms{class}     = 'page';
+    $terms{status}    = MT::Entry::RELEASE();
+
+    my $class = MT-&gt;model('page');
+    $class-&gt;count( \%terms );
+}
+
 sub _hdlr_authors {
     my($ctx, $args, $cond) = @_;
     my $blog_id = $ctx-&gt;stash('blog_id');
@@ -3091,7 +3410,7 @@ sub _hdlr_entries {
         my $entry = @$entries[0];
         $entries = undef if $entry-&gt;class ne $class_type;
 
-        foreach my $args_key ('category', 'categories', 'tag', 'tags', 'author', 'id', 'days', 'recently_commented_on', 'include_subcategories') {
+        foreach my $args_key ('category', 'categories', 'tag', 'tags', 'author', 'id', 'days', 'recently_commented_on', 'include_subcategories', 'include_blogs', 'exclude_blogs', 'blog_ids') {
             if (exists($args-&gt;{$args_key})) {
                 $entries = undef;
                 last;
@@ -3207,7 +3526,7 @@ sub _hdlr_entries {
         }
     }
     # Adds a tag filter to the filters list.
-    if (my $tag_arg = $args-&gt;{tag} || $args-&gt;{tags}) {
+    if (my $tag_arg = $args-&gt;{tags} || $args-&gt;{tag}) {
         require MT::Tag;
         require MT::ObjectTag;
 
@@ -3240,7 +3559,7 @@ sub _hdlr_entries {
             }
             push @filters, sub { $cexpr-&gt;($_[0]-&gt;id, \%map) };
         } else {
-            return $ctx-&gt;error(MT-&gt;translate(&quot;You have an error in your 'tag' attribute: [_1]&quot;, $args-&gt;{tag} || $args-&gt;{tags}));
+            return $ctx-&gt;error(MT-&gt;translate(&quot;You have an error in your 'tag' attribute: [_1]&quot;, $args-&gt;{tags} || $args-&gt;{tag}));
         }
     }
 
@@ -3992,7 +4311,7 @@ sub _hdlr_entry_tb_data {
     my $path = _hdlr_cgi_path($ctx);
     $path .= $cfg-&gt;TrackbackScript . '/' . $tb-&gt;id;
     my $url;
-    if (my $at = $_[0]-&gt;{archive_type} || $_[0]-&gt;{current_archive_type}) {
+    if (my $at = $_[0]-&gt;{current_archive_type} || $_[0]-&gt;{archive_type}) {
         $url = $e-&gt;archive_url($at);
         $url .= '#' . sprintf(&quot;%06d&quot;, $e-&gt;id)
             unless $at eq 'Individual';
@@ -4286,7 +4605,8 @@ sub _hdlr_date {
         $blog = MT-&gt;model('blog')-&gt;load($blog_id)
           if $blog_id;
     }
-    my $lang = $args-&gt;{language} || ($blog &amp;&amp; $blog-&gt;language);
+    my $lang = $args-&gt;{language} || $_[0]-&gt;var('local_lang_id')
+        || ($blog &amp;&amp; $blog-&gt;language);
     if ($args-&gt;{utc}) {
         my($y, $mo, $d, $h, $m, $s) = $ts =~ /(\d\d\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)/;
         $mo--;
@@ -4713,10 +5033,7 @@ sub _hdlr_comment_author_identity {
     my $static_path = _hdlr_static_path($ctx);
     my $logo = $cmntr-&gt;auth_icon_url;
     unless ($logo) {
-        my $blog = MT::Blog-&gt;load($ctx-&gt;stash('blog_id'));
-        my $root_url = MT-&gt;config-&gt;PublishCommenterIcon
-            ? $blog-&gt;site_url()
-            : $static_path . &quot;images&quot;;
+        my $root_url = $static_path . &quot;images&quot;;
         $root_url =~ s|/$||;
         $logo = &quot;$root_url/nav-commenters.gif&quot;;
     }
@@ -5251,7 +5568,7 @@ sub _hdlr_archive_set {
     my $old_at = $blog-&gt;archive_type_preferred();
     foreach my $type (@at) {
         $blog-&gt;archive_type_preferred($type);
-        local $ctx-&gt;{archive_type} = $type;
+        local $ctx-&gt;{current_archive_type} = $type;
         defined(my $out = $builder-&gt;build($ctx, $tokens, $cond)) or
             return $ctx-&gt;error( $builder-&gt;errstr );
         $res .= $out;
@@ -5359,10 +5676,6 @@ sub _hdlr_archives {
 sub _hdlr_archive_title {
     my($ctx, $args) = @_;
 
-    ## Since this tag can be called from inside &lt;MTCategories&gt;,
-    ## we need a way to map this tag to &lt;$MTCategoryLabel$&gt;.
-    return _hdlr_category_label(@_) if $ctx-&gt;{inside_mt_categories};
-
     my $at = $ctx-&gt;{current_archive_type} || $ctx-&gt;{archive_type};
     return _hdlr_category_label(@_) if $at eq 'Category';
 
@@ -5421,15 +5734,15 @@ sub _hdlr_archive_date_end {
 sub _hdlr_archive_type {
     my ($ctx, $args, $cond) = @_;
 
-    my $at = $ctx-&gt;{archive_type} || $ctx-&gt;{current_archive_type};
+    my $at = $ctx-&gt;{current_archive_type} || $ctx-&gt;{archive_type};
     $at = 'Category' if $ctx-&gt;{inside_mt_categories};
     defined $at ? $at : '';
 }
 
 sub _hdlr_archive_label {
     my ($ctx, $args, $cond) = @_;
-
-    my $at = $ctx-&gt;{archive_type} || $ctx-&gt;{current_archive_type};
+    
+    my $at = $ctx-&gt;{current_archive_type} || $ctx-&gt;{archive_type};
     $at = 'Category' if $ctx-&gt;{inside_mt_categories};
     return q() unless defined $at;
     my $archiver = MT-&gt;publisher-&gt;archiver($at);
@@ -5443,7 +5756,7 @@ sub _hdlr_archive_label {
 sub _hdlr_archive_file {
     my ($ctx, $args, $cond) = @_;
 
-    my $at = $ctx-&gt;{archive_type} || $ctx-&gt;{current_archive_type};
+    my $at = $ctx-&gt;{current_archive_type} || $ctx-&gt;{archive_type};
     $at = 'Category' if $ctx-&gt;{inside_mt_categories};
     my $archiver = MT-&gt;publisher-&gt;archiver($at);
     my $f;
@@ -5471,9 +5784,7 @@ sub _hdlr_archive_file {
 
 sub _hdlr_archive_link {
     my($ctx, $args) = @_;
-    ## Since this tag can be called from inside &lt;MTCategories&gt;,
-    ## we need a way to map this tag to &lt;$MTCategoryArchiveLink$&gt;.
-    return _hdlr_category_archive(@_) if $ctx-&gt;{inside_mt_categories};
+
     my $at = $args-&gt;{type} || $args-&gt;{archive_type};
     return _hdlr_category_archive(@_)
         if ($at &amp;&amp; ('Category' eq $at)) ||
@@ -5828,23 +6139,15 @@ sub _hdlr_category_archive {
         or return $_[0]-&gt;error(MT-&gt;translate(
             &quot;You used an [_1] tag outside of the proper context.&quot;,
             '&lt;$MTCategoryArchiveLink$&gt;' ));
-    my $curr_at = $_[0]-&gt;{archive_type} || $_[0]-&gt;{current_archive_type} || 'Category';
-    my $blog = $_[0]-&gt;stash('blog');
-    my $at = $blog-&gt;archive_type;
-    my @at = split /,/, $at;
-    my $cat_based = 0;
-    foreach my $type (@at) {
-        my $archiver = MT-&gt;publisher-&gt;archiver($type);
-        next unless defined $archiver;
-        if ($archiver-&gt;category_based) {
-            $cat_based = 1;
-            last;
-        }
-    }
-    return '' unless $cat_based;
+    my $curr_at = $_[0]-&gt;{current_archive_type} || $_[0]-&gt;{archive_type} || 'Category';
+    my $archiver = MT-&gt;publisher-&gt;archiver($curr_at);
+    return '' unless defined $archiver;
+    return '' unless $archiver-&gt;category_based;
+
     my @entries = MT::Entry-&gt;load({ status =&gt; MT::Entry::RELEASE() },
         { join =&gt; [ 'MT::Placement', 'entry_id', { category_id =&gt; $cat-&gt;id }, { unqiue =&gt; 1 } ] } );
     my $entry = $entries[0] if @entries;
+    my $blog = $_[0]-&gt;stash('blog');
     my $arch = $blog-&gt;archive_url;
     $arch .= '/' unless $arch =~ m!/$!;
     $arch = $arch . archive_file_for($entry, $blog, 'Category', $cat);
@@ -6745,8 +7048,10 @@ sub _hdlr_is_ancestor {
     my $iter = MT::Category-&gt;load_iter({ blog_id =&gt; $blog_id,
                                          label =&gt; $args-&gt;{'child'} }) || undef;
     while (my $child = $iter-&gt;()) {
-        my $ret = $cat-&gt;is_ancestor($child);
-        return 1 if $ret;
+        if ($cat-&gt;is_ancestor($child)) {
+            $iter-&gt;('finish');
+            return 1;
+        }
     }
 
     0;
@@ -6765,8 +7070,10 @@ sub _hdlr_is_descendant {
     my $iter = MT::Category-&gt;load_iter({ blog_id =&gt; $blog_id,
                                          label =&gt; $args-&gt;{'parent'} });
     while (my $parent = $iter-&gt;()) {
-        my $ret = $cat-&gt;is_descendant($parent);
-        return 1 if $ret;
+        if ($cat-&gt;is_descendant($parent)) {
+            $iter-&gt;('finish');
+            return 1;
+        }
     }
 
     0;
@@ -6972,7 +7279,7 @@ sub _hdlr_assets {
     }
 
     # Adds a tag filter to the filters list.
-    if (my $tag_arg = $args-&gt;{tag} || $args-&gt;{tags}) {
+    if (my $tag_arg = $args-&gt;{tags} || $args-&gt;{tag}) {
         require MT::Tag;
         require MT::ObjectTag;
 
@@ -6998,7 +7305,7 @@ sub _hdlr_assets {
                                                                                                                                                                                     }
             push @filters, sub { $cexpr-&gt;($_[0]-&gt;id, \%map) };
         } else {
-            return $ctx-&gt;error(MT-&gt;translate(&quot;You have an error in your 'tag' attribute: [_1]&quot;, $args-&gt;{tag} || $args-&gt;{tags}));
+            return $ctx-&gt;error(MT-&gt;translate(&quot;You have an error in your 'tag' attribute: [_1]&quot;, $args-&gt;{tags} || $args-&gt;{tag}));
         }
     }
 
@@ -7096,6 +7403,7 @@ sub _hdlr_assets {
                 $args{direction} = $args-&gt;{sort_order} || 'descend'
                   if exists($args{sort});
                 $no_resort = 1 unless $args-&gt;{sort_by};
+                $args{limit} = $args-&gt;{limit} if $args-&gt;{limit};
             }
             $args{offset} = $args-&gt;{offset} if $args-&gt;{offset};
             @assets = MT::Asset-&gt;load(\%terms, \%args);
@@ -7107,6 +7415,7 @@ sub _hdlr_assets {
             } else {
                 $args{direction} = $args-&gt;{sort_order} || 'descend';
                 $no_resort = 1 unless $args-&gt;{sort_by};
+                $args-&gt;{lastn} = $args-&gt;{limit} if $args-&gt;{limit};
             }
             my $iter = MT::Asset-&gt;load_iter(\%terms, \%args);
             my $i = 0; my $j = 0;
@@ -7134,7 +7443,7 @@ sub _hdlr_assets {
         if (@filters) {
             my $i = 0; my $j = 0;
             my $off = $args-&gt;{offset} || 0;
-            my $n = $args-&gt;{lastn};
+            my $n = $args-&gt;{lastn} || $args-&gt;{limit};
             ASSET2: foreach my $e (@$assets) {
                 for (@filters) {
                     next ASSET2 unless $_-&gt;($e);
@@ -7155,7 +7464,7 @@ sub _hdlr_assets {
             } else {
                 @assets = @$assets;
             }
-            if (my $last = $args-&gt;{lastn}) {
+            if (my $last = $args-&gt;{lastn} || $args-&gt;{limit}) {
                 if (scalar @assets &gt; $last) {
                     @assets = @assets[0..$last-1];
                 }
@@ -7491,9 +7800,8 @@ sub _hdlr_asset_if_tagged {
     my $a = $_[0]-&gt;stash('asset')
         or return $_[0]-&gt;_no_asset_error('MTAssetIfTagged');
 
-    if (exists $args-&gt;{tag}) {
-        my $tag = defined $args-&gt;{tag} ? $args-&gt;{tag} : '';
-        return 0 unless $tag ne '';
+    my $tag = defined $args-&gt;{name} ? $args-&gt;{name} : ( defined $args-&gt;{tag} ? $args-&gt;{tag} : '' );
+    if ($tag ne '') {
         $a-&gt;has_tag($tag);
     } else {
         my @tags = $a-&gt;tags;
@@ -7554,8 +7862,8 @@ sub _hdlr_pages {
     }
 
     # remove current_timestamp;
-    $ctx-&gt;{current_timestamp} = undef;
-    $ctx-&gt;{current_timestamp_end} =undef;
+    local $ctx-&gt;{current_timestamp};
+    local $ctx-&gt;{current_timestamp_end};
 
     require MT::Page;
     $args-&gt;{class_type} = MT::Page-&gt;properties-&gt;{class_type};
@@ -8148,4 +8456,42 @@ sub _hdlr_section {
     return $out;
 }
 
+sub _math_operation {
+    my ($ctx, $op, $lvalue, $rvalue) = @_;
+    return $lvalue
+        unless ( $lvalue =~ m/^\-?[\d\.]+$/ )
+            &amp;&amp; ( ( defined($rvalue) &amp;&amp; ( $rvalue =~ m/^\-?[\d\.]+$/ ) )
+              || ( ( $op eq 'inc' ) || ( $op eq 'dec' ) || ( $op eq '++' ) || ( $op eq '--' ) )
+            );
+    if ( ( '+' eq $op ) || ( 'add' eq $op ) ) {
+        return $lvalue + $rvalue;
+    }
+    elsif ( ( '++' eq $op ) || ( 'inc' eq $op ) ) {
+        return $lvalue + 1;
+    }
+    elsif ( ( '-' eq $op ) || ( 'sub' eq $op ) ) {
+        return $lvalue - $rvalue;
+    }
+    elsif ( ( '--' eq $op ) || ( 'dec' eq $op ) ) {
+        return $lvalue - 1;
+    }
+    elsif ( ( '*' eq $op ) || ( 'mul' eq $op ) ) {
+        return $lvalue * $rvalue;
+    }
+    elsif ( ( '/' eq $op ) || ( 'div' eq $op ) ) {
+        return $ctx-&gt;error( MT-&gt;translate('Division by zero.') )
+            if $rvalue == 0;
+        return $lvalue / $rvalue;
+    }
+    elsif ( ( '%' eq $op ) || ( 'mod' eq $op ) ) {
+        # Perl % is integer only
+        $lvalue = int($lvalue);
+        $rvalue = int($rvalue);
+        return $ctx-&gt;error( MT-&gt;translate('Division by zero.') )
+            if $rvalue == 0;
+        return $lvalue % $rvalue;
+    }
+    return $lvalue;
+}
+
 1;</diff>
      <filename>lib/MT/Template/ContextHandlers.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/TemplateMap.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -81,6 +81,25 @@ sub mt_schwartz_init {
     TheSchwartz::Job-&gt;properties-&gt;{datasource}        = 'ts_job';
     TheSchwartz::Error-&gt;properties-&gt;{datasource}      = 'ts_error';
     TheSchwartz::ExitStatus-&gt;properties-&gt;{datasource} = 'ts_exitstatus';
+
+    my $job_set_exit_status = \&amp;TheSchwartz::Job::set_exit_status;
+    my $job_add_failure = \&amp;TheSchwartz::Job::add_failure;
+
+    my $driver = MT::Object-&gt;driver;
+    no warnings 'redefine';
+    *TheSchwartz::Job::set_exit_status = sub {
+        $driver-&gt;Disabled(1);
+        my $res = $job_set_exit_status-&gt;(@_);
+        $driver-&gt;Disabled(0);
+        return $res;
+    };
+    *TheSchwartz::Job::add_failure = sub {
+        $driver-&gt;Disabled(1);
+        my $res = $job_add_failure-&gt;(@_);
+        $driver-&gt;Disabled(0);
+        return $res;
+    };
+
     return $initialized = 1;
 }
 </diff>
      <filename>lib/MT/TheSchwartz.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
 
 package MT::TheSchwartz::Error;</diff>
      <filename>lib/MT/TheSchwartz/Error.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
 
 package MT::TheSchwartz::ExitStatus;</diff>
      <filename>lib/MT/TheSchwartz/ExitStatus.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
 
 package MT::TheSchwartz::FuncMap;</diff>
      <filename>lib/MT/TheSchwartz/FuncMap.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
 
 package MT::TheSchwartz::Job;</diff>
      <filename>lib/MT/TheSchwartz/Job.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Trackback.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -44,6 +44,10 @@ sub BEGIN {
             code =&gt; sub { shift-&gt;core_column_action('alter', @_) },
             priority =&gt; 3,
         },
+        'core_index_column' =&gt; {
+            code =&gt; sub { shift-&gt;core_column_action('index', @_) },
+            priority =&gt; 3.5,
+        },
         'core_seed_database' =&gt; {
             code =&gt; \&amp;seed_database,
             priority =&gt; 4,
@@ -1222,6 +1226,8 @@ sub check_type {
                 if $result-&gt;{alter};
             $self-&gt;add_step('core_drop_column', type =&gt; $type)
                 if $result-&gt;{drop};
+            $self-&gt;add_step('core_index_column', type =&gt; $type)
+                if $result-&gt;{index};
         }
     }
     1;
@@ -1239,6 +1245,9 @@ sub type_diff {
     my $ddl = $class-&gt;driver-&gt;dbd-&gt;ddl_class;
     my $db_defs = $ddl-&gt;column_defs($class);
 
+    my $class_idx_defs = $class-&gt;index_defs;
+    my $db_idx_defs = $ddl-&gt;index_defs($class);
+
     # now, compare $defs and $db_defs;
     # here are the scenarios
     #   1. we find something in $defs that isn't in $db_defs
@@ -1259,7 +1268,7 @@ sub type_diff {
 
     # we're only scanning defined columns; we don't care about
     # columns that are unique to the table.
-    my (@cols_to_add, @cols_to_alter, @cols_to_drop);
+    my (@cols_to_add, @cols_to_alter, @cols_to_drop, @cols_to_index);
 
     if (!$fix_class) {
         my @def_cols = keys %$defs;
@@ -1296,14 +1305,59 @@ sub type_diff {
                 }
             }
         }
+
+        foreach my $key (keys %$class_idx_defs) {
+            my $db_idx_def = $db_idx_defs-&gt;{$key};
+            if (!$db_idx_def) {
+                push @cols_to_index, $key;
+                next;
+            }
+            # if there is a mismatch in definition, add it to index
+            my $class_idx_def = $class_idx_defs-&gt;{$key};
+            if (ref($class_idx_def)) {
+                if (!ref $db_idx_def) {
+                    push @cols_to_index, $key;
+                }
+                else {
+                    my $db_cols;
+                    if (exists $db_idx_def-&gt;{columns}) {
+                        $db_cols = join ',', @{ $db_idx_def-&gt;{columns} };
+                    }
+                    else {
+                        $db_cols = $key;
+                    }
+                    my $class_cols;
+                    if (exists $class_idx_def-&gt;{columns}) {
+                        $class_cols = join ',', @{ $class_idx_def-&gt;{columns} };
+                    }
+                    else {
+                        $class_cols = $key;
+                    }
+                    if ($db_cols ne $class_cols) {
+                        push @cols_to_index, $key;
+                    }
+                    else {
+                        if (($db_idx_def-&gt;{unique} || 0) != ($class_idx_def-&gt;{unique} || 0)) {
+                            push @cols_to_index, $key;
+                        }
+                    }
+                }
+            }
+            else {
+                if (ref $db_idx_def) {
+                    push @cols_to_index, $key;
+                }
+            }
+        }
     }
 
-    if ($fix_class || @cols_to_add || @cols_to_alter || @cols_to_drop) {
+    if ($fix_class || @cols_to_add || @cols_to_alter || @cols_to_drop || @cols_to_index) {
         my %param;
         $param{drop} = \@cols_to_drop if @cols_to_drop;
         $param{add} = \@cols_to_add if @cols_to_add;
         $param{alter} = \@cols_to_alter if @cols_to_alter;
         $param{fix} = $fix_class;
+        $param{index} = \@cols_to_index if @cols_to_index;
         if ((@cols_to_add &amp;&amp; !$ddl-&gt;can_add_column) ||
             (@cols_to_alter &amp;&amp; !$ddl-&gt;can_alter_column) || 
             (@cols_to_drop &amp;&amp; !$ddl-&gt;can_drop_column)) {
@@ -1671,6 +1725,8 @@ sub post_alter_column { 1 }
 sub pre_drop_column { 1 }
 sub post_drop_column { 1 }
 sub pre_add_column { 1 }
+sub pre_index_column { 1 }
+sub post_index_column { 1 }
 sub pre_schema_upgrade { 1 }
 
 # issued last, after all table creation...
@@ -1838,6 +1894,7 @@ sub core_fix_type {
     my $alter = $result-&gt;{alter};
     my $add = $result-&gt;{add};
     my $drop = $result-&gt;{drop};
+    my $index = $result-&gt;{index};
 
     my $driver = $class-&gt;driver;
     my $ddl = $driver-&gt;dbd-&gt;ddl_class;
@@ -1848,11 +1905,13 @@ sub core_fix_type {
     push @stmts, sub { $self-&gt;pre_add_column($class, $add) } if $add;
     push @stmts, sub { $self-&gt;pre_alter_column($class, $alter) } if $alter;
     push @stmts, sub { $self-&gt;pre_drop_column($class, $drop) } if $drop;
+    push @stmts, sub { $self-&gt;pre_index_column($class, $index) } if $index;
     push @stmts, $ddl-&gt;fix_class($class);
     push @stmts, sub { $self-&gt;post_create_table($class) };
     push @stmts, sub { $self-&gt;post_add_column($class, $add) } if $add;
     push @stmts, sub { $self-&gt;post_alter_column($class, $alter) } if $alter;
     push @stmts, sub { $self-&gt;post_drop_column($class, $drop) } if $drop;
+    push @stmts, sub { $self-&gt;post_index_column($class, $index) } if $index;
     push @stmts, $ddl-&gt;upgrade_end($class);
     push @stmts, sub { $self-&gt;post_upgrade_class($class) };
     $self-&gt;run_statements($class, @stmts);
@@ -1881,7 +1940,7 @@ sub core_column_action {
     push @stmts, sub { $self-&gt;pre_upgrade_class($class) };
     push @stmts, $ddl-&gt;upgrade_begin($class);
     push @stmts, sub { $self-&gt;$pre_method($class, $columns) };
-    push @stmts, $ddl-&gt;$method($class, $_-&gt;{name}) foreach @$columns;
+    push @stmts, $ddl-&gt;$method($class, $_) foreach @$columns;
     push @stmts, sub { $self-&gt;$post_method($class, $columns) };
     push @stmts, $ddl-&gt;upgrade_end($class);
     push @stmts, sub { $self-&gt;post_upgrade_class($class) };
@@ -1909,7 +1968,8 @@ sub run_statements {
                         my $err;
                         $dbh-&gt;do($stmt) or $err = $dbh-&gt;errstr;
                         if ($err) {
-                            # ignore drop errors; the table/sequence didn't exist
+                            # ignore drop errors; the table/sequence
+                            # didn't exist
                             if ($stmt !~ m/^drop /i) {
                                 die &quot;failed to execute statement $stmt: $err&quot;;
                             }</diff>
      <filename>lib/MT/Upgrade.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -18,7 +18,7 @@ our @EXPORT_OK = qw( start_end_day start_end_week start_end_month start_end_year
                  archive_file_for format_ts dirify remove_html
                  days_in wday_from_ts encode_js get_entry spam_protect
                  is_valid_email encode_php encode_url decode_url encode_xml
-                 decode_xml is_valid_url discover_tb convert_high_ascii 
+                 decode_xml is_valid_url is_url discover_tb convert_high_ascii 
                  mark_odd_rows dsa_verify perl_sha1_digest relative_date
                  perl_sha1_digest_hex dec2bin bin2dec xliterate_utf8 
                  start_background_task launch_background_tasks substr_wref
@@ -440,6 +440,9 @@ sub encode_js {
     my($str) = @_;
     return '' unless defined $str;
     $str =~ s!\\!\\\\!g;
+    $str =~ s!&gt;!\\&gt;!g;
+    $str =~ s!&lt;!\\&lt;!g;
+    $str =~ s!(s)(cript)!$1\\$2!gi;
     $str =~ s!&lt;/!&lt;\\/!g; # &lt;/ is supposed to be the end of Javascript (&lt;/script in most UA)
     $str =~ s!(['&quot;])!\\$1!g;
     $str =~ s!\n!\\n!g;
@@ -872,9 +875,9 @@ sub make_unique_basename {
     my $i = 1;
     my $base_copy = $base;
 
-   my $class = ref $entry; 
+    my $class = ref $entry; 
     while ($class-&gt;count({ blog_id =&gt; $blog-&gt;id,
-                              basename =&gt; $base })) {
+                           basename =&gt; $base })) {
         $base = $base_copy . '_' . $i++;
     }
     $base;
@@ -900,7 +903,7 @@ sub make_unique_category_basename {
 
     my $cat_class = ref $cat;
     while ($cat_class-&gt;count({ blog_id =&gt; $cat-&gt;blog_id,
-                                 basename =&gt; $base })) {
+                               basename =&gt; $base })) {
         $base = $base_copy . '_' . $i++;
     }
     $base;
@@ -979,6 +982,12 @@ sub is_valid_url {
     }
 }
 
+sub is_url {
+    my($url) = @_;
+
+    return $url =~ /s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&amp;=+\$,%#]+/;
+}
+
 sub discover_tb {
     my($url, $find_all, $contents) = @_;
     my $c = '';
@@ -1764,6 +1773,80 @@ sub caturl {
     return $url;
 }
 
+sub get_newsbox_html {
+    my ($newsbox_url, $kind, $cached_only) = @_;
+
+    return unless $newsbox_url;
+    return unless is_url($newsbox_url);
+    return unless $kind &amp;&amp; (length($kind) == 2);
+    $cached_only ||= 0;
+
+    my $NEWSCACHE_TIMEOUT = 60 * 60 * 24;
+    my $sess_class        = MT-&gt;model('session');
+    my ($news_object)     = (&quot;&quot;);
+    my $retries           = 0;
+    $news_object = $sess_class-&gt;load( { id =&gt; $kind } );
+    my $refresh_news;
+    if ( $news_object
+        &amp;&amp; ( $news_object-&gt;start() &lt; ( time - $NEWSCACHE_TIMEOUT ) ) )
+    {
+        $refresh_news = 1;
+    }
+    my $last_available_news = MT::I18N::encode_text( $news_object-&gt;data(), 'utf-8', undef )
+      if $news_object;
+    return $last_available_news unless $refresh_news || !$news_object;
+    return q() if $cached_only;
+
+    # don't block the dashboard for more than 10 seconds to fetch
+    # the news feed...
+    my $ua = MT-&gt;new_ua( { timeout =&gt; 10 } );
+    return $last_available_news unless $ua;
+
+    my $req = new HTTP::Request( GET =&gt; $newsbox_url );
+    my $resp = $ua-&gt;request($req);
+    my $result = $resp-&gt;content();
+    if ( !$resp-&gt;is_success() || !$result ) {
+        # failure; either timeout or worse
+        # if news_object is available, bump up it's expiration
+        # so we don't attempt to hit the server again
+        # for an hour
+        if (! $news_object ) {
+            $news_object = MT::Session-&gt;new;
+            $news_object-&gt;set_values(
+                {
+                    id    =&gt; $kind,
+                    kind  =&gt; $kind,
+                    data  =&gt; ''
+                }
+            );
+            $last_available_news = '';
+            $refresh_news = 1;
+        }
+        if (defined($last_available_news) &amp;&amp; $refresh_news) {
+            $news_object-&gt;start( ( time - $NEWSCACHE_TIMEOUT ) + 60 * 60 );
+            $news_object-&gt;save;
+        }
+        return $last_available_news;
+    }
+    require MT::Sanitize;
+
+    # allowed html
+    my $spec = 'a href,* style class id,ul,li,div,span,br';
+    $result = MT::Sanitize-&gt;sanitize( $result, $spec );
+    $news_object = MT::Session-&gt;new();
+    $news_object-&gt;set_values(
+        {
+            id    =&gt; $kind,
+            kind  =&gt; $kind,
+            start =&gt; time(),
+            data  =&gt; $result
+        }
+    );
+    $news_object-&gt;save();
+    $result = MT::I18N::encode_text( $result, 'utf-8', undef );
+    return $result;
+}
+
 ## FIXME
 # This method is to supplement CGI.pm's lack of read method.
 # Some XML parsers (XML::SAX::ExpatXS and XML::LibXML to name a few) 
@@ -1946,6 +2029,12 @@ Verifies that sig is a DSA signature of $msg (or $dgst) produced using
 the private half of the public key given in $key. Requires
 Math::BigInt but doesn't call for any non-perl libraries.
 
+=head2 get_newsbox_html($newsbox_url, $kind)
+
+Retrieves newsbox content from the specified URL.  Content retrieved is
+cached in MT::Session for 24 hours under the key specified in I&lt;$kind&gt;.
+Content will be sanitized based on pre-defined rules.
+
 =head1 AUTHOR &amp; COPYRIGHTS
 
 Please see the I&lt;MT&gt; manpage for author, copyright, and license information.</diff>
      <filename>lib/MT/Util.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Util/Archive.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Util/Archive/Tgz.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Util/Archive/Zip.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/Util/Captcha.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -90,6 +90,7 @@ sub core_archive_types {
                 module_yearly_archives   =&gt; 1,
                 main_template            =&gt; 1,
                 archive_template         =&gt; 1,
+                archive_listing          =&gt; 1,
                 archive_class            =&gt; &quot;datebased-yearly-archive&quot;,
             },
         ),
@@ -115,9 +116,9 @@ sub core_archive_types {
             template_params =&gt; {
                 datebased_only_archive    =&gt; 1,
                 datebased_monthly_archive =&gt; 1,
-                module_monthly_archives   =&gt; 1,
                 main_template             =&gt; 1,
                 archive_template          =&gt; 1,
+                archive_listing           =&gt; 1,
                 archive_class             =&gt; &quot;datebased-monthly-archive&quot;,
             },
         ),
@@ -146,6 +147,7 @@ sub core_archive_types {
                 datebased_weekly_archive =&gt; 1,
                 main_template            =&gt; 1,
                 archive_template         =&gt; 1,
+                archive_listing          =&gt; 1,
                 archive_class            =&gt; &quot;datebased-weekly-archive&quot;,
             },
         ),
@@ -221,9 +223,6 @@ sub core_archive_types {
                 entry_template    =&gt; 1,
                 feedback_template =&gt; 1,
                 archive_class     =&gt; &quot;entry-archive&quot;,
-
-                # module_recent_posts =&gt; 0,
-                # module_monthly_archives =&gt; 0,
             },
         ),
         'Page' =&gt; ArchiveType(
@@ -309,6 +308,7 @@ sub core_archive_types {
                 datebased_daily_archive =&gt; 1,
                 main_template           =&gt; 1,
                 archive_template        =&gt; 1,
+                archive_listing         =&gt; 1,
             },
         ),
         'Category' =&gt; ArchiveType(
@@ -338,7 +338,7 @@ sub core_archive_types {
                 category_archive                   =&gt; 1,
                 main_template                      =&gt; 1,
                 archive_template                   =&gt; 1,
-                module_category_archives           =&gt; 1,
+                archive_listing                    =&gt; 1,
                 'module_category-monthly_archives' =&gt; 1,
             },
         ),
@@ -367,10 +367,10 @@ sub core_archive_types {
             template_params  =&gt; {
                 archive_class                    =&gt; &quot;author-archive&quot;,
                 'module_author-monthly_archives' =&gt; 1,
-                module_author_archives           =&gt; 1,
                 main_template                    =&gt; 1,
                 author_archive                   =&gt; 1,
                 archive_template                 =&gt; 1,
+                archive_listing                  =&gt; 1,
             },
         ),
         'Author-Yearly' =&gt; ArchiveType(
@@ -403,6 +403,7 @@ sub core_archive_types {
                 author_yearly_archive =&gt; 1,
                 main_template         =&gt; 1,
                 archive_template      =&gt; 1,
+                archive_listing       =&gt; 1,
             },
         ),
         'Author-Monthly' =&gt; ArchiveType(
@@ -434,9 +435,9 @@ sub core_archive_types {
                 archive_class                    =&gt; &quot;author-monthly-archive&quot;,
                 author_monthly_archive           =&gt; 1,
                 'module_author-monthly_archives' =&gt; 1,
-                module_author_archives           =&gt; 1,
                 main_template                    =&gt; 1,
                 archive_template                 =&gt; 1,
+                archive_listing                  =&gt; 1,
             },
         ),
         'Author-Weekly' =&gt; ArchiveType(
@@ -469,6 +470,7 @@ sub core_archive_types {
                 author_weekly_archive =&gt; 1,
                 main_template         =&gt; 1,
                 archive_template      =&gt; 1,
+                archive_listing       =&gt; 1,
             },
         ),
         'Author-Daily' =&gt; ArchiveType(
@@ -501,6 +503,7 @@ sub core_archive_types {
                 author_daily_archive =&gt; 1,
                 main_template        =&gt; 1,
                 archive_template     =&gt; 1,
+                archive_listing      =&gt; 1,
             },
         ),
         'Category-Yearly' =&gt; ArchiveType(
@@ -533,6 +536,7 @@ sub core_archive_types {
                 category_yearly_archive =&gt; 1,
                 main_template           =&gt; 1,
                 archive_template        =&gt; 1,
+                archive_listing         =&gt; 1,
             },
         ),
         'Category-Monthly' =&gt; ArchiveType(
@@ -564,9 +568,9 @@ sub core_archive_types {
                 archive_class            =&gt; &quot;category-monthly-archive&quot;,
                 category_monthly_archive =&gt; 1,
                 'module_category-monthly_archives' =&gt; 1,
-                module_category_archives           =&gt; 1,
                 main_template                      =&gt; 1,
                 archive_template                   =&gt; 1,
+                archive_listing                    =&gt; 1,
             },
         ),
         'Category-Daily' =&gt; ArchiveType(
@@ -599,6 +603,7 @@ sub core_archive_types {
                 category_daily_archive =&gt; 1,
                 main_template          =&gt; 1,
                 archive_template       =&gt; 1,
+                archive_listing        =&gt; 1,
             },
         ),
         'Category-Weekly' =&gt; ArchiveType(
@@ -633,6 +638,7 @@ sub core_archive_types {
                 category_weekly_archive =&gt; 1,
                 main_template           =&gt; 1,
                 archive_template        =&gt; 1,
+                archive_listing         =&gt; 1,
             },
         )
     };
@@ -785,9 +791,6 @@ sub rebuild {
     unless ( $param{NoIndexes} ) {
         $mt-&gt;rebuild_indexes( Blog =&gt; $blog ) or return;
     }
-    if ( $mt-&gt;{PublishCommenterIcon} ) {
-        $mt-&gt;make_commenter_icon($blog);
-    }
     1;
 }
 
@@ -877,41 +880,6 @@ sub rebuild_authors {
     1;
 }
 
-sub make_commenter_icon {
-    my $mt   = shift;
-    my $blog = shift;
-    if ( !UNIVERSAL::isa( $blog, 'MT::Blog' ) ) { $blog = shift; }
-    my $identity_link_image = $blog-&gt;site_path . &quot;/nav-commenters.gif&quot;;
-    unless ( -f $identity_link_image ) {
-        my $fmgr = $blog-&gt;file_mgr;
-        unless ( $fmgr-&gt;exists( $blog-&gt;site_path ) ) {
-            $fmgr-&gt;mkpath( $blog-&gt;site_path )
-              or return MT-&gt;trans_error( &quot;Error making path '[_1]': [_2]&quot;,
-                $blog-&gt;site_path, $fmgr-&gt;errstr );
-        }
-        my $nav_commenters_gif =
-          (     q{47494638396116000f00910200504d4b}
-              . q{ffffffffffff00000021f90401000002}
-              . q{002c0000000016000f0000022c948fa9}
-              . q{19e0bf2208b482a866a51723bd75dee1}
-              . q{70e2f83586837ed773a22fd4ba6cede2}
-              . q{241c8f7ceff9e95005003b} );
-        $nav_commenters_gif = pack( &quot;H*&quot;, $nav_commenters_gif );
-        eval {
-            if ( open( TARGET, &quot;&gt;$identity_link_image&quot; ) )
-            {
-                print TARGET $nav_commenters_gif;
-                close TARGET;
-            }
-            else {
-                MT::log( &quot;Couldn't write authenticated commenter icon to &quot;
-                      . $identity_link_image );
-                die;
-            }
-        };
-    }
-}
-
 #   rebuild_entry
 #
 # $mt-&gt;rebuild_entry(Entry =&gt; $entry_id,
@@ -1902,7 +1870,12 @@ sub publish_future_posts {
     require MT::Util;
     my $mt            = MT-&gt;instance;
     my $total_changed = 0;
-    for my $blog ( MT::Blog-&gt;load ) {
+    my @blogs = MT::Blog-&gt;load(undef, {
+        join =&gt; MT::Entry-&gt;join_on('blog_id', {
+            status =&gt; MT::Entry::FUTURE(),
+        }, { unique =&gt; 1 })
+    });
+    foreach my $blog (@blogs) {
         my @ts = MT::Util::offset_time_list( time, $blog );
         my $now = sprintf &quot;%04d%02d%02d%02d%02d%02d&quot;, $ts[5] + 1900, $ts[4] + 1,
           @ts[ 3, 2, 1, 0 ];
@@ -2028,7 +2001,14 @@ sub remove_entry_archive_file {
             die MT-&gt;translate( $blog-&gt;errstr() );
             return $mt-&gt;error( MT-&gt;translate( $blog-&gt;errstr() ) );
         }
+
+        # Run callbacks
+        MT-&gt;run_callbacks( 'pre_delete_archive_file', $file, $at, $entry);
+
         $fmgr-&gt;delete($file);
+
+        # Run callbacks
+        MT-&gt;run_callbacks( 'post_delete_archive_file', $file, $at, $entry);
     }
     1;
 }
@@ -2453,7 +2433,7 @@ sub category_group_iter {
 
     return sub {
         while ( my $c = $iter-&gt;() ) {
-            my $args = [
+            my @arguments = (
                 {
                     blog_id =&gt; $blog_id,
                     status  =&gt; MT::Entry::RELEASE()
@@ -2463,8 +2443,8 @@ sub category_group_iter {
                         'MT::Placement', 'entry_id', { category_id =&gt; $c-&gt;id }
                     ]
                 }
-            ];
-            my $count = MT::Entry-&gt;count( undef, $args );
+            );
+            my $count = MT::Entry-&gt;count( @arguments );
             next unless $count || $args-&gt;{show_empty};
             return ( $count, category =&gt; $c );
         }
@@ -4756,10 +4736,6 @@ The default is C&lt;0&gt; (do not rebuild such templates).
 
 Call L&lt;MT/translate&gt;.
 
-=head2 $mt-&gt;make_commenter_icon
-
-Make sure there is a C&lt;nav-commenters.gif&gt; file under the blog I&lt;site_path&gt;.
-
 =head2 $mt-&gt;remove_entry_archive_file(%param)
 
 Delete the archive files for an entry based on the following</diff>
      <filename>lib/MT/WeblogPublisher.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,18 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::Worker::Publish;
 
 use strict;
 use base qw( TheSchwartz::Worker );
 
 use TheSchwartz::Job;
+use Time::HiRes qw(gettimeofday tv_interval);
 use MT::FileInfo;
 
-
 sub work {
     my $class = shift;
     my TheSchwartz::Job $job = shift;
@@ -25,60 +31,84 @@ sub work {
         }
     }
 
+    my $sync = MT-&gt;config('SyncTarget');
+
     my $throttles = $mt-&gt;{throttle} || {};
-    MT::TheSchwartz-&gt;debug(&quot;Publishing: &quot; . scalar(@jobs) . &quot; files...&quot;);
+    MT::TheSchwartz-&gt;debug($mt-&gt;translate(&quot;Publishing: [quant,_1,file]...&quot;, scalar(@jobs)));
+
+    my $start = [gettimeofday];
+    my $rebuilt = 0;
 
     foreach $job (@jobs) {
         my $fi_id = $job-&gt;uniqkey;
         my $fi = MT::FileInfo-&gt;load($fi_id);
 
-        if ($fi) {
-            # Important: prevents requeuing!
-            $fi-&gt;{from_queue} = 1;
-
-            my $mtime = (stat($fi-&gt;file_path))[9];
-
-            my $throttle = $throttles-&gt;{$fi-&gt;template_id}
-                        || $throttles-&gt;{lc $fi-&gt;archive_type};
-
-            # think about-- throttle by archive type or by template
-            if ($throttle) {
-                if (-f $fi-&gt;file_path) {
-                    my $time = time;
-                    if ($time - $mtime &lt; $throttle) {
-                        # ignore rebuilding this file now; not enough
-                        # time has elapsed for rebuilding this file...
-                        $job-&gt;failed(&quot;Not ready to rebuild file &quot; . $fi-&gt;file_path . &quot; based on throttle rules.&quot;);
-                        next;
-                    }
+        # FileInfo record missing? Strange, but ignore and continue.
+        unless ($fi) {
+            $job-&gt;completed();
+            next;
+        }
+
+        # Important: prevents requeuing!
+        $fi-&gt;{from_queue} = 1;
+
+        my $mtime = (stat($fi-&gt;file_path))[9];
+
+        my $throttle = $throttles-&gt;{$fi-&gt;template_id}
+                    || $throttles-&gt;{lc $fi-&gt;archive_type};
+
+        # think about-- throttle by archive type or by template
+        if ($throttle) {
+            if (-f $fi-&gt;file_path) {
+                my $time = time;
+                if ($time - $mtime &lt; $throttle) {
+                    # ignore rebuilding this file now; not enough
+                    # time has elapsed for rebuilding this file...
+                    $job-&gt;failed(&quot;Not ready to publish file &quot; . $fi-&gt;file_path . &quot; based on throttle rules.&quot;);
+                    next;
                 }
             }
+        }
 
-            ## MT::TheSchwartz-&gt;debug(&quot;Publishing: &quot; . RebuildQueue::Daemon::_summary($fi));
-            my $res = $mt-&gt;publisher-&gt;rebuild_from_fileinfo($fi);
-            if ($res) {
-                if ( MT-&gt;config('SyncTarget') ) {
-                    my $sync_job = TheSchwartz::Job-&gt;new();
-                    $sync_job-&gt;funcname('MT::Worker::Sync');
-                    $sync_job-&gt;uniqkey($fi_id);
-                    $sync_job-&gt;coalesce($job-&gt;coalesce) if $job-&gt;coalesce;
-                    $sync_job-&gt;priority($job-&gt;priority) if $job-&gt;priority;
-                    $job-&gt;replace_with($sync_job);
-                } else {
-                    $job-&gt;completed();
-                }
+        ## MT::TheSchwartz-&gt;debug(&quot;Publishing: &quot; . RebuildQueue::Daemon::_summary($fi));
+        MT::TheSchwartz-&gt;debug(&quot;Publishing file &quot; . $fi-&gt;file_path . &quot;...&quot;);
+        my $res = $mt-&gt;publisher-&gt;rebuild_from_fileinfo($fi);
+        if (defined $res) {
+            if ( $sync ) {
+                my $sync_job = TheSchwartz::Job-&gt;new();
+                $sync_job-&gt;funcname('MT::Worker::Sync');
+                $sync_job-&gt;uniqkey($fi_id);
+                $sync_job-&gt;coalesce($job-&gt;coalesce) if $job-&gt;coalesce;
+                $sync_job-&gt;priority($job-&gt;priority) if $job-&gt;priority;
+                $job-&gt;replace_with($sync_job);
             } else {
-                my $error = $mt-&gt;publisher-&gt;errstr;
-                $job-&gt;permanent_failure(&quot;Error during build: &quot; . $error);
+                $job-&gt;completed();
             }
+            $rebuilt++;
         } else {
-            $job-&gt;completed();
+            my $error = $mt-&gt;publisher-&gt;errstr;
+            my $errmsg = $mt-&gt;translate(&quot;Error rebuilding file [_1]&quot; . $fi-&gt;file_path . &quot;: &quot; . $error);
+            MT::TheSchwartz-&gt;debug($errmsg);
+            $job-&gt;permanent_failure($errmsg);
+            require MT::Log;
+            $mt-&gt;log({
+                ($fi-&gt;blog_id ? ( blog_id =&gt; $fi-&gt;blog_id ) : () ),
+                message =&gt; $errmsg,
+                metadata =&gt; $errmsg . &quot;:\n&quot; . $error,
+                category =&gt; &quot;publish&quot;,
+                level =&gt; MT::Log::ERROR(),
+            });
         }
     }
+
+    if ($rebuilt) {
+        MT::TheSchwartz-&gt;debug($mt-&gt;translate(&quot;-- set complete ([quant,_1,file] in [_2] seconds)&quot;, $rebuilt, sprintf(&quot;%0.02f&quot;, tv_interval($start))));
+    }
+
 }
 
 sub grab_for { 60 }
-sub max_retries { 100000 }
+sub max_retries { 0 }
 sub retry_delay { 60 }
 
 1;</diff>
      <filename>lib/MT/Worker/Publish.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package MT::Worker::Sync;
 
 use strict;
@@ -15,6 +21,7 @@ sub work {
     # Build this
     my $mt = MT-&gt;instance;
 
+    my $rsync_cmd = MT-&gt;config(&quot;RsyncPath&quot;) || &quot;rsync&quot;;
     my $rsync_opt = $mt-&gt;config('RsyncOptions') || '';
     my @targets = $mt-&gt;config('SyncTarget');
 
@@ -46,8 +53,8 @@ sub work {
             }
         } else {
             if (!$fi) {
-                MT::TheSchwartz-&gt;debug(&quot;Warning: couldn't locate fileinfo record id &quot; . $fi_id);
-                $job-&gt;permanent_failure(&quot;FileInfo record &quot; . $fi_id . &quot; not found.&quot;);
+                # Don't know where the FileInfo record went. Oh well.
+                $job-&gt;completed();
             } else {
                 unless (-f $fi-&gt;file_path) {
                     MT::TheSchwartz-&gt;debug(&quot;Warning: couldn't locate file: &quot; . $fi-&gt;file_path);
@@ -66,7 +73,7 @@ sub work {
         print FOUT join(&quot;\n&quot;, @files) . &quot;\n&quot;;
         close FOUT;
         foreach my $target (@targets) {
-            my $cmd = &quot;rsync $rsync_opt --files-from=\&quot;$file\&quot; / \&quot;$target\&quot;&quot;;
+            my $cmd = &quot;$rsync_cmd $rsync_opt --files-from=\&quot;$file\&quot; / \&quot;$target\&quot;&quot;;
             MT::TheSchwartz-&gt;debug(&quot;Syncing files to $target...&quot;);
             my $start = [gettimeofday];
             my $res = system $cmd;
@@ -74,9 +81,17 @@ sub work {
             if ($exit != 0) {
                 # TBD: notification to administrator
                 # At the very least, log to MT activity log.
-                MT::TheSchwartz-&gt;debug(&quot;Error during rsync of files in $file...&quot;);
-                MT::TheSchwartz-&gt;debug(&quot;Command: $cmd&quot;);
-                MT::TheSchwartz-&gt;debug($res);
+                my $errmsg = &quot;Error during rsync of files in $file:\n&quot;
+                    . &quot;Command (exit code $res): $cmd&quot;;
+                MT::TheSchwartz-&gt;debug($errmsg);
+                require MT::Log;
+                $mt-&gt;log({
+                    message =&gt; $errmsg,
+                    metadata =&gt; $errmsg . &quot;\nFiles affected:\n\t&quot; . join(&quot;\n\t&quot;, @files),
+                    category =&gt; &quot;sync&quot;,
+                    level =&gt; MT::Log::ERROR(),
+                });
+
                 $_-&gt;failed(&quot;Error during rsync&quot;) foreach @jobs;
                 return;
             } else {
@@ -94,7 +109,7 @@ sub work {
 }
 
 sub grab_for { 60 }
-sub max_retries { 10000 }
+sub max_retries { 10 }
 sub retry_delay { 60 }
 
 1;</diff>
      <filename>lib/MT/Worker/Sync.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/XMLRPC.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -19,6 +19,7 @@ sub mt_new {
     #$main::server-&gt;serializer-&gt;encoding($mt-&gt;config('PublishCharset'));
     # we need to be UTF-8 here no matter which PublishCharset
     $main::server-&gt;serializer-&gt;encoding('UTF-8');
+    $mt-&gt;run_callbacks('init_app', $mt, {App =&gt; 'xmlrpc'});
     $mt;
 }
 
@@ -160,20 +161,141 @@ sub _publish {
     1;
 }
 
-sub newPost {
+sub _apply_basename {
     my $class = shift;
-    my($appkey, $blog_id, $user, $pass, $item, $publish);
-    if ($class eq 'blogger') {
-        ($appkey, $blog_id, $user, $pass, my($content), $publish) = @_;
-        $item-&gt;{description} = $content;
-    } else {
-        ($blog_id, $user, $pass, $item, $publish) = @_;
+    my ($entry, $item, $param) = @_;
+
+    my $basename = $item-&gt;{mt_basename} || $item-&gt;{wp_slug};
+    if ($param-&gt;{page} &amp;&amp; $item-&gt;{permaLink}) {
+        local $entry-&gt;{column_values}-&gt;{basename} = '##s##';
+        my $real_url = $entry-&gt;archive_url();
+        my ($pre, $post) = split /##s##/, $real_url, 2;
+        
+        my $req_url = $item-&gt;{permaLink};
+        if ($req_url =~ m{ \A \Q$pre\E (.*) \Q$post\E \z }xms) {
+            my $req_base = $1;
+            my @folders = split /\//, $req_base;
+            $basename = pop @folders;
+            $param-&gt;{__permaLink_folders} = \@folders;
+        }
+        else {
+            die _fault(MT-&gt;translate(&quot;Requested permalink '[_1]' is not available for this page&quot;,
+                $req_url));
+        }
+    }
+
+    if (defined $basename) {
+        # Ensure this basename is unique.
+        my $entry_class = ref $entry;
+        my $basename_uses = $entry_class-&gt;count({
+            blog_id  =&gt; $entry-&gt;blog_id,
+            basename =&gt; $basename,
+            ($entry-&gt;id ? ( id =&gt; { op =&gt; '!=', value =&gt; $entry-&gt;id } ) : ()),
+        });
+        if ($basename_uses) {
+            $basename = MT::Util::make_unique_basename($entry);
+        }
+
+        $entry-&gt;basename($basename);
+    }
+
+    1;
+}
+
+sub _save_placements {
+    my $class = shift;
+    my ($entry, $item, $param) = @_;
+
+    my @categories;
+
+    if ($param-&gt;{page}) {
+        if (my $folders = $param-&gt;{__permaLink_folders}) {
+            my $parent_id = 0;
+            my $folder;
+            require MT::Folder;
+            for my $basename (@$folders) {
+                $folder = MT::Folder-&gt;load({
+                    blog_id  =&gt; $entry-&gt;blog_id,
+                    parent   =&gt; $parent_id,
+                    basename =&gt; $basename,
+                });
+
+                if (!$folder) {
+                    # Autovivify the folder tree.
+                    $folder = MT::Folder-&gt;new;
+                    $folder-&gt;blog_id($entry-&gt;blog_id);
+                    $folder-&gt;parent($parent_id);
+                    $folder-&gt;basename($basename);
+                    $folder-&gt;label($basename);
+                    $folder-&gt;save
+                      or die _fault(MT-&gt;translate(&quot;Saving folder failed: [_1]&quot;,
+                        $folder-&gt;errstr));
+                }
+
+                $parent_id = $folder-&gt;id;
+            }
+            @categories = ($folder) if $folder;
+        }
+    }
+    elsif (my $cats = $item-&gt;{categories}) {
+        my $cat_class = MT-&gt;model('category');
+        # The spec says to ignore invalid category names.
+        @categories = grep { defined } $cat_class-&gt;search({
+            blog_id =&gt; $entry-&gt;blog_id,
+            label   =&gt; $cats,
+        });
     }
+
+    require MT::Placement;
+    my $is_primary_placement = 1;
+    CATEGORY: for my $category (@categories) {
+        my $place;
+        if ($is_primary_placement) {
+            $place = MT::Placement-&gt;load({
+                entry_id   =&gt; $entry-&gt;id,
+                is_primary =&gt; 1,
+            });
+        }
+        if (!$place) {
+            $place = MT::Placement-&gt;new;
+            $place-&gt;blog_id($entry-&gt;blog_id);
+            $place-&gt;entry_id($entry-&gt;id);
+            $place-&gt;is_primary($is_primary_placement ? 1 : 0);
+        }
+        $place-&gt;category_id($category-&gt;id);
+        $place-&gt;save
+          or die _fault(MT-&gt;translate(&quot;Saving placement failed: [_1]&quot;,
+            $place-&gt;errstr));
+
+        if ($is_primary_placement) {
+            # Delete all the secondary placements, so each of the remaining
+            # iterations of the loop make a brand new placement.
+            my @old_places = MT::Placement-&gt;load({
+                entry_id =&gt; $entry-&gt;id,
+                is_primary =&gt; 0,
+            });
+            for my $place (@old_places) {
+                $place-&gt;remove;
+            }
+        }
+
+        $is_primary_placement = 0;
+    }
+
+    1;
+}
+
+sub _new_entry {
+    my $class = shift;
+    my %param = @_;
+    my($blog_id, $user, $pass, $item, $publish) =
+        @param{qw( blog_id user pass item publish )};
+    my $obj_type = $param{page} ? 'page' : 'entry';
     die _fault(MT-&gt;translate(&quot;No blog_id&quot;)) unless $blog_id;
     my $mt = MT::XMLRPCServer::Util::mt_new();   ## Will die if MT-&gt;new fails.
     no_utf8($blog_id, values %$item);
     for my $f (qw( title description mt_text_more
-                   mt_excerpt mt_keywords mt_tags mt_basename )) {
+                   mt_excerpt mt_keywords mt_tags mt_basename wp_slug )) {
         next unless defined $item-&gt;{$f}; 
         my $enc = $mt-&gt;{cfg}-&gt;PublishCharset;
         $item-&gt;{$f} = encode_text($item-&gt;{$f}, 'utf-8', $enc);
@@ -188,8 +310,7 @@ sub newPost {
     my($author, $perms) = $class-&gt;_login($user, $pass, $blog_id);
     die _fault(MT-&gt;translate(&quot;Invalid login&quot;)) unless $author;
     die _fault(MT-&gt;translate(&quot;No publishing privileges&quot;)) unless $perms &amp;&amp; $perms-&gt;can_post;
-    require MT::Entry;
-    my $entry = MT::Entry-&gt;new;
+    my $entry = MT-&gt;model($obj_type)-&gt;new;
     my $orig_entry = $entry-&gt;clone;
     $entry-&gt;blog_id($blog_id);
     $entry-&gt;author_id($author-&gt;id);
@@ -210,7 +331,9 @@ sub newPost {
     $entry-&gt;allow_comments($item-&gt;{mt_allow_comments})
         if exists $item-&gt;{mt_allow_comments};
     $entry-&gt;title($item-&gt;{title} || first_n_text($item-&gt;{description}, const('LENGTH_ENTRY_TITLE_FROM_TEXT')));
-    $entry-&gt;basename($item-&gt;{mt_basename}) if $item-&gt;{mt_basename};
+
+    $class-&gt;_apply_basename($entry, $item, \%param);
+
     $entry-&gt;text($item-&gt;{description});
     for my $field (qw( allow_pings )) {
         my $val = $item-&gt;{&quot;mt_$field&quot;};
@@ -244,12 +367,14 @@ sub newPost {
     }
     $entry-&gt;discover_tb_from_entry();
 
-    MT-&gt;run_callbacks('api_pre_save.entry', $mt, $entry, $orig_entry)
+    MT-&gt;run_callbacks(&quot;api_pre_save.$obj_type&quot;, $mt, $entry, $orig_entry)
         || die MT::XMLRPCServer::_fault(MT-&gt;translate(&quot;PreSave failed [_1]&quot;, MT-&gt;errstr));
 
     $entry-&gt;save;
 
-    MT-&gt;run_callbacks('api_post_save.entry', $mt, $entry, $orig_entry);
+    $class-&gt;_save_placements($entry, $item, \%param);
+
+    MT-&gt;run_callbacks(&quot;api_post_save.$obj_type&quot;, $mt, $entry, $orig_entry);
 
     require MT::Log;
     $mt-&gt;log({
@@ -267,20 +392,37 @@ sub newPost {
     SOAP::Data-&gt;type(string =&gt; $entry-&gt;id);
 }
 
-sub editPost {
+sub newPost {
     my $class = shift;
-    my($appkey, $entry_id, $user, $pass, $item, $publish);
+    my($appkey, $blog_id, $user, $pass, $item, $publish);
     if ($class eq 'blogger') {
-        ($appkey, $entry_id, $user, $pass, my($content), $publish) = @_;
+        ($appkey, $blog_id, $user, $pass, my($content), $publish) = @_;
         $item-&gt;{description} = $content;
     } else {
-        ($entry_id, $user, $pass, $item, $publish) = @_;
+        ($blog_id, $user, $pass, $item, $publish) = @_;
     }
+    $class-&gt;_new_entry( blog_id =&gt; $blog_id, user =&gt; $user, pass =&gt; $pass,
+        item =&gt; $item, publish =&gt; $publish );
+}
+
+sub newPage {
+    my $class = shift;
+    my ($blog_id, $user, $pass, $item, $publish) = @_;
+    $class-&gt;_new_entry( blog_id =&gt; $blog_id, user =&gt; $user, pass =&gt; $pass,
+        item =&gt; $item, publish =&gt; $publish, page =&gt; 1 );
+}
+
+sub _edit_entry {
+    my $class = shift;
+    my %param = @_;
+    my ($blog_id, $entry_id, $user, $pass, $item, $publish) =
+        @param{qw( blog_id entry_id user pass item publish )};
+    my $obj_type = $param{page} ? 'page' : 'entry';
     die _fault(MT-&gt;translate(&quot;No entry_id&quot;)) unless $entry_id;
     my $mt = MT::XMLRPCServer::Util::mt_new();   ## Will die if MT-&gt;new fails.
     no_utf8(values %$item);
     for my $f (qw( title description mt_text_more
-                   mt_excerpt mt_keywords mt_tags mt_basename )) {
+                   mt_excerpt mt_keywords mt_tags mt_basename wp_slug )) {
         next unless defined $item-&gt;{$f}; 
         my $enc = $mt-&gt;config('PublishCharset');
         $item-&gt;{$f} = encode_text($item-&gt;{$f}, 'utf-8', $enc);
@@ -289,9 +431,11 @@ sub editPost {
             $item-&gt;{$f} =~ s!&amp;apos;!'!g;  #'
         }
     }
-    require MT::Entry;
-    my $entry = MT::Entry-&gt;load($entry_id)
+    my $entry = MT-&gt;model($obj_type)-&gt;load($entry_id)
         or die _fault(MT-&gt;translate(&quot;Invalid entry ID '[_1]'&quot;, $entry_id));
+    if ($blog_id &amp;&amp; $blog_id != $entry-&gt;blog_id) {
+        die _fault(MT-&gt;translate(&quot;Invalid entry ID '[_1]'&quot;, $entry_id));
+    }
     my($author, $perms) = $class-&gt;_login($user, $pass, $entry-&gt;blog_id);
     die _fault(MT-&gt;translate(&quot;Invalid login&quot;)) unless $author;
     die _fault(MT-&gt;translate(&quot;Not privileged to edit entry&quot;))
@@ -299,7 +443,9 @@ sub editPost {
     my $orig_entry = $entry-&gt;clone;
     $entry-&gt;status(MT::Entry::RELEASE()) if $publish;
     $entry-&gt;title($item-&gt;{title}) if $item-&gt;{title};
-    $entry-&gt;basename($item-&gt;{mt_basename}) if defined $item-&gt;{mt_basename};
+
+    $class-&gt;_apply_basename($entry, $item, \%param);
+
     $entry-&gt;text($item-&gt;{description});
     $entry-&gt;convert_breaks($item-&gt;{mt_convert_breaks})
         if exists $item-&gt;{mt_convert_breaks};
@@ -336,6 +482,8 @@ sub editPost {
 
     $entry-&gt;save;
 
+    $class-&gt;_save_placements($entry, $item, \%param);
+
     MT-&gt;run_callbacks('api_post_save.entry', $mt, $entry, $orig_entry);
 
     require MT::Log;
@@ -353,6 +501,28 @@ sub editPost {
     SOAP::Data-&gt;type(boolean =&gt; 1);
 }
 
+sub editPost {
+    my $class = shift;
+    my($entry_id, $user, $pass, $item, $publish);
+    if ($class eq 'blogger') {
+        (my($appkey), $entry_id, $user, $pass, my($content), $publish) = @_;
+        $item-&gt;{description} = $content;
+    }
+    else {
+        ($entry_id, $user, $pass, $item, $publish) = @_;
+    }
+    $class-&gt;_edit_entry( entry_id =&gt; $entry_id, user =&gt; $user, pass =&gt; $pass,
+        item =&gt; $item, publish =&gt; $publish );
+}
+
+sub editPage {
+    my $class = shift;
+    my($blog_id, $entry_id, $user, $pass, $item, $publish) = @_;
+    $class-&gt;_edit_entry( blog_id =&gt; $blog_id, entry_id =&gt; $entry_id,
+        user =&gt; $user, pass =&gt; $pass, item =&gt; $item, publish =&gt; $publish,
+        page =&gt; 1 );
+}
+
 sub getUsersBlogs {
     my $class;
     if (UNIVERSAL::isa($_[0] =&gt; __PACKAGE__)) {
@@ -400,22 +570,19 @@ sub getUserInfo {
       url =&gt; SOAP::Data-&gt;type(string =&gt; $author-&gt;url) };
 }
 
-sub getRecentPosts {
+sub _get_entries {
     my $class = shift;
-    my($blog_id, $user, $pass, $num, $titles_only);
-    if ($class eq 'blogger') {
-        (my($appkey), $blog_id, $user, $pass, $num, $titles_only) = @_;
-    } else {
-        ($blog_id, $user, $pass, $num, $titles_only) = @_;
-    }
+    my %param = @_;
+    my($blog_id, $user, $pass, $num, $titles_only) =
+        @param{qw( blog_id user pass num titles_only )};
+    my $obj_type = $param{page} ? 'page' : 'entry';
     my $mt = MT::XMLRPCServer::Util::mt_new();   ## Will die if MT-&gt;new fails.
     my($author, $perms) = $class-&gt;_login($user, $pass, $blog_id);
     die _fault(MT-&gt;translate(&quot;Invalid login&quot;)) unless $author;
     die _fault(MT-&gt;translate(&quot;No publishing privileges&quot;)) unless $perms &amp;&amp; $perms-&gt;can_post;
     require MT::Blog;
     my $blog = MT::Blog-&gt;load($blog_id);
-    require MT::Entry;
-    my $iter = MT::Entry-&gt;load_iter({ blog_id =&gt; $blog_id },
+    my $iter = MT-&gt;model($obj_type)-&gt;load_iter({ blog_id =&gt; $blog_id },
         { 'sort' =&gt; 'authored_on',
           direction =&gt; 'descend',
           limit =&gt; $num });
@@ -424,8 +591,9 @@ sub getRecentPosts {
         my $co = sprintf &quot;%04d%02d%02dT%02d:%02d:%02d&quot;,
             unpack 'A4A2A2A2A2A2', $entry-&gt;authored_on;
         my $row = { dateCreated =&gt; SOAP::Data-&gt;type(dateTime =&gt; $co),
-                    userid =&gt; SOAP::Data-&gt;type(string =&gt; $entry-&gt;author_id),
-                    postid =&gt; SOAP::Data-&gt;type(string =&gt; $entry-&gt;id), };
+                    userid =&gt; SOAP::Data-&gt;type(string =&gt; $entry-&gt;author_id) };
+        $row-&gt;{ $param{page} ? 'page_id' : 'postid' } =
+            SOAP::Data-&gt;type(string =&gt; $entry-&gt;id);
         if ($class eq 'blogger') {
             $row-&gt;{content} = SOAP::Data-&gt;type(string =&gt; encode_text($entry-&gt;text, undef, 'utf-8'));
         } else {
@@ -453,21 +621,41 @@ sub getRecentPosts {
     \@res;
 }
 
+sub getRecentPosts {
+    my $class = shift;
+    my ($blog_id, $user, $pass, $num);
+    if ($class eq 'blogger') {
+        (my($appkey), $blog_id, $user, $pass, $num) = @_;
+    }
+    else {
+        ($blog_id, $user, $pass, $num) = @_;
+    }
+    $class-&gt;_get_entries( blog_id =&gt; $blog_id, user =&gt; $user,
+        pass =&gt; $pass, num =&gt; $num );
+}
+
 sub getRecentPostTitles {
-    getRecentPosts(@_, 1);
+    my $class = shift;
+    my ($blog_id, $user, $pass, $num) = @_;
+    $class-&gt;_get_entries( blog_id =&gt; $blog_id, user =&gt; $user,
+        pass =&gt; $pass, num =&gt; $num, titles_only =&gt; 1 );
 }
 
-sub deletePost {
-    my $class;
-    if (UNIVERSAL::isa($_[0] =&gt; __PACKAGE__)) {
-        $class = shift;
-    } else {
-        $class = __PACKAGE__;
-    }
-    my($appkey, $entry_id, $user, $pass, $publish) = @_;
+sub getPages {
+    my $class = shift;
+    my ($blog_id, $user, $pass) = @_;
+    $class-&gt;_get_entries( blog_id =&gt; $blog_id, user =&gt; $user,
+        pass =&gt; $pass, page =&gt; 1 );
+}
+
+sub _delete_entry {
+    my $class = shift;
+    my %param = @_;
+    my ($blog_id, $entry_id, $user, $pass, $publish) =
+        @param{qw( blog_id entry_id user pass publish )};
     my $mt = MT::XMLRPCServer::Util::mt_new();   ## Will die if MT-&gt;new fails.
-    require MT::Entry;
-    my $entry = MT::Entry-&gt;load($entry_id)
+    my $obj_type = $param{page} ? 'page' : 'entry';
+    my $entry = MT-&gt;model($obj_type)-&gt;load($entry_id)
         or die _fault(MT-&gt;translate(&quot;Invalid entry ID '[_1]'&quot;, $entry_id));
     my($author, $perms) = $class-&gt;_login($user, $pass, $entry-&gt;blog_id);
     die _fault(MT-&gt;translate(&quot;Invalid login&quot;)) unless $author;
@@ -480,8 +668,7 @@ sub deletePost {
         level =&gt; MT::Log::INFO(),
         class =&gt; 'system',
         category =&gt; 'delete' 
-   });
-
+    });
 
     if ($publish) {
         $class-&gt;_publish($mt, $entry, 1) or die _fault($class-&gt;errstr);
@@ -489,13 +676,37 @@ sub deletePost {
     SOAP::Data-&gt;type(boolean =&gt; 1);
 }
 
-sub getPost {
+sub deletePost {
+    my $class;
+    if (UNIVERSAL::isa($_[0] =&gt; __PACKAGE__)) {
+        $class = shift;
+    } else {
+        $class = __PACKAGE__;
+    }
+    my($appkey, $entry_id, $user, $pass, $publish) = @_;
+    $class-&gt;_delete_entry( entry_id =&gt; $entry_id, user =&gt; $user,
+        pass =&gt; $pass, publish =&gt; $publish );
+}
+
+sub deletePage {
     my $class = shift;
-    my($entry_id, $user, $pass) = @_;
+    my ($blog_id, $user, $pass, $entry_id) = @_;
+    $class-&gt;_delete_entry( blog_id =&gt; $blog_id, entry_id =&gt; $entry_id,
+        user =&gt; $user, pass =&gt; $pass, publish =&gt; 1, page =&gt; 1 );
+}
+
+sub _get_entry {
+    my $class = shift;
+    my %param = @_;
+    my($blog_id, $entry_id, $user, $pass) =
+        @param{qw( blog_id entry_id user pass )};
+    my $obj_type = $param{page} ? 'page' : 'entry';
     my $mt = MT::XMLRPCServer::Util::mt_new();   ## Will die if MT-&gt;new fails.
-    require MT::Entry;
-    my $entry = MT::Entry-&gt;load($entry_id)
+    my $entry = MT-&gt;model($obj_type)-&gt;load($entry_id)
         or die _fault(MT-&gt;translate(&quot;Invalid entry ID '[_1]'&quot;, $entry_id));
+    if ($blog_id &amp;&amp; $blog_id != $entry-&gt;blog_id) {
+        die _fault(MT-&gt;translate(&quot;Invalid entry ID '[_1]'&quot;, $entry_id));
+    }
     my($author, $perms) = $class-&gt;_login($user, $pass, $entry-&gt;blog_id);
     die _fault(MT-&gt;translate(&quot;Invalid login&quot;)) unless $author;
     die _fault(MT-&gt;translate(&quot;Not privileged to get entry&quot;))
@@ -508,15 +719,29 @@ sub getPost {
     require MT::Tag;
     my $delim = chr($author-&gt;entry_prefs-&gt;{tag_delim});
     my $tags = MT::Tag-&gt;join($delim, $entry-&gt;tags);
+
+    my $cats = [];
+    my $cat_data = $entry-&gt;__load_category_data();
+    if (scalar @$cat_data) {
+        my ($first_cat) = grep {  $_-&gt;[1] } @$cat_data;
+        my @cat_ids     = grep { !$_-&gt;[1] } @$cat_data;
+        unshift @cat_ids, $first_cat if $first_cat;
+        $cats = MT-&gt;model('category')-&gt;lookup_multi(
+            [ map { $_-&gt;[0] } @cat_ids ]);
+    }
+
+    my $basename = SOAP::Data-&gt;type(string =&gt; encode_text($entry-&gt;basename, undef, 'utf-8'));
     {
         dateCreated =&gt; SOAP::Data-&gt;type(dateTime =&gt; $co),
         userid =&gt; SOAP::Data-&gt;type(string =&gt; $entry-&gt;author_id),
-        postid =&gt; SOAP::Data-&gt;type(string =&gt; $entry-&gt;id),
+        ($param{page} ? 'page_id' : 'postid') =&gt; SOAP::Data-&gt;type(string =&gt; $entry-&gt;id),
         description =&gt; SOAP::Data-&gt;type(string =&gt; encode_text($entry-&gt;text, undef, 'utf-8')),
         title =&gt; SOAP::Data-&gt;type(string =&gt; encode_text($entry-&gt;title, undef, 'utf-8')),
-        mt_basename =&gt; SOAP::Data-&gt;type(string =&gt; encode_text($entry-&gt;basename, undef, 'utf-8')),
+        mt_basename =&gt; $basename,
+        wp_slug =&gt; $basename,
         link =&gt; SOAP::Data-&gt;type(string =&gt; $link),
         permaLink =&gt; SOAP::Data-&gt;type(string =&gt; $link),
+        categories =&gt; [ map { SOAP::Data-&gt;type(string =&gt; $_-&gt;label) } @$cats ],
         mt_allow_comments =&gt; SOAP::Data-&gt;type(int =&gt; $entry-&gt;allow_comments),
         mt_allow_pings =&gt; SOAP::Data-&gt;type(int =&gt; $entry-&gt;allow_pings),
         mt_convert_breaks =&gt; SOAP::Data-&gt;type(string =&gt; $entry-&gt;convert_breaks),
@@ -527,6 +752,19 @@ sub getPost {
     }
 }
 
+sub getPost {
+    my $class = shift;
+    my($entry_id, $user, $pass) = @_;
+    $class-&gt;_get_entry( entry_id =&gt; $entry_id, user =&gt; $user, pass =&gt; $pass );
+}
+
+sub getPage {
+    my $class = shift;
+    my ($blog_id, $entry_id, $user, $pass) = @_;
+    $class-&gt;_get_entry( blog_id =&gt; $blog_id, entry_id =&gt; $entry_id,
+        user =&gt; $user, pass =&gt; $pass, page =&gt; 1 );
+}
+
 sub supportedMethods {
     [ 'blogger.newPost', 'blogger.editPost', 'blogger.getRecentPosts',
       'blogger.getUsersBlogs', 'blogger.getUserInfo', 'blogger.deletePost',
@@ -534,6 +772,8 @@ sub supportedMethods {
       'metaWeblog.getRecentPosts', 'metaWeblog.newMediaObject',
       'metaWeblog.getCategories', 'metaWeblog.deletePost',
       'metaWeblog.getUsersBlogs',
+      'wp.newPage', 'wp.getPages', 'wp.getPage', 'wp.editPage',
+      'wp.deletePage',
        # not yet supported: metaWeblog.getTemplate, metaWeblog.setTemplate
       'mt.getCategoryList', 'mt.setPostCategories', 'mt.getPostCategories',
       'mt.getTrackbackPings', 'mt.supportedTextFilters',
@@ -931,6 +1171,9 @@ BEGIN { @metaWeblog::ISA = qw( MT::XMLRPCServer ); }
 package mt;
 BEGIN { @mt::ISA = qw( MT::XMLRPCServer ); }
 
+package wp;
+BEGIN { @wp::ISA = qw( MT::XMLRPCServer ); }
+
 1;
 __END__
 </diff>
      <filename>lib/MT/XMLRPCServer.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more details, consult 
-# your Movable Type license for details.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>lib/MT/default-templates.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-add-notify.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-atom.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -353,7 +353,7 @@ my $ver = $^V ? join('.', unpack 'C*', $^V) : $];
 my $perl_ver_check = '';
 if ($] &lt; 5.006001) {  # our minimal requirement for support
     $perl_ver_check = &lt;&lt;EOT;
-&lt;p class=&quot;warning&quot;&gt;&lt;MT_TRANS phrase=&quot;The version of Perl installed on your server ([_1]) is lower than the minimum supported version ([_2]). While Movable Type may run, it is an &lt;strong&gt;untested and unsupported&lt;/strong&gt; environment.  We &lt;strong&gt;strongly recommend&lt;/strong&gt; upgrading to at least Perl [_2].&quot; params=&quot;$ver%%5.6.1&quot;&gt;&lt;/p&gt;
+&lt;p class=&quot;warning&quot;&gt;&lt;MT_TRANS phrase=&quot;The version of Perl installed on your server ([_1]) is lower than the minimum supported version ([_2]). Please upgrade to at least Perl [_2].&quot; params=&quot;$ver%%5.6.1&quot;&gt;&lt;/p&gt;
 EOT
 }
 my $config_check = '';
@@ -494,20 +494,16 @@ MSG
         } else {
             if ($data) {
                 $dbi_is_okay = 1 if $mod eq 'DBI';
-                if ($mod eq 'DB_File') {
-                    $got_one_data = 1;
-                } elsif ($mod ne 'DBI') {
-                    if ($mod eq 'DBD::mysql') {
-                        if ($DBD::mysql::VERSION == 3.0000) {
-                            print trans_templ(qq{&lt;p class=&quot;warning&quot;&gt;&lt;MT_TRANS phrase=&quot;The DBD::mysql version you have installed is known to be incompatible with Movable Type. Please install the current release available from CPAN.&quot;&gt;&lt;/p&gt;});
-                        }
-                    }
-                    if (!$dbi_is_okay) {
-                        print trans_templ(qq{&lt;p class=&quot;warning&quot;&gt;&lt;MT_TRANS phrase=&quot;The $mod is installed properly, but requires an updated DBI module. Please see note above regarding the DBI module requirements.&quot;&gt;&lt;/p&gt;});
-                    } else {
-                        $got_one_data = 1;
+                if ($mod eq 'DBD::mysql') {
+                    if ($DBD::mysql::VERSION == 3.0000) {
+                        print trans_templ(qq{&lt;p class=&quot;warning&quot;&gt;&lt;MT_TRANS phrase=&quot;The DBD::mysql version you have installed is known to be incompatible with Movable Type. Please install the current release available from CPAN.&quot;&gt;&lt;/p&gt;});
                     }
                 }
+                if (!$dbi_is_okay) {
+                    print trans_templ(qq{&lt;p class=&quot;warning&quot;&gt;&lt;MT_TRANS phrase=&quot;The $mod is installed properly, but requires an updated DBI module. Please see note above regarding the DBI module requirements.&quot;&gt;&lt;/p&gt;});
+                } else {
+                    $got_one_data = 1;
+                }
             }
             print trans_templ(qq{&lt;p class=&quot;installed&quot;&gt;&lt;MT_TRANS phrase=&quot;Your server has [_1] installed (version [_2]).&quot; params=&quot;$mod%%} . $mod-&gt;VERSION . qq{&quot;&gt;&lt;/p&gt;\n\n});
         }</diff>
      <filename>mt-check.cgi.pre</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
   
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-comments.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
   
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-feed.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,8 @@
 #!/usr/bin/perl -w
 
-# Original copyright 2001-2002 Jay Allen.
-# Modifications and integration Copyright 2001-2007 Six Apart.
-# Copyright 2001-2006 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-search.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,7 @@ em {
 
 a:link,
 a:visited {
-    color: #61889b;
+    color: #33789c;
 }
 
 a:hover,
@@ -219,7 +219,7 @@ fieldset {
 }
 
 .input-hint {
-    color:#999999;
+    color:#999;
 }
 
 .msg a.close-me {
@@ -323,7 +323,7 @@ table.show-admin td {
     margin: 0;
 }
 .chromeless-wide #footer .inner {
-    border-top: 1px solid #CCC;
+    border-top: 1px solid #ccc;
     padding-top: 10px;
     margin: 0 18px;
 }
@@ -450,10 +450,10 @@ table.show-admin td {
 .actions-bar .plugin-actions a:link,
 .actions-bar .plugin-actions a:visited,
 .actions-bar .plugin-actions button {
-    color: #306a86 !important;
-    border: 1px solid #93b2bf;
-    border-top-color: #c2cacd;
-    border-left-color: #c2cacd;
+    color: #33789c !important;
+    border: 1px solid #85afc4;
+    border-top-color: #cddee7;
+    border-left-color: #cddee7;
     padding: 1px 2px;
     background: #999 url('../images/buttons/button-list.gif') repeat-x 50% 50%;
     margin: 0 5px 0 0;
@@ -464,7 +464,7 @@ table.show-admin td {
 .system .listing .actions-bar .actions button,
 .system .actions-bar .plugin-actions a,
 .system .actions-bar .plugin-actions button {
-    color: #7b8a35 !important;
+    color: #7f8833 !important;
     border-color: #a2a48d;
     border-top-color: #c9ccb0;
     border-left-color: #c9ccb0;
@@ -496,7 +496,7 @@ table.show-admin td {
 .actions-bar .plugin-actions a:hover,
 .actions-bar .plugin-actions a:active,
 .actions-bar .plugin-actions button:hover {
-    color: #306a86 !important;
+    color: #33789c !important;
     background-position: 50% 30%;
 }
 .system .buttons a:hover,
@@ -508,7 +508,7 @@ table.show-admin td {
 .system .actions-bar .plugin-actions a:hover,
 .system .actions-bar .plugin-actions a:active,
 .system .actions-bar .plugin-actions button:hover {
-    color: #7b8a35 !important;
+    color: #7f8833 !important;
 }
 
 /* Actions Bar Chromeless ---------------------------------------------------------------------------------- */
@@ -530,9 +530,9 @@ table.show-admin td {
 .upgrade .upgrade-process {
     overflow: auto;
     margin: 10px 0;
-    border: 1px solid #CCC;
+    border: 1px solid #ccc;
     padding: 10px;
-    background-color: #F7F7F7;
+    background-color: #fafafa;
     height: 200px;
 }
 </diff>
      <filename>mt-static/css/chromeless.css</filename>
    </modified>
    <modified>
      <diff>@@ -7,10 +7,6 @@ ul.main-nav-list ul a {
     float: left !important;
 }
 
-.object-nav {
-    margin-top: 1em;
-}
-
 .system_check {
     width: 736px; /* scrollbars are wider in IE */
 }
@@ -89,7 +85,8 @@ button.big-button {
 /* In IE, the header block is actually placed at the bottom of the document
    but above the modal dialog iframe; this allows the pulldown menus to
    display above all other elements on the screen */
-.main-screen #content {
+
+.main-screen #content-header {
     margin-top: 120px;
 }
 .main-screen #header {
@@ -98,3 +95,9 @@ button.big-button {
     left: 0px;
     width: 100%;
 }
+
+#editor .editor-header .tab {
+    position: relative;
+    top: 1px;
+    margin-bottom: 0;
+}</diff>
      <filename>mt-static/css/hacks/ie.css</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ body {
 
 a:link,
 a:visited {
-    color: #61889b;
+    color: #33789c;
 }
 
 a:hover,
@@ -24,7 +24,7 @@ a:active {
 
 .system a:hover,
 .system a:active {
-    color: #61889b;
+    color: #33789c;
 }
 
 strong {
@@ -81,30 +81,28 @@ textarea {
 
 select,
 textarea {
-/*    border: 1px solid #5694b6;*/
-/*    background-color: #fafbfd;*/
 }
 
 .inline-nav {
     white-space: nowrap;
-    color: #afb0b2;
+    color: #aaa;
 }
 
 .inline-nav li { /* TODO - use Vox inline list styling */
     display: inline;
-    border-right: 1px solid #afb0b2;
+    border-right: 1px solid #aaa;
     padding: 0 7px;
 }
 
 fieldset {
-    margin-bottom: 2em;
+    margin-bottom: 1em;
 }
 fieldset + .actions-bar {
-    margin-top: -2em;
+/*    margin-top: -2em;*/
 }
 
 iframe {
-    border: 1px solid #C5D3E0;
+    border: 1px solid #cddee7;
 }
 .system iframe {
     border-color: #C1C790;
@@ -123,11 +121,10 @@ iframe {
     font-size: 11px;
 }
 
-/* Page ------------------------------------------------------------ */
+/* Screen ------------------------------------------------------------ */
 
 .main-screen {
     text-align: center;
-/*    height: 100%;*/
 }
 
 #container {
@@ -135,6 +132,7 @@ iframe {
 }
 
 .main-screen #header-inner,
+.main-screen #content-header-inner,
 .main-screen #content-inner,
 .main-screen #footer-inner {
     margin-left: auto;
@@ -150,7 +148,7 @@ iframe {
     position: relative;
 }
 
-.popup-screen #container {
+#container.popup-screen {
     margin: 10px;
 }
 
@@ -226,7 +224,7 @@ iframe {
     white-space: nowrap;
 }
 #utility-nav #user a {
-    color: #FFF;
+    color: #fff;
     margin-left: 25px;
     padding-right: 0;
     padding-left: 0;
@@ -242,7 +240,7 @@ iframe {
 #utility-nav li li span { /* disabled items */
     display: block;
     padding: 2px 10px;
-    color: #888;
+    color: #777;
 }
 
 #system-menu a.nav-menu-link {
@@ -314,7 +312,7 @@ iframe {
 }
 
 #selector-nav-list ul ul span {
-    color: #888;
+    color: #777;
     background-color: #575757;
 }
 
@@ -354,7 +352,7 @@ iframe {
 }
 #selector-nav li.show-nav li a {
     margin: 0 5px;
-    color: #6d7800;
+    color: #606900;
     border-top: 1px solid #fff;
     background: #f3f4de;
 }
@@ -510,17 +508,17 @@ li#config-menu {
 }
 
 #blog-nav a {
-    color: #3d7993;
+    color: #33789c;
     font-size: 13px;
 }
 
 #blog-nav a:hover {
-    color: #e9f0f4;
+    color: #ebf2f5;
 }
 
 #blog-nav li.show-nav a { 
     background-color: #575757;
-    color: #e9f0f4;
+    color: #ebf2f5;
 }
 #blog-nav li.show-nav li a { 
     color: #c2e3f3;
@@ -531,13 +529,13 @@ li#config-menu {
 }
 
 #blog-nav li.show-nav li span {
-    color: #888;
+    color: #777;
     background-color: #575757;
     border-top: 1px solid #424242;
 }
 
 .system #blog-nav a {
-    color: #6d7800;
+    color: #606900;
 }
 
 .system #blog-nav a:hover {
@@ -648,13 +646,56 @@ li#config-menu {
     position: absolute;
     left: 180px;
     white-space: nowrap;
+    color: #fff;
+}
+#modal-search .search-reset:hover {
+    color: #fff;
+    text-decoration: underline;
+}
+
+.display-options-link {
+    float: right;
+}
+
+#content-header-inner {
+    position: relative;
+}
+
+.object-nav {
+    text-align: center;
+    position: absolute;
+    right: 240px;
+    top: 27px;
+}
+.edit-entry .object-nav,
+.edit-asset .object-nav {
+    right: 340px;
+}
+
+.object-nav li {
+    display: inline;
+}
+
+
+
+/* Content Header ---------------------------------------------------------------------------------- */
+
+#content-header {
+    background: #E7F0F6;
+}
+.system #content-header {
+    background: #EAF3D8;
+}
+
+#content-header-inner {
+    padding-top: 18px;
 }
 
 
 /* Footer ---------------------------------------------------------------------------------- */
 
 #footer {
-    border-top: 1px solid #c5d3e0;
+    border-top: 1px solid #cddee7;
     padding-top: 10px;
     background: url('../images/footer-bg.jpg') repeat-x;
 }
@@ -670,13 +711,13 @@ li#config-menu {
 #footer .inline-nav {
     margin-left: -10px;
     white-space: nowrap;
-    color: #afb0b2;
+    color: #aaa;
 }
 
 #footer .inline-nav li {
     display: inline;
     border: 0;
-    border-left: 1px solid #afb0b2;
+    border-left: 1px solid #aaa;
     padding: 0 7px;
 }
 
@@ -691,12 +732,99 @@ li#config-menu {
 /* Content ------------------------------------------------------------ */
 
 .main-screen #content {
-    background: url('../images/content-bg.jpg') repeat-x;
-    padding: 18px 0;
+    background: url('../images/content.jpg') repeat-x;
     min-height: 400px;
 }
 .system #content {
-    background-image: url('../images/content-bg-system.jpg');
+    background-image: url('../images/content-system.jpg');
+}
+
+#main-content-inner {
+    margin: 8px 10px 0;
+}
+#dashboard #main-content-inner {
+    margin-right: 0;
+}
+#edit-entry #main-content-inner,
+#edit-page #main-content-inner {
+    margin-top: 10px;
+}
+.listing-screen #main-content-inner {
+    margin: 0;
+}
+
+.main-screen #content-inner,
+#dashboard #content-inner {
+    padding-top: 5px;
+    margin-bottom: 20px;
+    background: url('../images/content-inner.gif') no-repeat center 0;
+}
+.main-screen .listing-screen #content-inner,
+#dashboard .listing-screen #content-inner {
+    background-image: url('../images/content-inner-listing.gif');
+}
+.system .main-screen #content-inner,
+#dashboard.system #content-inner {
+    background-image: url('../images/content-inner-system.gif');
+}
+.system .listing-screen #content-inner,
+#dashboard.system .listing-screen #content-inner {
+    background-image: url('../images/content-inner-listing-system.gif');
+}
+
+.content-nav #content-inner {
+    background: url('../images/content-inner-tw.gif') no-repeat 175px 0;
+}
+.listing-screen .content-nav #content-inner {
+    background-image: url('../images/content-inner-tw-listing.gif');
+}
+.system .content-nav #content-inner {
+    background-image: url('../images/content-inner-tw-system.gif');
+}
+.system .listing-screen .content-nav #content-inner {
+    background-image: url('../images/content-inner-tw-listing-system.gif');
+}
+
+.related-content #content-inner {
+    background: url('../images/content-inner-twt.gif') no-repeat 175px 0;
+}
+.listing-screen .related-content #content-inner {
+    background-image: url('../images/content-inner-twt-listing.gif');
+}
+.system .related-content #content-inner {
+    background-image: url('../images/content-inner-twt-system.gif');
+}
+.system .listing-screen .related-content #content-inner {
+    background-image: url('../images/content-inner-twt-listing-system.gif');
+}
+
+.related-content-without-content-nav #content-inner {
+    background: url('../images/content-inner-wt.gif') no-repeat center 0;
+}
+.listing-screen .related-content-without-content-nav #content-inner {
+    background-image: url('../images/content-inner-wt-listing.gif');
+}
+.system .related-content-without-content-nav #content-inner {
+    background-image: url('../images/content-inner-wt-system.gif');
+}
+.system .listing-screen .related-content-without-content-nav #content-inner {
+    background-image: url('../images/content-inner-wt-listing-system.gif');
+}
+
+
+#edit-entry #content-inner,
+#edit-page #content-inner,
+#edit-asset #content-inner {
+    background-image: url('../images/content-inner-wm.gif');
+}
+
+#list-blog #main-content,
+#list-group #main-content,
+#list-widget-set #main-content,
+#list-associations #main-content,
+#list-author #main-content,
+#list-role #main-content {
+    padding-top: 5px;
 }
 
 .content-nav #content-nav,
@@ -705,23 +833,16 @@ li#config-menu {
 .related-content #related-content {
     float: left;
 }
-.content-nav #content-header {
-    float: right;
-}
 
 .content-nav #content-nav {
-    width: 130px;
+    width: 140px;
     padding-bottom: 100px; /* taller than content-header */
 }
-.content-nav #content-header,
+
 .content-nav #main-content {
     width: 760px;
-    padding-left: 29px;
-    border-left: 1px solid #c5d3e0;
-}
-.system .content-nav #content-header,
-.system .content-nav #main-content {
-    border-left: 1px solid #c1c790;
+    padding-left: 20px;
+/*    border-left: 1px solid #cddee7;*/
 }
 
 .related-content #main-content {
@@ -730,18 +851,25 @@ li#config-menu {
 .related-content-without-content-nav #main-content {
     width: 700px;
 }
+.edit-entry .related-content-without-content-nav #main-content,
+.edit-asset .related-content-without-content-nav #main-content {
+    width: 600px;
+}
 .related-content #related-content {
     width: 220px;
 }
+.edit-entry .related-content #related-content,
+.edit-asset .related-content #related-content {
+    width: 320px;
+}
 
 .main-screen #main-content {
     min-height: 300px;
 }
 
 .dashboard #main-content {
-    margin-top: 15px;
-    margin-left: 15px;
-    width: 567px;
+    margin-top: 8px;
+    width: 587px;
 }
 .dashboard #related-content {
     margin-top: 15px;
@@ -749,12 +877,24 @@ li#config-menu {
 }
 
 .main-screen #content-header h2 {
-    margin: 0 0 20px;
+    margin: 0 0 10px;
     padding: 0;
     font-size: 24px;
     font-weight: normal;
     line-height: 1;
 }
+.content-nav #content-header h2,
+.content-nav .action-link-list {
+    margin-left: 140px;
+    padding-left: 20px;
+}
+.content-nav .msg {
+    margin-left: 160px;
+}
+.content-nav .msg-info {
+    margin-left: 0px;
+}
+
 
 /* Tabs ---------------------------------------------------------------------------------- */
 
@@ -798,7 +938,8 @@ li#config-menu {
 /* Content Nav ---------------------------------------------------------------------------------- */
 
 #content-nav {
-    margin: 1.5em 0 0;
+    position: relative;
+    top: -38px;
 }
 
 #content-nav ul li {
@@ -823,7 +964,7 @@ li#config-menu {
     font-weight: bold;
 }
 .system #content-nav ul li.active a {
-    background: url('../images/content-nav-arrow-system.gif') no-repeat right center;
+    background-image: url('../images/content-nav-arrow-system.gif');
 }
 
 /* Related Content ---------------------------------------------------------------------------------- */
@@ -832,12 +973,8 @@ li#config-menu {
     margin-left: 20px;
 }
 
-.widget {
-    background: #fff;
-}
-
 .widget-label {
-    padding: 4px 10px;
+    padding: 4px 0;
 }
 .widget-content-inner {
     padding: 7px 10px 10px;
@@ -865,38 +1002,120 @@ li#config-menu {
 }
 
 .widget-header {
-    background: #fff url(../images/widget/related-content-header-bg.gif) repeat-x left bottom;
-    border: 1px solid #e7eff3;
-    border-width: 1px 0;
+    margin: 0 10px;
+    border-bottom: 1px solid #e7eff3;
 }
-.widget:first-child .widget-header {
-    border-top: none;
+#dashboard .widget-header {
+    margin: 0;
 }
 
-.widget:first-child .widget-header-inner {
-    background: url(../images/widget/related-content-tl.gif) no-repeat left top;
+/* Status Widget */
+
+.stats-widget .widget-header {
+    display: none;
 }
 
-.widget:first-child .widget-label {
-    background: url(../images/widget/related-content-tr.gif) no-repeat right top;
+.stats-widget .object-status {
+    background: #000 url('../images/status-widget-bar-top.gif') no-repeat;
+    text-align: right;
 }
 
-/* Display Options Widget */
+.stats-widget .object-status ul {
+    background: transparent url('../images/status-widget-bar-bottom.gif') no-repeat center bottom;
+    padding: 3px 8px 0;
+    margin-bottom: 0;
+}
 
-#display-options-widget .widget-header a {
-    background: url(../images/spinner-right.gif) no-repeat left center;
-    padding-left: 11px;
+.stats-widget .object-status li {
+    display: inline;
 }
-#display-options-widget.active .widget-header a {
-    background-image: url(../images/spinner-bottom.gif);
+
+.stats-widget .object-status-detail {
+    float: left;
 }
 
-#display-options-widget .widget-content {
-    display: none;
+.stats-widget .view-entry-link {
+    background: transparent url('../images/divider.gif') no-repeat left center;
+    padding: 0 10px;
 }
 
-#display-options-widget.active .widget-content {
-    display: block;
+.stats-widget .object-status,
+.stats-widget .object-status a,
+.stats-widget .object-status a:hover {
+    color: #fff;
+}
+
+
+.object-stats {
+    clear: both;
+}
+
+.comments-link a,
+.pings-link a {
+    padding-left: 20px;
+    background-position: left center;
+    background-repeat: no-repeat;
+}
+
+.comments-link a {
+    background-image: url('../images/nav_icons/color/comments.gif');
+}
+
+.pings-link a {
+    background-image: url('../images/nav_icons/color/trackbacks.gif');
+}
+
+.stats-widget .object-stats li {
+    padding: 3px 5px;
+    border-bottom: 1px dashed #cddee7;
+}
+
+#manage-link {
+    margin: 0 10px;
+    border: 1px solid #cddee7;
+    border-width: 0 1px;
+    padding: 0 10px;
+    white-space: nowrap;
+}
+
+.object-nav span {
+    color: #666;
+}
+#previous-link a,
+#previous-link span {
+    padding-left: 14px;
+    background: transparent url('../images/arrow-left-gray.gif') no-repeat left center;
+}
+#previous-link a {
+    background-image: url('../images/arrow-left-blue.gif');
+}
+#previous-link a:hover {
+    background-image: url('../images/arrow-left-green.gif');
+}
+#next-link a,
+#next-link span {
+    padding-right: 14px;
+    background: transparent url('../images/arrow-right-gray.gif') no-repeat right center;
+}
+#next-link a {
+    background-image: url('../images/arrow-right-blue.gif');
+}
+#next-link a:hover {
+    background-image: url('../images/arrow-right-green.gif');
+}
+
+
+/* Display Options Widget */
+
+#display-options-widget {
+    position: absolute;
+    z-index: 99998;
+    left: -1000px;
+    top: -1000px;
+    text-align: left;
+    background-color: #fff;
+    border: 1px solid #cddee7;
+    width: 180px;
 }
 
 #entryfield-options li .cb,
@@ -908,6 +1127,8 @@ li#config-menu {
     margin-bottom: .25em;
 }
 
+/* Quickfilters widget */
+
 #quickfilters .widget-content-inner {
     padding-left: 0;
 }
@@ -941,6 +1162,10 @@ li#config-menu {
     padding-top: 0;
 }
 
+.dashboard .widget-label {
+    padding: 4px 10px;
+}
+
 .dashboard .user-pic {
     float: left;
     width: 50px;
@@ -1010,7 +1235,7 @@ li#config-menu {
 }
 
 .dashboard .blog_stats-widget .widget-content {
-    border-left: 1px solid #f5f7f9;
+    border-left: 1px solid #f3f6f9;
 }
 
 .dashboard .blog_stats-widget .widget-footer {
@@ -1118,7 +1343,7 @@ li#config-menu {
     color: #000;
 }
 .dashboard .entry h4 a:hover {
-    color: #61889b;
+    color: #33789c;
 }
 
 .dashboard .entry-odd {
@@ -1313,15 +1538,6 @@ li#config-menu {
         margin-bottom: .75em;
     }
 
-/* Dashboard ---------------------------------------------------------------------------------- */
-
-#dashboard #content-inner {
-    background: url(../images/dashboard-bg.gif) no-repeat center 38px;
-}
-#dashboard.system #content-inner {
-    background-image: url(../images/dashboard-bg-system.gif);
-}
-
 /* Forms ---------------------------------------------------------------------------------- */
 
 .full-width {
@@ -1371,12 +1587,13 @@ textarea.tall {
 
 fieldset h3 {
     margin-top: 0;
+    margin-bottom: 1em;
+    border-bottom: 1px solid #cddee7;
+    padding-bottom: .25em;
 }
 
 .field {
-    margin-bottom: .75em;
-    border-bottom: 1px solid #c5d3e0;
-    padding-bottom: .75em;
+    margin-bottom: 1.5em;
 }
 .system .field {
     border-color: #C1C790;
@@ -1386,6 +1603,7 @@ fieldset h3 {
     display: block;
     font-weight: bold;
     margin-top: 2px;
+    color: #777;
 }
 
 .field-left-label .field-header {
@@ -1444,7 +1662,7 @@ fieldset h3 {
 
 .textarea-wrapper {
     border: 1px solid #ccc;
-    background-color: #FFF;
+    background-color: #fff;
     padding: 0 4px;
 }
 
@@ -1463,20 +1681,43 @@ fieldset h3 {
 .actions-bar-top, 
 .actions-bar-bottom { 
     display: none;
-} 
+}
+.listing-screen .actions-bar-top, 
+.listing-screen .actions-bar-bottom { 
+    background-color: #f3f6f9;
+}
 .show-actions-bar-top .actions-bar-top { 
     display: block; 
 } 
 .show-actions-bar-bottom .actions-bar-bottom { 
     display: block; 
 }
+
+.actions-bar-top {
+    padding-bottom: .5em;
+    border-bottom: 1px solid #cddee7;
+}
+.actions-bar-bottom {
+    padding-top: .5em;
+    border-top: 1px solid #cddee7;
+}
+.system .actions-bar {
+    border-color: #c1c1c1;
+}
+
+.edit-entry .actions-bar-top,
+.edit-entry .actions-bar-bottom {
+    padding: 0;
+    border: none;
+}
+
 .search-replace .actions-bar-top, 
 .search-replace .actions-bar-bottom { 
     display: block; 
 }
 .edit-entry .actions-bar-bottom { 
     margin-bottom: .75em;
-} 
+}
 
 .settings-actions-bar .actions-bar-inner {
     margin-left: 130px;
@@ -1612,10 +1853,10 @@ button.primary-button:hover {
 .actions-bar .plugin-actions a:link,
 .actions-bar .plugin-actions a:visited,
 .actions-bar .plugin-actions button {
-    color: #306a86 !important;
-    border: 1px solid #93b2bf;
-    border-top-color: #c2cacd;
-    border-left-color: #c2cacd;
+    color: #33789c !important;
+    border: 1px solid #85afc4;
+    border-top-color: #cddee7;
+    border-left-color: #cddee7;
     padding: 1px 2px;
     background: #999 url('../images/buttons/button-list.gif') repeat-x 50% 50%;
     margin: 0 5px 0 0;
@@ -1626,7 +1867,7 @@ button.primary-button:hover {
 .system .listing .actions-bar .actions button,
 .system .actions-bar .plugin-actions a,
 .system .actions-bar .plugin-actions button {
-    color: #7b8a35 !important;
+    color: #7f8833 !important;
     border-color: #a2a48d;
     border-top-color: #c9ccb0;
     border-left-color: #c9ccb0;
@@ -1658,7 +1899,7 @@ button.primary-button:hover {
 .actions-bar .plugin-actions a:hover,
 .actions-bar .plugin-actions a:active,
 .actions-bar .plugin-actions button:hover {
-    color: #306a86 !important;
+    color: #33789c !important;
     background-position: 50% 30%;
 }
 .system .buttons a:hover,
@@ -1670,7 +1911,7 @@ button.primary-button:hover {
 .system .actions-bar .plugin-actions a:hover,
 .system .actions-bar .plugin-actions a:active,
 .system .actions-bar .plugin-actions button:hover {
-    color: #7b8a35 !important;
+    color: #7f8833 !important;
 }
 
 .listing .delete {
@@ -1740,23 +1981,11 @@ optgroup option {
 
 /* Listing ---------------------------------------------------------------------------------- */
 
-.listing {
-    border: 1px solid #c5d3e0;
-}
-.system .listing {
-    border-color: #c1c1c1;
-}
-.dialog .listing {
-    border: none;
-}
-
 .listing table {
     width: 100%;
     margin: 0;
     border: 0;
     padding: 0;
-    border: 1px solid #c5d3e0;
-    border-width: 1px 0;
 }
 .system .listing table {
     border-color: #c1c1c1;
@@ -1795,8 +2024,8 @@ optgroup option {
 }
 
 .listing th {
-    border-bottom-color: #c5d3e0;
-    border-left: 1px solid #cfdae5;
+    border-bottom-color: #cddee7;
+    border-left: 1px solid #cddee7;
     padding-left: 5px;
     color: #333;
     font-weight: bold;
@@ -1953,7 +2182,7 @@ optgroup option {
 .detail-inner {
     margin-top: -4px;
     margin-left: 4px;
-    border-left: 1px solid #c5d3e0;
+    border-left: 1px solid #cddee7;
     padding-left: 10px;
 }
 
@@ -2002,7 +2231,71 @@ optgroup option {
 
 /* list asset */
 
-.asset-preview {
+.asset-listing-table .as-file-size {
+    white-space: nowrap;
+}
+
+#asset-listing-table .asset-thumb {
+    height: 75px;
+    width: 75px;
+    border: 2px solid #CCC;
+    background: #EEE url(../images/asset/file.gif) no-repeat center center;
+}
+#asset-listing-table .asset-thumb { background-image: url(../images/asset/file.gif); }
+#asset-listing-table .asset-type-image .asset-thumb { background-image: url(../images/asset/image.gif); }
+#asset-listing-table .asset-type-audio .asset-thumb { background-image: url(../images/asset/audio.gif); }
+#asset-listing-table .asset-type-video .asset-thumb { background-image: url(../images/asset/video.gif); }
+
+#asset-listing-table .status-missing .asset-thumb { background-image: url(../images/asset/file-warning.gif); }
+#asset-listing-table .status-missing .asset-type-image .asset-thumb { background-image: url(../images/asset/image-warning.gif); }
+#asset-listing-table .status-missing .asset-type-audio .asset-thumb { background-image: url(../images/asset/audio-warning.gif); }
+#asset-listing-table .status-missing .asset-type-video .asset-thumb { background-image: url(../images/asset/video-warning.gif); }
+
+#asset-listing-table .asset-thumbnail .asset-thumb {
+    position: relative;
+    height: 79px;
+    width: 79px;
+    background: #000;
+    border: none;
+}
+
+#asset-listing-table .asset-no-thumbnail .asset-thumb a {
+    display: block;
+    height: 75px;
+}
+#asset-listing-table .asset-thumb a span {
+    display: none;
+}
+
+#asset-listing-table .status-missing .as-asset-type {
+    background: url(../images/status_icons/warning.gif) no-repeat left center;
+    padding-left: 15px;
+}
+
+.asset-image {
+    background-image: url(../images/asset-image.gif);
+}
+
+#asset-listing-table .asset-thumb-innner {
+    margin: 2px;
+}
+
+.asset-listing-table .as-file-status .asset-preview-link {
+    position: absolute;
+    bottom: 0;
+    right: 0;
+    width: 18px;
+    height: 18px;
+    background: transparent url(../images/preview.gif) no-repeat;
+}
+.asset-listing-table .as-file-status .asset-preview-link a:hover {
+    text-decoration: none;
+}
+.asset-listing-table .as-file-status .asset-preview-link span {
+    display: none;
+}
+
+.listing .asset-preview {
     display: none;
     position: relative;
     top: -45px;
@@ -2011,25 +2304,25 @@ optgroup option {
 .dialog .asset-preview {
     position: absolute;
     top: 1px;
-    left: 238px;
-    width: 370px;
+    left: 348px;
+    width: 260px;
     height: 302px;
     border: 1px solid #D7E3F5;
     border-width: 0 1px 1px;
     background-color: #000;
 }
 
-.asset-preview-inner {
+.listing .asset-preview-inner {
     position: absolute;
     background-color: #000;
     padding: 10px;
-    width: 350px;
+    width: 260px;
     z-index: 5;
     overflow: hidden;
 }
 .dialog .asset-preview-inner {
     position: static;
-    width: 350px;
+    width: 260px;
 }
 
 .listing tbody tr td .asset-preview,
@@ -2037,15 +2330,15 @@ optgroup option {
     color: #fff;
 }
 
-.asset-preview .asset-preview-inner a:link,
-.asset-preview .asset-preview-inner a:visited,
-.asset-preview .asset-preview-inner a:hover,
-.asset-preview .asset-preview-inner a:active {
-    color: #61889b;
+.listing .asset-preview .asset-preview-inner a:link,
+.listing .asset-preview .asset-preview-inner a:visited,
+.listing .asset-preview .asset-preview-inner a:hover,
+.listing .asset-preview .asset-preview-inner a:active {
+    color: #33789c;
     text-decoration: none;
 }
 
-.asset-preview .close-preview-link {
+.listing .asset-preview .close-preview-link {
     position: absolute;
     top: 0;
     right: 0;
@@ -2057,17 +2350,26 @@ optgroup option {
     color: #999;
     text-decoration: none;
 }
-.asset-preview .close-preview-link span {
+.listing .asset-preview .close-preview-link span {
     display: none;
 }
 
-.asset-preview-title {
+.listing .asset-preview-image {
+    overflow: hidden;
+    margin-bottom: 5px;
+}
+
+.listing .asset-preview-title {
     overflow: hidden;
     color: #c2e3f3;
     line-height: 1.3;
     font-size: 16px;
     font-weight: bold;
 }
+.dialog .listing .asset-preview-title {
+    white-space: nowrap;
+    display: none;
+}
 
 .asset-icon {
     height: 146px;
@@ -2122,7 +2424,7 @@ optgroup option {
 .log-listing-table .detail-inner {
     border-left: 1px solid #ccc;
     padding-left: 10px;
-    color: #444;
+    color: #424242;
     width: 650px;
     max-height: 200px;
     overflow: scroll;
@@ -2216,16 +2518,9 @@ optgroup option {
 /* filter */
 
 .listing-filter {
-    background: #000 url(../images/listing/filter-tl.gif) no-repeat left top;
     color: #fff;
-}
-.listing-filter-inner {
-    background: url(../images/listing/filter-tr.gif) no-repeat right top;
     padding: 5px 10px;
 }
-.listing-filter-inner-empty {
-    padding: 3px;
-}
 
             #filter-mode-all,
             #filter-mode-only {
@@ -2303,15 +2598,6 @@ optgroup option {
     margin-left: 90px;
 }
 
-.edit-entry #entry-nav .inline-nav {
-    margin-bottom: 5px;
-}
-
-.edit-entry #entry-nav #next-link,
-.edit-entry #entry-nav .view-entry-link {
-    border-right: none;
-}
-
 .edit-entry #title-field, 
 .edit-entry #entry-body-field {
     border-bottom: none;
@@ -2323,7 +2609,7 @@ optgroup option {
 }
 
 .edit-entry #title-field #title {
-    width: 691px;
+    width: 561px;
     padding: 2px 2px 1px;
     font-size: 18px;
     font-weight:bold;
@@ -2331,31 +2617,35 @@ optgroup option {
 
 #editor {
     clear: both;
-    background: #ccc;
 }
 
 #editor .editor-header .tab {
     float: left;
-    width: 100px;
-    margin: 4px 0 0 4px;
-    margin-bottom: -1px; /*use value of -1 for IE6 if necessary when final editor installed*/
-    padding: 2px 0;
-    border-bottom-width: 0;
-    background-color: #b3b3b3;
+    margin: 4px 4px -1px 0;
+    padding: 4px 10px;
+    background-color: #f3f3f3;
     font-weight: bold;
     text-align: center;
+    text-transform: uppercase;
+    font-size: 11px;
 }
 
 #editor .editor-header .selected-tab {
-    background-color: #f3f3f3;
+    border: 1px solid #b8b8b8;
+    border-bottom-width: 0;
 }
 
 #editor .editor-header .tab a {
-    color: #fff;
+    color: #777;
+}
+
+#editor .editor-header .tab a:hover {
+    color: #33789c;
 }
 
-#editor .editor-header .selected-tab a {
-    color: #293a43;
+#editor .editor-header .selected-tab a,
+#editor .editor-header .selected-tab a:hover {
+    color: #000;
 }
 
 #field-convert_breaks {
@@ -2373,12 +2663,6 @@ optgroup option {
 
 #editor-content {
     border-bottom: 1px solid #fff; /* hack - safari */
-    margin-bottom: 1em;
-}
-
-.edit-entry fieldset {
-    border-top: 2px solid #c5d3e0;
-    padding: 0 10px;
 }
 
 .edit-entry .main-content .field {
@@ -2386,24 +2670,7 @@ optgroup option {
 }
 
 .edit-entry fieldset h3 {
-    font-weight: normal;
-    text-transform: uppercase;
-    background: #fff;
-    display: inline;
-    position: relative;
-    bottom: .85em;
-    padding: 0 5px;
-    font-size: 13px;
-}
-
-#publishing-field,
-#feedback-field {
-    float: left;
-    width: 315px;
-}
-
-#publishing-field {
-    margin-right: 30px;
+    display: none;
 }
 
 #sent-tb {
@@ -2417,7 +2684,7 @@ optgroup option {
 
 #basename-field .field-content input {
     border: 1px solid #ccc;
-    background-color: #FFF;
+    background-color: #fff;
 }
 
 #basename-field .field-content input,
@@ -2452,9 +2719,11 @@ optgroup option {
     float: left;
 }
 
-.entry-date,
+.entry-date {
+    width: 43%;
+}
 .entry-time {
-    width: 80px;
+    width: 33%;
 }
 
 .date-picker {
@@ -2489,7 +2758,7 @@ optgroup option {
 
 #tags_completion .complete-highlight {
     color: #fff;
-    background-color: #8faebe;
+    background-color: #85afc4;
 }
 
 .edit-entry .button-actions { float: left; }
@@ -2497,7 +2766,7 @@ optgroup option {
 
 .edit-entry .main-content .actions-bar {
     clear: both;
-    border-top: 1px solid #c5d3e0;
+    border-top: 1px solid #cddee7;
     padding-top: 10px;
 }
 
@@ -2508,10 +2777,6 @@ optgroup option {
 .edit-entry .actions-bar-bottom {
     margin-top: .75em;
 }
-.create-new .actions-bar-bottom {
-/*    border: none;*/
-/*    padding-top: 0;*/
-}
 
 .edit-entry .create-new .actions-bar-top {
     border-width: 0;
@@ -2526,6 +2791,11 @@ optgroup option {
     line-height: 2;
 }
 
+.edit-entry .field {
+    border-bottom: 0;
+    padding-bottom: 0;
+}
+
 
 /* Preview Entry ---------------------------------------------------------------------------------- */
 
@@ -2570,7 +2840,7 @@ body.preview-screen {
 }
 
 .edit-template #title-field #title {
-    width: 691px;
+    width: 671px;
     padding: 2px 2px 1px;
     font-size: 18px;
     font-weight:bold;
@@ -2583,6 +2853,10 @@ body.preview-screen {
     background: #f3f3f3;
 }
 
+.edit-template .listing {
+    border: 1px solid #cddee7;
+}
+
 .edit-template .actions-bar-top {
     margin-bottom: .75em;
 }
@@ -2624,6 +2898,99 @@ body.preview-screen {
     display: none;
 }
 
+/* Edit Asset ---------------------------------------------------------------------------------- */
+
+.edit-asset #main-content .asset-preview {
+    float: right;
+    width: 260px;
+    text-align: center;
+}
+
+.edit-asset #main-content .asset-thumb {
+    height: 256px;
+    width: 256px;
+    border: 2px solid #CCC;
+    background: #EEE url(../images/asset/file.gif) no-repeat center center;
+}
+.edit-asset #main-content .asset-thumb { background-image: url(../images/asset/file.gif); }
+.edit-asset #main-content .asset-type-image .asset-thumb { background-image: url(../images/asset/image.gif); }
+.edit-asset #main-content .asset-type-audio .asset-thumb { background-image: url(../images/asset/audio.gif); }
+.edit-asset #main-content .asset-type-video .asset-thumb { background-image: url(../images/asset/video.gif); }
+
+.edit-asset #main-content .status-missing .asset-thumb { background-image: url(../images/asset/file-warning.gif); }
+.edit-asset #main-content .status-missing .asset-type-image .asset-thumb { background-image: url(../images/asset/image-warning.gif); }
+.edit-asset #main-content .status-missing .asset-type-audio .asset-thumb { background-image: url(../images/asset/audio-warning.gif); }
+.edit-asset #main-content .status-missing .asset-type-video .asset-thumb { background-image: url(../images/asset/video-warning.gif); }
+
+.edit-asset #main-content .asset-thumbnail .asset-thumb {
+    float: right;
+    height: 260px;
+    width: 260px;
+    margin-bottom: .75em;
+    background: #000;
+    border: none;
+}
+.edit-asset #main-content .asset-thumb-inner {
+    height: 240px;
+    margin: 10px;
+    overflow: hidden;
+}
+
+.edit-asset #main-content .asset-thumb span {
+    display: none;
+}
+.edit-asset #main-content .asset-thumb .asset-missing-msg {
+    display: inline;
+    background: url(../images/status_icons/warning.gif) no-repeat left center;
+    padding-left: 15px;
+}
+
+.edit-asset #main-content .asset-thumb-metadata {
+    margin-top: .75em;
+}
+
+
+.edit-asset #main-content .asset-metadata {
+    float: left;
+    width: 300px;
+}
+
+.edit-asset #related-content .asset {
+    clear: left;
+    margin-bottom: 8px;
+    border-bottom: 1px dashed #cddee7;
+    padding-bottom: 4px;
+}
+
+.edit-asset #related-content .asset * {
+    font-size: 11px;
+}
+
+.edit-asset #related-content .asset-preview {
+    float: left;
+    margin: 3px 10px 10px 0;
+    border: 2px solid #000;
+    width: 79px;
+    background-color: #000;
+    text-align: center;
+}
+
+.edit-asset #related-content .asset .asset-metadata {
+    margin-left: 94px;
+/*    overflow: hidden;*/
+}
+
+.edit-asset #url-field .field-content {
+    overflow: hidden;
+}
+
+.asset-embed input {
+    width: 240px;
+}
+
+.edit-asset .actions-bar {
+    clear: both;
+}
 
 /* Edit Role ---------------------------------------------------------------------------------- */
 
@@ -2635,7 +3002,7 @@ body.preview-screen {
 #permission-list .field {
     margin-top: 1em;
     padding-bottom: .5em;
-    border-bottom: 1px solid #8faebe;
+    border-bottom: 1px solid #85afc4;
 }
 
 /* Tools ---------------------------------------------------------------------------------- */
@@ -2656,7 +3023,7 @@ body.preview-screen {
 .search-replace .tabs {
     height: 22px;
     margin: 10px 0;
-    border-bottom: 1px solid #c5d3e0;
+    border-bottom: 1px solid #cddee7;
     width: 100%;
 }
 
@@ -2675,7 +3042,7 @@ body.preview-screen {
 }
 
 .search-replace .tabs .yah {
-    background: #CEDCF0 url(../images/tab-bg-yah.gif) repeat-x;
+    background: #cddee7 url(../images/tab-bg-yah.gif) repeat-x;
 }
 
 .search-replace .tabs .yah a {
@@ -2684,7 +3051,7 @@ body.preview-screen {
 
                         .search-replace .search-bar {
                             margin: -10px 0 10px 0;
-                            border-bottom: 1px solid #c5d3e0;
+                            border-bottom: 1px solid #cddee7;
                             padding: 15px 0 15px 150px;
                             font-size: 11px;
                             background-color: #fff;
@@ -2767,7 +3134,7 @@ body.preview-screen {
 
                         .search-replace .advanced-options {
                             margin: -10px 0 10px 0;
-                            border-bottom: 1px solid #CEDCF0;
+                            border-bottom: 1px solid #cddee7;
                             padding: 10px 0 5px 0;
                             text-align: left;
                             background-color: #fff;
@@ -2833,7 +3200,7 @@ body.preview-screen {
     top: 2em;
     left: 0;
     width: 300px;
-    border: 1px solid #c6d4e0;
+    border: 1px solid #cddee7;
     background-color: #f3f6f9;
     z-index: 6;
 }
@@ -2868,7 +3235,7 @@ body.preview-screen {
 }
 
 .category-selector-list {
-    border: 1px solid #c6d4e0;
+    border: 1px solid #cddee7;
     background: #fff;
     height: 200px;
     overflow: scroll;
@@ -2972,14 +3339,9 @@ body.preview-screen {
     display: none;
 }
 
-.add-new-category-link {
-    float: right;
-    padding-left: 11px;
-    background: url(../images/status_icons/create.gif) no-repeat left center;
-}
-
+.add-new-category-link,
 .change-folder-link {
-    float: left;
+    float: right;
     padding-left: 11px;
     background: url(../images/status_icons/create.gif) no-repeat left center;
 }
@@ -3003,10 +3365,28 @@ body.preview-screen {
     background-position: right center;
 }
 
-.icon-right-wide { padding-right: 15px; }
-.icon-left-wide { padding-left: 15px; }
-.icon-right-xwide { padding-right: 20px; }
-.icon-left-xwide { padding-left: 20px; }
+.icon-left-wide {
+    padding-left: 15px;
+    background-repeat: no-repeat;
+    background-position: left center;
+}
+.icon-right-wide {
+    padding-right: 15px;
+    background-repeat: no-repeat;
+    background-position: right center;
+}
+
+.icon-left-xwide {
+    padding-left: 20px;
+    background-repeat: no-repeat;
+    background-position: left center;
+}
+.icon-right-xwide {
+    padding-right: 20px;
+    background-repeat: no-repeat;
+    background-position: right center;
+}
+
 
 .icon-batch { background-image: url('../images/status_icons/batch.gif'); }
 .icon-feed { background-image: url('../images/status_icons/feed.gif'); }
@@ -3027,13 +3407,23 @@ body.preview-screen {
 .icon-draft { background-image: url('../images/status_icons/draft.gif'); }
 .icon-future { background-image: url('../images/status_icons/future.gif'); }
 .icon-pending { background-image: url('../images/status_icons/warning.gif'); }
+.icon-share { background-image: url('../images/status_icons/share.gif');}
+
+.edit-entry .stats-widget .icon-success { background-image: url('../images/status_icons/success-k.gif'); }
+.edit-entry .stats-widget .icon-view { background-image: url('../images/status_icons/view-k.gif'); }
+.edit-entry .stats-widget .icon-draft { background-image: url('../images/status_icons/draft-k.gif'); }
+.edit-entry .stats-widget .icon-future { background-image: url('../images/status_icons/future-k.gif'); }
+.edit-entry .stats-widget .icon-pending { background-image: url('../images/status_icons/warning-k.gif'); }
 
 .icon-plugins { background-image: url('../images/nav_icons/color/plugins.gif'); }
 .icon-search { background-image: url('../images/nav_icons/color/search.gif'); }
 .icon-trackbacks { background-image: url('../images/nav_icons/color/trackbacks.gif'); }
+.icon-comments { background-image: url('../images/nav_icons/color/comments.gif'); }
 .icon-log { background-image: url('../images/nav_icons/color/log.gif'); }
 .icon-import { background-image: url('../images/nav_icons/color/import.gif'); }
 .icon-settings { background-image: url('../images/nav_icons/color/settings.gif'); }
+.icon-entry { background-image: url('../images/nav_icons/color/entry.gif'); }
+.icon-page { background-image: url('../images/nav_icons/color/page.gif'); }
 
 .icon-user { background-image: url('../images/nav_icons/color/user.gif'); }
 .icon-group { background-image: url('../images/nav_icons/color/group.gif'); }
@@ -3069,21 +3459,25 @@ body.preview-screen {
     background-position: right center;
 }
 
-.icon-mini-comments     { background-image: url('../images/nav_icons/mini/comments.gif'); }
-.icon-mini-docs         { background-image: url('../images/nav_icons/mini/docs.gif'); }
 .icon-mini-view-site    { background-image: url('../images/nav_icons/mini/view-site.gif'); }
-.icon-mini-templates    { background-image: url('../images/nav_icons/mini/templates.gif'); }
 .icon-mini-settings     { background-image: url('../images/nav_icons/mini/settings.gif'); }
 .icon-mini-delete       { background-image: url('../images/nav_icons/mini/delete.gif'); }
-.icon-mini-trackbacks   { background-image: url('../images/nav_icons/mini/trackbacks.gif'); }
 .icon-mini-rebuild      { background-image: url('../images/nav_icons/mini/rebuild.gif'); }
 .icon-mini-dashboard    { background-image: url('../images/nav_icons/mini/dashboard.gif'); }
-.icon-mini-new-entry    { background-image: url('../images/nav_icons/mini/entry-new.gif'); }
-.icon-mini-new-page     { background-image: url('../images/nav_icons/mini/page-new.gif'); }
-.icon-mini-new-asset    { background-image: url('../images/nav_icons/mini/asset-new.gif'); }
+
+.icon-mini-templates    { background-image: url('../images/nav_icons/mini/templates.gif'); }
+.icon-mini-comments     { background-image: url('../images/nav_icons/mini/comments.gif'); }
+.icon-mini-docs         { background-image: url('../images/nav_icons/mini/docs.gif'); }
+.icon-mini-trackbacks   { background-image: url('../images/nav_icons/mini/trackbacks.gif'); }
+
 .icon-mini-entries      { background-image: url('../images/nav_icons/mini/entries.gif'); }
+.icon-mini-new-entry    { background-image: url('../images/nav_icons/mini/entry-new.gif'); }
+
 .icon-mini-pages        { background-image: url('../images/nav_icons/mini/pages.gif'); }
+.icon-mini-new-page     { background-image: url('../images/nav_icons/mini/page-new.gif'); }
+
 .icon-mini-assets       { background-image: url('../images/nav_icons/mini/assets.png'); }
+.icon-mini-new-asset    { background-image: url('../images/nav_icons/mini/asset-new.gif'); }
 
 .icon-mini-delete span { display: none; }
 
@@ -3165,7 +3559,7 @@ body.preview-screen {
 }
 
 .resizer {
-    background: #C5C5C5 url(../images/resize.png) no-repeat scroll center 4px;
+    background: #c5c5c5 url(../images/resize.png) no-repeat scroll center 4px;
     -moz-user-select: none;
     bottom: 0;
     left: 0;
@@ -3207,7 +3601,7 @@ body.preview-screen {
 
 body.dialog {
     margin: 20px 25px 25px;
-    background: url('../images/content-bg.jpg') repeat-x;
+    background: url('../images/content.jpg') repeat-x;
 }
 
 .dialog #container {
@@ -3281,7 +3675,7 @@ body.dialog {
 }
 
 #new_entry_prefs {
-    border: 1px solid #c5d3e0;
+    border: 1px solid #cddee7;
     background-color: #f3f6f9;
     padding: 10px;
     position: relative;
@@ -3362,7 +3756,7 @@ body.dialog {
 .dialog .selected-items .items a:link,
 .dialog .selected-items .items a:visited { 
     text-decoration: none;
-    color: #26566e;
+    color: #33789c;
     padding-left: 4px;
     padding-right: 4px;
 }
@@ -3371,20 +3765,20 @@ body.dialog {
 .dialog .selected-items .items a:hover {
     cursor: pointer;
     text-decoration: none;
-    color: #FFF;
-    background-color: #8faebe;
+    color: #fff;
+    background-color: #85afc4;
     padding-left: 4px;
     padding-right: 4px;
 }
 
 .dialog .selected-items .items a:link .remove,
 .dialog .selected-items .items a:visited .remove {
-    color: #FFF;
+    color: #fff;
 }
 
 .dialog .selected-items .items a:hover .remove,
 .dialog .selected-items .items a:active .remove { 
-    color: #26566e;
+    color: #33789c;
 }
 
 /* Search Bar */
@@ -3392,11 +3786,21 @@ body.dialog {
 .dialog .listing-filter {
     height: 30px;
     overflow: hidden;
+    background: #000 url(../images/listing/filter-tl.gif) no-repeat left top;
+    color: #fff;
+    padding: 0;
 }
 .dialog .listing-filter-inner {
-    padding: 0 10px;
+    background: url(../images/listing/filter-tr.gif) no-repeat right top;
+    padding: 5px 10px;
+}
+.dialog .listing-filter-inner-empty {
+    padding: 3px;
 }
 
+
+
+
 .dialog .listing-filter input {
     font-size: 11px;
 }
@@ -3407,7 +3811,7 @@ body.dialog {
     overflow: auto;
     overflow-x: hidden;
     overflow-y: auto;
-    border: 1px solid #c5d3e0;
+    border: 1px solid #cddee7;
     border-width: 0 1px 1px;
     font-size: 11px;
 }
@@ -3421,7 +3825,7 @@ body.dialog {
     overflow: auto;
     overflow-x: hidden;
     overflow-y: auto;
-    border: 1px solid #c5d3e0;
+    border: 1px solid #cddee7;
     border-width: 0 1px 1px;
 }
 
@@ -3430,7 +3834,7 @@ body.dialog {
 }
 
 .insert-asset-dialog .condensed .list-data-wrapper-modal { 
-    width: 238px; 
+    width: 348px; 
     border-width: 0 1px 1px;
 }
 
@@ -3537,7 +3941,7 @@ body.dialog {
 .edit-comment .comment-status-unapproved,
 .edit-ping .ping-status-unapproved,
 .edit-author .user-status-pending {
-    background: #ffff87;
+    background: #ff9;
 }
 
 .edit-comment .comment-status-spam,
@@ -3646,6 +4050,12 @@ body.dialog {
     text-decoration: none;
 }
 
+#allow_pings-field,
+#allow_comments-field {
+    background-color: #f3f6f9;
+    padding: 1em 0;
+    
+}
 
 /* Plugin Settings ---------------------------------------------------------------------------------- */
 
@@ -3744,14 +4154,14 @@ body.dialog {
     background-position: 10px center;
 }
 #list-plugins .plugin-tabs-list li.selected-tab a {
-    border-bottom: 3px solid #c5d3e0;
+    border-bottom: 3px solid #cddee7;
 }
 #list-plugins.system .plugin-tabs-list li.selected-tab a {
     border-bottom-color: #c1c790;
 }
 
 #list-plugins .plugin-tabs-content {
-    border: 1px solid #c5d3e0;
+    border: 1px solid #cddee7;
     border-width: 1px 0 0;
 /*    background: #f3f6f9;*/
     padding: 10px 10px;
@@ -3778,7 +4188,7 @@ body.dialog {
 .edit-author ul.inline-list li {
     float: left;
     white-space: nowrap;
-    margin-right: 30px;
+    width: 175px;
 }
 
 
@@ -3813,9 +4223,9 @@ body.dialog {
 .import-process {
     overflow: auto;
     margin: 0 0 10px;
-    border: 1px solid #c5d3e0;
+    border: 1px solid #cddee7;
     padding: 10px;
-    background-color: #F7F7F7;
+    background-color: #fafafa;
     height: 258px;
     width: 738px;
 }
@@ -3842,7 +4252,7 @@ body.dialog {
 .restore-confirm-publishing-config .restore-publishing-paths {
     overflow: auto;
     height: 353px;
-    border: 1px solid #c5d3e0;
+    border: 1px solid #cddee7;
     padding: 10px 20px;
 }
 
@@ -3850,31 +4260,31 @@ body.dialog {
 
 .calendar {
     background:white none repeat scroll 0%;
-    border:1px solid #999999;
+    border:1px solid #999;
     padding:6px;
     position:absolute;
     width:160px;
 }
 
 .calendar-content {
-    border:1px solid #3399CC;
+    border:1px solid #33789c;
 }
 
 .calendar-month {
-    background-color:#3399CC;
+    background-color:#33789c;
     padding:2px 8px;
     text-align:center;
 }
 
 .calendar-month a {
-    color:#FFFFFF;
+    color:#fff;
     font-size:12px;
     line-height: 0.8;
     text-decoration:none;
 }
 
 .calendar-month h1 {
-    color:#FFFFFF;
+    color:#fff;
     font-size:10px;
     font-weight:bold;
     margin:0pt;
@@ -3886,9 +4296,9 @@ body.dialog {
 
 .calendar-week li, .calendar-days li {
     -moz-user-select:none;
-    background-color:#F2F7FB;
-    border:1px solid #FFFFFF;
-    color:#333333;
+    background-color:#f3f6f9;
+    border:1px solid #fff;
+    color:#333;
     float:left;
     font-size:11px;
     text-align:center;
@@ -3896,25 +4306,25 @@ body.dialog {
 }
 
 .calendar-days li {
-    background-color:#FFFFFF;
+    background-color:#fff;
 }
 
 .calendar-days li.today {
-    border-color:#3399CC;
+    border-color:#33789c;
 }
 
 .calendar-days li.future {
-    color:#CCCCCC;
+    color:#ccc;
     cursor:default;
     padding:1px 0pt;
 }
 
 .calendar-days li.selected {
-    border-color:#000000;
+    border-color:#000;
 }
 
 .calendar-days li a {
-    color:#333333;
+    color:#333;
     display:block;
     padding:1px;
     text-decoration:none;
@@ -4011,7 +4421,7 @@ body.dialog {
 .codepress-toolbar a.command-toggle-codepress-on,
 .codepress-toolbar a.command-toggle-codepress-on:hover {
     margin-right: 0;
-    border-right: 1px solid #b2b2b2;
+    border-right: 1px solid #999;
     background-position: 0 0;
 }
 
@@ -4025,3 +4435,32 @@ body.dialog {
 .setting-advanced {
     display: none;
 }
+
+/* Beta icon and message ------------------------------------------------------------------------------------- */
+
+#brand {
+    padding-right: 45px;
+    background: transparent url(../images/beta_icons/beta_icon.png) right center no-repeat;
+}
+
+.system #brand {
+    background-image: url(../images/beta_icons/beta_icon_system.png);
+}
+
+#msg-beta {
+    border-top: 1px solid #CDDEE7;
+    background-color: #ff9;
+}
+
+#msg-beta-inner {
+    width: 875px;
+    padding: 0.8em 0 0.8em 45px;
+    margin: 0 auto;
+    background: transparent url(../images/beta_icons/beta_icon.png) left center no-repeat;
+    text-align: left;
+}
+
+.system #msg-beta-inner {
+    background-image: url(../images/beta_icons/beta_icon_system.png);
+}
+</diff>
      <filename>mt-static/css/structure.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
-
+/*
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+*/
 
 App.singletonConstructor =
 MT.App = new Class( MT.App, {
@@ -295,6 +301,12 @@ MT.App.Editor.Iframe = new Class( Editor.Iframe, {
         }
     },
 
+    eventKeyUp: function( event ) {
+        /* safari always makes this event. ignore for language input method */
+        if ( this.isWebKit ) {
+            return false;
+        }
+    },
 
     extendedExecCommand: function( command, userInterface, argument ) {
         switch( command ) {</diff>
      <filename>mt-static/js/archetype_editor.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,11 @@
+/*
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+*/
+
 /* for showing, hiding, and displaying asset details */
 
 /* assign to an element when using a modal dialog, ie:
@@ -117,7 +125,7 @@ function waitForLoad(id) {
 function showPage(id) {
 
     /* display popup panel showing details of selected asset */
-    detailRowClass.className = 'selected';
+    DOM.addClassName( detailRowClass, 'selected' );
     var detail = getByID(&quot;asset-&quot; + id + &quot;-preview&quot;);
     var detail_inner = getByID(&quot;asset-&quot; + id + &quot;-preview-inner&quot;);
     var asset = assets[id];
@@ -132,8 +140,8 @@ function showPage(id) {
     var close = trans('Close');
     var close_link = &quot;&lt;a href=\&quot;javascript:void(0)\&quot; onclick=\&quot;toggleAssetDetails('&quot; + id + &quot;'); notOpened('&quot; + id + &quot;');\&quot; class=\&quot;close-preview-link\&quot;&gt;&lt;span&gt;&quot; + close + &quot;&lt;/span&gt;&amp;nbsp;&lt;/a&gt;&quot;;
     var preview;
-    if (asset.thumbnail_url) {
-        preview = &quot;&lt;img src=\&quot;&quot; + asset.thumbnail_url + &quot;\&quot; class=\&quot;preview\&quot; /&gt;&quot;;
+    if (asset.preview_url) {
+        preview = &quot;&lt;img src=\&quot;&quot; + asset.preview_url + &quot;\&quot; class=\&quot;preview\&quot; /&gt;&quot;;
     } else {
         ext = asset.ext;
         var icons = (&quot;doc,eps,fla,gif,jpg,mp3,mpg,pdf,png,ppt,psd,txt,xls,zip&quot;);</diff>
      <filename>mt-static/js/assetdetail.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,11 @@
+/*
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+*/
+
 /* requires js/common/Core.js to be loaded first */
 
 Dialog = {};</diff>
      <filename>mt-static/js/dialog.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
-
+/*
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+*/
 
 App.singletonConstructor =
 MT.App = new Class( MT.App, {
@@ -148,7 +154,7 @@ MT.App = new Class( MT.App, {
     },
 
     
-    setEditorIframeHTML: function( html ) {
+    setEditorIframeHTML: function() {
         this.editor.setHTML( this.editorInput[ app.currentEditor ].value );
         this.editor.setMode( &quot;iframe&quot; );
         this.editor.iframe.focus();</diff>
      <filename>mt-static/js/edit.js</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@ function FlashTag(src, width, height)
     this.src       = src;
     this.width     = width;
     this.height    = height;
-    this.version   = '7,0,14,0';
+    this.version   = '8,0,0,0';
     this.id        = null;
     this.bgcolor   = 'ffffff';
     this.flashVars = null;</diff>
      <filename>mt-static/js/flash/FlashTag.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2004 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2004-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/alert.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2004 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2004-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 /*</diff>
      <filename>mt-static/js/tc/autocomplete.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/benchmark.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003-2007 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 
@@ -67,8 +68,12 @@ TC.Client.call = function( param )
                     param['error']( c, c.responseText, param );
                 else
                     alert( 'Error: [' + c.status + '] ' + c.responseText );
-            } else if( param['load'] )
-                param['load']( c, c.responseText, param );
+            } else if( param['load'] ) {
+                if ( c.responseText.charAt(0) == '/' )
+                    param['load']( c, c.responseText.substr( 2, ( c.responseText.length - 4 ) ), param );
+                else 
+                    param['load']( c, c.responseText, param );
+            }
         }
     };
     var contents = null;</diff>
      <filename>mt-static/js/tc/client.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/colorpicker.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/cookie.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/focus.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/frankencode.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/gestalt.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/mixer.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/mixer/display.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/mixer/tagmatch.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/preview.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/spellcheck.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003-2007 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/tableselect.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2004 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2004-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 /*</diff>
      <filename>mt-static/js/tc/tagcomplete.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/window.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 /*
-Copyright 2003 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.
-
-$Id$
+# Movable Type (r) Open Source (C) 2003-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 </diff>
      <filename>mt-static/js/tc/wordselect.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 /*
-Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-permission from www.sixapart.com.  For more information, consult your
-Movable Type license.
-
-$Id$
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 */
 
 var pager;
@@ -189,7 +189,7 @@ function updateWidget(id) {
     var args = DOM.getFormData( f );
     args['json'] = '1';
     TC.Client.call({
-        'load': function(c) { updatedWidget(id, c); },
+        'load': function(c, responseText) { updatedWidget(id, responseText); },
         'error': function() { showMsg(&quot;Error updating widget.&quot;, &quot;widget-updated&quot;, &quot;alert&quot;); },
         'method': 'POST',
         'uri': ScriptURI,
@@ -198,11 +198,11 @@ function updateWidget(id) {
     return false;
 }
 
-function updatedWidget(id, c) {
+function updatedWidget(id, responseText) {
     var el = TC.elementOrId(id);
     var result;
     try {
-        result = eval('(' + c.responseText + ')');
+        result = eval('(' + responseText + ')');
     } catch(e) {
         showMsg(&quot;Error updating widget.&quot;, &quot;widget-updated&quot;, &quot;alert&quot;);
         return;
@@ -1315,7 +1315,8 @@ MT.App = new Class( App, {
 
     initComponents: function() {
         arguments.callee.applySuper( this, arguments );
-                    
+        this.openFlyouts = [];
+
         this.setDelegate( &quot;navMenu&quot;, new this.constructor.NavMenu() );
 
         this.initFormElements();
@@ -1461,8 +1462,23 @@ MT.App = new Class( App, {
     },
 
 
+    closeFlyouts: function( target ) {
+        var flyout;
+        var es = Array.fromPseudo( this.openFlyouts );
+        for ( var i = 0, len = es.length; i &lt; len; i++ ) {
+            if ( ( flyout = DOM.getElement( es[ i ] ) ) ) {
+                if ( DOM.hasAncestor( target, flyout ) )
+                    continue;
+                DOM.addClassName( flyout, &quot;hidden&quot; );
+                this.openFlyouts.remove( es[ i ] );
+            }
+        }
+    },
+
+
     eventClick: function( event ) {
         var command = this.getMouseEventCommand( event );
+
         switch( command ) {
             
             case &quot;openSelectBlog&quot;:
@@ -1486,7 +1502,31 @@ MT.App = new Class( App, {
                 this.cpeList.forEach( function( cpe ) { cpe.toggleOff( true ); } );
                 break;
 
+            case &quot;openFlyout&quot;:
+                var name = event.commandElement.getAttribute( &quot;mt:flyout&quot; );
+                var el = DOM.getElement( name );
+                if ( !defined( el ) )
+                    return;
+
+                this.closeFlyouts( event.target );
+
+                DOM.removeClassName( el, &quot;hidden&quot; );
+                this.targetElement = event.target;
+                this.applyAutolayouts( el );
+                this.targetElement = null;
+
+                this.openFlyouts.add( name );
+
+                break;
+                
+            case &quot;closeFlyout&quot;:
+                this.closeFlyouts();
+                
+                break;
+
             default:
+                this.closeFlyouts( event.target );
+
                 var form = DOM.getFirstAncestorByTagName( event.target, &quot;form&quot;, true );
                 if ( !form )
                     return;
@@ -2332,12 +2372,13 @@ MT.App.CodePress = new Class( Object, {
         if ( !this.editor )
             return;
         log('setting autosave data on: '+this.textarea.name);
-        data[ this.textarea.name ] = this.editor.getCode();
+        data[ this.textarea.name ] = this.getCode();
     },
 
     
     getCode: function() {
-        return this.textarea.disabled ? this.editor.getCode() : this.textarea.value;
+        var code = this.textarea.disabled ? this.editor.getCode() : this.textarea.value;
+        return document.all ? code.replace( /\r$/, '' ) : code;
     },
 
 
@@ -2490,7 +2531,7 @@ function showDropDown() {
 
 function setBarPosition(radio) {
     var mode = radio.value ? radio.value.toLowerCase() : radio;
-    var c = TC.elementOrId('container');
+    var c = TC.elementOrId('container-inner');
     var s = &quot;show-actions-bar-&quot;;
     if (mode == 'bottom') {
         TC.removeClassName(c, s + &quot;top&quot;);
@@ -2503,3 +2544,8 @@ function setBarPosition(radio) {
         TC.removeClassName(c, s + &quot;bottom&quot;);
     }
 }
+
+function selectAll(id) {
+    DOM.getElement( id ).focus();
+    DOM.getElement( id ).select();
+}</diff>
      <filename>mt-static/mt.js</filename>
    </modified>
    <modified>
      <diff>@@ -285,13 +285,13 @@ h2
     position: absolute;
     left: 0;
     top: 0;
-    width: 160px;
+    width: 150px;
 }
 
 #templates-wrapper
 {
     position: absolute;
-    left: 170px;
+    left: 161px;
     top: 0;
     width: 440px;
     height: 450px;
@@ -300,7 +300,7 @@ h2
 #details-wrapper
 {
     position: absolute;
-    left: 618px;
+    left: 600px;
     top: 0;
     width: 300px;
 }</diff>
      <filename>mt-static/plugins/StyleCatcher/templates.css</filename>
    </modified>
    <modified>
      <diff>@@ -428,12 +428,12 @@ ul { list-style: disc outside; }
     margin-bottom: 5px;
 }
 
-.widget-cloud .widget-list {
+.widget-tag-cloud .widget-list {
     margin-right: 0;
     margin-left: 0;
 }
 
-.widget-cloud .widget-list-item {
+.widget-tag-cloud .widget-list-item {
     display: inline;
     margin: 0 5px 0 0;
     padding: 0;
@@ -441,23 +441,23 @@ ul { list-style: disc outside; }
     background: none;
 }
 
-.widget-cloud .rank-1  { font-size: 1.75em; }
-.widget-cloud .rank-2  { font-size: 1.75em; }
-.widget-cloud .rank-3  { font-size: 1.625em; }
-.widget-cloud .rank-4  { font-size: 1.5em; }
-.widget-cloud .rank-5  { font-size: 1.375em; }
-.widget-cloud .rank-6  { font-size: 1.25em; }
-.widget-cloud .rank-7  { font-size: 1.125em; }
-.widget-cloud .rank-8  { font-size: 1em; }
-.widget-cloud .rank-9  { font-size: 0.95em; }
-.widget-cloud .rank-10 { font-size: 0.9em; }
+.widget-tag-cloud .rank-1  { font-size: 1.75em; }
+.widget-tag-cloud .rank-2  { font-size: 1.75em; }
+.widget-tag-cloud .rank-3  { font-size: 1.625em; }
+.widget-tag-cloud .rank-4  { font-size: 1.5em; }
+.widget-tag-cloud .rank-5  { font-size: 1.375em; }
+.widget-tag-cloud .rank-6  { font-size: 1.25em; }
+.widget-tag-cloud .rank-7  { font-size: 1.125em; }
+.widget-tag-cloud .rank-8  { font-size: 1em; }
+.widget-tag-cloud .rank-9  { font-size: 0.95em; }
+.widget-tag-cloud .rank-10 { font-size: 0.9em; }
 
 #footer .widget-content {
     margin-top: 0;
     margin-bottom: 0;
 }
 
-.widget-assets .widget-content .widget-list {
+.widget-recent-assets .widget-content .widget-list {
     overflow: auto;
     margin-right: 0;
 }
@@ -481,3 +481,10 @@ ul { list-style: disc outside; }
 .input-default {
     background-color: #9AAEC2;
 }
+
+@media print {
+    * {
+        position: static ! important;
+        overflow: visible ! important;
+    }
+}</diff>
      <filename>mt-static/themes-base/blog.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-tb.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-testbg.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-upgrade.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-view.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
-  
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt-wizard.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
 
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -34,6 +34,6 @@ use vars qw($server);
     ## the soap-&gt;action
     local $SIG{__WARN__} = sub { };
     $server = XMLRPC::Transport::HTTP::CGI-&gt;new;
-    $server-&gt;dispatch_to('blogger', 'metaWeblog', 'mt');
+    $server-&gt;dispatch_to('blogger', 'metaWeblog', 'mt', 'wp');
     $server-&gt;handle;
 }</diff>
      <filename>mt-xmlrpc.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
-  
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>mt.cgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
 &lt;?php
+# Movable Type (r) (C) 2001-2007 Six Apart, Ltd. All Rights Reserved.
+# This code cannot be redistributed without permission from www.sixapart.com.
+# For more information, consult your Movable Type license.
+#
+# $Id$
 
 	// ==================================================================
 	//  Author: Justin Vincent (justin@visunet.ie)
@@ -47,14 +52,14 @@
 
 		function db($dbuser, $dbpassword, $dbname, $dbhost)
 		{
-			$this-&gt;dbh = @mssql_connect($dbhost, $dbuser, $dbpassword);
-						
-			if ( ! $this-&gt;dbh )	{
-				$this-&gt;print_error(&quot;&lt;ol&gt;&lt;b&gt;Error establishing a database connection!&lt;/b&gt;&lt;li&gt;Are you sure you have the correct user/password?&lt;li&gt;Are you sure that you have typed the correct hostname?&lt;li&gt;Are you sure that the database server is running?&lt;/ol&gt;&quot;);
-			}
-
-
-			$this-&gt;select($dbname);
+			$this-&gt;dbh = @mssql_connect($dbhost, $dbuser, $dbpassword);
+						
+			if ( ! $this-&gt;dbh )	{
+				$this-&gt;print_error(&quot;&lt;ol&gt;&lt;b&gt;Error establishing a database connection!&lt;/b&gt;&lt;li&gt;Are you sure you have the correct user/password?&lt;li&gt;Are you sure that you have typed the correct hostname?&lt;li&gt;Are you sure that the database server is running?&lt;/ol&gt;&quot;);
+			}
+
+
+			$this-&gt;select(&quot;[$dbname]&quot;);
 			
 		}
 
@@ -63,29 +68,32 @@
 
 		function select($db)
 		{
-			mssql_select_db ($db);
+			if ( FALSE == mssql_select_db ($db) ) {
+                $this-&gt;print_error(&quot;&lt;ol&gt;&lt;b&gt;Error establishing a database connection!&lt;/b&gt;&lt;li&gt;Are you sure you have the correct user/password?&lt;li&gt;Are you sure that you have typed the correct hostname?&lt;li&gt;Are you sure that the database server is running?&lt;/ol&gt;&quot;);
+                die;
+            }
 		}
 
 		// ====================================================================
 		//	Format a string correctly for safe insert under all PHP conditions
 		
-		function escape($str)
-		{
-			
+		function escape($str)
+		{
+			
 			// This deals with quote escaping
 			$str = str_replace(&quot;'&quot;,&quot;''&quot;,str_replace(&quot;\'&quot;,&quot;'&quot;,$str));
-
+
 			// These values need to be escaped for ms sql
-			$escape = array ( &quot;\n&quot;=&gt;&quot;\\\\012&quot;,&quot;\r&quot;=&gt;&quot;\\\\015&quot;);
-	
+			$escape = array ( &quot;\n&quot;=&gt;&quot;\\\\012&quot;,&quot;\r&quot;=&gt;&quot;\\\\015&quot;);
+	
 			// Firstly unescape
 			foreach ( $escape as $match =&gt; $replace )
 			{
 				$str = str_replace($match,$replace,$str);
 			}
-
+
 			return $str;
-				
+				
 		}
 
 		// ==================================================================
@@ -167,16 +175,16 @@
 			$this-&gt;last_query = $query;
 
 			// Perform the query via std mssql_query function..
-			$this-&gt;result = @mssql_query($query, $this-&gt;dbh);
+			$this-&gt;result = @mssql_query($query, $this-&gt;dbh);
 			$this-&gt;num_queries++;
-			
-			// Unfortunately, PHP fuctions for MS SQL currently don't offer a decent way
-			// to retrieve errors from MS SQL
-			// Make sure not to run a query between the actual query and this one !
-				
-			$get_errorcode = &quot;SELECT @@ERROR as errorcode&quot;;
-			$error_res = @mssql_query($get_errorcode, $this-&gt;dbh);
-			$errorcode = @mssql_result($error_res, 0, &quot;errorcode&quot;);
+			
+			// Unfortunately, PHP fuctions for MS SQL currently don't offer a decent way
+			// to retrieve errors from MS SQL
+			// Make sure not to run a query between the actual query and this one !
+				
+			$get_errorcode = &quot;SELECT @@ERROR as errorcode&quot;;
+			$error_res = @mssql_query($get_errorcode, $this-&gt;dbh);
+			$errorcode = @mssql_result($error_res, 0, &quot;errorcode&quot;);
 
 			// If there was an insert, delete or update see how many rows were affected
 			// (Also, If there there was an insert take note of the last OID
@@ -194,21 +202,21 @@
 					if ( $word == &quot;insert&quot; || $word == &quot;replace&quot; )
 					{
 						$get_last_ident = &quot;SELECT @@IDENTITY as id&quot;;
-						$last_res = @mssql_query($get_last_ident, $this-&gt;dbh);
+						$last_res = @mssql_query($get_last_ident, $this-&gt;dbh);
 						$this-&gt;insert_id = @mssql_result($last_res, 0, &quot;id&quot;);
 						
 						// If insert id then return it - true evaluation
-						return $this-&gt;insert_id;
+						return $this-&gt;insert_id;
 					}
 					
 					// Set to false if there was no insert id
 					$this-&gt;result = false;
 				}
 			}
-
-			
-			if ($errorcode &lt;&gt; 0) {
-				// there is an error
+
+			
+			if ($errorcode &lt;&gt; 0) {
+				// there is an error
 				$this-&gt;print_error();
 			}
 			else
@@ -240,8 +248,8 @@
 
 				// Log number of rows the query returned
 				$this-&gt;num_rows = $i;
-
-				//}
+
+				//}
 
 				@mssql_free_result($this-&gt;result);
 
@@ -558,8 +566,8 @@
 
 
 	}
-
-// automatically create a new $db object
+
+// automatically create a new $db object
 
 #$db = new db(EZSQL_DB_USER, EZSQL_DB_PASSWORD, EZSQL_DB_NAME, EZSQL_DB_HOST);
 </diff>
      <filename>php/extlib/ezsql/ezsql_mssqlserver.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 
 	// ==================================================================
 	//  Author: Justin Vincent (justin@visunet.ie)</diff>
      <filename>php/extlib/ezsql/ezsql_mysql.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
 &lt;?php
+# Movable Type (r) (C) 2001-2007 Six Apart, Ltd. All Rights Reserved.
+# This code cannot be redistributed without permission from www.sixapart.com.
+# For more information, consult your Movable Type license.
+#
+# $Id$
 
 	// ==================================================================
 	//  Author: Justin Vincent (justin@visunet.ie)</diff>
      <filename>php/extlib/ezsql/ezsql_oracle.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 
 	// ==================================================================
 	//  Author: Justin Vincent (justin@visunet.ie)</diff>
      <filename>php/extlib/ezsql/ezsql_postgres.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 
 	// ==================================================================
 	//  Author: Justin Vincent (justin@visunet.ie)</diff>
      <filename>php/extlib/ezsql/ezsql_sqlite.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>php/lib/MTSerialize.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -797,6 +797,10 @@ function decode_xml($str) {
 function encode_js($str) {
     if (!isset($str)) return '';
     $str = preg_replace('!\\\\!', '\\\\', $str);
+    $str = preg_replace('!&gt;!', '\\&gt;', $str);
+    $str = preg_replace('!&lt;!', '\\&lt;', $str);
+    $str = preg_replace('!(s)(cript)!i', '$1\\\\$2', $str);
+    $str = preg_replace('!&lt;/!', '&lt;\\/', $str); # &lt;/ is supposed to be the end of Javascript (&lt;/script in most UA)
     $str = preg_replace('!\'!', '\\\'', $str);
     $str = preg_replace('!&quot;!', '\\&quot;', $str);
     $str = preg_replace('!\n!', '\\n', $str);
@@ -817,6 +821,17 @@ function gmtime($ts = null) {
     return $tsa;
 }
 
+function is_hash($array) {
+    if ( is_array($array) ) {
+        if ( array_keys($array) === range(0, count($array) - 1) ) {
+            // 0,1,2,3... must be an array
+            return false;
+        }
+        return true;
+    }
+    return false;
+}
+
 function offset_time_list($ts, $blog = null, $dir = null) {
     return gmtime(offset_time($ts, $blog, $dir));
 }
@@ -1498,4 +1513,44 @@ function create_rating_expr_function($expr, $filter, $namespace, $datasource = '
     }
     return $fn;
 }
+
+function _math_operation($op, $lvalue, $rvalue) {
+    if (!preg_match('/^\-?[\d\.]+$/', $lvalue))
+        return;
+    if ( isset($rvalue) &amp;&amp; !preg_match('/^\-?[\d\.]+$/', $rvalue))
+        return;
+    if ( !isset($rvalue)
+      &amp;&amp; $op != 'inc' &amp;&amp; $op != 'dec' &amp;&amp; $op != '++' &amp;&amp; $op != '--' )
+        return;
+    if ( ( '+' == $op ) || ( 'add' == $op ) ) {
+        return $lvalue + $rvalue;
+    }
+    elseif ( ( '++' == $op ) || ( 'inc' == $op ) ) {
+        return $lvalue + 1;
+    }
+    elseif ( ( '-' == $op ) || ( 'sub' == $op ) ) {
+        return $lvalue - $rvalue;
+    }
+    elseif ( ( '--' == $op ) || ( 'dec' == $op ) ) {
+        return $lvalue - 1;
+    }
+    elseif ( ( '*' == $op ) || ( 'mul' == $op ) ) {
+        return $lvalue * $rvalue;
+    }
+    elseif ( ( '/' == $op ) || ( 'div' == $op ) ) {
+        if ( $rvalue == 0 )
+            return;
+        return $lvalue / $rvalue;
+    }
+    elseif ( ( '%' == $op ) || ( 'mod' == $op ) ) {
+        // to be in line with perl equivalent
+        $lvalue = floor($lvalue);
+        $rvalue = floor($rvalue);
+        if ( $rvalue == 0 )
+            return;
+        return $lvalue % $rvalue;
+    }
+    return;
+}
+
 ?&gt;</diff>
      <filename>php/lib/MTUtil.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -26,6 +26,8 @@ class MTViewer extends Smarty {
         'mthassubfolders' =&gt; 1,
         'mthasparentfolders' =&gt; 1,
         'mthasparentfolder' =&gt; 1,
+        'mtauthorhasentry' =&gt; 1,
+        'mtauthorhaspage' =&gt; 1,
     );
     var $sanitized = array(
         'mtcommentauthor' =&gt; 1,</diff>
      <filename>php/lib/MTViewer.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;MTUtil.php&quot;);
 
 // Create default archivers
@@ -369,7 +375,6 @@ class MonthlyArchiver extends DateBasedArchiver {
         $vars['datebased_only_archive'] = 1;
         $vars['datebased_monthly_archive'] = 1;
         $vars['archive_class'] = 'datebased-monthly-archive';
-        $vars['module_monthly_archives'] = 1;
     }
 }
 
@@ -626,7 +631,6 @@ class AuthorBasedArchiver extends BaseArchiver {
         $vars['main_template'] = 1;
         $vars['author_archive'] = 1;
         $vars['archive_class'] = 'author-archive';
-        $vars['module_author_archives'] = 1;
         $vars['module_author-monthly_archives'] = 1;
     }
 }
@@ -989,7 +993,6 @@ class MonthlyAuthorBasedArchiver extends DateBasedAuthorArchiver {
         $vars['author_monthly_archive'] = 1;
         $vars['archive_class'] = 'author-monthly-archive';
         $vars['module_author-monthly_archives'] = 1;
-        $vars['module_author_archives'] = 1;
     }
 }
 
@@ -1580,7 +1583,6 @@ class MonthlyCategoryArchiver extends DateBasedCategoryArchiver {
         $vars['archive_class'] = 'category-monthlyl-archive';
         $vars['category-monthly_archive'] = 1;
         $vars['module_category-monthly_archives'] = 1;
-        $vars['module_category_archives'] = 1;
     }
 }
 </diff>
      <filename>php/lib/archive_lib.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
 require_once &quot;archive_lib.php&quot;;
 function smarty_block_mtarchivelist($args, $content, &amp;$ctx, &amp;$repeat) {
-  $localvars = array('current_archive_type', 'current_timestamp', 'current_timestamp_end', 'entries', 'archive_count', '_archive_list_num', '_archive_list_results','entry','ArchiveListHeader', 'ArchiveListFooter', 'inside_archive_list');
+    $localvars = array('current_archive_type', 'current_timestamp', 'current_timestamp_end', 'entries', 'archive_count', '_archive_list_num', '_archive_list_results','entry','ArchiveListHeader', 'ArchiveListFooter', 'inside_archive_list');
     global $_archivers;
     if (!isset($content)) {
         require_once(&quot;archive_lib.php&quot;);
@@ -56,7 +56,6 @@ function smarty_block_mtarchivelist($args, $content, &amp;$ctx, &amp;$repeat) {
             $ctx-&gt;restore($localvars);
         return $content;
     }
-
     if ($i &lt; count($archive_list_results)) {
         $grp = $archive_list_results[$i];
         $_archivers[$at]-&gt;prepare_list($ctx, $grp);</diff>
      <filename>php/lib/block.mtarchivelist.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtarchivelistfooter($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'ArchiveListFooter');</diff>
      <filename>php/lib/block.mtarchivelistfooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtarchivelistheader($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'ArchiveListHeader');</diff>
      <filename>php/lib/block.mtarchivelistheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;archive_lib.php&quot;);
 function smarty_block_mtarchivenext($args, $content, &amp;$ctx, &amp;$repeat) {
     return _hdlr_archive_prev_next($args, $content, $ctx, $repeat, 'archivenext');</diff>
      <filename>php/lib/block.mtarchivenext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;archive_lib.php&quot;);
 function smarty_block_mtarchiveprevious($args, $content, &amp;$ctx, &amp;$repeat) {
     return _hdlr_archive_prev_next($args, $content, $ctx, $repeat, 'archiveprevious');</diff>
      <filename>php/lib/block.mtarchiveprevious.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtarchives($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('current_archive_type', 'archive_types', 'archive_type_index', 'old_preferred_archive_type');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtarchives.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtasset($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $asset = $ctx-&gt;mt-&gt;db-&gt;fetch_assets($args);</diff>
      <filename>php/lib/block.mtasset.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,17 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtassetiftagged($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $asset = $ctx-&gt;stash('asset');
         if ($asset) {
             $asset_id = $asset['asset_id'];
-            $tag = $args['tag'];
+            $tag = $args['name'];
+            $tag or $tag = $args['tag'];
             $targs = array('asset_id' =&gt; $asset_id);
             if ($tag &amp;&amp; (substr($tag,0,1) == '@')) {
                 $targs['include_private'] = 1;</diff>
      <filename>php/lib/block.mtassetiftagged.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtassetisfirstinrow($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, $ctx-&gt;stash('asset_first_in_row'));</diff>
      <filename>php/lib/block.mtassetisfirstinrow.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtassetislastinrow($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, $ctx-&gt;stash('asset_last_in_row'));</diff>
      <filename>php/lib/block.mtassetislastinrow.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtassets($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('_assets', 'asset', 'asset_first_in_row', 'asset_last_in_row');
     $counter = 0;</diff>
      <filename>php/lib/block.mtassets.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtassetsfooter($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $assets = $ctx-&gt;stash('_assets');</diff>
      <filename>php/lib/block.mtassetsfooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtassetsheader($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $counter = $ctx-&gt;stash('_assets_counter');</diff>
      <filename>php/lib/block.mtassetsheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtassettags($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('_tags', 'Tag', '_tags_counter', 'tag_min_count', 'tag_max_count','all_tag_count');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtassettags.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtauthornext($args, $content, &amp;$ctx, &amp;$repeat) {
     static $_next_cache = array();
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtauthornext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtauthorprevious($args, $content, &amp;$ctx, &amp;$repeat) {
     static $_prev_cache = array();
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtauthorprevious.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtauthors($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('authors', 'authors_counter', 'blog_id');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtauthors.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtauthoruserpicasset($args, $content, &amp;$ctx, &amp;$repeat) {
     $author = $ctx-&gt;stash('author');
     if (!$author) {</diff>
      <filename>php/lib/block.mtauthoruserpicasset.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtblogifcclicense($args, $content, &amp;$ctx, &amp;$repeat) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/block.mtblogifcclicense.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtblogifcommentsopen($args, $content, &amp;$ctx, &amp;$repeat) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/block.mtblogifcommentsopen.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtblogs($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $ctx-&gt;localize(array('_blogs', '_blogs_counter', 'blog', 'blog_id'));</diff>
      <filename>php/lib/block.mtblogs.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;MTUtil.php&quot;);
 
 function smarty_block_mtcalendar($args, $content, &amp;$ctx, &amp;$repeat) {</diff>
      <filename>php/lib/block.mtcalendar.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcalendarifblank($args, $content, &amp;$ctx, &amp;$repeat) {
     return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'CalendarIfBlank');
 }</diff>
      <filename>php/lib/block.mtcalendarifblank.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcalendarifentries($args, $content, &amp;$ctx, &amp;$repeat) {
     return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'CalendarIfEntries');
 }</diff>
      <filename>php/lib/block.mtcalendarifentries.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcalendarifnoentries($args, $content, &amp;$ctx, &amp;$repeat) {
     return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'CalendarIfNoEntries');
 }</diff>
      <filename>php/lib/block.mtcalendarifnoentries.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcalendariftoday($args, $content, &amp;$ctx, &amp;$repeat) {
     return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'CalendarIfToday');
 }</diff>
      <filename>php/lib/block.mtcalendariftoday.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcalendarweekfooter($args, $content, &amp;$ctx, &amp;$repeat) {
     return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'CalendarWeekFooter');
 }</diff>
      <filename>php/lib/block.mtcalendarweekfooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcalendarweekheader($args, $content, &amp;$ctx, &amp;$repeat) {
     return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'CalendarWeekHeader');
 }</diff>
      <filename>php/lib/block.mtcalendarweekheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcategories($args, $content, &amp;$ctx, &amp;$repeat) {
     // status: incomplete
     // parameters: show_empty</diff>
      <filename>php/lib/block.mtcategories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcategoryifallowpings($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $entry = $ctx-&gt;stash('category');</diff>
      <filename>php/lib/block.mtcategoryifallowpings.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcategorynext($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('category', 'entries');
     $tag = $ctx-&gt;this_tag();</diff>
      <filename>php/lib/block.mtcategorynext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;block.mtcategorynext.php&quot;);
 function smarty_block_mtcategoryprevious($args, $content, &amp;$ctx, &amp;$repeat) {
     return smarty_block_mtcategorynext($args, $content, $ctx, $repeat);</diff>
      <filename>php/lib/block.mtcategoryprevious.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcommententry($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('entry', 'current_timestamp', 'modification_timestamp');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtcommententry.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcommenteriftrusted($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $a = $ctx-&gt;stash('commenter');</diff>
      <filename>php/lib/block.mtcommenteriftrusted.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcommenteruserpicasset($args, $content, &amp;$ctx, &amp;$repeat) {
     $comment = $ctx-&gt;stash('comment');
     if (!$comment) {</diff>
      <filename>php/lib/block.mtcommenteruserpicasset.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcommentparent($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('comment');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtcommentparent.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcommentreplies($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('comments', 'comment_order_num', 'comment','current_timestamp', 'commenter', 'blog', 'blog_id', '_comment_replies_tokens', 'conditional', 'else_content');
     $token_fn = $ctx-&gt;stash('_comment_replies_tokens');</diff>
      <filename>php/lib/block.mtcommentreplies.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcomments($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('comments', 'comment_order_num','comment','current_timestamp', 'commenter', 'blog', 'blog_id', 'conditional', 'else_content');
     if (!isset($content)) {
@@ -20,6 +26,7 @@ function smarty_block_mtcomments($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!$comments)
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 0);
 
+    $ctx-&gt;stash('conditional', $comments ? 1 : 0);
     if ($counter &lt; count($comments)) {
         $blog_id = $ctx-&gt;stash('blog_id');
         $comment = $comments[$counter];</diff>
      <filename>php/lib/block.mtcomments.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcommentsfooter($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $comments = $ctx-&gt;stash('comments');</diff>
      <filename>php/lib/block.mtcommentsfooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtcommentsheader($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $counter = $ctx-&gt;stash('comment_order_num');</diff>
      <filename>php/lib/block.mtcommentsheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtdatefooter($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'DateFooter');</diff>
      <filename>php/lib/block.mtdatefooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtdateheader($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'DateHeader');</diff>
      <filename>php/lib/block.mtdateheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentries($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('entry', '_entries_counter','entries','current_timestamp','modification_timestamp','_entries_lastn', 'current_timestamp_end', 'DateHeader', 'DateFooter', '_entries_glue', 'blog', 'blog_id', 'conditional', 'else_content');
     if (isset($args['sort_by']) &amp;&amp; $args['sort_by'] == 'score' &amp;&amp; !isset($args['namespace'])) {</diff>
      <filename>php/lib/block.mtentries.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentriesfooter($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $entries =&amp; $ctx-&gt;stash('entries');</diff>
      <filename>php/lib/block.mtentriesfooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentriesheader($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, $ctx-&gt;stash('_entries_counter') == 1);</diff>
      <filename>php/lib/block.mtentriesheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentrieswithsubcategories($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('entries');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtentrieswithsubcategories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentryadditionalcategories($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('_categories', 'category', '_categories_counter');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtentryadditionalcategories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;block.mtassets.php&quot;);
 function smarty_block_mtentryassets($args, $content, &amp;$ctx, &amp;$repeat) {
     return smarty_block_mtassets($args, $content, $ctx, $repeat);</diff>
      <filename>php/lib/block.mtentryassets.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentryauthoruserpicasset($args, $content, &amp;$ctx, &amp;$repeat) {
     $entry = $ctx-&gt;stash('entry');
     if (!$entry) {</diff>
      <filename>php/lib/block.mtentryauthoruserpicasset.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentrycategories($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('_categories', 'category', '_categories_counter');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtentrycategories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentryifallowcomments($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $entry = $ctx-&gt;stash('entry');</diff>
      <filename>php/lib/block.mtentryifallowcomments.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentryifallowpings($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $entry = $ctx-&gt;stash('entry');</diff>
      <filename>php/lib/block.mtentryifallowpings.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;block.mtifcategory.php&quot;);
 function smarty_block_mtentryifcategory($args, $content, &amp;$ctx, &amp;$repeat) {
     return smarty_block_mtifcategory($args, $content, $ctx, $repeat);</diff>
      <filename>php/lib/block.mtentryifcategory.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentryifcommentsopen($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $entry = $ctx-&gt;stash('entry');</diff>
      <filename>php/lib/block.mtentryifcommentsopen.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentryifextended($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $entry = $ctx-&gt;stash('entry');</diff>
      <filename>php/lib/block.mtentryifextended.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,18 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentryiftagged($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $entry = $ctx-&gt;stash('entry');
         if ($entry) {
             $entry_id = $entry['entry_id'];
             $blog_id = $entry['entry_blog_id'];
-            $tag = $args['tag'];
+            $tag = $args['name'];
+            $tag or $tag = $args['tag'];
             $targs = array('entry_id' =&gt; $entry_id, 'blog_id' =&gt; $blog_id);
             if ($tag &amp;&amp; (substr($tag,0,1) == '@')) {
                 $targs['include_private'] = 1;</diff>
      <filename>php/lib/block.mtentryiftagged.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentrynext($args, $content, &amp;$ctx, &amp;$repeat) {
     static $_next_cache = array();
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtentrynext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentryprevious($args, $content, &amp;$ctx, &amp;$repeat) {
     static $_prev_cache = array();
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtentryprevious.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtentrytags($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('_tags', 'Tag', '_tags_counter', 'tag_min_count', 'tag_max_count','all_tag_count');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtentrytags.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtfolderfooter($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $categories =&amp; $ctx-&gt;stash('_categories');</diff>
      <filename>php/lib/block.mtfolderfooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtfolderheader($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $ctx-&gt;localize(array('conditional', 'else_content'));</diff>
      <filename>php/lib/block.mtfolderheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtcategorynext.php');
 function smarty_block_mtfoldernext($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['clas'] = 'folder';</diff>
      <filename>php/lib/block.mtfoldernext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;block.mtcategorynext.php&quot;);
 function smarty_block_mtfolderprevious($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mtfolderprevious.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtcategories.php');
 function smarty_block_mtfolders($args, $content, &amp;$ctx, &amp;$repeat) {
     // status: incomplete</diff>
      <filename>php/lib/block.mtfolders.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,15 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtfor($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('__for_end', '__for_var');
 
     if (!isset($content)) {
+        $ctx-&gt;localize($localvars);
         // first invocation; setup loop
         $start = array_key_exists('start', $args) ?
             $args['start']</diff>
      <filename>php/lib/block.mtfor.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mthasnoparentcategory($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         require_once(&quot;MTUtil.php&quot;);</diff>
      <filename>php/lib/block.mthasnoparentcategory.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;block.mthassubcategories.php&quot;);
 function smarty_block_mthasnosubcategories($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mthasnosubcategories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mthasparentcategory($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         require_once(&quot;MTUtil.php&quot;);</diff>
      <filename>php/lib/block.mthasparentcategory.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mthasparentcategory.php');
 function smarty_block_mthasparentfolder($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mthasparentfolder.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mthassubcategories($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $class = 'category';</diff>
      <filename>php/lib/block.mthassubcategories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mthassubcategories.php');
 function smarty_block_mthassubfolders($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mthassubfolders.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,62 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtif($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $result = 0;
-        if (isset($args['var'])) {
-            $val = $ctx-&gt;__stash['vars'][$args['var']];
-        } elseif (isset($args['name'])) {
-            $val = $ctx-&gt;__stash['vars'][$args['name']];
+        $name = isset($args['name'])
+          ? $args['name'] : $args['var'];
+        if (isset($name)) {
+            # pick off any {...} or [...] from the name.
+            if (preg_match('/^(.+)([\[\{])(.+)[\]\}]$/', $name, $matches)) {
+                $name = $matches[1];
+                $br = $matches[2];
+                $ref = $matches[3];
+                if (preg_match('/^\\\\\$(.+)/', $ref, $ref_matches)) {
+                    $ref = $vars[$ref_matches[1]];
+                    if (!isset($ref))
+                        $ref = chr(0);
+                }
+                $br == '[' ? $index = $ref : $key = $ref;
+            } else {
+                if (array_key_exists('index', $args))
+                    $index = $args['index'];
+                else if (array_key_exists('key', $args))
+                    $key = $args['key'];
+            }
+            if (preg_match('/^$/', $name)) {
+                $name = $vars[$name];
+                if (!isset($name))
+                    return $ctx-&gt;error($ctx-&gt;mt-&gt;translate(
+                        &quot;You used a [_1] tag without a valid name attribute.&quot;, &quot;&lt;MT$tag&gt;&quot; ));
+            }
+            if (isset($name)) {
+                $value = $ctx-&gt;__stash['vars'][$name];
+                if (is_hash($value)) {
+                    if ( isset($key) ) {
+                        if ($key != chr(0)) {
+                            $val = $value[$key];
+                        } else {
+                            unset($value);
+                        }
+                    }
+                }
+                elseif (is_array($value)) {
+                    if ( isset($index) ) {
+                        if (is_numeric($index)) {
+                            $val = $value[ $index ];
+                        } else {
+                            unset($value); # fall through to any 'default'
+                        }
+                    }
+                }
+                if (!isset($val))
+                    $val = $value;
+            }
         } elseif (isset($args['tag'])) {
             $tag = $args['tag'];
             $tag = preg_replace('/^mt:?/i', '', $tag);
@@ -13,7 +64,8 @@ function smarty_block_mtif($args, $content, &amp;$ctx, &amp;$repeat) {
             unset($largs['tag']);
             $val = $ctx-&gt;tag($tag, $largs);
         }
-        if (preg_match('/^smarty_fun_[a-f0-9]+$/', $val)) {
+        if ( !is_array($value)
+          &amp;&amp; preg_match('/^smarty_fun_[a-f0-9]+$/', $value) ) {
             if (function_exists($val)) {
                 ob_start();
                 $val($ctx, array());
@@ -23,6 +75,15 @@ function smarty_block_mtif($args, $content, &amp;$ctx, &amp;$repeat) {
                 $val = '';
             }
         }
+        if ( array_key_exists('op', $args) ) {
+            $op = $args['op'];
+            $rvalue = $args['value'];
+            if ( $op &amp;&amp; isset($value) &amp;&amp; !is_array($value) ) {
+                $val = _math_operation($op, $val, $rvalue);
+                if (!isset($val)) {
+                    return $ctx-&gt;error($ctx-&gt;mt-&gt;translate(&quot;[_1] [_2] [_3] is illegal.&quot;, $val, $op, $rvalue));
+            }}
+        }
         if (array_key_exists('eq', $args)) {
             $val2 = $args['eq'];
             $result = $val == $val2 ? 1 : 0;</diff>
      <filename>php/lib/block.mtif.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifallowcommenthtml($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifallowcommenthtml.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifarchivetype($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifarchivetype.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifarchivetypeenabled($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifarchivetypeenabled.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifauthor($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $ok = $ctx-&gt;stash('author') ? 1 : 0;</diff>
      <filename>php/lib/block.mtifauthor.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifblog($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $ok = $ctx-&gt;stash('blog') ? 1 : 0;</diff>
      <filename>php/lib/block.mtifblog.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcategory($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $e = $ctx-&gt;stash('entry');</diff>
      <filename>php/lib/block.mtifcategory.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommenterisauthor($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifcommenterisauthor.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommenterisentryauthor($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifcommenterisentryauthor.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommentertrusted($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $a = $ctx-&gt;stash('commenter');</diff>
      <filename>php/lib/block.mtifcommentertrusted.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommentparent($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $comment = $ctx-&gt;stash('comment');</diff>
      <filename>php/lib/block.mtifcommentparent.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommentreplies($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $comment = $ctx-&gt;stash('comment');</diff>
      <filename>php/lib/block.mtifcommentreplies.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommentsaccepted($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifcommentsaccepted.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommentsactive($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifcommentsactive.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommentsallowed($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifcommentsallowed.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifcommentsmoderated($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifcommentsmoderated.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifdynamic($args, $content, &amp;$ctx, &amp;$repeat) {
     return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 1);
 }</diff>
      <filename>php/lib/block.mtifdynamic.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtifcategory.php');
 function smarty_block_mtiffolder($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mtiffolder.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifisancestor($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('conditional', 'else_content');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifisancestor.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifisdescendant($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('conditional', 'else_content');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifisdescendant.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifneedemail($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifneedemail.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifnonempty($args, $content, &amp;$ctx, &amp;$repeat) {
     // status: complete
     // parameters: tag</diff>
      <filename>php/lib/block.mtifnonempty.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifnonzero($args, $content, &amp;$ctx, &amp;$repeat) {
     // status: complete
     // parameters: tag</diff>
      <filename>php/lib/block.mtifnonzero.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifpingsaccepted($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifpingsaccepted.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifpingsactive($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifpingsactive.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifpingsallowed($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifpingsallowed.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifpingsmoderated($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifpingsmoderated.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifregistrationallowed($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $blog = $ctx-&gt;stash('blog');</diff>
      <filename>php/lib/block.mtifregistrationallowed.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifregistrationnotrequired($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $blog = $ctx-&gt;stash('blog');</diff>
      <filename>php/lib/block.mtifregistrationnotrequired.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifregistrationrequired($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $blog = $ctx-&gt;stash('blog');</diff>
      <filename>php/lib/block.mtifregistrationrequired.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtifrequirecommentemails($args, $content, &amp;$ctx, &amp;$repeat) {
     # status: complete
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtifrequirecommentemails.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtiftagsearch($args, $content, &amp;$ctx, &amp;$repeat) {
     return '';
 }</diff>
      <filename>php/lib/block.mtiftagsearch.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtiftypekeytoken($args, $content, &amp;$ctx, &amp;$repeat) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/block.mtiftypekeytoken.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtincludeblock($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
     } else {</diff>
      <filename>php/lib/block.mtincludeblock.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtindexlist($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('index_templates', 'index_templates_counter');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtindexlist.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;block.mtassets.php&quot;);
 function smarty_block_mtpageassets($args, $content, &amp;$ctx, &amp;$repeat) {
     return smarty_block_mtassets($args, $content, $ctx, $repeat);</diff>
      <filename>php/lib/block.mtpageassets.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtentrycategories.php');
 function smarty_block_mtpagefolder($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mtpagefolder.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtentryiftagged.php');
 function smarty_block_mtpageiftagged($args, $content, &amp;$ctx, &amp;$repeat) {
     return smarty_block_mtentryiftagged($args, $content, $ctx, $repeat);</diff>
      <filename>php/lib/block.mtpageiftagged.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtentrynext.php');
 function smarty_block_mtpagenext($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'page';</diff>
      <filename>php/lib/block.mtpagenext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtentryprevious.php');
 function smarty_block_mtpageprevious($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'page';</diff>
      <filename>php/lib/block.mtpageprevious.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtentries.php');
 function smarty_block_mtpages($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'page';
@@ -28,10 +34,13 @@ function smarty_block_mtpages($args, $content, &amp;$ctx, &amp;$repeat) {
         }
     }
 
-    $ctx-&gt;stash('current_timestamp', null);
-    $ctx-&gt;stash('current_timestamp_end', null);
-    $ctx-&gt;stash('current_archive_type', '');
+    $localvars = array('current_timestamp', 'current_timestamp_end', 'current_archive_type');
+    $ctx-&gt;localize($localvars);
+
+    $out = smarty_block_mtentries($args, $content, $ctx, $repeat);
+
+    $ctx-&gt;restore($localvars);
 
-    return smarty_block_mtentries($args, $content, $ctx, $repeat);
+    return $out;
 }
 ?&gt;</diff>
      <filename>php/lib/block.mtpages.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtentriesfooter.php');
 function smarty_block_mtpagesfooter($args, $content, &amp;$ctx, &amp;$repeat) {
     return smarty_block_mtentriesfooter($args, $content, $ctx, $repeat);</diff>
      <filename>php/lib/block.mtpagesfooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtentriesheader.php');
 function smarty_block_mtpagesheader($args, $content, &amp;$ctx, &amp;$repeat) {
     return smarty_block_mtentriesheader($args, $content, $ctx, $repeat);</diff>
      <filename>php/lib/block.mtpagesheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtentrytags.php');
 function smarty_block_mtpagetags($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'page';</diff>
      <filename>php/lib/block.mtpagetags.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function get_parent_categories(&amp;$cat, &amp;$ctx, &amp;$list) {
     if ($cat['category_parent']) {
         $parent = $ctx-&gt;mt-&gt;db-&gt;fetch_category($cat['category_parent']);</diff>
      <filename>php/lib/block.mtparentcategories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtparentcategory($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $ctx-&gt;localize(array('category', 'conditional', 'else_content'));</diff>
      <filename>php/lib/block.mtparentcategory.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtparentcategory.php');
 function smarty_block_mtparentfolder($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mtparentfolder.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtparentcategories.php');
 function smarty_block_mtparentfolders($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mtparentfolders.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtpingentry($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('entry', 'current_timestamp', 'modification_timestamp');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtpingentry.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtpings($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('ping', '_pings', '_pings_counter', 'current_timestamp', 'blog_id', 'blog');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtpings.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtpingsfooter($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $pings = $ctx-&gt;stash('_pings');</diff>
      <filename>php/lib/block.mtpingsfooter.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtpingsheader($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $counter = $ctx-&gt;stash('_pings_counter');</diff>
      <filename>php/lib/block.mtpingsheader.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtpingssent($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('_pinged_urls', '_ping_urls_counter', 'ping_sent_url');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtpingssent.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtsection($args, $content, &amp;$ctx, &amp;$repeat) {
     return $content;
 }</diff>
      <filename>php/lib/block.mtsection.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,132 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtsetvarblock($args, $content, &amp;$ctx, &amp;$repeat) {
     // parameters: name, value
     if (isset($content)) {
         $name = $args['name'];
         $name or $name = $args['var'];
         if (!$name) return '';
-        $value = $content;
+
         $vars =&amp; $ctx-&gt;__stash['vars'];
+
+        if (preg_match('/^(\w+)\((.+)\)$/', $name, $matches)) {
+            $func = $matches[1];
+            $name = $matches[2];
+        } else {
+            if (array_key_exists('function', $args))
+                $func = $args['function'];
+        }
+
+        # pick off any {...} or [...] from the name.
+        if (preg_match('/^(.+)([\[\{])(.+)[\]\}]$/', $name, $matches)) {
+            $name = $matches[1];
+            $br = $matches[2];
+            $ref = $matches[3];
+            if (preg_match('/^\$(.+)/', $ref, $ref_matches)) {
+                $ref = $vars[$ref_matches[1]];
+                if (!isset($ref))
+                    $ref = chr(0);
+            }
+            $br == '[' ? $index = $ref : $key = $ref;
+        } else {
+            if (array_key_exists('index', $args))
+                $index = $args['index'];
+            else if (array_key_exists('key', $args))
+                $key = $args['key'];
+        }
+
+        if (preg_match('/^$/', $name)) {
+            $name = $vars[$name];
+            if (!isset($name))
+                return $ctx-&gt;error($ctx-&gt;mt-&gt;translate(
+                    &quot;You used a [_1] tag without a valid name attribute.&quot;, &quot;&lt;MT$tag&gt;&quot; ));
+        }
+
+        $value = $content;
+        $existing = $vars[$name];
+
+        require_once(&quot;MTUtil.php&quot;);
+        if (isset($key)) {
+            if (!isset($existing))
+                $existing = array($key =&gt; $value);
+            elseif (is_hash($existing))
+                $existing = $existing[$key];
+            else
+                return $ctx-&gt;error( $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not a hash.&quot;, $name) );
+        }
+        elseif (isset($index)) {
+            if (!isset($existing))
+                $existing[$index] = $value;
+            elseif (is_array($existing)) {
+                if ( is_numeric($index) )
+                    $existing = $existing[$index];
+                else
+                    return $ctx-&gt;error( $ctx-&gt;mt-&gt;translate(&quot;Invalid index.&quot;) );
+            }
+            else
+                return $ctx-&gt;error( $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not an array.&quot;, $name) );
+        }
+
         if (array_key_exists('append', $args) &amp;&amp; $args['append']) {
-            $existing = is_array($vars) ? $vars[$name] : '';
-            $value = $existing . $value;
-        } elseif (array_key_exists('prepend', $args) &amp;&amp; $args['prepend']) {
-            $existing = is_array($vars) ? $vars[$name] : '';
-            $value = $value . $existing;
+            $value = isset($existing) ? $existing . $value : $value;
+        }
+        elseif (array_key_exists('prepend', $args) &amp;&amp; $args['prepend']) {
+            $value = isset($existing) ?  $value . $existing : $value;
+        }
+        elseif ( isset($existing) &amp;&amp; array_key_exists('op', $args) ) {
+            $op = $args['op'];
+            $value = _math_operation($op, $existing, $value);
+            if (!isset($value))
+                return $ctx-&gt;error();
+        }
+
+        $data = $vars[$name];
+        if ( isset($key) ) {
+            if ( ( isset($func) )
+              &amp;&amp; ( 'delete' == strtolower( $func ) ) ) {
+                unset($data[$key]);
+            }
+            else {
+                $data[$key] = $value;
+            }
+        }
+        elseif ( isset($index) ) {
+            $data[$index] = $value;
+        }
+        elseif ( isset($func) ) {
+            if ( 'undef' == strtolower( $func ) ) {
+                unset($data);
+            }
+            else {
+                if (isset($data) &amp;&amp; !is_array($data))
+                    return $ctx-&gt;error( $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not an array.&quot;, $name) );
+                if (!isset($data))
+                    $data = array();
+                if ( 'push' == strtolower( $func ) ) {
+                    array_push($data, $value);
+                }
+                elseif ( 'unshift' == strtolower( $func ) ) {
+                    array_unshift($data, $value);
+                }
+                else {
+                    return $ctx-&gt;error(
+                        $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not a valid function.&quot;, $func)
+                    );
+                }
+            }
+        }
+        else {
+            $data = $value;
         }
         if (is_array($vars)) {
-            $vars[$name] = $value;
+            $vars[$name] = $data;
         } else {
-            $vars = array($name =&gt; $value);
+            $vars = array($name =&gt; $data);
             $ctx-&gt;__stash['vars'] =&amp; $vars;
         }
     }</diff>
      <filename>php/lib/block.mtsetvarblock.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtsetvars($args, $content, &amp;$ctx, &amp;$repeat) {
     // parameters: name, value
     if (isset($content)) {</diff>
      <filename>php/lib/block.mtsetvars.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtsetvartemplate($args, $content, &amp;$ctx, &amp;$repeat) {
     // parameters: name, value
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mtsetvartemplate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtsubcatisfirst($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'subCatIsFirst');</diff>
      <filename>php/lib/block.mtsubcatisfirst.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtsubcatislast($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         return $ctx-&gt;_hdlr_if($args, $content, $ctx, $repeat, 'subCatIsLast');</diff>
      <filename>php/lib/block.mtsubcatislast.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mtsubcategories.php');
 function smarty_block_mtsubfolders($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mtsubfolders.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mttags($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('_tags', 'Tag', '_tags_counter', 'tag_min_count', 'tag_max_count', 'all_tag_count', 'include_blogs', 'exclude_blogs', 'blog_ids');
     if (!isset($content)) {</diff>
      <filename>php/lib/block.mttags.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mttoplevelcategories($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $ctx-&gt;localize(array('category', 'archive_category'));</diff>
      <filename>php/lib/block.mttoplevelcategories.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mttoplevelparent.php');
 function smarty_block_mttoplevelfolder($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mttoplevelfolder.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('block.mttoplevelcategories.php');
 function smarty_block_mttoplevelfolders($args, $content, &amp;$ctx, &amp;$repeat) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/block.mttoplevelfolders.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mttoplevelparent($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $ctx-&gt;localize(array('category','conditional','else_content'));</diff>
      <filename>php/lib/block.mttoplevelparent.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_block_mtunless($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {
         $result = 0;</diff>
      <filename>php/lib/block.mtunless.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $_captcha_providers;
 $provider = new MTUtilCaptcha();
 $_captcha_providers[$provider-&gt;get_key()] = $provider;</diff>
      <filename>php/lib/captcha_lib.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $_cc_Data;
 $_cc_Data = array(
     'by' =&gt; array(</diff>
      <filename>php/lib/cc_lib.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $_commenter_auths;
 $provider = new OpenIDCommenterAuth();
 $_commenter_auths[$provider-&gt;get_key()] = $provider;</diff>
      <filename>php/lib/commenter_auth_lib.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 
 /* create code for a function call */ 
 function smarty_compiler_fun($tag_args, &amp;$compiler) { </diff>
      <filename>php/lib/compiler.defun.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtadmincgipath($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtadmincgipath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtadminscript($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtadminscript.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtarchivecategory($args, &amp;$ctx) {
     if ($ctx-&gt;stash('inside_mt_categories')) {
         require_once(&quot;function.mtcategorylabel.php&quot;);</diff>
      <filename>php/lib/function.mtarchivecategory.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtarchivecount($args, &amp;$ctx) {
     if ($ctx-&gt;stash('inside_mt_categories')) {
         return $ctx-&gt;tag('MTCategoryCount', $args);</diff>
      <filename>php/lib/function.mtarchivecount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtarchivedate($args, &amp;$ctx) {
     return $ctx-&gt;_hdlr_date($args, $ctx);
 }</diff>
      <filename>php/lib/function.mtarchivedate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtarchivedateend($args, &amp;$ctx) {
     // status: complete
     $end = $ctx-&gt;stash('current_timestamp_end');</diff>
      <filename>php/lib/function.mtarchivedateend.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtarchivefile($args, &amp;$ctx) {
     $at = $ctx-&gt;stash('archive_type');
     $at or $at = $ctx-&gt;stash('current_archive_type');</diff>
      <filename>php/lib/function.mtarchivefile.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;archive_lib.php&quot;);
 function smarty_function_mtarchivelabel($args, &amp;$ctx) {
     global $_archivers;</diff>
      <filename>php/lib/function.mtarchivelabel.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtarchivelink($args, &amp;$ctx) {
     $blog = $ctx-&gt;stash('blog');
     $at = $args['type'];</diff>
      <filename>php/lib/function.mtarchivelink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;archive_lib.php&quot;);
 function smarty_function_mtarchivetitle($args, &amp;$ctx) {
     global $_archivers;</diff>
      <filename>php/lib/function.mtarchivetitle.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtarchivetype($args, &amp;$ctx) {
     $at = $ctx-&gt;stash('current_archive_type');
     return $at;</diff>
      <filename>php/lib/function.mtarchivetype.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;function.mtarchivelabel.php&quot;);
 function smarty_function_mtarchivetypelabel($args, &amp;$ctx) {
     return smarty_function_mtarchivelabel($args, $ctx);</diff>
      <filename>php/lib/function.mtarchivetypelabel.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetaddedby($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetaddedby.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetcount($args, &amp;$ctx) {
     $args['blog_id'] = $ctx-&gt;stash('blog_id');
     $count = $ctx-&gt;mt-&gt;db-&gt;asset_count($args);</diff>
      <filename>php/lib/function.mtassetcount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetdateadded($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetdateadded.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetfileext($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetfileext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetfilename($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetfilename.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetfilepath($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetfilepath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetid($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetlabel($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetlabel.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;function.mtasseturl.php&quot;);
 function smarty_function_mtassetlink($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');</diff>
      <filename>php/lib/function.mtassetlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetmimetype($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetmimetype.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;function.mtassetfilepath.php&quot;);
 function smarty_function_mtassetproperty($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');</diff>
      <filename>php/lib/function.mtassetproperty.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtassetrank($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtassetrank.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtassetscore($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtassetscore.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtassetscoreavg($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtassetscoreavg.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtassetscorecount($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtassetscorecount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtassetscorehigh($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtassetscorehigh.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtassetscorelow($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtassetscorelow.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;function.mtasseturl.php&quot;);
 function smarty_function_mtassetthumbnaillink($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
@@ -27,7 +33,7 @@ function smarty_function_mtassetthumbnaillink($args, &amp;$ctx) {
 
     $asset_url = smarty_function_mtasseturl($args, $ctx);
 
-    return sprintf(&quot;&lt;a href=\&quot;%s\&quot;%s&gt;&lt;img src=\&quot;%s\&quot; width=\&quot;%d\&quot; height=\&quot;%d\&quot;&gt;&lt;/a&gt;&quot;,
+    return sprintf(&quot;&lt;a href=\&quot;%s\&quot;%s&gt;&lt;img src=\&quot;%s\&quot; width=\&quot;%d\&quot; height=\&quot;%d\&quot; alt=\&quot;\&quot; /&gt;&lt;/a&gt;&quot;,
         $asset_url,
         $target,
         $thumb,</diff>
      <filename>php/lib/function.mtassetthumbnaillink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassetthumbnailurl($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassetthumbnailurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtassettype($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtassettype.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtasseturl($args, &amp;$ctx) {
     $asset = $ctx-&gt;stash('asset');
     if (!$asset) return '';</diff>
      <filename>php/lib/function.mtasseturl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtatomscript($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtatomscript.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthorauthiconurl($args, &amp;$ctx) {
     $author = $ctx-&gt;stash('author');
     if (!$author) {</diff>
      <filename>php/lib/function.mtauthorauthiconurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthorauthtype($args, &amp;$ctx) {
     $author = $ctx-&gt;stash('author');
     if (!$author) {</diff>
      <filename>php/lib/function.mtauthorauthtype.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthordisplayname($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtauthordisplayname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthoremail($args, &amp;$ctx) {
     $author = $ctx-&gt;stash('author');
     if (!$author) {</diff>
      <filename>php/lib/function.mtauthoremail.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthorid($args, &amp;$ctx) {
     $author = $ctx-&gt;stash('author');
     if (!$author) {</diff>
      <filename>php/lib/function.mtauthorid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthorname($args, &amp;$ctx) {
     $author = $ctx-&gt;stash('author');
     if (!$author) {</diff>
      <filename>php/lib/function.mtauthorname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtauthorrank($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtauthorrank.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtauthorscore($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtauthorscore.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtauthorscoreavg($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtauthorscoreavg.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtauthorscorecount($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtauthorscorecount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtauthorscorehigh($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtauthorscorehigh.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtauthorscorelow($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtauthorscorelow.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthorurl($args, &amp;$ctx) {
     $author = $ctx-&gt;stash('author');
     if (!$author) {</diff>
      <filename>php/lib/function.mtauthorurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthoruserpic($args, &amp;$ctx) {
     $author = $ctx-&gt;stash('author');
     if (!$author) return '';</diff>
      <filename>php/lib/function.mtauthoruserpic.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtauthoruserpicurl($args, &amp;$ctx) {
     $author = $ctx-&gt;stash('author');
     if (!$author) return '';</diff>
      <filename>php/lib/function.mtauthoruserpicurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogarchiveurl($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogarchiveurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogcategorycount($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogcategorycount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogcclicenseimage($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogcclicenseimage.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogcclicenseurl($args, &amp;$ctx) {
     $blog = $ctx-&gt;stash('blog');
     $cc = $blog['blog_cc_license'];</diff>
      <filename>php/lib/function.mtblogcclicenseurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogcommentcount($args, &amp;$ctx) {
     $args['blog_id'] = $ctx-&gt;stash('blog_id');
     return $ctx-&gt;mt-&gt;db-&gt;blog_comment_count($args);</diff>
      <filename>php/lib/function.mtblogcommentcount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogdescription($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogdescription.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogentrycount($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogentrycount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogfileextension($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogfileextension.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtbloghost($args, &amp;$ctx) {
     // status: complete
     // parameters: exclude_port, signature</diff>
      <filename>php/lib/function.mtbloghost.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogid($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtbloglanguage($args, &amp;$ctx) {
     $real_lang = array('cz' =&gt; 'cs', 'dk' =&gt; 'da', 'jp' =&gt; 'ja', 'si' =&gt; 'sl');
     $blog = $ctx-&gt;stash('blog');</diff>
      <filename>php/lib/function.mtbloglanguage.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogname($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtblogentrycount.php');
 function smarty_function_mtblogpagecount($args, &amp;$ctx) {
     // status: complete</diff>
      <filename>php/lib/function.mtblogpagecount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogpingcount($args, &amp;$ctx) {
     $args['blog_id'] = $ctx-&gt;stash('blog_id');
     return $ctx-&gt;mt-&gt;db-&gt;blog_ping_count($args);</diff>
      <filename>php/lib/function.mtblogpingcount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogrelativeurl($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogrelativeurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogsitepath($args, &amp;$ctx) {
     $blog = $ctx-&gt;stash('blog');
     $path = $blog['blog_site_path'];</diff>
      <filename>php/lib/function.mtblogsitepath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogtemplatesetid($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogtemplatesetid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogtimezone($args, &amp;$ctx) {
     // status: complete
     // parameters: no_colon</diff>
      <filename>php/lib/function.mtblogtimezone.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtblogurl($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtblogurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtbuildtemplateid($args, &amp;$ctx) {
     return $ctx-&gt;stash('build_template_id');
 }</diff>
      <filename>php/lib/function.mtbuildtemplateid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcalendarcellnumber($args, &amp;$ctx) {
     return $ctx-&gt;stash('CalendarCellNumber');
 }</diff>
      <filename>php/lib/function.mtcalendarcellnumber.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcalendardate($args, &amp;$ctx) {
     return $ctx-&gt;_hdlr_date($args, $ctx);
 }</diff>
      <filename>php/lib/function.mtcalendardate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcalendarday($args, &amp;$ctx) {
     return $ctx-&gt;stash('CalendarDay');
 }</diff>
      <filename>php/lib/function.mtcalendarday.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('captcha_lib.php');
 function smarty_function_mtcaptchafields($args, &amp;$ctx) {
     // status: complete</diff>
      <filename>php/lib/function.mtcaptchafields.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategoryarchivelink($args, &amp;$ctx) {
     $category = $ctx-&gt;stash('category') or $ctx-&gt;stash('archive_category');
     if (!$category) {</diff>
      <filename>php/lib/function.mtcategoryarchivelink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategorybasename($args, &amp;$ctx) {
     $cat = $ctx-&gt;stash('category');
     if (!$cat) return '';</diff>
      <filename>php/lib/function.mtcategorybasename.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategorycommentcount($args, &amp;$ctx) {
     global $mt;
     $db =&amp; $mt-&gt;db;</diff>
      <filename>php/lib/function.mtcategorycommentcount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategorycount($args, &amp;$ctx) {
     $category = $ctx-&gt;stash('category');
     return $category['category_count'];</diff>
      <filename>php/lib/function.mtcategorycount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategorydescription($args, &amp;$ctx) {
     $cat = $ctx-&gt;stash('category');
     if (!$cat) return '';</diff>
      <filename>php/lib/function.mtcategorydescription.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategoryid($args, &amp;$ctx) {
     $cat = $ctx-&gt;stash('category');
     if (!$cat) return '';</diff>
      <filename>php/lib/function.mtcategoryid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategorylabel($args, &amp;$ctx) {
     $cat = $ctx-&gt;stash('category');
     if (!$cat) return '';</diff>
      <filename>php/lib/function.mtcategorylabel.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategorytrackbackcount($args, &amp;$ctx) {
     $cat = $ctx-&gt;stash('category');
     $cat_id = $cat['category_id'];</diff>
      <filename>php/lib/function.mtcategorytrackbackcount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcategorytrackbacklink($args, &amp;$ctx) {
     $cat = $ctx-&gt;stash('category');
     if (!$cat) return '';</diff>
      <filename>php/lib/function.mtcategorytrackbacklink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcclicenserdf($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtcclicenserdf.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcgihost($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtcgihost.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcgipath($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtcgipath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcgirelativeurl($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtcgirelativeurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcgiserverpath($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtcgiserverpath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentauthor($args, &amp;$ctx) {
     $c = $ctx-&gt;stash('comment');
     if (!$c) {</diff>
      <filename>php/lib/function.mtcommentauthor.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentauthoridentity($args, &amp;$ctx) {
     $cmt = $ctx-&gt;stash('comment');
     $cmntr = $ctx-&gt;stash('commenter');
@@ -20,12 +26,7 @@ function smarty_function_mtcommentauthoridentity($args, &amp;$ctx) {
     require_once &quot;commenter_auth_lib.php&quot;;
     $logo = _auth_icon_url($static_path, $cmntr);
     if (!$logo) {
-        $blog = $ctx-&gt;stash('blog');
-        if ($ctx-&gt;mt-&gt;config('PublishCommenterIcon')) {
-            $root_url = $blog['blog_site_url'];
-        } else {
-            $root_url = $static_path . 'images/';
-        }
+        $root_url = $static_path . 'images/';
         if (!preg_match('/\/$/', $root_url)) {
             $root_url .= '/';
         }</diff>
      <filename>php/lib/function.mtcommentauthoridentity.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentauthorlink($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     $name = $comment['comment_author'];</diff>
      <filename>php/lib/function.mtcommentauthorlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentbody($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     $text = $comment['comment_text'];</diff>
      <filename>php/lib/function.mtcommentbody.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentdate($args, &amp;$ctx) {
     $c = $ctx-&gt;stash('comment');
     $args['ts'] = $c['comment_created_on'];</diff>
      <filename>php/lib/function.mtcommentdate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentemail($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     $email = $comment['comment_email'];</diff>
      <filename>php/lib/function.mtcommentemail.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommententryid($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     $id = $comment['comment_entry_id'];</diff>
      <filename>php/lib/function.mtcommententryid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenterauthiconurl($args, &amp;$ctx) {
     $a =&amp; $ctx-&gt;stash('commenter');
     if (!isset($a)) {</diff>
      <filename>php/lib/function.mtcommenterauthiconurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenterauthtype($args, &amp;$ctx) {
     $a =&amp; $ctx-&gt;stash('commenter');
     return isset($a) ? $a['author_auth_type'] : '';</diff>
      <filename>php/lib/function.mtcommenterauthtype.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenteremail($args, &amp;$ctx) {
     $a =&amp; $ctx-&gt;stash('commenter');
     if (!isset($a)) return '';</diff>
      <filename>php/lib/function.mtcommenteremail.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenterid($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     if (!$comment) return '';</diff>
      <filename>php/lib/function.mtcommenterid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentername($args, &amp;$ctx) {
     $a =&amp; $ctx-&gt;stash('commenter');
     return isset($a) ? $a['author_nickname'] : '';</diff>
      <filename>php/lib/function.mtcommentername.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenternamethunk($args, &amp;$ctx) {
     $blog = $ctx-&gt;stash('blog');
     $archive_url = $ctx-&gt;tag('BlogArchiveURL');</diff>
      <filename>php/lib/function.mtcommenternamethunk.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenterurl($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     if (!$comment) return '';</diff>
      <filename>php/lib/function.mtcommenterurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenterusername($args, &amp;$ctx) {
     $a =&amp; $ctx-&gt;stash('commenter');
     return isset($a) ? $a['author_name'] : '';</diff>
      <filename>php/lib/function.mtcommenterusername.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenteruserpic($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     if (!$comment) {</diff>
      <filename>php/lib/function.mtcommenteruserpic.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenteruserpicurl($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     if (!$comment) {</diff>
      <filename>php/lib/function.mtcommenteruserpicurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentfields($args, &amp;$ctx) {
     return &quot;&quot;;
 }</diff>
      <filename>php/lib/function.mtcommentfields.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentid($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     $id = $comment['comment_id'];</diff>
      <filename>php/lib/function.mtcommentid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentip($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     return $comment['comment_ip'];</diff>
      <filename>php/lib/function.mtcommentip.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentlink($args, &amp;$ctx) {
     $args['no_anchor'] = 1;
     $entry_link = $ctx-&gt;tag('EntryPermaink', $args);</diff>
      <filename>php/lib/function.mtcommentlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentname($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     return $comment['comment_author'];</diff>
      <filename>php/lib/function.mtcommentname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentordernumber($args, &amp;$ctx) {
     return $ctx-&gt;stash('comment_order_num');
 }</diff>
      <filename>php/lib/function.mtcommentordernumber.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtcommentrank($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtcommentrank.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentrepliesrecurse($args, &amp;$ctx) {
     $localvars = array('comments', 'comment_order_num', 'comment','current_timestamp', 'commenter', 'blog', 'blog_id');
     $token_fn = $ctx-&gt;stash('_comment_replies_tokens');</diff>
      <filename>php/lib/function.mtcommentrepliesrecurse.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtcommentscore($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtcommentscore.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtcommentscoreavg($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtcommentscoreavg.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtcommentscorecount($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtcommentscorecount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtcommentscorehigh($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtcommentscorehigh.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtcommentscorelow($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtcommentscorelow.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommentscript($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtcommentscript.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtcommenturl($args, &amp;$ctx) {
     $comment = $ctx-&gt;stash('comment');
     return $comment['comment_url'];</diff>
      <filename>php/lib/function.mtcommenturl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtconfigfile($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtconfigfile.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtdate($args, &amp;$ctx) {
     require_once(&quot;MTUtil.php&quot;);
     $t = time();</diff>
      <filename>php/lib/function.mtdate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtdefaultlanguage($args, &amp;$ctx) {
     return $ctx-&gt;mt-&gt;config('DefaultLanguage');
 }</diff>
      <filename>php/lib/function.mtdefaultlanguage.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentriescount($args, &amp;$ctx) {
     if ($ctx-&gt;stash('inside_mt_categories')) {
         return $ctx-&gt;tag('MTCategoryCount', $args);</diff>
      <filename>php/lib/function.mtentriescount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryatomid($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     return $entry['entry_atom_id'];</diff>
      <filename>php/lib/function.mtentryatomid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthor($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtentryauthor.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthordisplayname($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtentryauthordisplayname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthorid($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtentryauthorid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthorlink($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if (!$entry) return '';</diff>
      <filename>php/lib/function.mtentryauthorlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthornickname($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtentryauthornickname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthorurl($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     return $entry['author_url'];</diff>
      <filename>php/lib/function.mtentryauthorurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthorusername($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtentryauthorusername.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthoruserpic($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if (!$entry) {</diff>
      <filename>php/lib/function.mtentryauthoruserpic.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryauthoruserpicurl($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if (!$entry) return '';</diff>
      <filename>php/lib/function.mtentryauthoruserpicurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrybasename($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if (!$entry) return '';</diff>
      <filename>php/lib/function.mtentrybasename.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryblogdescription($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if ($entry['entry_blog_id']) {</diff>
      <filename>php/lib/function.mtentryblogdescription.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryblogid($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     return (isset($args['pad']) &amp;&amp; $args['pad']) ? sprintf(&quot;%06d&quot;, $entry['entry_blog_id']) : $entry['entry_blog_id'];</diff>
      <filename>php/lib/function.mtentryblogid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryblogname($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if ($entry['entry_blog_id']) {</diff>
      <filename>php/lib/function.mtentryblogname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryblogurl($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if ($entry['entry_blog_id']) {</diff>
      <filename>php/lib/function.mtentryblogurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrybody($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $text = $entry['entry_text'];</diff>
      <filename>php/lib/function.mtentrybody.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrycategory($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if ($entry['placement_category_id']) {</diff>
      <filename>php/lib/function.mtentrycategory.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryclass($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $class = $entry['entry_class'];</diff>
      <filename>php/lib/function.mtentryclass.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryclasslabel($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $class = $entry['entry_class'];</diff>
      <filename>php/lib/function.mtentryclasslabel.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrycommentcount($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $entry_id = $entry['entry_id'];</diff>
      <filename>php/lib/function.mtentrycommentcount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrycreateddate($args, &amp;$ctx) {
     $e = $ctx-&gt;stash('entry');
     $args['ts'] = $e['entry_created_on'];</diff>
      <filename>php/lib/function.mtentrycreateddate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrydate($args, &amp;$ctx) {
     $e = $ctx-&gt;stash('entry');
     $args['ts'] = $e['entry_authored_on'];</diff>
      <filename>php/lib/function.mtentrydate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryexcerpt($args, &amp;$ctx) {
     // todo: needs work
     $e = $ctx-&gt;stash('entry');</diff>
      <filename>php/lib/function.mtentryexcerpt.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryflag($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $flag = 'entry_' . $args['flag'];</diff>
      <filename>php/lib/function.mtentryflag.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentryid($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     return (isset($args['pad']) &amp;&amp; $args['pad']) ? sprintf(&quot;%06d&quot;, $entry['entry_id']) : $entry['entry_id'];</diff>
      <filename>php/lib/function.mtentryid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrykeywords($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     return $entry['entry_keywords'];</diff>
      <filename>php/lib/function.mtentrykeywords.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrylink($args, &amp;$ctx) {
     $args['no_anchor'] = 1;
     $link = $ctx-&gt;tag('EntryPermalink', $args);</diff>
      <filename>php/lib/function.mtentrylink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrymodifieddate($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $args['ts'] = $entry['entry_modified_on'];</diff>
      <filename>php/lib/function.mtentrymodifieddate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrymore($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $text = $entry['entry_text_more'];</diff>
      <filename>php/lib/function.mtentrymore.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,14 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrypermalink($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
+    if (!$entry)
+        return '';
     $blog = $ctx-&gt;stash('blog');
     $at = $args['type'];
     $at or $at = $args['archive_type'];</diff>
      <filename>php/lib/function.mtentrypermalink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtentryrank($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtentryrank.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtentryscore($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtentryscore.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtentryscoreavg($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtentryscoreavg.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtentryscorecount($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtentryscorecount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtentryscorehigh($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtentryscorehigh.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtentryscorelow($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtentryscorelow.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 define('STATUS_HOLD', 1);
 define('STATUS_RELEASE', 2);
 define('STATUS_REVIEW', 3);</diff>
      <filename>php/lib/function.mtentrystatus.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrytitle($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $title = $entry['entry_title'];</diff>
      <filename>php/lib/function.mtentrytitle.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrytrackbackcount($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     $entry_id = $entry['entry_id'];</diff>
      <filename>php/lib/function.mtentrytrackbackcount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrytrackbackdata($args, &amp;$ctx) {
     $e = $ctx-&gt;stash('entry');
     if (!$e['trackback_id']) {</diff>
      <filename>php/lib/function.mtentrytrackbackdata.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrytrackbackid($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     return $entry['trackback_id'];</diff>
      <filename>php/lib/function.mtentrytrackbackid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtentrytrackbacklink($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');
     if (!$entry) return '';</diff>
      <filename>php/lib/function.mtentrytrackbacklink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mterrorcode($args, &amp;$ctx) {
     $err = $ctx-&gt;stash('error_code');
     return empty($err) ? '' : $err;</diff>
      <filename>php/lib/function.mterrorcode.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mterrormessage($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mterrormessage.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtfeedbackscore($args, &amp;$ctx) {
     $fb =&amp; $ctx-&gt;stash('comment');
     $score = '';</diff>
      <filename>php/lib/function.mtfeedbackscore.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function _file_template_format($m) {
     static $f = array(
         'a' =&gt; &quot;&lt;MTEntryAuthorNickname DIR&gt;&quot;,</diff>
      <filename>php/lib/function.mtfiletemplate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtcategorybasename.php');
 function smarty_function_mtfolderbasename($args, &amp;$ctx) {
     return smarty_function_mtcategorybasename($args, $ctx);</diff>
      <filename>php/lib/function.mtfolderbasename.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtcategorycount.php');
 function smarty_function_mtfoldercount($args, &amp;$ctx) {
     return smarty_function_mtcategorycount($args, $ctx);</diff>
      <filename>php/lib/function.mtfoldercount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtcategorydescription.php');
 function smarty_function_mtfolderdescription($args, &amp;$ctx) {
     return smarty_function_mtcategorydescription($args, $ctx);</diff>
      <filename>php/lib/function.mtfolderdescription.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtcategoryid.php');
 function smarty_function_mtfolderid($args, &amp;$ctx) {
     return smarty_function_mtcategoryid($args, $ctx);</diff>
      <filename>php/lib/function.mtfolderid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtcategorylabel.php');
 function smarty_function_mtfolderlabel($args, &amp;$ctx) {
     return smarty_function_mtcategorylabel($args, $ctx);</diff>
      <filename>php/lib/function.mtfolderlabel.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtsubcategorypath.php');
 function smarty_function_mtfolderpath($args, &amp;$ctx) {
     return smarty_function_mtsubcategorypath($args, $ctx);</diff>
      <filename>php/lib/function.mtfolderpath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtgetvar($args, &amp;$ctx) {
     require_once(&quot;function.mtvar.php&quot;);
     return smarty_function_mtvar($args, $ctx);</diff>
      <filename>php/lib/function.mtgetvar.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mthttpcontenttype($args, &amp;$ctx) {
     $ctx-&gt;stash('content_type', $args['type']);
     return '';</diff>
      <filename>php/lib/function.mthttpcontenttype.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mthttperrorcode($args, &amp;$ctx) {
     $err = $ctx-&gt;stash('http_error');
     return empty($err) ? '' : $err;</diff>
      <filename>php/lib/function.mthttperrorcode.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtimageheight($args, &amp;$ctx) {
     // todo: needs work
     return $ctx-&gt;stash('ImageHeight');</diff>
      <filename>php/lib/function.mtimageheight.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtimageurl($args, &amp;$ctx) {
     return $ctx-&gt;stash('ImageURL');
 }</diff>
      <filename>php/lib/function.mtimageurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtimagewidth($args, &amp;$ctx) {
     // todo: needs work
     return $ctx-&gt;stash('ImageWidth');</diff>
      <filename>php/lib/function.mtimagewidth.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $restricted_include_filenames;
 $restricted_include_filenames = array('mt-config.cgi' =&gt; 1, 'passwd' =&gt; 1);
 </diff>
      <filename>php/lib/function.mtinclude.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtindexbasename($args, &amp;$ctx) {
     $name = $ctx-&gt;mt-&gt;config('IndexBasename');
     if (!isset($args['extension']) || !$args['extension']) return $name;</diff>
      <filename>php/lib/function.mtindexbasename.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtindexlink($args, &amp;$ctx) {
     $tmpl = $ctx-&gt;stash('index_templates');
     $counter = $ctx-&gt;stash('index_templates_counter');</diff>
      <filename>php/lib/function.mtindexlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtindexname($args, &amp;$ctx) {
     $tmpl = $ctx-&gt;stash('index_templates');
     $counter = $ctx-&gt;stash('index_templates_counter');</diff>
      <filename>php/lib/function.mtindexname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtlink($args, &amp;$ctx) {
     // status: incomplete
     // parameters: template, entry_id</diff>
      <filename>php/lib/function.mtlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtnotifyscript($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtnotifyscript.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentryauthordisplayname.php');
 function smarty_function_mtpageauthordisplayname($args, &amp;$ctx) {
     return smarty_function_mtentryauthordisplayname($args, $ctx);</diff>
      <filename>php/lib/function.mtpageauthordisplayname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentryauthoremail.php');
 function smarty_function_mtpageauthoremail($args, &amp;$ctx) {
     return smarty_function_mtentryauthoremail($args, $ctx);</diff>
      <filename>php/lib/function.mtpageauthoremail.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentryauthorlink.php');
 function smarty_function_mtpageauthorlink($args, &amp;$ctx) {
     return smarty_function_mtentryauthorlink($args, $ctx);</diff>
      <filename>php/lib/function.mtpageauthorlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentryauthorurl.php');
 function smarty_function_mtpageauthorurl($args, &amp;$ctx) {
     return smarty_function_mtentryauthorurl($args, $ctx);</diff>
      <filename>php/lib/function.mtpageauthorurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentrybasename.php');
 function smarty_function_mtpagebasename($args, &amp;$ctx) {
     return smarty_function_mtentrybasename($args, $ctx);</diff>
      <filename>php/lib/function.mtpagebasename.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentrybody.php');
 function smarty_function_mtpagebody($args, &amp;$ctx) {
     return smarty_function_mtentrybody($args, $ctx);</diff>
      <filename>php/lib/function.mtpagebody.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentrydate.php');
 function smarty_function_mtpagedate($args, &amp;$ctx) {
     return smarty_function_mtentrydate($args, $ctx);</diff>
      <filename>php/lib/function.mtpagedate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentryexcerpt.php');
 function smarty_function_mtpageexcerpt($args, &amp;$ctx) {
     return smarty_function_mtentryexcerpt($args, $ctx);</diff>
      <filename>php/lib/function.mtpageexcerpt.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentryid.php');
 function smarty_function_mtpageid($args, &amp;$ctx) {
     return smarty_function_mtentryid($args, $ctx);</diff>
      <filename>php/lib/function.mtpageid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentrykeywords.php');
 function smarty_function_mtpagekeywords($args, &amp;$ctx) {
     return smarty_function_mtentrykeywords($args, $ctx);</diff>
      <filename>php/lib/function.mtpagekeywords.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentrymodifieddate.php');
 function smarty_function_mtpagemodifieddate($args, &amp;$ctx) {
     return smarty_function_mtentrymodifieddate($args, $ctx);</diff>
      <filename>php/lib/function.mtpagemodifieddate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentrymore.php');
 function smarty_function_mtpagemore($args, &amp;$ctx) {
     return smarty_function_mtentrymore($args, $ctx);</diff>
      <filename>php/lib/function.mtpagemore.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentrypermalink.php');
 function smarty_function_mtpagepermalink($args, &amp;$ctx) {
     $entry = $ctx-&gt;stash('entry');</diff>
      <filename>php/lib/function.mtpagepermalink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtentrytitle.php');
 function smarty_function_mtpagetitle($args, &amp;$ctx) {
     return smarty_function_mtentrytitle($args, $ctx);</diff>
      <filename>php/lib/function.mtpagetitle.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpingblogname($args, &amp;$ctx) {
     $ping = $ctx-&gt;stash('ping');
     return $ping['tbping_blog_name'];</diff>
      <filename>php/lib/function.mtpingblogname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpingdate($args, &amp;$ctx) {
     $p = $ctx-&gt;stash('ping');
     $args['ts'] = $p['tbping_created_on'];</diff>
      <filename>php/lib/function.mtpingdate.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpingexcerpt($args, &amp;$ctx) {
     $ping = $ctx-&gt;stash('ping');
     return $ping['tbping_excerpt'];</diff>
      <filename>php/lib/function.mtpingexcerpt.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpingid($args, &amp;$ctx) {
     $ping = $ctx-&gt;stash('ping');
     return $ping['tbping_id'];</diff>
      <filename>php/lib/function.mtpingid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpingip($args, &amp;$ctx) {
     $ping = $ctx-&gt;stash('ping');
     return $ping['tbping_ip'];</diff>
      <filename>php/lib/function.mtpingip.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtpingrank($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtpingrank.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtpingscore($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtpingscore.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtpingscoreavg($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtpingscoreavg.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtpingscorecount($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtpingscorecount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtpingscorehigh($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtpingscorehigh.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('rating_lib.php');
 
 function smarty_function_mtpingscorelow($args, &amp;$ctx) {</diff>
      <filename>php/lib/function.mtpingscorelow.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpingssenturl($args, &amp;$ctx) {
     $url = $ctx-&gt;stash('ping_sent_url');
     return $url;</diff>
      <filename>php/lib/function.mtpingssenturl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpingtitle($args, &amp;$ctx) {
     $ping = $ctx-&gt;stash('ping');
     return $ping['tbping_title'];</diff>
      <filename>php/lib/function.mtpingtitle.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpingurl($args, &amp;$ctx) {
     $ping = $ctx-&gt;stash('ping');
     return $ping['tbping_source_url'];</diff>
      <filename>php/lib/function.mtpingurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtproductname($args, &amp;$ctx) {
     $short_name = PRODUCT_NAME;
     if ($args['version']) {</diff>
      <filename>php/lib/function.mtproductname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtpublishcharset($args, &amp;$ctx) {
     // Status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtpublishcharset.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtremotesigninlink($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtremotesigninlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtremotesignoutlink($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtremotesignoutlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtsearchincludeblogs($args, &amp;$ctx) {
     return '';
 }</diff>
      <filename>php/lib/function.mtsearchincludeblogs.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtsearchscript($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtsearchscript.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtsearchstring($args, &amp;$ctx) {
     return '';
 }</diff>
      <filename>php/lib/function.mtsearchstring.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,132 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtsetvar($args, &amp;$ctx) {
     // status: complete
     // parameters: name, value
     $name = $args['name'];
     $name or $name = $args['var'];
     if (!$name) return '';
-    $value = $args['value'];
+
     $vars =&amp; $ctx-&gt;__stash['vars'];
+
+    if (preg_match('/^(\w+)\((.+)\)$/', $name, $matches)) {
+        $func = $matches[1];
+        $name = $matches[2];
+    } else {
+        if (array_key_exists('function', $args))
+            $func = $args['function'];
+    }
+
+    # pick off any {...} or [...] from the name.
+    if (preg_match('/^(.+)([\[\{])(.+)[\]\}]$/', $name, $matches)) {
+        $name = $matches[1];
+        $br = $matches[2];
+        $ref = $matches[3];
+        if (preg_match('/^\$(.+)/', $ref, $ref_matches)) {
+            $ref = $vars[$ref_matches[1]];
+            if (!isset($ref))
+                $ref = chr(0);
+        }
+        $br == '[' ? $index = $ref : $key = $ref;
+    } else {
+        if (array_key_exists('index', $args))
+            $index = $args['index'];
+        else if (array_key_exists('key', $args))
+            $key = $args['key'];
+    }
+
+    if (preg_match('/^$/', $name)) {
+        $name = $vars[$name];
+        if (!isset($name))
+            return $ctx-&gt;error($ctx-&gt;mt-&gt;translate(
+                &quot;You used a [_1] tag without a valid name attribute.&quot;, &quot;&lt;MT$tag&gt;&quot; ));
+    }
+
+    $value = $args['value'];
+    $existing = $vars[$name];
+
+    require_once(&quot;MTUtil.php&quot;);
+    if (isset($key)) {
+        if (!isset($existing))
+            $existing = array($key =&gt; $value);
+        elseif (is_hash($existing))
+            $existing = $existing[$key];
+        else
+            return $ctx-&gt;error( $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not a hash.&quot;, $name) );
+    }
+    elseif (isset($index)) {
+        if (!isset($existing))
+            $existing[$index] = $value;
+        elseif (is_array($existing)) {
+            if ( is_numeric($index) )
+                $existing = $existing[$index];
+            else
+                return $ctx-&gt;error( $ctx-&gt;mt-&gt;translate(&quot;Invalid index.&quot;) );
+        }
+        else
+            return $ctx-&gt;error( $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not an array.&quot;, $name) );
+    }
+
     if (array_key_exists('append', $args) &amp;&amp; $args['append']) {
-        $existing = is_array($vars) ? $vars[$name] : '';
-        $value = $existing . $value;
-    } elseif (array_key_exists('prepend', $args) &amp;&amp; $args['prepend']) {
-        $existing = is_array($vars) ? $vars[$name] : '';
-        $value = $value . $existing;
+        $value = isset($existing) ? $existing . $value : $value;
+    }
+    elseif (array_key_exists('prepend', $args) &amp;&amp; $args['prepend']) {
+        $value = isset($existing) ?  $value . $existing : $value;
+    }
+    elseif ( isset($existing) &amp;&amp; array_key_exists('op', $args) ) {
+        $op = $args['op'];
+        $value = _math_operation($op, $existing, $value);
+        if (!isset($value))
+            return $ctx-&gt;error($ctx-&gt;mt-&gt;translate(&quot;[_1] [_2] [_3] is illegal.&quot;, $existing, $op, $value));
+    }
+
+    $data = $vars[$name];
+    if ( isset($key) ) {
+        if ( ( isset($func) )
+          &amp;&amp; ( 'delete' == strtolower( $func ) ) ) {
+            unset($data[$key]);
+        }
+        else {
+            $data[$key] = $value;
+        }
+    }
+    elseif ( isset($index) ) {
+        $data[$index] = $value;
+    }
+    elseif ( isset($func) ) {
+        if ( 'undef' == strtolower( $func ) ) {
+            unset($data);
+        }
+        else {
+            if (isset($data) &amp;&amp; !is_array($data))
+                return $ctx-&gt;error( $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not an array.&quot;, $name) );
+            if (!isset($data))
+                $data = array();
+            if ( 'push' == strtolower( $func ) ) {
+                array_push($data, $value);
+            }
+            elseif ( 'unshift' == strtolower( $func ) ) {
+                array_unshift($data, $value);
+            }
+            else {
+                return $ctx-&gt;error(
+                    $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not a valid function.&quot;, $func)
+                );
+            }
+        }
+    }
+    else {
+        $data = $value;
     }
     if (is_array($vars)) {
-        $vars[$name] = $value;
+        $vars[$name] = $data;
     } else {
-        $vars = array($name =&gt; $value);
+        $vars = array($name =&gt; $data);
         $ctx-&gt;__stash['vars'] =&amp; $vars;
     }
     return '';</diff>
      <filename>php/lib/function.mtsetvar.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtsignonurl($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtsignonurl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtstaticfilepath($args, &amp;$ctx) {
     $path = $ctx-&gt;mt-&gt;config('StaticFilePath');
     if (!$path) {</diff>
      <filename>php/lib/function.mtstaticfilepath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtstaticwebpath($args, &amp;$ctx) {
     $path = $ctx-&gt;mt-&gt;config('StaticWebPath');
     if (!$path) {</diff>
      <filename>php/lib/function.mtstaticwebpath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtsubcategorypath($args, &amp;$ctx) {
     require_once(&quot;block.mtparentcategories.php&quot;);
     require_once(&quot;function.mtcategorylabel.php&quot;);</diff>
      <filename>php/lib/function.mtsubcategorypath.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtsubcatsrecurse($args, &amp;$ctx) {
     $localvars = array('subCatsDepth', 'category', 'subCatIsFirst', 'subCatIsLast');
     $fn = $ctx-&gt;stash('subCatTokens');</diff>
      <filename>php/lib/function.mtsubcatsrecurse.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mtsubcatsrecurse.php');
 function smarty_function_mtsubfolderrecurse($args, &amp;$ctx) {
     $args['class'] = 'folder';</diff>
      <filename>php/lib/function.mtsubfolderrecurse.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttagcount($args, &amp;$ctx) {
     $tag = $ctx-&gt;stash('Tag');
     if (!$tag) return '';</diff>
      <filename>php/lib/function.mttagcount.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttagid($args, &amp;$ctx) {
     $tag = $ctx-&gt;stash('Tag');
     if (!$tag) return '';</diff>
      <filename>php/lib/function.mttagid.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once('function.mttagname.php');
 function smarty_function_mttaglabel($args, &amp;$ctx) {
     return smarty_function_mttagname($args, $ctx);</diff>
      <filename>php/lib/function.mttaglabel.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttagname($args, &amp;$ctx) {
     $tag = $ctx-&gt;stash('Tag');
     if (!$tag) return '';</diff>
      <filename>php/lib/function.mttagname.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttagrank($args, &amp;$ctx) {
     $blog_id = $ctx-&gt;stash('blog_id');
     $max_level = $args['max'];</diff>
      <filename>php/lib/function.mttagrank.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttagsearchlink($args, &amp;$ctx) {
     $tag = $ctx-&gt;stash('Tag');
     if (!$tag) return '';</diff>
      <filename>php/lib/function.mttagsearchlink.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttemplatecreatedon($args, &amp;$ctx) {
     $args['ts'] = $ctx-&gt;stash('template_created_on');
     return $ctx-&gt;_hdlr_date($args, $ctx);</diff>
      <filename>php/lib/function.mttemplatecreatedon.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttemplatenote($args, &amp;$ctx) {
     return '';
 }</diff>
      <filename>php/lib/function.mttemplatenote.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttrackbackscript($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mttrackbackscript.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mttypekeytoken($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mttypekeytoken.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,19 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtvar($args, &amp;$ctx) {
     // status: complete
     // parameters: name
-    if (array_key_exists('value', $args)) {
+    if ( array_key_exists('value', $args)
+      &amp;&amp; !array_key_exists('op', $args) ) {
         require_once(&quot;function.mtsetvar.php&quot;);
         return smarty_function_mtsetvar($args, $ctx);
     }
+    require_once(&quot;MTUtil.php&quot;);
     $vars =&amp; $ctx-&gt;__stash['vars'];
     $value = '';
     $name = $args['name'];
@@ -22,9 +30,44 @@ function smarty_function_mtvar($args, &amp;$ctx) {
         }
     }
     if (!$name) return '';
+
+    if (preg_match('/^(\w+)\((.+)\)$/', $name, $matches)) {
+        $func = $matches[1];
+        $name = $matches[2];
+    } else {
+        if (array_key_exists('function', $args))
+            $func = $args['function'];
+    }
+
+    # pick off any {...} or [...] from the name.
+    if (preg_match('/^(.+)([\[\{])(.+)[\]\}]$/', $name, $matches)) {
+        $name = $matches[1];
+        $br = $matches[2];
+        $ref = $matches[3];
+        if (preg_match('/^\\\\\$(.+)/', $ref, $ref_matches)) {
+            $ref = $vars[$ref_matches[1]];
+            if (!isset($ref))
+                $ref = chr(0);
+        }
+        $br == '[' ? $index = $ref : $key = $ref;
+    } else {
+        if (array_key_exists('index', $args))
+            $index = $args['index'];
+        else if (array_key_exists('key', $args))
+            $key = $args['key'];
+    }
+
+    if (preg_match('/^$/', $name)) {
+        $name = $vars[$name];
+        if (!isset($name))
+            return $ctx-&gt;error($ctx-&gt;mt-&gt;translate(
+                &quot;You used a [_1] tag without a valid name attribute.&quot;, &quot;&lt;MT$tag&gt;&quot; ));
+    }
+
     if (isset($vars[$name]))
         $value = $vars[$name];
-    if (preg_match('/^smarty_fun_[a-f0-9]+$/', $value)) {
+    if ( !is_array($value)
+      &amp;&amp; preg_match('/^smarty_fun_[a-f0-9]+$/', $value) ) {
         if (function_exists($value)) {
             ob_start();
             $value($ctx, array());
@@ -35,7 +78,87 @@ function smarty_function_mtvar($args, &amp;$ctx) {
         }
     }
 
-    if ($value == '') {
+    $return_val = $value;
+    if (isset($name)) {
+        if (is_hash($value)) {
+            if ( isset($key) ) {
+                if ( isset($func) ) {
+                    if ( 'delete' == strtolower($func) ) {
+                        $return_val = $value[$key];
+                        unset($value[$key]);
+                        $vars[$name] = $value;
+                    } else {
+                        return $ctx-&gt;error(
+                            $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not a valid function for a hash.&quot;, $func)
+                        );
+                    }
+                } else {
+                    if ($key != chr(0)) {
+                        $return_val = $value[$key];
+                    } else {
+                        unset($value);
+                    }
+                }
+            }
+            elseif ( isset($func) ) {
+                if ( 'count' == strtolower($func) ) {
+                    $return_val = count(array_keys($value));
+                }
+                else {
+                    return $ctx-&gt;error(
+                        $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not a valid function for a hash.&quot;, $func)
+                    );
+                }
+            }
+        }
+        elseif (is_array($value)) {
+            if ( isset($index) ) {
+                if (is_numeric($index)) {
+                    $return_val = $value[ $index ];
+                } else {
+                    unset($value); # fall through to any 'default'
+                }
+            }
+            elseif ( isset($func) ) {
+                $func = strtolower($func);
+                if ( 'pop' == $func ) {
+                    $return_val = array_pop($value);
+                    $vars[$name] = $value;
+                }
+                elseif ( 'shift' == $func ) {
+                    $return_val = array_shift($value);
+                    $vars[$name] = $value;
+                }
+                elseif ( 'count' == $func ) {
+                    $return_val = count($value);
+                }
+                else {
+                    return $ctx-&gt;error(
+                        $ctx-&gt;mt-&gt;translate(&quot;'[_1]' is not a valid function for an array.&quot;, $func)
+                    );
+                }
+            }
+            else {
+                if (!array_key_exists('to_json', $args) &amp;&amp; $args['to_json']) {
+                    $glue = $args['glue'];
+                    if (!isset($glue))
+                        $glue = '';
+                    $return_val = implode($glue, $value);
+                }
+            }
+        }
+        if ( array_key_exists('op', $args) ) {
+            $op = $args['op'];
+            $rvalue = $args['value'];
+            if ( $op &amp;&amp; isset($value) &amp;&amp; !is_array($value) ) {
+                $return_val = _math_operation($op, $value, $rvalue);
+                if (!isset($return_val)) {
+                    return $ctx-&gt;error($ctx-&gt;mt-&gt;translate(&quot;[_1] [_2] [_3] is illegal.&quot;, $value, $op, $rvalue));
+            }}
+        }
+    }
+
+    if ($return_val == '') {
         if (isset($args['default'])) {
             $value = $args['default'];
         }
@@ -43,21 +166,20 @@ function smarty_function_mtvar($args, &amp;$ctx) {
     if (isset($args['escape'])) {
         $esc = strtolower($args['escape']);
         if ($esc == 'js') {
-            require_once(&quot;MTUtil.php&quot;);
-            $value = encode_js($value);
+            $return_val = encode_js($return_val);
         } elseif ($esc == 'html') {
             if (version_compare(phpversion(), '4.3.0', '&gt;=')) {
                 global $mt;
                 $charset = $mt-&gt;config('PublishCharset');
-                $value = htmlentities($value, ENT_COMPAT, $charset);
+                $return_val = htmlentities($return_val, ENT_COMPAT, $charset);
             } else {
-                $value = htmlentities($value, ENT_COMPAT);
+                $return_val = htmlentities($return_val, ENT_COMPAT);
             }
         } elseif ($esc == 'url') {
-            $value = urlencode($text);
-            $value = preg_replace('/\+/', '%20', $text);
+            $return_val = urlencode($return_val);
+            $return_val = preg_replace('/\+/', '%20', $return_val);
         }
     }
-    return $value;
+    return $return_val;
 }
 ?&gt;</diff>
      <filename>php/lib/function.mtvar.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtversion($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtversion.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtxmlrpcscript($args, &amp;$ctx) {
     // status: complete
     // parameters: none</diff>
      <filename>php/lib/function.mtxmlrpcscript.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $Lexicon_de;
 $Lexicon_de = array(
 ## php/lib/archive_lib.php
@@ -42,7 +48,7 @@ $Lexicon_de = array(
 ## php/lib/function.mtentryclasslabel.php
 	'page' =&gt; 'erneut ver&#246;ffentlichen',
 	'entry' =&gt; 'Eintrag',
-	'Entry' =&gt; 'Eintrag',
+	'Entry' =&gt; 'Eintrag'
 );
 function translate_phrase($str, $params = null) {
     global $Lexicon, $Lexicon_de;</diff>
      <filename>php/lib/l10n_de.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $Lexicon;
 $Lexicon['Individual'] = 'Entry';
 function translate_phrase($str, $params = null) {</diff>
      <filename>php/lib/l10n_en.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $Lexicon_es;
 $Lexicon_es = array(
 ## php/lib/archive_lib.php
@@ -42,7 +48,7 @@ $Lexicon_es = array(
 ## php/lib/function.mtentryclasslabel.php
 	'page' =&gt; 'p&#225;gina',
 	'entry' =&gt; 'entrada',
-	'Entry' =&gt; 'Entrada'
+	'Entry' =&gt; 'Entrada',
 );
 function translate_phrase($str, $params = null) {
     global $Lexicon, $Lexicon_es;</diff>
      <filename>php/lib/l10n_es.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $Lexicon_fr;
 $Lexicon_fr = array(
 ## php/lib/archive_lib.php</diff>
      <filename>php/lib/l10n_fr.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $Lexicon_ja;
 $Lexicon_ja = array(
 </diff>
      <filename>php/lib/l10n_ja.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 global $Lexicon_nl;
 $Lexicon_nl = array(
 ## php/lib/archive_lib.php
@@ -36,6 +42,8 @@ $Lexicon_nl = array(
 
 ## php/lib/MTUtil.php
 	'userpic-[_1]-%wx%h%x' =&gt; 'gebruikersafbeelding-[_1]-%wx%h%x',
+
+## php/lib/function.mtauthordisplayname.php
 );
 function translate_phrase($str, $params = null) {
     global $Lexicon, $Lexicon_nl;</diff>
      <filename>php/lib/l10n_nl.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_convert_breaks($text) {
     require_once(&quot;MTUtil.php&quot;);
     return html_text_transform($text);</diff>
      <filename>php/lib/modifier.convert_breaks.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_decode_html($text) {
     require_once(&quot;MTUtil.php&quot;);
     return decode_html($text);</diff>
      <filename>php/lib/modifier.decode_html.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_decode_xml($text) {
     require_once(&quot;MTUtil.php&quot;);
     return decode_xml($text);</diff>
      <filename>php/lib/modifier.decode_xml.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_dirify($text, $attr = '1') {
     if ($attr == &quot;0&quot;) return $text;
     require_once(&quot;MTUtil.php&quot;);</diff>
      <filename>php/lib/modifier.dirify.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_encode_html($text) {
     if (version_compare(phpversion(), '4.3.0', '&gt;=')) {
         global $mt;</diff>
      <filename>php/lib/modifier.encode_html.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_encode_js($text) {
     require_once(&quot;MTUtil.php&quot;);
     return encode_js($text);</diff>
      <filename>php/lib/modifier.encode_js.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_encode_php($text, $type) {
     switch ($type) {
         case 'qq':</diff>
      <filename>php/lib/modifier.encode_php.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_encode_url($text) {
     $text = urlencode($text);
     $text = preg_replace('/\+/', '%20', $text);</diff>
      <filename>php/lib/modifier.encode_url.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_encode_xml($text) {
     require_once(&quot;MTUtil.php&quot;);
     return encode_xml($text);</diff>
      <filename>php/lib/modifier.encode_xml.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_filters($text,$filters) {
     // status: complete
     $f = preg_split('/\s*,\s*/', $filters);</diff>
      <filename>php/lib/modifier.filters.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_lower_case($text) {
     return strtolower($text);
 }</diff>
      <filename>php/lib/modifier.lower_case.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_ltrim($text) {
     return ltrim($text);
 }</diff>
      <filename>php/lib/modifier.ltrim.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_nofollowfy($str, $arg = 1) {
     # manipulate hyperlinks in $str...
     if (!isset($str)) return $str;</diff>
      <filename>php/lib/modifier.nofollowfy.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_remove_html($text) {
     return strip_tags($text);
 }</diff>
      <filename>php/lib/modifier.remove_html.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_richtext($text) {
     return $text;
 }</diff>
      <filename>php/lib/modifier.richtext.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_rtrim($text) {
     return rtrim($text);
 }</diff>
      <filename>php/lib/modifier.rtrim.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_sanitize($text, $spec) {
     if ($spec == '1') {
         global $mt;</diff>
      <filename>php/lib/modifier.sanitize.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_space_pad($text, $len) {
     return sprintf(&quot;%&quot;.$len.&quot;s&quot;, $text);
 }</diff>
      <filename>php/lib/modifier.space_pad.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_spam_protect($text) {
     # defined in mt.php itself
     return spam_protect($text);</diff>
      <filename>php/lib/modifier.spam_protect.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_sprintf($text, $format) {
     return sprintf($format, $text);
 }</diff>
      <filename>php/lib/modifier.sprintf.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_strip_linefeeds($text) {
     return preg_replace('/[\r\n]/', '', $text);
 }</diff>
      <filename>php/lib/modifier.strip_linefeeds.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_trim($text) {
     return trim($text);
 }</diff>
      <filename>php/lib/modifier.trim.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_trim_to($text, $len) {
     $len = intval($len);
     require_once(&quot;MTUtil.php&quot;);</diff>
      <filename>php/lib/modifier.trim_to.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_upper_case($text) {
     return strtoupper($text);
 }</diff>
      <filename>php/lib/modifier.upper_case.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_words($text, $words) {
     require_once(&quot;MTUtil.php&quot;);
     return first_n_text($text, $words);</diff>
      <filename>php/lib/modifier.words.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_wrap_text($text, $words) {
     return wordwrap($text, $words - 1, &quot;\n&quot;, true);
 }</diff>
      <filename>php/lib/modifier.wrap_text.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_modifier_zero_pad($text, $len) {
     return sprintf(&quot;%0&quot;.$len.&quot;s&quot;, $text);
 }</diff>
      <filename>php/lib/modifier.zero_pad.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -1878,6 +1878,31 @@ class MTDatabaseBase extends ezsql {
         return $count;
     }
 
+    function author_entry_count($args) {
+        if ($sql = $this-&gt;include_exclude_blogs($args)) {
+            $blog_filter = 'and entry_blog_id ' . $sql;
+        } elseif (isset($args['blog_id'])) {
+            $blog_id = intval($args['blog_id']);
+            $blog_filter = 'and entry_blog_id = ' . $blog_id;
+        }
+        if (isset($args['author_id'])) {
+            $author_id = intval($args['author_id']);
+            $author_filter = &quot; and entry_author_id = $author_id&quot;;
+        }
+        if (isset($args['class'])) {
+            $class = $args['class'];
+        }
+        $count = $this-&gt;get_var(&quot;
+          select count(*)
+            from mt_entry
+            where entry_status = 2
+            and entry_class='$class'
+            $blog_filter
+            $author_filter
+            &quot;);
+        return $count;
+    }
+
     function &amp;fetch_placements($args) {
         $category_id_list = $args['category_id'];
         $id_list = '';
@@ -1996,6 +2021,7 @@ class MTDatabaseBase extends ezsql {
 
         if ($entry_id) {
             $entry_filter = &quot; and comment_entry_id = $entry_id&quot;;
+            $entry_join = &quot;join mt_entry on entry_id = comment_entry_id&quot;;
         } else {
             $entry_join = &quot;join mt_entry on entry_id = comment_entry_id and entry_status = 2&quot;;
         }
@@ -2012,6 +2038,8 @@ class MTDatabaseBase extends ezsql {
         $offset = 0;
         if (isset($args['lastn']))
             $limit = $args['lastn'];
+        if (isset($args['limit']))
+            $limit = $args['limit'];
         if (isset($args['offset']))
             $limit = $args['offset'];
         if (count($filters)) {
@@ -2022,7 +2050,8 @@ class MTDatabaseBase extends ezsql {
 
         $sql = &quot;
             select $distinct
-                   mt_comment.*
+                   mt_comment.*,
+                   mt_entry.*
               from mt_comment
                    $entry_join
                    $join_score
@@ -2032,7 +2061,6 @@ class MTDatabaseBase extends ezsql {
              order by comment_created_on $order
                    &lt;LIMIT&gt;&quot;;
         $sql = $this-&gt;apply_limit_sql($sql, $limit, $offset);
-
         # Fetch resultset
         $result = $this-&gt;query_start($sql);
         if (!$result) return null;
@@ -2100,7 +2128,7 @@ class MTDatabaseBase extends ezsql {
             $asc_created_on = create_function('$a,$b', 'return strcmp($a[&quot;comment_created_on&quot;], $b[&quot;comment_created_on&quot;]);');
             usort($comments, $asc_created_on);
         }
-  
+
         return $comments;
     }
 
@@ -2552,6 +2580,8 @@ class MTDatabaseBase extends ezsql {
         $offset = 0;
         if (isset($args['lastn']))
             $limit = $args['lastn'];
+        if (isset($args['limit']))
+            $limit = $args['limit'];
         if (isset($args['offset']))
             $offset = $args['offset'];
 
@@ -2819,19 +2849,36 @@ class MTDatabaseBase extends ezsql {
 
     function include_exclude_blogs(&amp;$args) {
 
-        if (isset($args[blog_ids]) || isset($args[include_blogs])) {
+        if (isset($args['blog_ids']) || isset($args['include_blogs'])) {
             // The following are aliased
-            $args[blog_ids] and $args[include_blogs] = $args[blog_ids];
-            $attr = $args[include_blogs];
-            unset($args[blog_ids]);
+            $args['blog_ids'] and $args['include_blogs'] = $args['blog_ids'];
+            $attr = $args['include_blogs'];
+            unset($args['blog_ids']);
             $is_excluded = 0;
-        } elseif (isset($args[exclude_blogs])) {            
+        } elseif (isset($args['exclude_blogs'])) {            
             $attr = $args[exclude_blogs];
             $is_excluded = 1;
         } else {
             return;
         }
-        $blog_ids = strtolower($blog_ids);
+
+        if (preg_match('/-/', $attr)) {
+            # parse range blog ids out
+            $list = preg_split('/\s*,\s*/', $attr);
+            $attr = '';
+            foreach ($list as $item) {
+                if (preg_match('/(\d+)-(\d+)/', $item, $matches)) {
+                    for ($i = $matches[1]; $i &lt;= $matches[2]; $i++) {
+                        if ($attr != '') $attr .= ',';
+                        $attr .= $i;
+                    }
+                } else {
+                    if ($attr != '') $attr .= ',';
+                    $attr .= $item;
+                }
+            }
+        }
+
         $blog_ids = preg_split('/\s*,\s*/', 
                                 $attr, 
                                 -1, PREG_SPLIT_NO_EMPTY);</diff>
      <filename>php/lib/mtdb_base.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>php/lib/mtdb_mysql.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>php/lib/mtdb_postgres.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>php/lib/mtdb_sqlite.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 /* Movable Type template -&gt; Smarty template
   
     &lt;$MTVariable$&gt; -&gt; {Variable}</diff>
      <filename>php/lib/prefilter.mt_to_smarty.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
 
 function get_score(&amp;$ctx, $obj_id, $datasource, $namespace, $user_id) {
     $score = $ctx-&gt;mt-&gt;db-&gt;fetch_score($namespace, $obj_id, $user_id, $datasource);</diff>
      <filename>php/lib/rating_lib.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_resource_mt_source($tpl_name, &amp;$tpl_source, &amp;$ctx) {
     $blog_id = $ctx-&gt;stash('blog_id');
     if (intval($tpl_name) &gt; 0) {</diff>
      <filename>php/lib/resource.mt.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 &lt;?php
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2004-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -509,7 +509,6 @@ class MT {
                 $vars['category_archive'] = 1;
                 $vars['main_template'] = 1;
                 $vars['archive_template'] = 1;
-                $vars['module_category_archives'] = 1;
                 $vars['module_category-monthly_archives'] = 1;
             }
         }</diff>
      <filename>php/mt.php.pre</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# Blog Cloner plugin for Movable Type
-# Author: Brad Choate, Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Blog Cloner plugin for Movable Type
+# Author: Brad Choate, Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package MT::Plugin::Cloner;
 
 use strict;
@@ -12,9 +16,9 @@ use base 'MT::Plugin';
 our $VERSION = '2.0';
 
 my $plugin = MT::Plugin::Cloner-&gt;new({
-    name        =&gt; &quot;Weblog Cloner&quot;,
+    name        =&gt; &quot;Blog Cloner&quot;,
     version     =&gt; $VERSION,
-    description =&gt; '&lt;MT_TRANS phrase=&quot;Clones a weblog and all of its contents.&quot;&gt;',
+    description =&gt; '&lt;MT_TRANS phrase=&quot;Clones a blog and all of its contents.&quot;&gt;',
     author_name =&gt; &quot;Six Apart, Ltd.&quot;,
     author_link =&gt; 'http://www.sixapart.com/',
     registry =&gt; {</diff>
      <filename>plugins/Cloner/cloner.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,11 @@
-# Copyright 2006-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
-#
-# Original Copyright (c) 2004-2006 David Raynes
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original Copyright (c) 2004-2006 David Raynes
+
 package MultiBlog;
 
 use strict;
@@ -101,7 +101,7 @@ sub post_entry_save {
         }
 
         require MT::Entry;
-        if ( $entry-&gt;status == MT::Entry::RELEASE() ) {
+        if ( ( $entry-&gt;status || 0 ) == MT::Entry::RELEASE() ) {
             while ( my ( $id, $a ) = each( %{ $d-&gt;{'entry_pub'} } ) ) {
                 next if $id == $blog_id;
                 perform_mb_action( $app, $id, $_ ) foreach keys %$a;
@@ -168,7 +168,7 @@ sub filter_blogs_from_args {
     }
     # Make sure include_blogs/exclude_blogs is valid
     elsif (($incl || $excl) ne 'all' 
-        and ($incl || $excl) !~ /^\d+(,\d+)*$/) {
+        and ($incl || $excl) !~ /^\d+([,-]\d+)*$/) {
         $err =  $plugin-&gt;translate('The value for the include_blogs/exclude_blogs attributes must be one or more blog IDs, separated by commas.');
     }
     return $ctx-&gt;error($err) if $err;
@@ -180,7 +180,20 @@ sub filter_blogs_from_args {
     } else {
         ($attr, $val) = ('exclude_blogs', $excl);
     }
-    @blogs = split(',', $val);
+
+    if ($val =~ m/-/) {
+        my @list = split /\s*,\s*/, $val;
+        foreach my $id (@list) {
+            if ($id =~ m/^(\d+)-(\d+)$/) {
+                push @blogs, $_ for $1..$2;
+            } else {
+                push @blogs, $id;
+            }
+        }
+    }
+    else {
+        @blogs = split(/\s*,\s*/, $val);
+    }
 
     # Filter the blogs using the MultiBlog access controls
     ($attr, @blogs) = filter_blogs($plugin, $ctx, $attr, @blogs);</diff>
      <filename>plugins/MultiBlog/lib/MultiBlog.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,13 @@
-package MultiBlog::L10N;
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
+
+# Original Copyright (c) 2004-2006 David Raynes
+
+package MultiBlog::L10N;
+
 use strict;
 use base 'MT::Plugin::L10N';
 </diff>
      <filename>plugins/MultiBlog/lib/MultiBlog/L10N.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,13 @@
-package MultiBlog::L10N::en_us;
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
+
+# Original Copyright (c) 2004-2006 David Raynes
+
+package MultiBlog::L10N::en_us;
+
 use strict;
 
 use base 'MultiBlog::L10N';</diff>
      <filename>plugins/MultiBlog/lib/MultiBlog/L10N/en_us.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,13 @@
-package MultiBlog::L10N::ja;
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
+
+# Original Copyright (c) 2004-2006 David Raynes
+
+package MultiBlog::L10N::ja;
+
 use strict;
 use base 'MultiBlog::L10N::en_us';
 use vars qw( %Lexicon );</diff>
      <filename>plugins/MultiBlog/lib/MultiBlog/L10N/ja.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,11 @@
-# Copyright 2006-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
-#
-# Original Copyright (c) 2004-2006 David Raynes
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original Copyright (c) 2004-2006 David Raynes
+
 package MultiBlog::Tags;
 
 use strict;</diff>
      <filename>plugins/MultiBlog/lib/MultiBlog/Tags.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,11 @@
-# Copyright 2006-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
-#
-# Original Copyright (c) 2004-2006 David Raynes
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original Copyright (c) 2004-2006 David Raynes
+
 package MT::Plugin::MultiBlog;
 
 use strict;</diff>
      <filename>plugins/MultiBlog/multiblog.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 if (MULTIBLOG_ENABLED) {
 function smarty_block_mtmultiblog($args, $content, &amp;$ctx, &amp;$repeat) {
 </diff>
      <filename>plugins/MultiBlog/php/block.mtmultiblog.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 if (MULTIBLOG_ENABLED) {
 function smarty_block_mtmultiblogiflocalblog($args, $content, &amp;$ctx, &amp;$repeat) {
     if (!isset($content)) {</diff>
      <filename>plugins/MultiBlog/php/block.mtmultiblogiflocalblog.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 if (MULTIBLOG_ENABLED) {
 function smarty_block_mtmultibloglocalblog($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('local_blog_id', 'blog_id', 'blog');</diff>
      <filename>plugins/MultiBlog/php/block.mtmultibloglocalblog.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 if (MULTIBLOG_ENABLED) {
 function smarty_block_mtotherblog($args, $content, &amp;$ctx, &amp;$repeat) {
     $localvars = array('local_blog_id', 'blog_id', 'blog');</diff>
      <filename>plugins/MultiBlog/php/block.mtotherblog.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,8 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
 
 global $mt;
@@ -174,7 +178,7 @@ function multiblog_filter_blogs_from_args(&amp;$ctx, &amp;$args) {
 
     # Make sure include_blogs/exclude_blogs is valid
     if (($incl or $excl) != 'all' 
-        and !preg_match('/^\d+(,\d+)*$/', $incl or $excl)) {
+        and !preg_match('/^\d+([,-]\d+)*$/', $incl or $excl)) {
             return false;
     }
 
@@ -182,7 +186,20 @@ function multiblog_filter_blogs_from_args(&amp;$ctx, &amp;$args) {
     $blogs = array();
     $attr = $incl ? 'include_blogs' : 'exclude_blogs';
     $val = $incl ? $incl : $excl;
-    $blogs = preg_split('/,/', $val);
+    if (preg_match('/-/', $val)) {
+        # parse range blog ids out
+        $list = preg_split('/\s*,\s*/', $val);
+        foreach ($list as $item) {
+            if (preg_match('/(\d+)-(\d+)/', $item, $matches)) {
+                for ($i = $matches[1]; $i &lt;= $matches[2]; $i++)
+                    $blogs[] = $i;
+            } else {
+                $blogs[] = $item;
+            }
+        }
+    } else {
+        $blogs = preg_split('/\s*,\s*/', $val);
+    }
 
     # Filter the blogs using the MultiBlog access controls
     list($attr, $blogs) = multiblog_filter_blogs($ctx, $attr, $blogs);</diff>
      <filename>plugins/MultiBlog/php/init.MultiBlog.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 &lt;mt:unless name=&quot;json&quot;&gt;
-&lt;$mt:setvar name=&quot;screen_type&quot; value=&quot;dialog-screen dialog-4&quot;$&gt;
+&lt;$mt:setvar name=&quot;screen_type&quot; value=&quot;dialog-screen&quot;$&gt;
 &lt;mt:setvarblock name=&quot;page_title&quot;&gt;&lt;__trans phrase=&quot;Create MultiBlog Trigger&quot;&gt;&lt;/mt:setvarblock&gt;
 &lt;mt:setvarblock name=&quot;html_head&quot; append=&quot;1&quot;&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;js/tc/client.js&quot;&gt;&lt;/script&gt;</diff>
      <filename>plugins/MultiBlog/tmpl/dialog_create_trigger.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2005-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
@@ -40,11 +41,16 @@ sub listify {
 sub view {
     my $app     = shift;
     my $blog_id = $app-&gt;param('blog_id');
-    return $app-&gt;errtrans(&quot;Invalid request&quot;) unless $blog_id;
+    $app-&gt;return_to_dashboard( redirect =&gt; 1 ) unless $blog_id;
 
     my $blog = MT::Blog-&gt;load($blog_id);
     return $app-&gt;errtrans(&quot;Invalid request&quot;) unless $blog;
 
+    my $static_path = $app-&gt;static_file_path;
+    if (! -d $static_path ) {
+        return $app-&gt;errtrans(&quot;Your mt-static directory could not be found. Please configure 'StaticFilePath' to continue.&quot;);
+    }
+
     my $themeroot =
       File::Spec-&gt;catdir( $app-&gt;static_file_path, 'support', 'themes' );
     my $webthemeroot = $app-&gt;static_path . 'support/themes';
@@ -150,8 +156,13 @@ sub apply {
     return $app-&gt;json_error($app-&gt;translate(&quot;Invalid request&quot;))
       unless $blog_id &amp;&amp; $url &amp;&amp; $tmpl;
 
+    my $static_path = $app-&gt;static_file_path;
+    if (! -d $static_path ) {
+        return $app-&gt;json_error($app-&gt;translate(&quot;Your mt-static directory could not be found. Please configure 'StaticFilePath' to continue.&quot;));
+    }
+
     my $themeroot =
-      File::Spec-&gt;catdir( $app-&gt;static_file_path, 'support', 'themes' );
+      File::Spec-&gt;catdir( $static_path, 'support', 'themes' );
     my $webthemeroot = $app-&gt;static_path . 'support/themes/';
     my $mtthemeroot  = $app-&gt;static_path . 'themes/';
     my $mtthemebase  = $app-&gt;static_path . 'themes-base/';</diff>
      <filename>plugins/StyleCatcher/lib/StyleCatcher/CMS.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-# Copyright 2001-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.  For more information, consult your
-# Movable Type license.
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>plugins/StyleCatcher/lib/StyleCatcher/L10N.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package StyleCatcher::L10N::de;
 
 use strict;</diff>
      <filename>plugins/StyleCatcher/lib/StyleCatcher/L10N/de.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package StyleCatcher::L10N::en_us;
 
 use strict;</diff>
      <filename>plugins/StyleCatcher/lib/StyleCatcher/L10N/en_us.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package StyleCatcher::L10N::es;
 
 use strict;</diff>
      <filename>plugins/StyleCatcher/lib/StyleCatcher/L10N/es.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package StyleCatcher::L10N::fr;
 
 use strict;</diff>
      <filename>plugins/StyleCatcher/lib/StyleCatcher/L10N/fr.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package StyleCatcher::L10N::ja;
 
 use strict;</diff>
      <filename>plugins/StyleCatcher/lib/StyleCatcher/L10N/ja.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,9 @@
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 package StyleCatcher::L10N::nl;
 
 use strict;</diff>
      <filename>plugins/StyleCatcher/lib/StyleCatcher/L10N/nl.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
-# Copyright 2005-2007 Six Apart. This code cannot be redistributed without
-# permission from www.sixapart.com.
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 </diff>
      <filename>plugins/StyleCatcher/stylecatcher.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# WXRImporter plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# WXRImporter plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package MT::Plugin::WXRImporter;
 
 use strict;
@@ -11,7 +15,7 @@ use base qw( MT::Plugin );
 
 my $plugin = new MT::Plugin::WXRImporter({
     name =&gt; &quot;WXR Importer&quot;,
-    version =&gt; '1.0',
+    version =&gt; '1.1',
     description =&gt; '&lt;MT_TRANS phrase=&quot;Import WordPress exported RSS into MT.&quot;&gt;',
     author_name =&gt; &quot;Six Apart, Ltd.&quot;,
     author_link =&gt; &quot;http://www.sixapart.com/&quot;,
@@ -27,11 +31,17 @@ sub init_registry {
                 label =&gt; 'WordPress eXtended RSS (WXR)',
                 type =&gt; 'WXRImporter::Import',
                 handler =&gt; 'WXRImporter::Import::import_contents',
-                options =&gt; [ 'wp_path', 'mt_site_path', 'mt_extra_path' ],
+                options =&gt; [ 'wp_path', 'mt_site_path', 'mt_extra_path', 'wp_download' ],
                 options_template =&gt; 'options.tmpl',
                 options_param =&gt; 'WXRImporter::Import::get_param',
             },
         },
+        task_workers =&gt; {
+            'wxr_importer' =&gt; {
+                label =&gt; &quot;Download WP attachments via HTTP.&quot;,
+                class =&gt; 'WXRImporter::Worker::Downloader',
+            },
+        },
     });
 }
 </diff>
      <filename>plugins/WXRImporter/WXRImporter.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,194 +1,201 @@
-# WXRImporter plugin for Movable Type
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
-#
-# $Id$
-
-package WXRImporter::Import;
-use strict;
-
-use base qw(MT::ErrorHandler);
-
-sub import_contents {
-    my $class = shift;
-    my %param = @_;
-    my $iter = $param{Iter};
-    my $blog = $param{Blog} or return $class-&gt;error(MT-&gt;translate(&quot;No Blog&quot;));
-    my $cb = $param{Callback} || sub { };
-    my $encoding = $param{Encoding};
-
-    my($root_path, $root_url, $relative_path);
-    if (my $p = delete $param{'mt_site_path'}) {
-        $root_path = $root_url = '%r';
-    } else {
-        $root_path = $root_url = '%a';
-    }
-
-    if ($root_path &amp;&amp; $root_url) {
-        $relative_path = delete $param{'mt_extra_path'};
-        my $path = $root_path;
-        if ($relative_path) {
-            if ($relative_path =~ m!\.\.|\0|\|!) {
-                return $class-&gt;error(MT-&gt;translate(
-                    &quot;Invalid extra path '[_1]'&quot;, $relative_path));
-            }
-            $path = File::Spec-&gt;catdir($path, $relative_path);
-        }
-
-        ## $path should be local path to file now (we don't create/upload files nor mkpath)
-
-        my $url = $path;
-        $url =~ s!\\!/!g;
-
-        $param{'mt_path'} = $path;
-        $param{'mt_url'} = $url;
-    }
-
-    if (exists $param{ImportAs}) {
-    } elsif (exists $param{ParentAuthor}) {
-        require MT::Auth;
-            return $class-&gt;error(MT-&gt;translate(
-                &quot;You need to provide a password if you are going to &quot; .
-                &quot;create new users for each user listed in your blog.&quot;))
-                    if MT::Auth-&gt;password_exists &amp;&amp; !(exists $param{NewAuthorPassword});
-    } else {
-        return $class-&gt;error(MT-&gt;translate(
-            &quot;Need either ImportAs or ParentAuthor&quot;));
-    }
-    $cb-&gt;(&quot;\n&quot;);
-    my $import_result = eval {
-        while (my $stream = $iter-&gt;()) {
-            my $result = eval {
-                $class-&gt;start_import($stream, %param);
-            };
-            $cb-&gt;($@) unless $result;
-        }
-        $class-&gt;errstr ? undef : 1;
-    };
-    $import_result;
-}
-
-sub start_import {
-    my $self = shift;
-    my ($stream, %param) = @_;
-
-    if (ref($stream) eq 'Fh') {
-        $stream = WXRImporter::Stream-&gt;new($stream);
-    }
-    
-    require XML::SAX;
-    require WXRImporter::WXRHandler;
-    my $handler = WXRImporter::WXRHandler-&gt;new(
-        callback =&gt; $param{Callback},
-        blog =&gt; $param{Blog},
-        def_cat_id =&gt; $param{DefaultCategoryID},
-        convert_breaks =&gt; $param{ConvertBreaks},
-        (exists $param{ImportAs}) ?
-            ( author =&gt; $param{ImportAs} ) :
-            ( parent =&gt; $param{ParentAuthor} ),
-        pass =&gt; $param{NewAuthorPassword},
-        wp_path =&gt; $param{wp_path},
-        mt_path =&gt; $param{mt_path},
-        mt_url =&gt; $param{mt_url},
-    );
-
-    require MT::Util;
-    my $parser = MT::Util::sax_parser();
-    $param{Callback}-&gt;(ref($parser) . &quot;\n&quot;) if MT::ConfigMgr-&gt;instance-&gt;DebugMode;
-    $parser-&gt;{Handler} = $handler;
-    my $e;
-    eval { $parser-&gt;parse_file($stream); };
-    $e = $@ if $@;
-    if ($e) {
-        $param{Callback}-&gt;($e);
-        return $self-&gt;error($e);
-    }
-    1;
-}
-
-sub get_param {
-    my $class = shift;
-    my ($blog_id) = @_;
-
-    my $blog = MT::Blog-&gt;load($blog_id) or return $class-&gt;error(MT-&gt;translate('No Blog'));
-
-    my $param = { blog_id =&gt; $blog_id };
-    my $label_path;
-    if ($blog-&gt;column('archive_path')) {
-        $param-&gt;{enable_archive_paths} = 1;
-        $label_path = MT-&gt;translate('Archive Root');
-    } else {
-        $label_path = MT-&gt;translate('Site Root');
-    }
-    $param-&gt;{missing_paths} =
-           ((defined $blog-&gt;site_path || defined $blog-&gt;archive_path) 
-         &amp;&amp; (-d $blog-&gt;site_path || -d $blog-&gt;archive_path)) ? 0 : 1;
-    $param;
-}
-
-# This package will be removed once WordPress fixes issues
-# which it generates non-well formed XML (therefore it's
-# not even XML at all).  See:
-# http://trac.wordpress.org/ticket/4242
-# http://trac.wordpress.org/ticket/4452
-package WXRImporter::Stream;
-
-use Symbol;
-
-use vars qw( $fh );
-sub new {
-    my $class = shift;
-    my $this = bless Symbol::gensym(), $class;
-    tie *$this, $this;
-    $fh = $_[0];
-    return $this;
-}
-
-sub read {
-    my $this = shift;
-    my $res = read($fh, $_[0], $_[1], $_[2] || 0);
-    my $string = $_[0];
-    $string = _encode_wp_comment($string);
-    $_[0] = $string;
-    $res;
-}
-
-sub binmode {
-    my $this = shift;
-    binmode $fh;
-}
-    
-sub eof {
-    my $this = shift;
-    eof $fh;
-}
-
-sub close {
-    my $this = shift;
-    close $fh;
-}
-
-*READ   = \&amp;read;
-*BINMODE = \&amp;binmode;
-*EOF    = \&amp;eof;
-*CLOSE  = \&amp;close;
-
-sub TIEHANDLE {
-    return $_[0] if ref($_[0]);
-    my $class = shift;
-    my $this = bless Symbol::gensym(), $class;
-    $fh = $_[0];
-    return $this;
-}
-
-sub _encode_wp_comment {
-    my ($str) = @_;
-
-    use HTML::Entities::Numbered;
-    $str = name2hex_xml($str);
-    return $str;
-}
-
-1;
-
-__END__
+# WXRImporter plugin for Movable Type
+# Author: Six Apart (http://www.sixapart.com)
+# Released under the Artistic License
+#
+# $Id$
+
+package WXRImporter::Import;
+use strict;
+
+use base qw(MT::ErrorHandler);
+
+sub import_contents {
+    my $class = shift;
+    my %param = @_;
+    my $iter = $param{Iter};
+    my $blog = $param{Blog} or return $class-&gt;error(MT-&gt;translate(&quot;No Blog&quot;));
+    my $cb = $param{Callback} || sub { };
+    my $encoding = $param{Encoding};
+
+    my($root_path, $root_url, $relative_path);
+    if (my $p = delete $param{'mt_site_path'}) {
+        $root_path = $root_url = '%r';
+    } else {
+        $root_path = $root_url = '%a';
+    }
+
+    if ($root_path &amp;&amp; $root_url) {
+        $relative_path = delete $param{'mt_extra_path'};
+        my $path = $root_path;
+        if ($relative_path) {
+            if ($relative_path =~ m!\.\.|\0|\|!) {
+                return $class-&gt;error(MT-&gt;translate(
+                    &quot;Invalid extra path '[_1]'&quot;, $relative_path));
+            }
+            $path = File::Spec-&gt;catdir($path, $relative_path);
+        }
+
+        ## $path should be local path to file now (we don't create/upload files nor mkpath)
+
+        my $url = $path;
+        $url =~ s!\\!/!g;
+
+        $param{'mt_path'} = $path;
+        $param{'mt_url'} = $url;
+    }
+
+    if (exists $param{ImportAs}) {
+    } elsif (exists $param{ParentAuthor}) {
+        require MT::Auth;
+        return $class-&gt;error(MT-&gt;translate(
+            &quot;You need to provide a password if you are going to &quot; .
+            &quot;create new users for each user listed in your blog.&quot;))
+                if MT::Auth-&gt;password_exists &amp;&amp; !(exists $param{NewAuthorPassword});
+    } else {
+        return $class-&gt;error(MT-&gt;translate(
+            &quot;Need either ImportAs or ParentAuthor&quot;));
+    }
+    $cb-&gt;(&quot;\n&quot;);
+    my $import_result = eval {
+        while (my $stream = $iter-&gt;()) {
+            my $result = eval {
+                $class-&gt;start_import($stream, %param);
+            };
+            $cb-&gt;($@) unless $result;
+        }
+        $class-&gt;errstr ? undef : 1;
+    };
+    $import_result;
+}
+
+sub start_import {
+    my $self = shift;
+    my ($stream, %param) = @_;
+
+    #if (ref($stream) eq 'Fh') {
+    #    $stream = WXRImporter::Stream-&gt;new($stream);
+    #}
+
+    my $xml = do { local $/ = undef; &lt;$stream&gt;} || ''; 
+    $xml =~ s{&lt;wp:comment_content&gt;(?:&lt;!\[CDATA\[)?(.*?)(?:\]\]&gt;)?&lt;/wp:comment_content&gt;} 
+             {&lt;wp:comment_content&gt;&lt;![CDATA[$1]]&gt;&lt;/wp:comment_content&gt;}sg; 
+    use HTML::Entities::Numbered;
+    $xml = HTML::Entities::Numbered::name2hex_xml($xml); 
+
+    require WXRImporter::WXRHandler;
+    my $handler = WXRImporter::WXRHandler-&gt;new(
+        callback =&gt; $param{Callback},
+        blog =&gt; $param{Blog},
+        def_cat_id =&gt; $param{DefaultCategoryID},
+        convert_breaks =&gt; $param{ConvertBreaks},
+        (exists $param{ImportAs}) ?
+            ( author =&gt; $param{ImportAs} ) :
+            ( parent =&gt; $param{ParentAuthor} ),
+        pass =&gt; $param{NewAuthorPassword},
+        wp_path =&gt; $param{wp_path},
+        mt_path =&gt; $param{mt_path},
+        mt_url =&gt; $param{mt_url},
+        wp_download =&gt; $param{wp_download},
+    );
+
+    require MT::Util;
+    my $parser = MT::Util::sax_parser();
+    $param{Callback}-&gt;(ref($parser) . &quot;\n&quot;) if MT::ConfigMgr-&gt;instance-&gt;DebugMode;
+    $parser-&gt;{Handler} = $handler;
+    my $e;
+    eval { $parser-&gt;parse_string($xml); };
+    #eval { $parser-&gt;parse_file($stream); };
+    $e = $@ if $@;
+    if ($e) {
+        $param{Callback}-&gt;($e);
+        return $self-&gt;error($e);
+    }
+    1;
+}
+
+sub get_param {
+    my $class = shift;
+    my ($blog_id) = @_;
+
+    my $blog = MT::Blog-&gt;load($blog_id) or return $class-&gt;error(MT-&gt;translate('No Blog'));
+
+    my $param = { blog_id =&gt; $blog_id };
+    my $label_path;
+    if ($blog-&gt;column('archive_path')) {
+        $param-&gt;{enable_archive_paths} = 1;
+        $label_path = MT-&gt;translate('Archive Root');
+    } else {
+        $label_path = MT-&gt;translate('Site Root');
+    }
+    $param-&gt;{missing_paths} =
+           ((defined $blog-&gt;site_path || defined $blog-&gt;archive_path) 
+         &amp;&amp; (-d $blog-&gt;site_path || -d $blog-&gt;archive_path)) ? 0 : 1;
+    $param;
+}
+
+## This package will be removed once WordPress fixes issues
+## which it generates non-well formed XML (therefore it's
+## not even XML at all).  See:
+## http://trac.wordpress.org/ticket/4242
+## http://trac.wordpress.org/ticket/4452
+#package WXRImporter::Stream;
+#
+#use Symbol;
+#
+#use vars qw( $fh );
+#sub new {
+#    my $class = shift;
+#    my $this = bless Symbol::gensym(), $class;
+#    tie *$this, $this;
+#    $fh = $_[0];
+#    return $this;
+#}
+#
+#sub read {
+#    my $this = shift;
+#    my $res = read($fh, $_[0], $_[1], $_[2] || 0);
+#    my $string = $_[0];
+#    $string = _encode_wp_comment($string);
+#    $_[0] = $string;
+#    $res;
+#}
+#
+#sub binmode {
+#    my $this = shift;
+#    binmode $fh;
+#}
+#    
+#sub eof {
+#    my $this = shift;
+#    eof $fh;
+#}
+#
+#sub close {
+#    my $this = shift;
+#    close $fh;
+#}
+#
+#*READ   = \&amp;read;
+#*BINMODE = \&amp;binmode;
+#*EOF    = \&amp;eof;
+#*CLOSE  = \&amp;close;
+#
+#sub TIEHANDLE {
+#    return $_[0] if ref($_[0]);
+#    my $class = shift;
+#    my $this = bless Symbol::gensym(), $class;
+#    $fh = $_[0];
+#    return $this;
+#}
+#
+#sub _encode_wp_comment {
+#    my ($str) = @_;
+#
+#    use HTML::Entities::Numbered;
+#    $str = name2hex_xml($str);
+#    return $str;
+#}
+
+1;
+
+__END__</diff>
      <filename>plugins/WXRImporter/lib/WXRImporter/Import.pm</filename>
    </modified>
    <modified>
      <diff>@@ -28,10 +28,7 @@ sub start_document {
     my $data = shift;
 
     $self-&gt;{start} = 1;
-
-    my $limit = $self-&gt;{blog}-&gt;basename_limit || 30;
-    $limit = 15 if $limit &lt; 15; $limit = 250 if $limit &gt; 250;
-    $self-&gt;{basename_limit} = $limit;
+    $self-&gt;{basename_limit} = 255; # max length of the column
 
     1;
 }
@@ -386,11 +383,27 @@ sub _create_asset {
 
     my $mt_url = $self-&gt;{'mt_url'};
     my $url = $asset_values-&gt;{'url'};
+    my $old_url = $url;
     if ($mt_url) {
         $url =~ s/^.*$wp_path(.+)$/$mt_url$1/i;
     }
     $asset_values-&gt;{'url'} = $url;
 
+    require MT::Asset;
+
+    # Check dupe
+    if ( MT::Asset-&gt;count(
+      {
+        blog_id =&gt; $asset_values-&gt;{blog_id},
+        label =&gt; $asset_values-&gt;{label},
+        file_path =&gt; $asset_values-&gt;{file_path},
+      }
+    ))
+    {
+        $cb-&gt;(MT-&gt;translate(&quot;Duplicate asset ('[_1]') found.  Skipping.&quot;, $asset_values-&gt;{label}));
+        $cb-&gt;(&quot;\n&quot;);
+        return 1;
+    }
     require File::Basename;
     my $local_basename = File::Basename::basename($path);
     my $ext = (File::Basename::fileparse($path, qr/[A-Za-z]+$/))[2];
@@ -398,9 +411,8 @@ sub _create_asset {
     $asset_values-&gt;{'file_name'} = $local_basename;
     $asset_values-&gt;{'file_ext'} = $ext;
 
-    require MT::Asset;
-    my $asset_pkg = MT::Asset-&gt;handler_for_file($local_basename);
     # Now save the asset.
+    my $asset_pkg = MT::Asset-&gt;handler_for_file($local_basename);
     my $asset = $asset_pkg-&gt;new();
     my $w = delete $asset_values-&gt;{'image_width'};
     my $h = delete $asset_values-&gt;{'image_height'};
@@ -414,6 +426,9 @@ sub _create_asset {
     $cb-&gt;(MT-&gt;translate(&quot; and asset will be tagged ('[_1]')...&quot;, join(',', @tags)));
     if ($asset-&gt;save) {
         $cb-&gt;(MT-&gt;translate(&quot;ok (ID [_1])&quot;, $asset-&gt;id) . &quot;\n&quot;);
+        if ( exists($self-&gt;{'wp_download'}) &amp;&amp; $self-&gt;{'wp_download'} ) {
+            _get_item_via_http($asset-&gt;id, $old_url);
+        }
     } else {
         $cb-&gt;(MT-&gt;translate(&quot;failed&quot;) . &quot;\n&quot;);
         die MT-&gt;translate(
@@ -436,8 +451,7 @@ sub _create_post {
     };
     my %meta_hash;
 
-    require MT::App::CMS;
-    my $class = MT::App::CMS-&gt;_load_driver_for($class_type);
+    my $class = MT-&gt;model($class_type);
     require MT::Comment;
     require MT::TBPing;
     require MT::Trackback;
@@ -458,7 +472,7 @@ sub _create_post {
         } elsif ('dc_creator' eq $key) {
             $post-&gt;author_id($self-&gt;_get_author_id($cb, $value));
         } elsif ('_category' eq $key) {
-            my $cat_class = MT::App::CMS-&gt;_load_driver_for(
+            my $cat_class = MT-&gt;model(
                 $class_type eq 'entry' ? 'category' : 'folder');
             my $cat = $cat_class-&gt;load(
                 { label =&gt; $value,
@@ -558,6 +572,21 @@ sub _create_post {
         }
     }
 
+    # Check dupe
+    if ( $class-&gt;count(
+      {
+        class =&gt; $class_type,
+        blog_id =&gt; $post-&gt;blog_id,
+        title =&gt; $post-&gt;title,
+        authored_on =&gt; $post-&gt;authored_on
+      }
+    ))
+    {
+        $cb-&gt;(MT-&gt;translate(&quot;Duplicate entry ('[_1]') found.  Skipping.&quot;, $post-&gt;title));
+        $cb-&gt;(&quot;\n&quot;);
+        return 1;
+    }
+
     # Now save the entry/page.
     if ('entry' eq $class_type) {
         $cb-&gt;(MT-&gt;translate(&quot;Saving entry ('[_1]')...&quot;, $post-&gt;title));
@@ -706,4 +735,17 @@ sub _gmt2blogtime {
     return undef;
 }
 
+sub _get_item_via_http {
+    my ($asset_id, $url) = @_;
+
+    require MT::TheSchwartz;
+    require TheSchwartz::Job;
+    my $job = TheSchwartz::Job-&gt;new();
+    $job-&gt;funcname('WXRImporter::Worker::Downloader');
+    $job-&gt;uniqkey( $asset_id );
+    $job-&gt;arg( { old_url =&gt; $url } );
+    $job-&gt;coalesce( $$ . ':' . ( time - ( time % 100 ) ) );
+    MT::TheSchwartz-&gt;insert($job);
+}
+
 1;</diff>
      <filename>plugins/WXRImporter/lib/WXRImporter/WXRHandler.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,29 @@
-&lt;mt:if name=&quot;missing_paths&quot;&gt;
-&lt;div class=&quot;error-message&quot;&gt;&lt;__trans phrase=&quot;Before you import WordPress posts to Movable Type, we recommend that you &lt;a href='[_1]'&gt;configure your blog's publishing paths&lt;/a&gt; first.&quot; params=&quot;&lt;mt:var name=&quot;script_uri&quot;&gt;?__mode=cfg_archives&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&quot;&gt;&lt;/div&gt;
-&lt;/mt:if&gt;
-
-    &lt;mtapp:setting
-        id=&quot;wp_path&quot;
-        label=&quot;&lt;__trans phrase=&quot;Upload path for this WordPress blog&quot;&gt;&quot;&gt;
-&lt;input name=&quot;wp_path&quot; id=&quot;wp_path&quot;  size=&quot;50&quot; value=&quot;wp-content/uploads&quot; /&gt;
-    &lt;/mtapp:setting&gt;
-
-    &lt;mtapp:setting
-        id=&quot;mt_site_path&quot;
-        label=&quot;&lt;__trans phrase=&quot;Replace with&quot;&gt;&quot;&gt;
-&lt;select name=&quot;mt_site_path&quot; onchange=&quot;setExtraPath(this)&quot;&gt;
-&lt;option value=&quot;1&quot;&gt;&amp;#60;&lt;MT_TRANS phrase=&quot;Site Root&quot;&gt;&amp;#62;&lt;/option&gt;
-&lt;mt:if name=&quot;enable_archive_paths&quot;&gt;
-&lt;option value=&quot;0&quot;&gt;&amp;#60;&lt;MT_TRANS phrase=&quot;Archive Root&quot;&gt;&amp;#62;&lt;/option&gt;
-&lt;/mt:if&gt;
-&lt;/select&gt;
-/ &lt;input name=&quot;mt_extra_path&quot; id=&quot;mt_extra_path&quot; /&gt;
-    &lt;/mtapp:setting&gt;
+&lt;mt:if name=&quot;missing_paths&quot;&gt;
+&lt;div class=&quot;error-message&quot;&gt;&lt;__trans phrase=&quot;Before you import WordPress posts to Movable Type, we recommend that you &lt;a href='[_1]'&gt;configure your blog's publishing paths&lt;/a&gt; first.&quot; params=&quot;&lt;mt:var name=&quot;script_uri&quot;&gt;?__mode=cfg_archives&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&quot;&gt;&lt;/div&gt;
+&lt;/mt:if&gt;
+
+    &lt;mtapp:setting
+        id=&quot;wp_path&quot;
+        label=&quot;&lt;__trans phrase=&quot;Upload path for this WordPress blog&quot;&gt;&quot;&gt;
+&lt;input name=&quot;wp_path&quot; id=&quot;wp_path&quot;  size=&quot;50&quot; value=&quot;wp-content/uploads&quot; /&gt;
+    &lt;/mtapp:setting&gt;
+
+    &lt;mtapp:setting
+        id=&quot;mt_site_path&quot;
+        label=&quot;&lt;__trans phrase=&quot;Replace with&quot;&gt;&quot;&gt;
+&lt;select name=&quot;mt_site_path&quot; onchange=&quot;setExtraPath(this)&quot;&gt;
+&lt;option value=&quot;1&quot;&gt;&amp;#60;&lt;MT_TRANS phrase=&quot;Site Root&quot;&gt;&amp;#62;&lt;/option&gt;
+&lt;mt:if name=&quot;enable_archive_paths&quot;&gt;
+&lt;option value=&quot;0&quot;&gt;&amp;#60;&lt;MT_TRANS phrase=&quot;Archive Root&quot;&gt;&amp;#62;&lt;/option&gt;
+&lt;/mt:if&gt;
+&lt;/select&gt;
+/ &lt;input name=&quot;mt_extra_path&quot; id=&quot;mt_extra_path&quot; /&gt;
+    &lt;/mtapp:setting&gt;
+
+    &lt;mtapp:setting
+        id=&quot;wp_download&quot;
+        label=&quot;&lt;__trans phrase=&quot;Download attachments&quot;&gt;&quot;
+        show_hint=&quot;1&quot;
+        hint=&quot;&lt;__trans phrase=&quot;Requires the use of a cron job to download attachments from WordPress powered blog in the background.&quot;&gt;&quot;&gt;
+&lt;input type=&quot;checkbox&quot; name=&quot;wp_download&quot; id=&quot;wp_download&quot; value=&quot;1&quot; /&gt; &lt;__trans phrase=&quot;Download attachments (images and files) from the imported WordPress powered blog.&quot;&gt;
+    &lt;/mtapp:setting&gt;</diff>
      <filename>plugins/WXRImporter/tmpl/options.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,13 @@
-# WidgetManager plugin for Movable Type
-# Author: Byrne Reese, Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2005-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# WidgetManager plugin for Movable Type
+# Author: Byrne Reese, Six Apart (http://www.sixapart.com)
+# Released under the Artistic and GPLv2 License
+
 package MT::Plugin::WidgetManager;
 
 use strict;
@@ -44,6 +48,7 @@ sub init_registry {
                 callback =&gt; 'MT::Blog::post_remove',
                 handler =&gt; '$WidgetManager::WidgetManager::Plugin::remove_blog_widgetmanager',
             },
+            'DefaultTemplateFilter' =&gt; '$WidgetManager::MT::Plugin::WidgetManager::default_templates',
         },
         applications =&gt; {
             cms =&gt; {
@@ -91,6 +96,15 @@ sub load_selected_modules {
     WidgetManager::Plugin::load_selected_modules(@_); 
 }
 
+sub default_templates {
+    my $cb = shift;
+    my ($tmpl_list) = @_;
+
+    my $widgetmgr = MT::Plugin::WidgetManager-&gt;instance;
+    my $widget_tmpls = $widgetmgr-&gt;templates(MT-&gt;instance);
+    push @$tmpl_list, @$widget_tmpls;
+}
+
 sub templates {
     my $plugin = shift;
     my ($app) = @_;</diff>
      <filename>plugins/WidgetManager/WidgetManager.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,70 +1,94 @@
 $default_widget_templates = [
     {
-        template =&gt; 'technorati_search.tmpl',
-        label =&gt; 'Technorati Search',
+        template =&gt; 'about_this_page.mtml',
+        label =&gt; 'About This Page',
     },
     {
-        template =&gt; 'calendar.tmpl',
-        label =&gt; 'Calendar',
+        template =&gt; 'archive_meta_widget.mtml',
+        label =&gt; 'Archives',
+    },
+    {
+        template =&gt; 'author_archive_list.mtml',
+        label =&gt; 'Author Archives',
     },
     {
-        template =&gt; 'category_archive_list.tmpl',
-        label =&gt; 'Category list (nested)',
+        template =&gt; 'current_author_monthly_archive_list.mtml',
+        label =&gt; 'Current Author Monthly Archives',
     },
     {
-        template =&gt; 'date-based_category_archives.tmpl',
-        label =&gt; 'Date-based Category Archives',
+        template =&gt; 'calendar.mtml',
+        label =&gt; 'Calendar',
+    },
+    {
+        template =&gt; 'category_archive_list.mtml',
+        label =&gt; 'Category Archives',
     },
     {
-        template =&gt; 'date-based_author_archives.tmpl',
-        label =&gt; 'Date-based Author Archives',
+        template =&gt; 'current_category_monthly_archive_list.mtml',
+        label =&gt; 'Current Category Monthly Archives',
     },
     {
-        template =&gt; 'creative_commons.tmpl',
+        template =&gt; 'creative_commons.mtml',
         label =&gt; 'Creative Commons',
     },
     {
-        template =&gt; 'monthly_archive_list.tmpl',
-        label =&gt; 'Monthly archive list',
+        template =&gt; 'main_index_meta_widget.mtml',
+        label =&gt; 'Home Page Widgets',
+    },
+    {
+        template =&gt; 'monthly_archive_dropdown.mtml',
+        label =&gt; 'Monthly Archives Dropdown',
     },
     {
-        template =&gt; 'powered_by.tmpl',
-        label =&gt; 'Powered by',
+        template =&gt; 'monthly_archive_list.mtml',
+        label =&gt; 'Monthly Archives',
     },
     {
-        template =&gt; 'recent_posts.tmpl',
-        label =&gt; 'Recent posts',
+        template =&gt; 'pages_list.mtml',
+        label =&gt; 'Pages',
     },
     {
-        template =&gt; 'search.tmpl',
-        label =&gt; 'Search form',
+        template =&gt; 'recent_assets.mtml',
+        label =&gt; 'Recent Assets',
     },
     {
-        template =&gt; 'subscribe_to_feed.tmpl',
-        label =&gt; 'Subscribe to feed',
+        template =&gt; 'powered_by.mtml',
+        label =&gt; 'Powered By',
     },
     {
-        template =&gt; 'recent_comments.tmpl',
-        label =&gt; 'Recent comments',
+        template =&gt; 'recent_comments.mtml',
+        label =&gt; 'Recent Comments',
     },
     {
-        template =&gt; 'tag_cloud_module.tmpl',
-        label =&gt; 'Tag cloud (sidebar)',
+        template =&gt; 'recent_entries.mtml',
+        label =&gt; 'Recent Entries',
     },
     {
-        template =&gt; 'monthly_archive_dropdown.tmpl',
-        label =&gt; 'Monthly archive dropdown',
+        template =&gt; 'search.mtml',
+        label =&gt; 'Search',
     },
     {
-        template =&gt; 'signin.tmpl',
+        template =&gt; 'signin.mtml',
         label =&gt; 'Sign In',
     },
     {
-        template =&gt; 'pages_list.tmpl',
-        label =&gt; 'Pages list (nested)',
+        template =&gt; 'syndication.mtml',
+        label =&gt; 'Syndication',
+    },
+    {
+        template =&gt; 'tag_cloud.mtml',
+        label =&gt; 'Tag Cloud',
+    },
+    {
+        template =&gt; 'technorati_search.mtml',
+        label =&gt; 'Technorati Search',
+    },
+    {
+        template =&gt; 'date_based_author_archives.mtml',
+        label =&gt; 'Date-Based Author Archives',
     },
     {
-        template =&gt; 'photos.tmpl',
-        label =&gt; 'Photos',
+        template =&gt; 'date_based_category_archives.mtml',
+        label =&gt; 'Date-Based Category Archives',
     }
 ];</diff>
      <filename>plugins/WidgetManager/default_widgets/widgets.cfg</filename>
    </modified>
    <modified>
      <diff>@@ -230,6 +230,8 @@ sub list {
     $tmpl-&gt;param(plugin_version    =&gt; $MT::Plugin::WidgetManager::VERSION);
     $tmpl-&gt;param(rebuild           =&gt; $app-&gt;param('rebuild') || 0);
     $tmpl-&gt;param(deleted           =&gt; $app-&gt;param('deleted') || 0);
+    $tmpl-&gt;param(listing_screen =&gt; 1);
+    $tmpl-&gt;param(screen_id =&gt; &quot;list-widget-set&quot;);
     return $app-&gt;build_page($tmpl);
 }
 </diff>
      <filename>plugins/WidgetManager/lib/WidgetManager/CMS.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 function smarty_function_mtwidgetmanager($args, &amp;$ctx) {
     $blog_id = $ctx-&gt;stash('blog_id');
     $widgetmanager = $args['name']; // Should we try to load is there's only one?</diff>
      <filename>plugins/WidgetManager/php/function.mtwidgetmanager.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,10 @@
 &lt;?php
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 require_once(&quot;function.mtwidgetmanager.php&quot;);
 function smarty_function_mtwidgetset($args, &amp;$ctx) {
     return smarty_function_mtwidgetmanager($args, $ctx);</diff>
      <filename>plugins/WidgetManager/php/function.mtwidgetset.php</filename>
    </modified>
    <modified>
      <diff>@@ -347,7 +347,7 @@ TC.attachLoadEvent( init );
         &lt;button
             type=&quot;submit&quot;
             accesskey=&quot;s&quot;
-            title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
             class=&quot;primary-button&quot;
             &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
     &lt;/mt:setvarblock&gt;</diff>
      <filename>plugins/WidgetManager/tmpl/edit.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
-# SpamLookup plugin for Movable Type
-# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
+
 package spamlookup;
 
 use strict;
@@ -492,8 +493,15 @@ sub wordlist_match {
             my ($opt) = $re =~ m!/([^/]*)$!;
             $re =~ s!^/!!;
             $re =~ s!/[^/]*$!!;
-            $re = '(?'.$opt.':'.$re.')' if $opt;
-            $re = eval { qr/$re/ };
+            if ($opt) {
+                # increment any internal backreferences (\1),
+                # since we're wrapping the whole expression in
+                # a capturing group
+                $re =~ s/ \\(\d+) / '\\' . ($1 + 1) /gex;
+
+                $re = '(?' . $opt . ':' . $re . ')';
+            }
+            $re = eval { qr/($re)/ };
             $re = $re_opt . quotemeta($patt) . $re_opt if $@;
             if ($has_encode) {
                 push @matches, [ Encode::encode($enc, $patt),</diff>
      <filename>plugins/spamlookup/lib/spamlookup.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,11 @@
-# SpamLookup plugin for Movable Type
-# Author: Brad Choate, Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
+
 package spamlookup::L10N;
 use strict;
 </diff>
      <filename>plugins/spamlookup/lib/spamlookup/L10N.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
-# SpamLookup plugin for Movable Type
-# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2006-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
+
 package MT::Plugin::SpamLookup;
 
 use strict;</diff>
      <filename>plugins/spamlookup/spamlookup.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
-# SpamLookup plugin for Movable Type
-# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2004-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
+
 package MT::Plugin::SpamLookup::Link;
 
 use strict;</diff>
      <filename>plugins/spamlookup/spamlookup_urls.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
-# SpamLookup plugin for Movable Type
-# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
-# Author: Six Apart (http://www.sixapart.com)
-# Released under the Artistic License
+# Movable Type (r) Open Source (C) 2004-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
 #
 # $Id$
 
+# Original copyright (c) 2004-2006, Brad Choate and Tobias Hoellrich
+
 package MT::Plugin::SpamLookup::KeywordFilter;
 
 use strict;</diff>
      <filename>plugins/spamlookup/spamlookup_words.pl</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ use lib 'extlib';
 
 # $Id$
 
-use Test::More tests =&gt; 45;
+use Test::More tests =&gt; 53;
 
 use MT;
 use MT::Author;</diff>
      <filename>t/20-setup.t</filename>
    </modified>
    <modified>
      <diff>@@ -414,5 +414,30 @@ Work rdf:about=\&quot;http://narnia.na/nana/\&quot;&gt;
 { &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTAuthors sort_by='id' need_entry='0' status='disabled'&gt;&lt;MTAuthorName&gt;;&lt;/MTAuthors&gt;&quot;, &quot;e&quot; : &quot;Hiro Nakamura;&quot;}, #362
 { &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTAuthors sort_by='id' need_entry='0' status='enabled or disabled'&gt;&lt;MTAuthorName&gt;;&lt;/MTAuthors&gt;&quot;, &quot;e&quot; : &quot;Melody;Chuck D;Bob D;John Doe;Hiro Nakamura;&quot;}, #363
 { &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTAuthors sort_by='id' need_entry='0' role='Author'&gt;&lt;MTAuthorName&gt;;&lt;/MTAuthors&gt;&quot;, &quot;e&quot; : &quot;Chuck D;&quot;}, #364
-{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTAuthors sort_by='id' need_entry='0' role='Author or Designer'&gt;&lt;MTAuthorName&gt;;&lt;/MTAuthors&gt;&quot;, &quot;e&quot; : &quot;Chuck D;Bob D;&quot;} #365
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTAuthors sort_by='id' need_entry='0' role='Author or Designer'&gt;&lt;MTAuthorName&gt;;&lt;/MTAuthors&gt;&quot;, &quot;e&quot; : &quot;Chuck D;Bob D;&quot;}, #365
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices' value='San Francisco' index='0'&gt;&lt;MTSetVar name='offices' value='Tokyo' function='unshift'&gt;&lt;MTSetVarBlock name='offices' index='2'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTGetVar name='offices' function='count'&gt;;&lt;MTGetVar name='offices' index='1'&gt;;&lt;MTGetVar name='offices' function='shift'&gt;;&lt;MTGetVar name='offices' function='count'&gt;;&lt;MTGetVar name='offices' index='1'&gt;&quot;, &quot;e&quot; : &quot;--3;San Francisco;Tokyo;2;Paris&quot;}, #366
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions' key='4.0' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions' key='4.01'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions' key='4.1'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;&lt;MTGetVar name='MTVersions' key='4.0'&gt;;&lt;MTGetVar name='MTVersions' key='4.01'&gt;;&lt;MTGetVar name='MTVersions' key='4.1'&gt;;&lt;MTGetVar name='MTVersions' key='4.2'&gt;;&quot;, &quot;e&quot; : &quot;Athena;Enterprise Solution;Boomer;Cal;&quot;}, #367
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTVar name='object1' key='name' value='foo'&gt;&lt;MTVar name='object1' key='price' value='1.00'&gt;&lt;MTVar name='object2' key='name' value='bar'&gt;&lt;MTVar name='object2' key='price' value='1.13'&gt;&lt;MTSetVar name='array1' function='push' value='$object1'&gt;&lt;MTSetVar name='array1' function='push' value='$object2'&gt;&lt;MTLoop name='array1'&gt;&lt;MTVar name='name'&gt;(&lt;MTVar name='price'&gt;)&lt;br /&gt;&lt;/MTLoop&gt;&quot;, &quot;e&quot; : &quot;foo(1.00)&lt;br /&gt;bar(1.13)&lt;br /&gt;&quot;}, #368
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices1' value='San Francisco' index='0'&gt;&lt;MTSetVar name='offices1' value='Tokyo' function='unshift'&gt;&lt;MTSetVarBlock name='offices1' index='2'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTGetVar name='offices1' function='count'&gt;;&lt;MTGetVar name='offices1' index='1'&gt;;&lt;MTGetVar name='offices1' function='shift'&gt;;&lt;MTGetVar name='offices1' function='count'&gt;;&lt;MTGetVar name='offices1' index='1'&gt;&quot;, &quot;e&quot; : &quot;--3;San Francisco;Tokyo;2;Paris&quot;}, #369
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices2' value='San Francisco' index='0'&gt;&lt;MTSetVar name='offices2' value='Tokyo' function='unshift'&gt;&lt;MTSetVarBlock name='offices2' index='2'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTSetVarBlock name='count'&gt;&lt;MTGetVar name='offices2' function='count' op='sub' value='1'&gt;&lt;/MTSetVarBlock&gt;&lt;MTFor from='0' to='$count' step='1' glue=','&gt;&lt;MTGetVar name='offices2' index='$__index__'&gt;&lt;/MTFor&gt;&quot;, &quot;e&quot; : &quot;--Tokyo,San Francisco,Paris&quot;}, #370
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions2' key='4.0' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions2' key='4.01'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions2' key='4.1'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;--&lt;MTLoop name='MTVersions2'&gt;&lt;MTVar name='__key__'&gt; - &lt;MTVar name='__value__'&gt;;&lt;/MTLoop&gt;&quot;, &quot;e&quot; : &quot;--4.2 - Cal;4.01 - Enterprise Solution;4.0 - Athena;4.1 - Boomer;&quot;}, #371
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions3' key='4.0' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions3' key='4.01'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions3' key='4.1'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;--&lt;MTLoop name='MTVersions3' sort_by='key'&gt;&lt;MTVar name='__key__'&gt; - &lt;MTVar name='__value__'&gt;;&lt;/MTLoop&gt;&quot;, &quot;e&quot; : &quot;--4.0 - Athena;4.01 - Enterprise Solution;4.1 - Boomer;4.2 - Cal;&quot;}, #372
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices3' value='San Francisco' index='0'&gt;&lt;MTSetVar name='offices3' value='Tokyo' function='unshift'&gt;&lt;MTSetVarBlock name='offices3' index='2'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTLoop name='offices3' glue=','&gt;&lt;MTVar name='__value__'&gt;&lt;/MTLoop&gt;&quot;, &quot;e&quot; : &quot;--Tokyo,San Francisco,Paris&quot;}, #373
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices4' value='San Francisco' index='0'&gt;&lt;MTSetVar name='offices4' value='Tokyo' function='unshift'&gt;&lt;MTSetVarBlock name='offices4' index='2'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTLoop name='offices4' glue=',' sort_by='value'&gt;&lt;MTVar name='__value__'&gt;&lt;/MTLoop&gt;&quot;, &quot;e&quot; : &quot;--Paris,San Francisco,Tokyo&quot;}, #374
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='num' op='add' value='99'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTGetVar name='num' value='1' op='+'&gt;;&lt;MTSetVar name='num' value='1'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTGetVar name='num' value='20' op='mul'&gt;;&lt;MTSetVar name='num' value='2' op='add'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTGetVar name='num' value='20' op='*'&gt;;&lt;MTSetVar name='num' value='3' op='*'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTGetVar name='num' value='3' op='/'&gt;;&lt;MTSetVar name='num' op='div' value='2'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTGetVar name='num' value='0.5' op='-'&gt;;&lt;MTSetVar name='num' op='mod' value='6'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTGetVar name='num' value='3' op='%'&gt;;&quot;, &quot;e&quot; : &quot;99;100;1;20;3;60;9;3;4.5;4;4;1;&quot;}, #375
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='num' value='1'&gt;&lt;MTGetVar name='num' op='++'&gt;;&lt;MTSetVar name='num' op='inc'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTSetVar name='num' op='dec'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTGetVar name='num' op='--'&gt;;&quot;, &quot;e&quot; : &quot;2;2;1;0;&quot;}, #376
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices9[0]' value='San Francisco'&gt;&lt;MTSetVar name='unshift(offices9)' value='Tokyo'&gt;&lt;MTSetVarBlock name='offices9[2]'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTGetVar name='count(offices9)'&gt;;&lt;MTGetVar name='offices9[1]'&gt;;&lt;MTGetVar name='shift(offices9)'&gt;;&lt;MTGetVar name='count(offices9)'&gt;;&lt;MTGetVar name='offices9' index='1'&gt;&quot;, &quot;e&quot; : &quot;--3;San Francisco;Tokyo;2;Paris&quot;}, #377
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions4{4.0}' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions4{4.01}'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions4{4.1}'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;&lt;MTGetVar name='MTVersions4{4.0}'&gt;;&lt;MTGetVar name='MTVersions4{4.01}'&gt;;&lt;MTGetVar name='MTVersions4{4.1}'&gt;;&lt;MTGetVar name='MTVersions4{4.2}'&gt;;&quot;, &quot;e&quot; : &quot;Athena;Enterprise Solution;Boomer;Cal;&quot;}, #378
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTVar name='object3{name}' value='foo'&gt;&lt;MTVar name='object3{price}' value='1.00'&gt;&lt;MTVar name='object4{name}' value='bar'&gt;&lt;MTVar name='object4{price}' value='1.13'&gt;&lt;MTSetVar name='push(array2)' value='$object3'&gt;&lt;MTSetVar name='push(array2)' value='$object4'&gt;&lt;MTLoop name='array2'&gt;&lt;MTVar name='name'&gt;(&lt;MTVar name='price'&gt;)&lt;br /&gt;&lt;/MTLoop&gt;&quot;, &quot;e&quot; : &quot;foo(1.00)&lt;br /&gt;bar(1.13)&lt;br /&gt;&quot;}, #379
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices5[0]' value='San Francisco'&gt;&lt;MTSetVar name='unshift(offices5)' value='Tokyo'&gt;&lt;MTSetVarBlock name='offices5[2]'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTGetVar name='count(offices5)'&gt;;&lt;MTGetVar name='offices5[1]'&gt;;&lt;MTGetVar name='shift(offices5)'&gt;;&lt;MTGetVar name='count(offices5)'&gt;;&lt;MTGetVar name='offices5[1]'&gt;&quot;, &quot;e&quot; : &quot;--3;San Francisco;Tokyo;2;Paris&quot;}, #380
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices6[0]' value='San Francisco'&gt;&lt;MTSetVar name='unshift(offices6)' value='Tokyo'&gt;&lt;MTSetVarBlock name='offices6[2]'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTSetVarBlock name='count'&gt;&lt;MTGetVar name='count(offices6)' op='--'&gt;&lt;/MTSetVarBlock&gt;&lt;MTFor from='0' to='$count' increment='1' glue=','&gt;&lt;MTGetVar name='offices6[$__index__]'&gt;&lt;/MTFor&gt;&quot;, &quot;e&quot; : &quot;--Tokyo,San Francisco,Paris&quot;}, #381
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions5{4.0}' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions5{4.01}'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions5{4.1}'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;--&lt;MTLoop name='MTVersions5'&gt;&lt;MTVar name='__key__'&gt; - &lt;MTVar name='__value__'&gt;;&lt;/MTLoop&gt;&quot;, &quot;e&quot; : &quot;--4.2 - Cal;4.01 - Enterprise Solution;4.0 - Athena;4.1 - Boomer;&quot;}, #382
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions6{4.0}' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions6{4.01}'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions6{4.1}'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;--&lt;MTLoop name='MTVersions6' sort_by='key'&gt;&lt;MTVar name='__key__'&gt; - &lt;MTVar name='__value__'&gt;;&lt;/MTLoop&gt;&quot;, &quot;e&quot; : &quot;--4.0 - Athena;4.01 - Enterprise Solution;4.1 - Boomer;4.2 - Cal;&quot;}, #383
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices7' value='San Francisco' index='0'&gt;&lt;MTSetVar name='unshift(offices7)' value='Tokyo'&gt;&lt;MTSetVarBlock name='offices7' index='2'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTVar name='offices7[1]'&gt;,&lt;MTVar name='shift(offices7)'&gt;,&lt;MTSetVar name='i' value='1'&gt;&lt;MTVar name='offices7[$i]'&gt;&quot;, &quot;e&quot; : &quot;--San Francisco,Tokyo,Paris&quot;}, #384
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices8' value='San Francisco' index='0'&gt;&lt;MTSetVar name='unshift(offices8)' value='Tokyo'&gt;&lt;MTSetVarBlock name='offices8' index='2'&gt;Paris&lt;/MTSetVarBlock&gt;&lt;MTSetVar name='var_offices' value='$offices8'&gt;--&lt;MTVar name='var_offices[1]'&gt;,&lt;MTVar name='shift(var_offices)'&gt;,&lt;MTSetVar name='i' value='1'&gt;&lt;MTVar name='var_offices[$i]'&gt;&quot;, &quot;e&quot; : &quot;--San Francisco,Tokyo,Paris&quot;}, #385
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions7' key='4.0' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions7' key='4.01'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions7' key='4.1'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;&lt;MTSetVar name='var_hash' value='$MTVersions7'&gt;&lt;MTGetVar name='var_hash{4.0}'&gt;;&lt;MTGetVar name='var_hash{4.01}'&gt;;&lt;MTGetVar name='var_hash{4.1}'&gt;;&lt;MTGetVar name='var_hash{4.2}'&gt;;&quot;, &quot;e&quot; : &quot;Athena;Enterprise Solution;Boomer;Cal;&quot;}, #386
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions8' key='4.0' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions8' key='4.01'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions8' key='4.1'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;&lt;MTGetVar name='delete(var_hash{4.0})'&gt;;&lt;MTGetVar name='var_hash{4.0}'&gt;;&lt;MTSetVar name='delete(var_hash{4.01})'&gt;;&lt;MTGetVar name='var_hash{4.01}'&gt;;&lt;MTGetVar name='var_hash' function='delete' key='4.2'&gt;;&lt;MTGetVar name='var_hash' function='delete' key='4.1'&gt;;&lt;MTGetVar name='var_hash' key='4.1'&gt;;&quot;, &quot;e&quot; : &quot;Athena;;;;Cal;Boomer;;&quot;}, #387
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='offices9' value='San Francisco' index='0'&gt;&lt;MTSetVar name='unshift(offices9)' value='Tokyo'&gt;&lt;MTSetVarBlock name='offices9' index='2'&gt;Paris&lt;/MTSetVarBlock&gt;--&lt;MTIf name='offices9' index='2' eq='Paris'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;,&lt;MTIf name='offices9[1]' eq='San Francisco'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;,&lt;MTVar name='idx' value='0'&gt;&lt;MTIf name='offices9[$idx]' eq='San Francisco'&gt;&lt;MTVar name='offices9[0]'&gt;&lt;MTElse name='offices9[2]' eq='San Francisco'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;,&lt;MTIf name='offices9' index='3' eq='1'&gt;&lt;MTIgnore&gt;value is undef so it is always evaluated false.&lt;/MTIgnore&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;,&quot;, &quot;e&quot; : &quot;--TRUE,TRUE,FALSE,FALSE,&quot;}, #388
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='MTVersions8' key='4.0' value='Athena'&gt;&lt;MTSetVarBlock name='MTVersions8' key='4.01'&gt;Enterprise Solution&lt;/MTSetVarBlock&gt;&lt;MTSetVarBlock name='MTVersions8' key='4.1'&gt;Boomer&lt;MTSetVar name='4.2' value='Cal'&gt;&lt;/MTSetVarBlock&gt;&lt;MTSetVar name='var_hash' value='$MTVersions8'&gt;&lt;MTIf name='var_hash{4.0}' eq='Enterprise Solution'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;;&lt;MTIf name='var_hash{4.01}' eq='Enterprise Solution'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;;&lt;MTIf name='var_hash' key='4.2' eq='Boomer'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;;&lt;MTIf name='MTVersions8{4.1}' ne='Boomer'&gt;&lt;MTVar name='MTVersions8{4.1}'&gt;&lt;MTElse name='MTVersions8{4.1}' eq='Cal'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;;&quot;, &quot;e&quot; : &quot;FALSE;TRUE;FALSE;FALSE;&quot;}, #389
+{ &quot;r&quot; : &quot;1&quot;, &quot;t&quot; : &quot;&lt;MTSetVar name='num' value='1'&gt;&lt;MTGetVar name='num'&gt;;&lt;MTIf name='num' eq='1'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;;&lt;MTGetVar name='num' value='20' op='mul'&gt;;&lt;MTIf name='num' value='3' op='*' eq='60'&gt;TRUE&lt;MTElse&gt;FALSE&lt;/MTIf&gt;;&lt;MTIf name='num' value='3' op='+' eq='4'&gt;TRUE&lt;MTElse name='num' op='+' value='4' eq='5'&gt;555&lt;MTElse&gt;FALSE&lt;/MTIf&gt;;&quot;, &quot;e&quot; : &quot;1;TRUE;20;FALSE;TRUE;&quot;} #390
 ]</diff>
      <filename>t/35-tags.dat</filename>
    </modified>
    <modified>
      <diff>@@ -57,7 +57,7 @@ MT::BackupRestore-&gt;backup(undef, $printer, sub {}, sub {}, sub { print $_[0], &quot;\
 use IO::String;
 my $h = IO::String-&gt;new(\$backup_data);
 my (%objects, %deferred, @errors);
-MT::BackupRestore-&gt;restore_process_single_file($h, \%objects, \%deferred, \@errors, &quot;4.0&quot;, sub { print $_[0], &quot;\n&quot;; });
+MT::BackupRestore-&gt;restore_process_single_file($h, \%objects, \%deferred, \@errors, &quot;4.0&quot;, 0, sub { print $_[0], &quot;\n&quot;; });
 
 is(scalar(keys %deferred), 0);
 print join &quot;\n&quot;, @errors;</diff>
      <filename>t/61-to_from_xml.t</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 #!/usr/bin/perl
 
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
+# $Id$
+
 use strict;
 use vars qw( $T_CFG );
 
@@ -28,12 +34,12 @@ $T_CFG = $ARGV[0] || $T_CFG;
 my $mt = MT-&gt;instance(Config =&gt; $T_CFG) or die &quot;No MT object &quot; . MT-&gt;errstr();
 
 my $driver = MT::Object-&gt;driver();
-my @tables = qw(author blog category comment entry fileinfo ipbanlist log notification permission placement plugindata session tbping template templatemap trackback objecttag group association);
-if ($driver-&gt;{dbh}) {
-    $driver-&gt;{dbh}-&gt;do(&quot;drop table mt_$_&quot;) foreach @tables;
-    if ($driver-&gt;{dbh}-&gt;isa('MT::ObjectDriver::DBI::postgres')) {
-        $driver-&gt;{dbh}-&gt;do(&quot;drop sequence mt_$_\_id&quot;) foreach @tables;
-    }
+my @tables = keys %{ $mt-&gt;registry(&quot;object_types&quot;) };
+@tables = grep { ! m/^plugin$/ } @tables;
+my $dbh = $driver-&gt;rw_handle;
+$dbh-&gt;do(&quot;drop table mt_$_&quot;) foreach @tables;
+if (MT-&gt;config('ObjectDriver') =~ m/(postgres|pg)/i) {
+    $dbh-&gt;do(&quot;drop sequence mt_$_\_id&quot;) foreach @tables;
 }
 require MT::Upgrade;
 MT::Upgrade-&gt;do_upgrade(Install =&gt; 1, App =&gt; __PACKAGE__);
@@ -216,6 +222,7 @@ $cat-&gt;description('bar');
 $cat-&gt;author_id($chuckd-&gt;id);
 $cat-&gt;parent(0);
 $cat-&gt;save or die &quot;Couldn't save category record 1: &quot;. $cat-&gt;errstr;
+my $parent_cat = $cat-&gt;id;
 
 $cat = new MT::Category;
 $cat-&gt;blog_id(1);
@@ -242,7 +249,7 @@ $cat-&gt;blog_id(1);
 $cat-&gt;label('subfoo');
 $cat-&gt;description('subcat');
 $cat-&gt;author_id($bobd-&gt;id);
-$cat-&gt;parent(1);
+$cat-&gt;parent($parent_cat);
 $cat-&gt;save or die &quot;Couldn't save category record 3: &quot;. $cat-&gt;errstr;
 
 require MT::Placement;</diff>
      <filename>t/blog-common.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 #!/usr/bin/perl
+
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
+
 use strict;
 use warnings;
 use Data::Dumper;
@@ -17,7 +23,7 @@ BEGIN {
     $ENV{MT_CONFIG} = &quot;$driver-test.cfg&quot;;
 }
 
-use Test::More tests =&gt; 227;
+use Test::More tests =&gt; 230;
 use lib 't/lib', 'extlib', 'lib', '../lib', '../extlib';
 use MT::Test qw(:testdb);
 
@@ -263,11 +269,11 @@ isa_ok($tmp, 'Foo');
 is($tmp-&gt;id, 2, 'id');
 
 ## Get count of objects
-is(Foo-&gt;count, 2, 'count');
-is(Foo-&gt;count({ status =&gt; 0 }), 1, 'count');
+is(Foo-&gt;count, 2, 'count1');
+is(Foo-&gt;count({ status =&gt; 0 }), 1, 'count2');
 is(Foo-&gt;count(
     { created_on =&gt; [ $foo[1]-&gt;column('created_on')-1 ] },
-    { range =&gt; { created_on =&gt; 1 } }), 1, 'count');
+    { range =&gt; { created_on =&gt; 1 } }), 1, 'count3');
 
 ## Update status for later tests.
 $foo[0]-&gt;status(2);
@@ -416,11 +422,11 @@ my ($count, $bfid, $month);
 isa_ok($cgb_iter, 'CODE');
 ok(($count, $bfid) = $cgb_iter-&gt;(), 'set');
 is($bfid, $bar[1]-&gt;id, 'id');
-is($count, 1, 'count');
+is($count, 1, 'count4');
 ok(($count, $bfid) = $cgb_iter-&gt;(), 'set');
 is($bfid, $bar[0]-&gt;id, 'id');
-is($count, 1, 'count');
-ok(!$iter-&gt;(), 'no $iter');
+is($count, 1, 'count5');
+ok(!$cgb_iter-&gt;(), 'no $iter');
 
 $cgb_iter = Bar-&gt;count_group_by(undef, {
         group =&gt; [ 'extract(month from created_on)' ],
@@ -430,8 +436,8 @@ isa_ok($cgb_iter, 'CODE');
 ok(($count, $month) = $cgb_iter-&gt;(), 'set');
 use POSIX qw(strftime);
 is(int($month), int(strftime(&quot;%m&quot;, localtime)), 'month');
-is($count, 3, 'count');
-ok(!$iter-&gt;(), 'no $iter');
+is($count, 3, 'count6');
+ok(!$cgb_iter-&gt;(), 'no $iter');
 
 ## Get a count of all Foo objects in order of most recently
 ## created Bar object. No uniqueness requirement. This tests
@@ -442,7 +448,7 @@ is(Foo-&gt;count(undef,
                 undef,
                 { unique =&gt; 1,
                   sort =&gt; 'created_on',
-                  direction =&gt; 'descend', } ] }), 2, 'count');
+                  direction =&gt; 'descend', } ] }), 2, 'count7');
 
 ## Now load all Foo objects in order of most recently
 ## created Bar object. Make sure they are unique.
@@ -681,13 +687,16 @@ isa_ok($offs[2], 'Foo');
 is($offs[2]-&gt;id, $foo1-&gt;id, 'id');
 
 #sum_group_by
-my $iterx = Foo-&gt;load_iter;
+my $cnt = 0;
+my @data = Foo-&gt;load(undef, {direction =&gt; 'ascend'});
 my @foos;
-while (my $f = $iterx-&gt;()) {
-    $f-&gt;status(scalar(@foos) + 1);
+foreach my $f (@data) {
+    $f-&gt;status($cnt + 1);
     $f-&gt;save;
     unshift @foos, $f;
+    $cnt++;
 }
+
 my $sgb = Foo-&gt;sum_group_by(undef, { sum =&gt; 'status', group =&gt; ['id'], direction =&gt; 'ascend' });
 while (my ($status, $id2) = $sgb-&gt;()) {
     my $f = pop @foos;
@@ -706,4 +715,48 @@ SKIP: {
 
 }
 
+# -or
+my $newdata = Foo-&gt;new;
+$newdata-&gt;status(11);
+$newdata-&gt;name('Apple');
+$newdata-&gt;text('MacBook');
+$newdata-&gt;save;
+$newdata = Foo-&gt;new;
+$newdata-&gt;status(12);
+$newdata-&gt;name('Linux');
+$newdata-&gt;text('Ubuntu');
+$newdata-&gt;save;
+$newdata = Foo-&gt;new;
+$newdata-&gt;status(13);
+$newdata-&gt;name('Microsoft');
+$newdata-&gt;text('Vista');
+$newdata-&gt;save;
+$newdata = Foo-&gt;new;
+$newdata-&gt;status(10);
+$newdata-&gt;name('Microsoft');
+$newdata-&gt;text('XP');
+$newdata-&gt;save;
+$newdata = Foo-&gt;new;
+$newdata-&gt;status(10);
+$newdata-&gt;name('Apple');
+$newdata-&gt;text('iBook');
+$newdata-&gt;save;
+
+my $count = Foo-&gt;count( [{status =&gt; 10}, -or =&gt; {name =&gt; 'Apple'}] );
+# ==&gt; select count(*) from mt_foo where foo_status = 10 or foo_name = 'Apple'
+is($count, 3, '-or count');
+
+$count = Foo-&gt;count( [ { status =&gt; { '&lt;=' =&gt; 20 }, name =&gt; 'Apple' }, -and_not =&gt; { status =&gt; 11 } ] );
+# ==&gt; select count(*) from mt_foo where (foo_status &lt;= 20 and foo_name = 'Apple') and not (foo_status = 11)
+is($count, 1, '-and_not count');
+
+$count = Foo-&gt;count( [
+    { status =&gt; 10 },
+    -or =&gt; { name =&gt; 'Apple' },
+    -or =&gt; { name =&gt; { like =&gt; '%nux' } },
+] );
+# ==&gt; select count(*) from mt_foo where (foo_status = 10) or (foo_name = 'Apple') or (foo_name like '%nux')
+# (selects Apple+MacBook, Apple+iBook, Microsoft+XP, Linux+Ubuntu)
+is($count, 4, '-or count, 3 clauses');
+
 1;</diff>
      <filename>t/driver-tests.pl</filename>
    </modified>
    <modified>
      <diff>@@ -58,7 +58,8 @@ sub init_test_db {
     # with stubs since we're not creating a full schema.
     MT::Upgrade-&gt;register_upgrade_function({
         core_seed_database     =&gt; { code =&gt; sub { 1 } },
-        core_install_templates =&gt; { code =&gt; sub { 1 } },
+        core_upgrade_templates =&gt; { code =&gt; sub { 1 } },
+        core_upgrade_templates =&gt; { code =&gt; sub { 1 } },
         core_finish            =&gt; { code =&gt; sub { 1 } },
     });
     $pkg-&gt;init_db();</diff>
      <filename>t/lib/MT/Test.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
 
 package __FILE__;</diff>
      <filename>t/plugins/testplug.pl</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 #!/usr/bin/perl
+
+# Movable Type (r) Open Source (C) 2001-2007 Six Apart, Ltd.
+# This program is distributed under the terms of the
+# GNU General Public License, version 2.
+#
 # $Id$
+
 use strict;
 use warnings;
 </diff>
      <filename>t/test-common.pl</filename>
    </modified>
    <modified>
      <diff>@@ -130,15 +130,14 @@ function is_valid_path(path_){
 }
 
 function disableFields(path1,path2) {
-    var url_is = &quot;&lt;mt:var name=&quot;site_url&quot;&gt;&quot;
-    var path_is = &quot;&lt;mt:var name=&quot;site_path&quot;&gt;&quot;
+    var url_is = &quot;&lt;mt:var name=&quot;site_url&quot; encode_js=&quot;1&quot;&gt;&quot;;
+    var path_is = &quot;&lt;mt:var name=&quot;site_path&quot; encode_js=&quot;1&quot;&gt;&quot;;
     if (url_is.match(/BLOG-NAME/)) {
         var daURL = getByID(path1);
         var lock = path1 +&quot;-lock&quot;;
         var lock_img = getByID(lock);
         daURL.disabled = false;
         lock_img.style.display = 'none';
-    } else {
     }
     if (path_is.match(/BLOG-NAME/)) {
         var daPath = getByID(path2);
@@ -146,7 +145,6 @@ function disableFields(path1,path2) {
         var lock_img = getByID(lock);
         daPath.disabled = false;
         lock_img.style.display = 'none';
-    } else {
     }
     return;
 }
@@ -362,7 +360,7 @@ TC.attachLoadEvent( init );
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_archives.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -67,6 +67,7 @@
 &lt;input type=&quot;hidden&quot; name=&quot;return_args&quot; value=&quot;&lt;mt:var name=&quot;return_args&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;magic_token&quot; value=&quot;&lt;mt:var name=&quot;magic_token&quot;&gt;&quot; /&gt;
 
+&lt;mt:if name=&quot;allow_comments&quot;&gt;
 &lt;mt:unless name=&quot;system_allow_comments&quot;&gt;
     &lt;mtapp:statusmsg
         id=&quot;system-allow-comments&quot;
@@ -74,6 +75,7 @@
         &lt;__trans phrase=&quot;Note: Commenting is currently disabled at the system level.&quot;&gt;
     &lt;/mtapp:statusmsg&gt;
 &lt;/mt:unless&gt;
+&lt;/mt:if&gt;
 
 &lt;mt:unless name=&quot;tk_available&quot;&gt;
 &lt;p&gt;&lt;__trans phrase=&quot;Comment authentication is not available because one of the needed modules, MIME::Base64 or LWP::UserAgent is not installed. Talk to your host about getting this module installed.&quot;&gt;&lt;/p&gt;
@@ -245,7 +247,7 @@
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_comments.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -199,7 +199,7 @@
 &lt;mtapp:settinggroup id=&quot;default-field-settings&quot;&gt;
 
 &lt;h3&gt;&lt;__trans phrase=&quot;Default Editor Fields&quot;&gt;&lt;/h3&gt;
-
+&lt;mt:setvarblock name=&quot;more_fields&quot; id=&quot;more_fields&quot;&gt;&lt;/mt:setvarblock&gt;
 &lt;mtapp:setting
     id=&quot;entry_prefs&quot;
     label=&quot;&lt;__trans phrase=&quot;Editor Fields&quot;&gt;&quot;
@@ -214,6 +214,7 @@
         &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-tags&quot; value=&quot;tags&quot; &lt;mt:if name=&quot;disp_prefs_show_tags&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;label for=&quot;custom-prefs-tags&quot;&gt;&lt;__trans phrase=&quot;Tags&quot;&gt;&lt;/label&gt;&lt;/li&gt;
         &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-publishing&quot; value=&quot;publishing&quot; &lt;mt:if name=&quot;disp_prefs_show_publishing&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;label for=&quot;custom-prefs-publishing&quot;&gt;&lt;__trans phrase=&quot;Publishing&quot;&gt;&lt;/label&gt;&lt;/li&gt;
         &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-feedback&quot; value=&quot;feedback&quot; &lt;mt:if name=&quot;disp_prefs_show_feedback&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;label for=&quot;custom-prefs-feedback&quot;&gt;&lt;__trans phrase=&quot;Feedback&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+        &lt;mt:var name=&quot;more_fields&quot;&gt;
     &lt;/ul&gt;
 &lt;/mtapp:setting&gt;
 
@@ -235,7 +236,7 @@
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_entry.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@
         id=&quot;useful-links&quot;
         label=&quot;&lt;__trans phrase=&quot;Useful links&quot;&gt;&quot;&gt;
         &lt;ul&gt;
-            &lt;li&gt;&lt;a href=&quot;&lt;__trans phrase=&quot;http://www.sixapart.com/pronet/plugins/&quot;&gt;&quot; target=&quot;_blank&quot;&gt;&lt;__trans phrase=&quot;Find Plugins&quot;&gt;&lt;/a&gt;&lt;/li&gt;
+            &lt;li&gt;&lt;a href=&quot;&lt;__trans phrase=&quot;http://plugins.movabletype.org/&quot;&gt;&quot; target=&quot;_blank&quot;&gt;&lt;__trans phrase=&quot;Find Plugins&quot;&gt;&lt;/a&gt;&lt;/li&gt;
         &lt;/ul&gt;
     &lt;/mtapp:widget&gt;
     &lt;mt:unless name=&quot;blog_view&quot;&gt;</diff>
      <filename>tmpl/cms/cfg_plugin.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -157,7 +157,7 @@ function validate (f) {
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_prefs.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -97,7 +97,7 @@
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_registration.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -121,7 +121,7 @@ function scoreNudge(amount) {
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_spam.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@
     &lt;/mtapp:setting&gt;
 
     &lt;mtapp:setting
-        id=&quot;comment_disable&quot;
+        id=&quot;ping_disable&quot;
         label=&quot;&lt;__trans phrase=&quot;TrackBacks&quot;&gt;&quot;
         content_class=&quot;field-content-text&quot;
         hint=&quot;&lt;__trans phrase=&quot;This will override all individual blog settings.&quot;&gt;&quot;&gt;
@@ -84,7 +84,7 @@
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_system_feedback.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -87,7 +87,7 @@ function is_valid_path(path_){
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_system_general.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -235,7 +235,7 @@ function clearNotifyUsers() {
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_system_users.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -169,7 +169,7 @@
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_trackbacks.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -114,7 +114,7 @@
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/cfg_web_services.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -44,48 +44,47 @@
 &lt;/div&gt;
 &lt;$mt:var name=&quot;select_widget_form&quot; set=&quot;sidebar&quot;$&gt;
 &lt;/mt:setvarblock&gt;
+&lt;mt:setvarblock name=&quot;content_header&quot;&gt;
+    &lt;div id=&quot;msg-block&quot;&gt;
 
-&lt;mt:include name=&quot;include/header.tmpl&quot;&gt;
-
-&lt;div id=&quot;msg-block&quot;&gt;
-
-&lt;mt:if name=&quot;saved&quot;&gt;
-    &lt;mtapp:statusmsg
-        id=&quot;saved&quot;
-        class=&quot;info&quot;
-        can_close=&quot;1&quot;&gt;
-        &lt;__trans phrase=&quot;Your Dashboard has been updated.&quot;&gt;
-    &lt;/mtapp:statusmsg&gt;
-&lt;/mt:if&gt;
-
-&lt;mt:if name=&quot;permission&quot;&gt;
-    &lt;mtapp:statusmsg
-        id=&quot;permissions&quot;
-        class=&quot;error&quot;&gt;
-        &lt;__trans phrase=&quot;You have attempted to use a feature that you do not have permission to access. If you believe you are seeing this message in error contact your system administrator.&quot;&gt;
-    &lt;/mtapp:statusmsg&gt;
-&lt;/mt:if&gt;
+    &lt;mt:if name=&quot;saved&quot;&gt;
+        &lt;mtapp:statusmsg
+            id=&quot;saved&quot;
+            class=&quot;info&quot;
+            can_close=&quot;1&quot;&gt;
+            &lt;__trans phrase=&quot;Your Dashboard has been updated.&quot;&gt;
+        &lt;/mtapp:statusmsg&gt;
+    &lt;/mt:if&gt;
 
-&lt;mt:unless name=&quot;has_uploads_path&quot;&gt;
-    &lt;mt:if name=&quot;is_administrator&quot;&gt;
+    &lt;mt:if name=&quot;permission&quot;&gt;
         &lt;mtapp:statusmsg
             id=&quot;permissions&quot;
             class=&quot;error&quot;&gt;
-            &lt;__trans phrase=&quot;The directory you have configured for uploading avatars is not writable. In order to enable users to upload userpics, please make the following directory writable by your web server: [_1]&quot; params=&quot;&lt;mt:var name=&quot;support_path&quot;&gt;&quot;&gt;
+            &lt;__trans phrase=&quot;You have attempted to use a feature that you do not have permission to access. If you believe you are seeing this message in error contact your system administrator.&quot;&gt;
         &lt;/mtapp:statusmsg&gt;
     &lt;/mt:if&gt;
-&lt;/mt:unless&gt;
 
-&lt;mt:unless name=&quot;main&quot;&gt;
-&lt;mtapp:statusmsg
-    id=&quot;empty_dashboard&quot;
-    class=&quot;info&quot;&gt;
-    &lt;__trans phrase=&quot;Your dashboard is empty!&quot;&gt;
-&lt;/mtapp:statusmsg&gt;
-&lt;/mt:unless&gt;
+    &lt;mt:unless name=&quot;has_uploads_path&quot;&gt;
+        &lt;mt:if name=&quot;is_administrator&quot;&gt;
+            &lt;mtapp:statusmsg
+                id=&quot;permissions&quot;
+                class=&quot;error&quot;&gt;
+                &lt;__trans phrase=&quot;The directory you have configured for uploading avatars is not writable. In order to enable users to upload userpics, please make the following directory writable by your web server: [_1]&quot; params=&quot;&lt;mt:var name=&quot;support_path&quot;&gt;&quot;&gt;
+            &lt;/mtapp:statusmsg&gt;
+        &lt;/mt:if&gt;
+    &lt;/mt:unless&gt;
 
-&lt;/div&gt;
+    &lt;mt:unless name=&quot;main&quot;&gt;
+    &lt;mtapp:statusmsg
+        id=&quot;empty_dashboard&quot;
+        class=&quot;info&quot;&gt;
+        &lt;__trans phrase=&quot;Your dashboard is empty!&quot;&gt;
+    &lt;/mtapp:statusmsg&gt;
+    &lt;/mt:unless&gt;
 
+    &lt;/div&gt;
+&lt;/mt:setvarblock&gt;
+&lt;mt:include name=&quot;include/header.tmpl&quot;&gt;
 
 &lt;div id=&quot;widget-container-main&quot;&gt;
 &lt;mt:section id=&quot;main&quot; class=&quot;widget-container&quot;&gt;&lt;mt:var name=&quot;main&quot;&gt;&lt;/mt:section&gt;</diff>
      <filename>tmpl/cms/dashboard.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,10 @@
 &lt;mt:include name=&quot;dialog/header.tmpl&quot;&gt;
+&lt;mt:setvarblock name=&quot;insert_script&quot; id=&quot;insert_script&quot;&gt;
+window.parent.app.insertHTML( '&lt;mt:var name=&quot;UPLOAD_HTML&quot; escape=&quot;JS&quot;&gt;', '&lt;mt:var name=&quot;EDIT_FIELD&quot;&gt;' );
+&lt;/mt:setvarblock&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;
 &lt;!--
-window.parent.app.insertHTML( '&lt;mt:var name=&quot;UPLOAD_HTML&quot; escape=&quot;JS&quot;&gt;', '&lt;mt:var name=&quot;EDIT_FIELD&quot;&gt;' );
+&lt;mt:var name=&quot;insert_script&quot;&gt;
 closeDialog();
 //--&gt;
 &lt;/script&gt;</diff>
      <filename>tmpl/cms/dialog/asset_insert.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -57,7 +57,8 @@
     &lt;div class=&quot;panel-header&quot;&gt;
 &lt;mt:setvarblock name=&quot;upload_new_file_link&quot;&gt;
     &lt;img src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;images/status_icons/create.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Upload New File&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;
-    &lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=start_upload&amp;amp;_type=asset&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;dialog_view=1&amp;amp;&lt;mt:if name=&quot;asset_select&quot;&gt;asset_select=1&amp;amp;&lt;mt:else&gt;entry_insert=1&amp;amp;&lt;/mt:if&gt;edit_field=&lt;mt:var name=&quot;edit_field&quot;&gt;&amp;amp;upload_mode=&lt;mt:var name=&quot;upload_mode&quot; escape=&quot;url&quot;&gt;&amp;amp;&lt;mt:if name=&quot;require_type&quot;&gt;require_type=&lt;mt:var name=&quot;require_type&quot;&gt;&amp;amp;&lt;/mt:if&gt;return_args=&lt;mt:var name=&quot;return_args&quot; escape=&quot;url&quot;&gt;&quot;&gt;&lt;mt:if name=&quot;is_image&quot;&gt;&lt;__trans phrase=&quot;Upload New Image&quot;&gt;&lt;mt:else&gt;&lt;__trans phrase=&quot;Upload New File&quot;&gt;&lt;/mt:if&gt;&lt;/a&gt;
+    &lt;mt:unless name=&quot;asset_select&quot;&gt;&lt;mt:setvar name=&quot;entry_insert&quot; value=&quot;1&quot;&gt;&lt;/mt:unless&gt;
+    &lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=start_upload&amp;amp;_type=asset&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;dialog_view=1&amp;amp;&lt;mt:if name=&quot;asset_select&quot;&gt;asset_select=1&amp;amp;&lt;mt:else&gt;entry_insert=1&amp;amp;&lt;/mt:if&gt;edit_field=&lt;mt:var name=&quot;edit_field&quot;&gt;&amp;amp;upload_mode=&lt;mt:var name=&quot;upload_mode&quot; escape=&quot;url&quot;&gt;&amp;amp;&lt;mt:if name=&quot;require_type&quot;&gt;require_type=&lt;mt:var name=&quot;require_type&quot;&gt;&amp;amp;&lt;/mt:if&gt;return_args=&lt;mt:var name=&quot;return_args&quot; escape=&quot;url&quot;&gt;&quot; onclick=&quot;toggleHidden('list-assets-dialog'); toggleHidden('upload-asset-dialog'); return false&quot;&gt;&lt;mt:if name=&quot;is_image&quot;&gt;&lt;__trans phrase=&quot;Upload New Image&quot;&gt;&lt;mt:else&gt;&lt;__trans phrase=&quot;Upload New File&quot;&gt;&lt;/mt:if&gt;&lt;/a&gt;
 &lt;/mt:setvarblock&gt;
 &lt;mt:if name=&quot;edit_blog_id&quot;&gt;
     &lt;mt:if name=&quot;can_upload&quot;&gt;
@@ -219,5 +220,12 @@
 
     &lt;/div&gt;
 
+&lt;div id=&quot;upload-asset-dialog&quot; class=&quot;hidden&quot;&gt;
+&lt;mt:setvar name=&quot;included_upload_asset&quot; value=&quot;1&quot;&gt;
+
+&lt;mt:include name=&quot;include/asset_upload.tmpl&quot;&gt;
+
+&lt;/div&gt;
+
 &lt;mt:include name=&quot;dialog/footer.tmpl&quot;&gt;
 &lt;/mt:unless&gt;</diff>
      <filename>tmpl/cms/dialog/asset_list.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -93,13 +93,13 @@
     hint=&quot;&quot;
     show_hint=&quot;0&quot;&gt;
     &lt;input type=&quot;radio&quot; name=&quot;align&quot; id=&quot;align-left&quot; class=&quot;rb&quot; value=&quot;left&quot; &lt;mt:if name=&quot;align_left&quot;&gt;checked=&quot;checked&quot; &lt;/mt:if&gt;/&gt;
-    &lt;label class=&quot;icon-left icon-left-xwide icon-align icon-align-left&quot;&gt;&lt;__trans phrase=&quot;Left&quot;&gt;&lt;/label&gt;
+    &lt;label class=&quot;icon-left-xwide icon-align icon-align-left&quot;&gt;&lt;__trans phrase=&quot;Left&quot;&gt;&lt;/label&gt;
 
     &lt;input type=&quot;radio&quot; name=&quot;align&quot; id=&quot;align-center&quot; class=&quot;rb&quot; value=&quot;center&quot; &lt;mt:if name=&quot;align_center&quot;&gt;checked=&quot;checked&quot; &lt;/mt:if&gt;/&gt;
-    &lt;label class=&quot;icon-left icon-left-xwide icon-align icon-align-center&quot;&gt;&lt;__trans phrase=&quot;Center&quot;&gt;&lt;/label&gt;
+    &lt;label class=&quot;icon-left-xwide icon-align icon-align-center&quot;&gt;&lt;__trans phrase=&quot;Center&quot;&gt;&lt;/label&gt;
 
     &lt;input type=&quot;radio&quot; name=&quot;align&quot; id=&quot;align-right&quot; class=&quot;rb&quot; value=&quot;right&quot; &lt;mt:if name=&quot;align_right&quot;&gt;checked=&quot;checked&quot; &lt;/mt:if&gt;/&gt;
-    &lt;label class=&quot;icon-left icon-left-xwide icon-align icon-align-right&quot;&gt;&lt;__trans phrase=&quot;Right&quot;&gt;&lt;/label&gt;
+    &lt;label class=&quot;icon-left-xwide icon-align icon-align-right&quot;&gt;&lt;__trans phrase=&quot;Right&quot;&gt;&lt;/label&gt;
 &lt;/mtapp:setting&gt;
 &lt;mt:if name=&quot;do_thumb&quot;&gt;
     &lt;mtapp:setting</diff>
      <filename>tmpl/cms/dialog/asset_options_image.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@
 &lt;!--
 function submit_form(f, command) {
     f['overwrite_' + command].value = 1;
-    f.submit();
+    return true;
 }
 // --&gt;
 &lt;/script&gt;</diff>
      <filename>tmpl/cms/dialog/asset_replace.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -9,107 +9,6 @@
 &lt;/mt:if&gt;
 &lt;mt:include name=&quot;dialog/header.tmpl&quot;&gt;
 
-&lt;script type=&quot;text/javascript&quot;&gt;
-&lt;!--
-function setExtraPath(sel) {
-   var opt = sel.options[sel.selectedIndex];
-   var path = opt.getAttribute(&quot;middle_path&quot;);
-   if (!path) path = '';
-   var middle = sel.form['middle_path'];
-   if (middle) middle.value = path;
-}
-//--&gt;
-&lt;/script&gt;
-
-&lt;mt:if name=&quot;missing_paths&quot;&gt;
-    &lt;mt:if name=&quot;have_permissions&quot;&gt;
-&lt;p&gt;&lt;__trans phrase=&quot;Before you can upload a file, you need to publish your blog. [_1]Configure your blog's publishing paths[_2] and rebuild your blog.&quot; params=&quot;&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;closeDialog('&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=cfg_archives&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;');&quot;&gt;%%&lt;/a&gt;&quot;&gt;&lt;/p&gt;
-    &lt;mt:else&gt;
-&lt;p&gt;&lt;__trans phrase=&quot;Your system or blog administrator needs to publish the blog before you can upload files. Please contact your system or blog administrator.&quot;&gt;&lt;/p&gt;
-    &lt;/mt:if&gt;
-&lt;div class=&quot;actions-bar&quot;&gt;
-    &lt;div class=&quot;actions-bar-inner pkg actions&quot;&gt;
-        &lt;button
-            onclick=&quot;closeDialog(); return false&quot;
-            type=&quot;submit&quot;
-            accesskey=&quot;x&quot;
-            title=&quot;&lt;__trans phrase=&quot;Close (x)&quot;&gt;&quot;
-            &gt;&lt;__trans phrase=&quot;Close&quot;&gt;&lt;/button&gt;
-    &lt;/div&gt;
-&lt;/div&gt; 
-
-&lt;mt:else&gt;
-    &lt;mt:if name=&quot;error&quot;&gt;
-        &lt;mtapp:statusmsg
-            id=&quot;generic-error&quot;
-            class=&quot;error&quot;&gt;
-            &lt;mt:var name=&quot;error&quot;&gt;
-        &lt;/mtapp:statusmsg&gt;
-    &lt;/mt:if&gt;
-
-&lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; action=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;&quot;&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;__mode&quot; value=&quot;&lt;mt:if name=&quot;upload_mode&quot;&gt;&lt;mt:var name=&quot;upload_mode&quot; escape=&quot;html&quot;&gt;&lt;mt:else&gt;upload_file&lt;/mt:if&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;blog_id&quot; value=&quot;&lt;mt:var name=&quot;blog_id&quot;&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;middle_path&quot; value=&quot;&lt;mt:var name=&quot;middle_path&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;entry_insert&quot; value=&quot;&lt;mt:var name=&quot;entry_insert&quot;&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;asset_select&quot; value=&quot;&lt;mt:var name=&quot;asset_select&quot;&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;edit_field&quot; value=&quot;&lt;mt:var name=&quot;edit_field&quot;&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;require_type&quot; value=&quot;&lt;mt:var name=&quot;require_type&quot;&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;magic_token&quot; value=&quot;&lt;mt:var name=&quot;magic_token&quot;&gt;&quot; /&gt;
-
-    &lt;mtapp:setting
-        id=&quot;file&quot;
-        label_class=&quot;top-label&quot;
-        label=&quot;&lt;__trans phrase=&quot;Select File to Upload&quot;&gt;&quot;
-        hint=&quot;&quot;
-        show_hint=&quot;0&quot;&gt;
-        &lt;input type=&quot;file&quot; name=&quot;file&quot; /&gt;
-    &lt;/mtapp:setting&gt;
-
-    &lt;mt:if name=&quot;enable_destination&quot;&gt;
-        &lt;mt:setvarblock name=&quot;upload_hint&quot;&gt;
-            &lt;__trans phrase=&quot;_USAGE_UPLOAD&quot; params=&quot;&lt;$mt:var name=&quot;blog_name&quot; escape=&quot;html&quot;$&gt;&quot;&gt;
-        &lt;/mt:setvarblock&gt;
-        &lt;mtapp:setting
-            id=&quot;folder&quot;
-            label_class=&quot;top-label&quot;
-            label=&quot;&lt;__trans phrase=&quot;Upload Destination&quot;&gt;&quot;
-            hint=&quot;&lt;$mt:var name=&quot;upload_hint&quot;$&gt;&quot;
-            show_hint=&quot;1&quot;&gt;
-            &lt;!-- &lt;$mt:var name=&quot;blog_url&quot; escape=&quot;html&quot;$&gt; --&gt;
-            &lt;select name=&quot;site_path&quot; onchange=&quot;setExtraPath(this)&quot;&gt;
-                &lt;option value=&quot;1&quot;&gt;&amp;#60;&lt;__trans phrase=&quot;Site Root&quot;&gt;&amp;#62;&lt;/option&gt;
-            &lt;mt:if name=&quot;enable_archive_paths&quot;&gt;
-                &lt;option value=&quot;0&quot;&lt;mt:if name=&quot;archive_path&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&amp;#60;&lt;__trans phrase=&quot;Archive Root&quot;&gt;&amp;#62;&lt;/option&gt;
-            &lt;/mt:if&gt;
-            &lt;mt:if name=&quot;extra_paths&quot;&gt;
-                &lt;mt:loop name=&quot;extra_paths&quot;&gt;
-                &lt;option value=&quot;&lt;mt:if name=&quot;enable_archive_paths&quot;&gt;0&lt;mt:else&gt;1&lt;/mt:if&gt;&quot; middle_path=&quot;&lt;mt:var name=&quot;path&quot; escape=&quot;html&quot;&gt;&quot;&lt;mt:if name=&quot;selected&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;mt:var name=&quot;label&quot; escape=&quot;html&quot;&gt;&lt;/option&gt;
-                &lt;/mt:loop&gt;
-            &lt;/mt:if&gt;
-            &lt;/select&gt;
-            / &lt;input name=&quot;extra_path&quot; id=&quot;extra_path&quot; value=&quot;&lt;mt:var name=&quot;extra_path&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
-        &lt;/mtapp:setting&gt;
-    &lt;/mt:if&gt;
-
-    &lt;div class=&quot;actions-bar&quot;&gt;
-        &lt;div class=&quot;actions-bar-inner pkg actions&quot;&gt;
-            &lt;button
-                type=&quot;submit&quot;
-                accesskey=&quot;s&quot;
-                title=&quot;&lt;__trans phrase=&quot;Upload (s)&quot;&gt;&quot;
-                class=&quot;primary-button&quot;
-                &gt;&lt;__trans phrase=&quot;Upload&quot;&gt;&lt;/button&gt;
-            &lt;button
-                onclick=&quot;closeDialog(); return false&quot;
-                type=&quot;submit&quot;
-                accesskey=&quot;x&quot;
-                title=&quot;&lt;__trans phrase=&quot;Cancel (x)&quot;&gt;&quot;
-                &gt;&lt;__trans phrase=&quot;Cancel&quot;&gt;&lt;/button&gt;
-        &lt;/div&gt;
-    &lt;/div&gt;
-
-&lt;/form&gt;
-&lt;/mt:if&gt;
+&lt;mt:include name=&quot;include/asset_upload.tmpl&quot;&gt;
 
 &lt;mt:include name=&quot;dialog/footer.tmpl&quot;&gt;</diff>
      <filename>tmpl/cms/dialog/asset_upload.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -7,8 +7,10 @@ var author_userpic = '&lt;mt:var name=&quot;author_userpic&quot; escape=&quot;JS&quot;&gt;';
 if (author_userpic != '') {
     var preview = window.parent.getByID( 'userpic-preview-userpic' );
     preview.innerHTML = author_userpic;
-    window.parent.show( 'remove-userpic', window.parent.document, 'inline' );
-    window.parent.show( 'userpic-preview', window.parent.document );
+    if (window.parent.DOM.hasClassName( 'remove-userpic', 'hidden' ))
+        window.parent.toggleHidden( 'remove-userpic' );
+    if (window.parent.DOM.hasClassName( 'userpic-preview', 'hidden' ))
+        window.parent.toggleHidden( 'userpic-preview' );
 }
 closeDialog();
 //--&gt;</diff>
      <filename>tmpl/cms/dialog/asset_userpic.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@
 &lt;/mt:if&gt;
 &lt;$mt:var name=&quot;html_head&quot;$&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;mt.js&quot;&gt;&lt;/script&gt;
-&lt;mt:if name=&quot;local_lang_id&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;styles_&lt;mt:var name=&quot;local_lang_id&quot;&gt;.css&quot; /&gt;
+&lt;mt:if name=&quot;local_lang_id&quot; ne=&quot;en&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;styles_&lt;mt:var name=&quot;local_lang_id&quot;&gt;.css&quot; /&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;mt_&lt;mt:var name=&quot;local_lang_id&quot;&gt;.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;&lt;/mt:if&gt;
 &lt;$mt:var name=&quot;js_include&quot;$&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;</diff>
      <filename>tmpl/cms/dialog/header.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -70,6 +70,7 @@
     &lt;input type=&quot;hidden&quot; name=&quot;is_dirty&quot; value=&quot;&lt;mt:var name=&quot;is_dirty&quot;&gt;&quot; /&gt;
     &lt;input type=&quot;hidden&quot; name=&quot;is_asset&quot; value=&quot;&lt;mt:var name=&quot;is_asset&quot;&gt;&quot; /&gt;
     &lt;input type=&quot;hidden&quot; name=&quot;schema_version&quot; value=&quot;&lt;mt:var name=&quot;schema_version&quot;&gt;&quot; /&gt;
+    &lt;input type=&quot;hidden&quot; name=&quot;overwrite_templates&quot; value=&quot;&lt;mt:var name=&quot;overwrite_templates&quot;&gt;&quot; /&gt;
     &lt;input type=&quot;hidden&quot; name=&quot;objects_json&quot; value=&quot;&lt;mt:var name=&quot;objects_json&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
     &lt;input type=&quot;hidden&quot; name=&quot;deferred_json&quot; value=&quot;&lt;mt:var name=&quot;deferred_json&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
 &lt;mt:setvarblock name=&quot;restore_file_label&quot;&gt;</diff>
      <filename>tmpl/cms/dialog/restore_upload.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -192,6 +192,7 @@ TC.attachLoadEvent(init);
     &lt;mtapp:setting
         id=&quot;userpic_asset_id&quot;
         label=&quot;&lt;__trans phrase=&quot;Userpic&quot;&gt;&quot;
+        content_class=&quot;field-content-text&quot;
         hint=&quot;&lt;__trans phrase=&quot;The image associated with this user.&quot;&gt;&quot;&gt;
         &lt;span id=&quot;userpic-preview&quot;&lt;mt:unless name=&quot;userpic&quot;&gt; class=&quot;hidden&quot;&lt;/mt:unless&gt;&gt;
             &lt;span id=&quot;userpic-preview-userpic&quot;&gt;&lt;mt:var name=&quot;userpic&quot;&gt;&lt;/span&gt;
@@ -201,7 +202,7 @@ TC.attachLoadEvent(init);
         &lt;input name=&quot;userpic_asset_id&quot; id=&quot;userpic_asset_id&quot; type=&quot;hidden&quot; value=&quot;&lt;mt:var name=&quot;userpic_asset_id&quot; default=&quot;0&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
         &lt;span id=&quot;remove-userpic&quot;&lt;mt:unless name=&quot;userpic&quot;&gt; class=&quot;hidden&quot;&lt;/mt:unless&gt;&gt;
             &lt;br /&gt;
-            &lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;getByID('userpic_asset_id').value = '0'; hide('userpic-preview'); hide('remove-userpic'); return false&quot;&gt;&lt;__trans phrase=&quot;Remove Userpic&quot;&gt;&lt;/a&gt;
+            &lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;getByID('userpic_asset_id').value = '0'; if (!DOM.hasClassName('userpic-preview', 'hidden')) toggleHidden('userpic-preview'); if (!DOM.hasClassName('remove-userpic', 'hidden')) toggleHidden('remove-userpic'); return false&quot;&gt;&lt;__trans phrase=&quot;Remove Userpic&quot;&gt;&lt;/a&gt;
         &lt;/span&gt;
     &lt;/mtapp:setting&gt;
 
@@ -341,12 +342,12 @@ TC.attachLoadEvent(init);
         accesskey=&quot;s&quot;
         title=&quot;&lt;__trans phrase=&quot;Create [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
-        &gt;&lt;__trans phrase=&quot;Create User&quot;&gt;&lt;/button&gt;
+        &gt;&lt;__trans phrase=&quot;Create [_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&lt;/button&gt;
     &lt;mt:else&gt;
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
     &lt;/mt:if&gt;</diff>
      <filename>tmpl/cms/edit_author.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -126,6 +126,8 @@ TC.attachLoadEvent(init);
     &lt;input type=&quot;hidden&quot; name=&quot;return_args&quot; value=&quot;&lt;mt:var name=&quot;return_args&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
     &lt;input type=&quot;hidden&quot; name=&quot;magic_token&quot; value=&quot;&lt;mt:var name=&quot;magic_token&quot;&gt;&quot; /&gt;
 
+&lt;fieldset&gt;
+    &lt;h3&gt;&lt;__trans phrase=&quot;Blog Details&quot;&gt;&lt;/h3&gt;
 &lt;mt:if name=&quot;can_edit_config&quot;&gt;
 
     &lt;mtapp:setting
@@ -136,7 +138,7 @@ TC.attachLoadEvent(init);
         help_section=&quot;blog_name&quot;&gt;
                 &lt;input name=&quot;name&quot; id=&quot;name&quot; value=&quot;&lt;mt:var name=&quot;name&quot; escape=&quot;html&quot;&gt;&quot; size=&quot;50&quot; onkeyup=&quot;dirify_blog_name(this)&quot; /&gt;
     &lt;/mtapp:setting&gt;
-
+&lt;mt:if name=&quot;template_set_index&quot;&gt;
     &lt;mtapp:setting
         id=&quot;template_set&quot;
         label=&quot;&lt;__trans phrase=&quot;Template Set&quot;&gt;&quot;
@@ -150,6 +152,7 @@ TC.attachLoadEvent(init);
         &lt;/select&gt;
     &lt;/mtapp:setting&gt;
 &lt;/mt:if&gt;
+&lt;/mt:if&gt;
 &lt;mt:if name=&quot;can_set_publish_paths&quot;&gt;
     &lt;mtapp:setting
         id=&quot;site_url&quot;
@@ -216,11 +219,12 @@ TC.attachLoadEvent(init);
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Create [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Create [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Create [_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;
 &lt;mt:include name=&quot;include/actions_bar.tmpl&quot; bar_position=&quot;bottom&quot; hide_pager=&quot;1&quot; settings_bar=&quot;1&quot;&gt;
+    &lt;/fieldset&gt;
 &lt;/form&gt;
 
 &lt;mt:include name=&quot;include/footer.tmpl&quot;&gt;</diff>
      <filename>tmpl/cms/edit_blog.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -160,7 +160,7 @@ TC.attachLoadEvent( init );
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/edit_category.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
     &lt;button</diff>
      <filename>tmpl/cms/edit_comment.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -45,14 +45,14 @@
             onclick=&quot;doForMarkedInThisWindow(this.form, '&lt;__trans phrase=&quot;commenter&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;commenters&quot; escape=&quot;js&quot;&gt;', 'id', 'trust_commenter', {}, '&lt;__trans phrase=&quot;to act upon&quot; escape=&quot;js&quot;&gt;')&quot;
             type=&quot;submit&quot;
             accesskey=&quot;t&quot;
-            title=&quot;&lt;__trans phrase=&quot;Trust [_1] (t)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Trust [lc,_1] (t)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Trust&quot;&gt;&lt;/button&gt;
             &lt;mt:else&gt;
         &lt;button
             onclick=&quot;doForMarkedInThisWindow(this.form, '&lt;__trans phrase=&quot;commenter&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;commenters&quot; escape=&quot;js&quot;&gt;', 'id', 'itemset_action', {action_name:'untrust'}, '&lt;__trans phrase=&quot;to act upon&quot; escape=&quot;js&quot;&gt;')&quot;
             type=&quot;submit&quot;
             accesskey=&quot;t&quot;
-            title=&quot;&lt;__trans phrase=&quot;Untrust [_1] (t)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Untrust [lc,_1] (t)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Untrust&quot;&gt;&lt;/button&gt;
             &lt;/mt:unless&gt;
             &lt;/mt:unless&gt;
@@ -61,14 +61,14 @@
             onclick=&quot;doForMarkedInThisWindow(this.form, '&lt;__trans phrase=&quot;commenter&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;commenters&quot; escape=&quot;js&quot;&gt;', 'id', 'ban_commenter', {}, '&lt;__trans phrase=&quot;to act upon&quot; escape=&quot;js&quot;&gt;')&quot;
             type=&quot;submit&quot;
             accesskey=&quot;b&quot;
-            title=&quot;&lt;__trans phrase=&quot;Ban [_1] (b)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Ban [lc,_1] (b)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Ban&quot;&gt;&lt;/button&gt;
             &lt;mt:else&gt;
         &lt;button
             onclick=&quot;doForMarkedInThisWindow(this.form, '&lt;__trans phrase=&quot;commenter&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;commenters&quot; escape=&quot;js&quot;&gt;', 'id', 'itemset_action', {action_name:'unban'}, '&lt;__trans phrase=&quot;to act upon&quot; escape=&quot;js&quot;&gt;')&quot;
             type=&quot;submit&quot;
             accesskey=&quot;b&quot;
-            title=&quot;&lt;__trans phrase=&quot;Unban [_1] (b)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Unban [lc,_1] (b)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Unban&quot;&gt;&lt;/button&gt;
             &lt;/mt:unless&gt;
         &lt;mt:else&gt;
@@ -76,13 +76,13 @@
             onclick=&quot;doForMarkedInThisWindow(this.form, '&lt;__trans phrase=&quot;commenter&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;commenters&quot; escape=&quot;js&quot;&gt;', 'id', 'trust_commenter', {}, '&lt;__trans phrase=&quot;to act upon&quot; escape=&quot;js&quot;&gt;')&quot;
             type=&quot;submit&quot;
             accesskey=&quot;t&quot;
-            title=&quot;&lt;__trans phrase=&quot;Trust [_1] (t)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Trust [lc,_1] (t)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Trust&quot;&gt;&lt;/button&gt;
         &lt;button
             onclick=&quot;doForMarkedInThisWindow(this.form, '&lt;__trans phrase=&quot;commenter&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;commenters&quot; escape=&quot;js&quot;&gt;', 'id', 'ban_commenter', {}, '&lt;__trans phrase=&quot;to act upon&quot; escape=&quot;js&quot;&gt;')&quot;
             type=&quot;submit&quot;
             accesskey=&quot;b&quot;
-            title=&quot;&lt;__trans phrase=&quot;Ban [_1] (b)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Ban [lc,_1] (b)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Ban&quot;&gt;&lt;/button&gt;
             /&gt;
         &lt;/mt:if&gt;
@@ -159,12 +159,12 @@ TC.attachLoadEvent(init);
             hint=&quot;&lt;__trans phrase=&quot;The trusted status of the commenter&quot;&gt;&quot;
             show_hint=&quot;0&quot;&gt;
             &lt;mt:if name=&quot;commenter_approved&quot;&gt;
-            &lt;span class=&quot;icon-left icon-left-wide icon-trusted&quot;&gt;&lt;__trans phrase=&quot;Trusted&quot;&gt;&lt;/span&gt;
+            &lt;span class=&quot;icon-left-wide icon-trusted&quot;&gt;&lt;__trans phrase=&quot;Trusted&quot;&gt;&lt;/span&gt;
             &lt;mt:else&gt;
                 &lt;mt:if name=&quot;commenter_banned&quot;&gt;
-              &lt;span class=&quot;icon-left icon-left-wide icon-banned&quot;&gt;&lt;__trans phrase=&quot;Banned&quot;&gt;&lt;/span&gt;
+              &lt;span class=&quot;icon-left-wide icon-banned&quot;&gt;&lt;__trans phrase=&quot;Banned&quot;&gt;&lt;/span&gt;
                 &lt;mt:else&gt;
-            &lt;span class=&quot;icon-left icon-left-wide icon-authenticated&quot;&gt;&lt;__trans phrase=&quot;Authenticated&quot;&gt;&lt;/span&gt;
+            &lt;span class=&quot;icon-left-wide icon-authenticated&quot;&gt;&lt;__trans phrase=&quot;Authenticated&quot;&gt;&lt;/span&gt;
                 &lt;/mt:if&gt;
             &lt;/mt:if&gt;
             &lt;a title=&quot;&lt;__trans phrase=&quot;View all commenters&quot;&gt;&quot; href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=list_member&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;filter_key=commenter&quot;&gt;&lt;img src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;images/filter.gif&quot; alt=&quot;&quot; width=&quot;8&quot; height=&quot;8&quot; /&gt;&lt;/a&gt;</diff>
      <filename>tmpl/cms/edit_commenter.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,52 @@
 &lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;
     &lt;mt:if name=&quot;can_manage_pages&quot;&gt;
-        &lt;mt:setvar name=&quot;can_publish_post&quot; value=&quot;1&quot;&gt;
+        &lt;$mt:setvar name=&quot;can_publish_post&quot; value=&quot;1&quot;$&gt;
     &lt;/mt:if&gt;
-    &lt;mt:setvar name=&quot;disp_prefs_show_category&quot; value=&quot;1&quot;&gt;
-    &lt;mt:setvar name=&quot;container_label&quot; value=&quot;&lt;__trans phrase=&quot;Folder&quot;&gt;&quot;&gt;
-    &lt;mt:setvar name=&quot;basename_label&quot; value=&quot;&lt;__trans phrase=&quot;Filename&quot;&gt;&quot;&gt;
-    &lt;mt:setvar name=&quot;container_label_plural&quot; value=&quot;&lt;__trans phrase=&quot;Folders&quot;&gt;&quot;&gt;
-    &lt;mt:setvar name=&quot;container_type&quot; value=&quot;Folder&quot;&gt;
+    &lt;$mt:setvar name=&quot;disp_prefs_show_category&quot; value=&quot;1&quot;$&gt;
+    &lt;$mt:setvar name=&quot;container_label&quot; value=&quot;&lt;__trans phrase=&quot;Folder&quot;&gt;&quot;$&gt;
+    &lt;$mt:setvar name=&quot;basename_label&quot; value=&quot;&lt;__trans phrase=&quot;Filename&quot;&gt;&quot;$&gt;
+    &lt;$mt:setvar name=&quot;container_label_plural&quot; value=&quot;&lt;__trans phrase=&quot;Folders&quot;&gt;&quot;$&gt;
+    &lt;$mt:setvar name=&quot;container_type&quot; value=&quot;Folder&quot;&gt;
 &lt;mt:else&gt;
-    &lt;mt:setvar name=&quot;container_label&quot; value=&quot;&lt;__trans phrase=&quot;Category&quot;&gt;&quot;&gt;
-    &lt;mt:setvar name=&quot;basename_label&quot; value=&quot;&lt;__trans phrase=&quot;Basename&quot;&gt;&quot;&gt;
-    &lt;mt:setvar name=&quot;container_label_plural&quot; value=&quot;&lt;__trans phrase=&quot;Categories&quot;&gt;&quot;&gt;
-    &lt;mt:setvar name=&quot;container_type&quot; value=&quot;Category&quot;&gt;
-    &lt;mt:ignore&gt;
-        &lt;__trans phrase=&quot;folder&quot;&gt;
-        &lt;__trans phrase=&quot;folders&quot;&gt;
-        &lt;__trans phrase=&quot;category&quot;&gt;
-        &lt;__trans phrase=&quot;categories&quot;&gt;
-    &lt;/mt:ignore&gt;
+    &lt;$mt:setvar name=&quot;container_label&quot; value=&quot;&lt;__trans phrase=&quot;Category&quot;&gt;&quot;$&gt;
+    &lt;$mt:setvar name=&quot;basename_label&quot; value=&quot;&lt;__trans phrase=&quot;Basename&quot;&gt;&quot;$&gt;
+    &lt;$mt:setvar name=&quot;container_label_plural&quot; value=&quot;&lt;__trans phrase=&quot;Categories&quot;&gt;&quot;$&gt;
+    &lt;$mt:setvar name=&quot;container_type&quot; value=&quot;Category&quot;&gt;
+    &lt;$mt:setvar name=&quot;container_label_class&quot; value=&quot;no-header&quot;$&gt;
 &lt;/mt:if&gt;
 &lt;mt:if name=&quot;new_object&quot;&gt;
     &lt;mt:setvarblock name=&quot;page_title&quot;&gt;&lt;__trans phrase=&quot;Create [_1]&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot;$&gt;&quot;&gt;&lt;/mt:setvarblock&gt;
 &lt;mt:else&gt;
     &lt;mt:setvarblock name=&quot;page_title&quot;&gt;&lt;__trans phrase=&quot;Edit [_1]&quot;  params=&quot;&lt;$mt:var name=&quot;object_label&quot;$&gt;&quot;&gt;&lt;/mt:setvarblock&gt;
 &lt;/mt:if&gt;
+&lt;mt:setvartemplate name=&quot;action_buttons&quot;&gt;
+    &lt;button
+        mt:mode=&quot;save_entry&quot;
+        type=&quot;submit&quot;
+        accesskey=&quot;s&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
+        class=&quot;primary-button&quot;
+        &gt;&lt;__trans phrase=&quot;Save&quot;&gt;&lt;/button&gt;
+    &lt;button
+        mt:mode=&quot;preview_entry&quot;
+        name=&quot;preview_entry&quot;
+        type=&quot;submit&quot;
+        accesskey=&quot;v&quot;
+        title=&quot;&lt;__trans phrase=&quot;Preview this [lc,_1] (v)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
+        &gt;&lt;__trans phrase=&quot;Preview&quot;&gt;&lt;/button&gt;
+    &lt;mt:if name=&quot;id&quot;&gt;
+    &lt;button
+        mt:command=&quot;do-remove-items&quot;
+        mt:object-singular=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot; escape=&quot;html&quot;&gt;&quot;
+        mt:object-plural=&quot;&lt;mt:var name=&quot;object_label_plural&quot; lower_case=&quot;1&quot; escape=&quot;html&quot;&gt;&quot;
+        mt:object-type=&quot;&lt;mt:var name=&quot;object_type&quot; escape=&quot;html&quot;&gt;&quot; mt:blog-id=&quot;&lt;mt:var name=&quot;blog_id&quot;&gt;&quot;
+        type=&quot;submit&quot;
+        accesskey=&quot;x&quot;
+        title=&quot;&lt;__trans phrase=&quot;Delete this [lc,_1] (x)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
+        &gt;&lt;__trans phrase=&quot;Delete&quot;&gt;&lt;/button&gt;
+    &lt;/mt:if&gt;
+    &lt;div id=&quot;autosave-notification-&lt;$mt:var name=&quot;bar_position&quot; default=&quot;top&quot;$&gt;&quot; class=&quot;autosave-notification&quot;&gt;&lt;/div&gt;
+&lt;/mt:setvartemplate&gt;
 &lt;mt:setvarblock name=&quot;content_header&quot;&gt;
     &lt;div id=&quot;msg-block&quot;&gt;
 
@@ -41,7 +64,7 @@
         &lt;mtapp:statusmsg
             id=&quot;saved-added&quot;
             class=&quot;success&quot;&gt;
-            &lt;__trans phrase=&quot;Your [_1] has been saved.&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;
+            &lt;__trans phrase=&quot;Your [lc,_1] has been saved.&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot;$&gt;&quot;&gt;
         &lt;/mtapp:statusmsg&gt;
     &lt;/mt:if&gt;
 
@@ -127,79 +150,258 @@
     &lt;/mt:if&gt;
     &lt;/div&gt;
 &lt;/mt:setvarblock&gt;
+&lt;mt:setvarblock name=&quot;form_header&quot;&gt;
+    &lt;form name=&quot;entry_form&quot; id=&quot;entry_form&quot; method=&quot;post&quot; action=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;&quot; mt:once=&quot;1&quot; mt:auto-save=&quot;1&quot; mt:auto-save-delay=&quot;&lt;$mt:var name=&quot;autosave_frequency&quot;$&gt;000&quot;&gt;
+    &lt;mt:if name=&quot;new_object&quot;&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;author_id&quot; value=&quot;&lt;$mt:var name=&quot;author_id&quot;$&gt;&quot; /&gt;
+    &lt;mt:else&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;$mt:var name=&quot;id&quot;$&gt;&quot; /&gt;
+    &lt;/mt:if&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;blog_id&quot; value=&quot;&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot; /&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;__mode&quot; value=&quot;save_entry&quot; /&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;_type&quot; value=&quot;&lt;$mt:var name=&quot;object_type&quot;$&gt;&quot; /&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;return_args&quot; value=&quot;&lt;$mt:var name=&quot;return_args&quot; escape=&quot;html&quot;$&gt;&quot; /&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;magic_token&quot; value=&quot;&lt;$mt:var name=&quot;magic_token&quot;$&gt;&quot; id=&quot;m_t&quot; /&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;action_name&quot; value=&quot;&quot; /&gt;
+        &lt;input type=&quot;hidden&quot; name=&quot;itemset_action_input&quot; value=&quot;&quot; /&gt;
+&lt;/mt:setvarblock&gt;
+&lt;mt:setvarblock name=&quot;category_setting&quot;&gt;
+    &lt;mtapp:setting
+        id=&quot;category&quot;
+        shown=&quot;$disp_prefs_show_category&quot;
+        label=&quot;$container_label&quot;
+        label_class=&quot;$container_label_class&quot;
+        help_page=&quot;entries&quot;
+        help_section=&quot;entry_categories&quot;
+        content_class=&quot;field-content-text&quot;&gt;
+        &lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;
+        &lt;a href=&quot;javascript:void(0);&quot; class=&quot;change-folder-link&quot; mt:command=&quot;open-category-selector&quot; title=&quot;&lt;__trans phrase=&quot;Change [lc,_1]&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot;$&gt;&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;Add&quot;/&gt;&lt;/a&gt;
+        &lt;div mt:delegate=&quot;category-list&quot; id=&quot;category-list&quot;&gt;&lt;/div&gt;
+        &lt;mt:else&gt;
+        &lt;a href=&quot;javascript:void(0);&quot; class=&quot;add-new-category-link&quot; mt:command=&quot;open-category-selector&quot; title=&quot;&lt;__trans phrase=&quot;Add [lc,_1]&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot;$&gt;&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;Add&quot;/&gt;&lt;/a&gt;
+        &lt;div mt:delegate=&quot;category-list&quot; id=&quot;category-list&quot;&gt;&lt;/div&gt;
+        &lt;/mt:if&gt;
+        &lt;input id=&quot;category-ids&quot; type=&quot;hidden&quot; name=&quot;category_ids&quot; value=&quot;&lt;$mt:var name=&quot;selected_category_loop&quot; glue=&quot;,&quot;$&gt;&quot; /&gt;
+    &lt;script type=&quot;text/javascript&quot;&gt;
+        /* &lt;![CDATA[ */
+            MT.App.selectedCategoryList = &lt;$mt:if name=&quot;selected_category_loop&quot;&gt;&lt;$mt:var name=&quot;selected_category_loop&quot; to_json=&quot;1&quot;$&gt;&lt;mt:else&gt;[]&lt;/mt:if&gt;;
+            Template.templates.categoryList = '&lt;mt:section encode_js=&quot;1&quot;&gt;
+                [# if ( !items.length ) { #]
+                    &lt;span class=&quot;disabled&quot;&gt;[#|h trans(&quot;None selected&quot;) #]&lt;/span&gt;
+                    [#* return #]
+                [# } #]
+                &lt;ul class=&quot;&lt;$mt:var name=&quot;container_type&quot; lower_case=&quot;1&quot;$&gt;-list pkg&quot;&gt;
+                [# var map = {}; #]
+                [# for ( var i = 0; i &lt; items.length; i++ ) { #]
+                    [# if ( items[ i ] == 0 &amp;&amp; i == 0 ) { #]
+                        [#-- special case, no primary selected, but has secondaries --#]
+                        [# continue #]
+                    [# } #]
+                    [# var cat = cache.getItem( &quot;cat:&quot;+items[ i ] ); #]
+                    [# if ( !cat ) continue; #]
+                    [# var label; #]
+                    [# if ( cat.path.length ) {
+                        label = [];
+                        for ( var j = 0; j &lt; cat.path.length; j++ ) {
+                            var c = cache.getItem( &quot;cat:&quot;+cat.path[ j ] );
+                            if ( c ) 
+                                label.push( c.label );
+                        }
+                        label.push( cat.label );
+                        for ( var j = 0; j &lt; label.length; j++ )
+                            label[ j ] = context.f.h( label[ j ] );
+                        label = label.join( &lt;mt:if name=&quot;object_type&quot; ne=&quot;page&quot;&gt;' &amp;raquo; '&lt;mt:else&gt;''&lt;/mt:if&gt; );
+                    } else {
+                        label = context.f.h( cat.label );
+                    } #]
+                    &lt;mt:if name=&quot;object_type&quot; ne=&quot;page&quot;&gt;
+                    [# if ( i == 0 ) { #]
+                        &lt;li class=&quot;primary pkg&quot; mt:focus-hover=&quot;1&quot; mt:id=&quot;[#= cat.id #]&quot;&gt;&lt;strong&gt;[#= label #]&lt;/strong&gt;&lt;a href=&quot;javascript:void(0);&quot; mt:command=&quot;remove&quot; class=&quot;delete&quot; title=&quot;[#|h trans(&quot;Remove&quot;) #]&quot;&gt;&amp;nbsp;&lt;span&gt;[#|h trans(&quot;Remove&quot;) #]&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
+                    [# } else { #]
+                        &lt;li class=&quot;pkg&quot; mt:focus-hover=&quot;1&quot; mt:id=&quot;[#= cat.id #]&quot;&gt;&lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;&lt;a mt:focus-hover=&quot;1&quot; href=&quot;javascript:void(0);&quot; mt:command=&quot;primary&quot; class=&quot;primary&quot; title=&quot;[#|h trans(&quot;Make primary&quot;) #]&quot;&gt;[#= label #]&lt;/a&gt;&lt;/mt:if&gt;&lt;a mt:focus-hover=&quot;1&quot; href=&quot;javascript:void(0);&quot; mt:command=&quot;remove&quot; class=&quot;delete&quot; title=&quot;[#|h &quot;Remove&quot; #]&quot;&gt;&amp;nbsp;&lt;span&gt;[#|h trans(&quot;Remove&quot;) #]&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
+                    [# } #]
+                    &lt;mt:else&gt;
+                    &lt;li class=&quot;pkg&quot; mt:focus-hover=&quot;1&quot; mt:id=&quot;[#= cat.id #]&quot;&gt;[#= label #]&lt;/li&gt;
+                    &lt;/mt:if&gt;
+                [# } #]
+                &lt;/ul&gt;
+            &lt;/mt:section&gt;';
+        /* ]]&gt; */
+    &lt;/script&gt;
+    &lt;/mtapp:setting&gt;
+&lt;/mt:setvarblock&gt;
 &lt;mt:setvarblock name=&quot;related_content&quot;&gt;
     &lt;mt:unless name=&quot;new_object&quot;&gt;
-        &lt;mt:setvarblock name=&quot;summary_label&quot;&gt;&lt;__trans phrase=&quot;[_1] Summary&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot;$&gt;&quot;&gt;&lt;/mt:setvarblock&gt;
+        &lt;mt:setvarblock name=&quot;stats_widget_id&quot;&gt;&lt;$mt:var name=&quot;object_type&quot;$&gt;-stats-widget&lt;/mt:setvarblock&gt;
         &lt;mtapp:widget
-            id=&quot;entry-summary-widget&quot;
-            label=&quot;$summary_label&quot;&gt;
+            id=&quot;$stats_widget_id&quot;
+            class=&quot;stats-widget&quot;
+            label=&quot;&lt;__trans phrase=&quot;Stats&quot;&gt;&quot;&gt;
+            &lt;div class=&quot;object-status&quot;&gt;
+                &lt;ul class=&quot;pkg&quot;&gt;
+                    &lt;li class=&quot;object-status-detail&quot;&gt;
+                        &lt;mt:if name=&quot;status_draft&quot;&gt;
+                            &lt;span class=&quot;icon-left-wide icon-draft&quot;&gt;&lt;__trans phrase=&quot;Unpublished (Draft)&quot;&gt;&lt;/span&gt;
+                        &lt;mt:else name=&quot;status_review&quot;&gt;
+                            &lt;span class=&quot;icon-left-wide icon-warning&quot;&gt;&lt;__trans phrase=&quot;Unpublished (Review)&quot;&gt;&lt;/span&gt;
+                        &lt;mt:else name=&quot;status_future&quot;&gt;
+                            &lt;span class=&quot;icon-left-wide icon-future&quot;&gt;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&lt;/span&gt;
+                        &lt;mt:else name=&quot;status_publish&quot;&gt;
+                            &lt;span class=&quot;icon-left-wide icon-success&quot;&gt;&lt;__trans phrase=&quot;Published&quot;&gt;&lt;/span&gt;
+                        &lt;/mt:if&gt;
+                    &lt;/li&gt;
+                    &lt;mt:if name=&quot;status_publish&quot;&gt;
+                        &lt;mt:if name=&quot;entry_permalink&quot;&gt;
+                    &lt;li class=&quot;view-entry-link&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;entry_permalink&quot;$&gt;&quot; target=&quot;&lt;__trans phrase=&quot;_external_link_target&quot;&gt;&quot; class=&quot;icon-left-wide icon-view&quot;&gt;&lt;__trans phrase=&quot;View&quot;&gt;&lt;/a&gt;&lt;/li&gt;
+                        &lt;/mt:if&gt;
+                        &lt;mt:if name=&quot;can_send_notifications&quot;&gt;
+                    &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;openDialog(null,'entry_notify','blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;entry_id=&lt;mt:var name=&quot;id&quot;&gt;');return false;&quot; class=&quot;icon-left-wide icon-share&quot;&gt;&lt;__trans phrase=&quot;Share&quot;&gt;&lt;/a&gt;&lt;/li&gt;
+                        &lt;/mt:if&gt;
+                    &lt;/mt:if&gt;
+                &lt;/ul&gt;
+            &lt;/div&gt;
+            &lt;ul class=&quot;object-stats&quot;&gt;
+                &lt;li class=&quot;comments-link&quot;&gt;&lt;__trans phrase=&quot;&lt;a href=&quot;[_2]&quot;&gt;[quant,_1,comment,comments]&lt;/a&gt;&quot; params=&quot;&lt;$mt:var name=&quot;num_comments&quot;$&gt;%%&lt;$mt:var name=&quot;script_url&quot;&gt;?__mode=list_comments&amp;amp;filter_key=_comments_by_entry&amp;amp;filter_val=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;/li&gt;
+                &lt;li class=&quot;pings-link&quot;&gt;&lt;__trans phrase=&quot;&lt;a href=&quot;[_2]&quot;&gt;[quant,_1,trackback,trackbacks]&lt;/a&gt;&quot; params=&quot;&lt;$mt:var name=&quot;num_pings&quot;$&gt;%%&lt;$mt:var name=&quot;script_url&quot;&gt;?__mode=list_pings&amp;amp;filter=entry_id&amp;amp;filter_val=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;/li&gt;
+            &lt;/ul&gt;
+        &lt;/mtapp:widget&gt;
+    &lt;/mt:unless&gt;
+    &lt;mtapp:widget
+        id=&quot;entry-publishing-widget&quot;
+        label=&quot;&lt;__trans phrase=&quot;Publishing&quot;&gt;&quot;&gt;
+        &lt;mtapp:setting
+            id=&quot;status&quot;
+            label=&quot;&lt;__trans phrase=&quot;Status&quot;&gt;&quot;
+            help_page=&quot;entries&quot;
+            help_section=&quot;status&quot;&gt;
+            &lt;mt:unless name=&quot;sitepath_configured&quot;&gt;
+                            &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;1&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Unpublished&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;alert-warning-inline&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/status_icons/warning.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Warning&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt; &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=cfg_archives&amp;amp;id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;You must configure this blog before you can publish this [lc,_1].&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&lt;/a&gt;&lt;/span&gt;
+            &lt;mt:else&gt;
+                &lt;mt:if name=&quot;can_publish_post&quot;&gt;
+                            &lt;select name=&quot;status&quot; id=&quot;status&quot; class=&quot;full-width&quot; tabindex=&quot;9&quot; onchange=&quot;highlightSwitch(this)&quot;&gt;
+                                &lt;option value=&quot;1&quot;&lt;mt:if name=&quot;status_draft&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Unpublished (Draft)&quot;&gt;&lt;/option&gt;
+                                &lt;option value=&quot;2&quot;&lt;mt:if name=&quot;status_publish&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Published&quot;&gt;&lt;/option&gt;
+                    &lt;mt:if name=&quot;status_review&quot;&gt;
+                                &lt;option value=&quot;3&quot;&lt;mt:if name=&quot;status_review&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Unpublished (Review)&quot;&gt;&lt;/option&gt;
+                    &lt;/mt:if&gt;
+                    &lt;mt:if name=&quot;new_object&quot;&gt;
+                                    &lt;option value=&quot;4&quot;&lt;mt:if name=&quot;status_future&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&lt;/option&gt;
+                    &lt;mt:else&gt;
+                        &lt;mt:unless name=&quot;status_publish&quot;&gt;
+                                &lt;option value=&quot;4&quot;&lt;mt:if name=&quot;status_future&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&lt;/option&gt;
+                        &lt;/mt:unless&gt;
+                    &lt;/mt:if&gt;
+                            &lt;/select&gt;
+                &lt;mt:else&gt;
+                    &lt;mt:if name=&quot;new_object&quot;&gt;
+                            &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;1&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Unpublished&quot;&gt;&lt;/span&gt;
+                    &lt;mt:else&gt;
+                        &lt;mt:if name=&quot;status_draft&quot;&gt;
+                            &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;1&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Unpublished (Draft)&quot;&gt;&lt;/span&gt;
+                        &lt;mt:else name=&quot;status_publish&quot;&gt;
+                            &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;2&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Published&quot;&gt;&lt;/span&gt;
+                        &lt;mt:else name=&quot;status_future&quot;&gt;
+                            &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;4&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&lt;/span&gt;
+                        &lt;mt:else name=&quot;status_review&quot;&gt;
+                            &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;3&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Unpublished (Review)&quot;&gt;&lt;/span&gt;
+                        &lt;/mt:if&gt;
+                    &lt;/mt:if&gt;
+                &lt;/mt:if&gt;
+            &lt;/mt:unless&gt;
+            &lt;mt:unless name=&quot;new_object&quot;&gt;
             &lt;ul&gt;
-                &lt;li&gt;&lt;__trans phrase=&quot;Created [_1] by [_2].&quot; params=&quot;&lt;$mt:date ts=&quot;$created_on_ts&quot; relative=&quot;1&quot; _default=&quot;$created_on_formatted&quot;$&gt;%%&lt;$mt:var name=&quot;created_by&quot; escape=&quot;html&quot;$&gt;&quot;&gt;&lt;/li&gt;
-            &lt;mt:if name=&quot;modified_by&quot;&gt;
-                &lt;li&gt;&lt;__trans phrase=&quot;Last edited [_1] by [_2].&quot; params=&quot;&lt;$MTDate ts=&quot;$modified_on_ts&quot; relative=&quot;1&quot; _default=&quot;$modified_on_formatted&quot;$&gt;%%&lt;$mt:var name=&quot;modified_by&quot; escape=&quot;html&quot;$&gt;&quot;&gt;&lt;/li&gt;
-            &lt;/mt:if&gt;
+                &lt;li&gt;&lt;__trans phrase=&quot;[_1] - Created by [_2]&quot; params=&quot;&lt;$mt:date ts=&quot;$created_on_ts&quot; relative=&quot;1&quot; _default=&quot;$created_on_formatted&quot;$&gt;%%&lt;$mt:var name=&quot;created_by&quot; escape=&quot;html&quot;$&gt;&quot;&gt;&lt;/li&gt;
             &lt;mt:if name=&quot;status_publish&quot;&gt;
-                &lt;li&gt;&lt;__trans phrase=&quot;Published [_1].&quot; params=&quot;&lt;$MTDate ts=&quot;$authored_on_ts&quot; relative=&quot;1&quot; _default=&quot;$authored_on_formatted&quot;$&gt;&quot;&gt;&lt;/li&gt;
+                &lt;li&gt;&lt;__trans phrase=&quot;[_1] - Published by [_2]&quot; params=&quot;&lt;$MTDate ts=&quot;$authored_on_ts&quot; relative=&quot;1&quot; _default=&quot;$authored_on_formatted&quot;$&gt;%%&lt;$mt:var name=&quot;author_name&quot; escape=&quot;html&quot;$&gt;&quot;&gt;&lt;/li&gt;
+            &lt;/mt:if&gt;
+            &lt;mt:if name=&quot;modified_by&quot;&gt;
+                &lt;li&gt;&lt;__trans phrase=&quot;[_1] - Edited by [_2]&quot; params=&quot;&lt;$MTDate ts=&quot;$modified_on_ts&quot; relative=&quot;1&quot; _default=&quot;$modified_on_formatted&quot;$&gt;%%&lt;$mt:var name=&quot;modified_by&quot; escape=&quot;html&quot;$&gt;&quot;&gt;&lt;/li&gt;
             &lt;/mt:if&gt;
-                &lt;li&gt;&lt;__trans phrase=&quot;This [_1] has received &lt;a href=&quot;[_4]&quot;&gt;[quant,_2,comment,comments]&lt;/a&gt; and &lt;a href=&quot;[_5]&quot;&gt;[quant,_3,trackback,trackbacks]&lt;/a&gt;.&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;$&gt;%%&lt;$mt:var name=&quot;num_comments&quot;$&gt;%%&lt;$mt:var name=&quot;num_pings&quot;$&gt;%%&lt;$mt:var name=&quot;script_url&quot;&gt;?__mode=list_comments&amp;amp;filter_key=_comments_by_entry&amp;amp;filter_val=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;%%&lt;$mt:var name=&quot;script_url&quot;&gt;?__mode=list_pings&amp;amp;filter=entry_id&amp;amp;filter_val=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;/li&gt;
             &lt;/ul&gt;
+            &lt;/mt:unless&gt;
+        &lt;/mtapp:setting&gt;
+
+        &lt;mt:if name=&quot;status_future&quot;&gt;
+            &lt;$mt:setvar name=&quot;authored_on_label&quot; value=&quot;&lt;__trans phrase=&quot;Publish On&quot;&gt;&quot;$&gt;
+        &lt;mt:else&gt;
+            &lt;$mt:setvar name=&quot;authored_on_label&quot; value=&quot;&lt;__trans phrase=&quot;Publish Date&quot;&gt;&quot;$&gt;
+        &lt;/mt:if&gt;
+        &lt;mtapp:setting
+            id=&quot;authored_on&quot;
+            label=&quot;$authored_on_label&quot;
+            help_page=&quot;entries&quot;
+            help_section=&quot;date&quot;&gt;
+            &lt;span class=&quot;date-time-fields&lt;mt:if name=&quot;status_future&quot;&gt;&lt;mt:if name=&quot;can_publish_post&quot;&gt; highlight&lt;/mt:if&gt;&lt;/mt:if&gt;&quot;&gt;
+                &lt;input id=&quot;created-on&quot; class=&quot;entry-date&quot; name=&quot;authored_on_date&quot; tabindex=&quot;10&quot; value=&quot;&lt;$mt:var name=&quot;authored_on_date&quot; escape=&quot;html&quot;$&gt;&quot; /&gt;
+                &lt;a href=&quot;javascript:void(0);&quot; mt:command=&quot;open-calendar-created-on&quot; class=&quot;date-picker&quot; title=&quot;&lt;__trans phrase=&quot;Select entry date&quot;&gt;&quot;&gt;&lt;span&gt;Choose Date&lt;/span&gt;&lt;/a&gt;
+                &lt;input class=&quot;entry-time&quot; name=&quot;authored_on_time&quot; tabindex=&quot;11&quot; value=&quot;&lt;$mt:var name=&quot;authored_on_time&quot; escape=&quot;html&quot;$&gt;&quot; /&gt;
+            &lt;/span&gt;
+        &lt;/mtapp:setting&gt;
+
+        &lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;
+            &lt;$mt:var name=&quot;category_setting&quot;$&gt;
+        &lt;/mt:if&gt;
+
+        &lt;mtapp:setting
+            id=&quot;basename&quot;
+            label=&quot;$basename_label&quot;
+            help_page=&quot;entries&quot;
+            help_section=&quot;basename&quot;&gt;
+                &lt;input type=&quot;hidden&quot; name=&quot;basename_manual&quot; id=&quot;basename_manual&quot; value=&quot;0&quot; /&gt;
+                &lt;input type=&quot;hidden&quot; name=&quot;basename_old&quot; id=&quot;basename_old&quot; value=&quot;&lt;$mt:var name=&quot;basename_old&quot; escape=&quot;html&quot;$&gt;&quot; /&gt;
+                &lt;input type=&quot;text&quot; &lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;disabled=&quot;disabled&quot;&lt;/mt:if&gt; name=&quot;basename&quot; id=&quot;basename&quot; value=&quot;&lt;$mt:var name=&quot;basename&quot;$&gt;&quot; onchange=&quot;setElementValue('basename', dirify(this.value))&quot; tabindex=&quot;12&quot; /&gt;
+            &lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;
+            &lt;span class=&quot;file-extension&quot;&gt;&lt;$mt:var name=&quot;file_extension&quot;$&gt;&lt;/span&gt;
+            &lt;/mt:if&gt;
+            &lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;
+                &lt;mt:if name=&quot;can_publish_post&quot;&gt;
+                &lt;a href=&quot;javascript:void(0);&quot; id=&quot;basename-lock&quot; title=&quot;&lt;__trans phrase=&quot;Unlock this entry&amp;rsquo;s output filename for editing&quot;&gt;&quot; onclick=&quot;return toggleFile()&quot;&gt;&lt;span&gt;Unlock&lt;/span&gt;&lt;/a&gt;
+                &lt;/mt:if&gt;
+                &lt;p class=&quot;alert-warning-inline&quot; id=&quot;basename-warning&quot; style=&quot;display: none&quot;&gt;
+                    &lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/status_icons/warning.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Warning&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;
+                &lt;mt:if name=&quot;new_object&quot;&gt;
+                    &lt;__trans phrase=&quot;Warning: If you set the basename manually, it may conflict with another entry.&quot;&gt;
+                &lt;mt:else&gt;
+                    &lt;__trans phrase=&quot;Warning: Changing this entry's basename may break inbound links.&quot;&gt;
+                &lt;/mt:if&gt;
+                &lt;/p&gt;
+            &lt;/mt:if&gt;
+        &lt;/mtapp:setting&gt;
+    &lt;/mtapp:widget&gt;
+    &lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;
+        &lt;mtapp:widget
+            id=&quot;entry-category-widget&quot;
+            label=&quot;&lt;__trans phrase=&quot;Categories&quot;&gt;&quot;&gt;
+            &lt;$mt:var name=&quot;category_setting&quot;$&gt;
         &lt;/mtapp:widget&gt;
-    &lt;/mt:unless&gt;
+    &lt;/mt:if&gt;
     &lt;mtapp:widget
-        id=&quot;display-options-widget&quot;
-        label=&quot;&lt;__trans phrase=&quot;Display Options&quot;&gt;&quot;
-        label_link=&quot;javascript:void(0)&quot;
-        label_onclick=&quot;return toggleEntryDisplayOptions();&quot;&gt;
+        id=&quot;entry-feedback-widget&quot;
+        label=&quot;&lt;__trans phrase=&quot;Feedback&quot;&gt;&quot;&gt;
+        &lt;mtapp:setting
+            id=&quot;allow_feedback&quot;
+            label=&quot;&lt;__trans phrase=&quot;Accept&quot;&gt;&quot;
+            help_page=&quot;entries&quot;
+            help_section=&quot;accept_comments&quot;&gt;
+            &lt;ul&gt;
+                &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;allow_comments&quot; id=&quot;allow_comments&quot; tabindex=&quot;14&quot; value=&quot;1&quot;&lt;mt:if name=&quot;allow_comments&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;label for=&quot;allow_comments&quot;&gt;&lt;__trans phrase=&quot;Comments&quot;/&gt;&lt;/label&gt;&lt;/li&gt;
+                &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;allow_pings&quot; id=&quot;allow_pings&quot; tabindex=&quot;15&quot; value=&quot;1&quot;&lt;mt:if name=&quot;allow_pings&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;label for=&quot;allow_pings&quot;&gt;&lt;__trans phrase=&quot;TrackBacks&quot;/&gt;&lt;/label&gt;&lt;/li&gt;
+            &lt;/ul&gt;
+        &lt;/mtapp:setting&gt;
+
+        &lt;mtapp:setting
+            id=&quot;ping_urls&quot;
+            label=&quot;&lt;__trans phrase=&quot;Outbound TrackBack URLs&quot;&gt;&quot;
+            help_page=&quot;entries&quot;
+            help_section=&quot;urls_to_ping&quot;&gt;
+                &lt;textarea name=&quot;to_ping_urls&quot; id=&quot;to_ping_urls&quot; class=&quot;full-width short&quot; tabindex=&quot;16&quot; cols=&quot;&quot; rows=&quot;&quot;&gt;&lt;$mt:var name=&quot;to_ping_urls&quot; escape=&quot;html&quot;$&gt;&lt;/textarea&gt;
+            &lt;mt:unless name=&quot;new_object&quot;&gt;
+                &lt;mt:if name=&quot;has_any_pinged_urls&quot;&gt;
+                &lt;div id=&quot;sent-tb&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;listPreviousPings(); return false&quot;&gt;&lt;__trans phrase=&quot;View Previously Sent TrackBacks&quot;&gt;&lt;/a&gt;&lt;/div&gt;
+                &lt;/mt:if&gt;
+            &lt;/mt:unless&gt;
+        &lt;/mtapp:setting&gt;
 
-        &lt;form name=&quot;display-options-form&quot; method=&quot;post&quot; action=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;&quot;&gt;
-            &lt;input type=&quot;hidden&quot; id=&quot;entry_prefs&quot; name=&quot;entry_prefs&quot; value=&quot;&lt;mt:if name=&quot;disp_prefs_default&quot;&gt;Default&lt;mt:else&gt;Custom&lt;/mt:if&gt;&quot;&gt;
-                &lt;mtapp:setting
-                    id=&quot;entry_fields&quot;
-                    label=&quot;&lt;__trans phrase=&quot;Fields&quot;&gt;&quot;
-                    label_class=&quot;display-options&quot;&gt;
-                    &lt;ul&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-title&quot; value=&quot;title&quot; checked=&quot;checked&quot; disabled=&quot;disabled&quot; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Title&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-body&quot; value=&quot;body&quot; checked=&quot;checked&quot; disabled=&quot;disabled&quot; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Body&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;setCustomFields(); return true;&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-tags&quot; value=&quot;tags&quot; &lt;mt:if name=&quot;disp_prefs_show_tags&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Tags&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;mt:if name=&quot;object_type&quot; ne=&quot;page&quot;&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-category&quot; value=&quot;category&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_category&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Category&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;/mt:if&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-excerpt&quot; value=&quot;excerpt&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_excerpt&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Excerpt&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-keywords&quot; value=&quot;keywords&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_keywords&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Keywords&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-publishing&quot; value=&quot;publishing&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_publishing&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Publishing&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-feedback&quot; value=&quot;feedback&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_feedback&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Feedback&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                    &lt;/ul&gt;
-                &lt;/mtapp:setting&gt;
-                &lt;mtapp:setting
-                    id=&quot;action_bars&quot;
-                    label=&quot;&lt;__trans phrase=&quot;Actions&quot;&gt;&quot;
-                    label_class=&quot;display-options&quot;&gt;
-                    &lt;ul class=&quot;action-button-options&quot;&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;bar_position&quot; id=&quot;bar_position_top&quot; value=&quot;Top&quot;&lt;mt:unless name=&quot;position_actions_both&quot;&gt;&lt;mt:if name=&quot;position_actions_top&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt;&lt;/mt:unless&gt; onclick=&quot;setBarPosition(this)&quot; class=&quot;rb&quot; /&gt; &lt;__trans phrase=&quot;Top&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;bar_position&quot; id=&quot;bar_position_both&quot; value=&quot;Both&quot;&lt;mt:if name=&quot;position_actions_both&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; onclick=&quot;setBarPosition(this)&quot; class=&quot;rb&quot; /&gt; &lt;__trans phrase=&quot;Both&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;bar_position&quot; id=&quot;bar_position_bottom&quot; value=&quot;Bottom&quot;&lt;mt:unless name=&quot;position_actions_both&quot;&gt;&lt;mt:if name=&quot;position_actions_bottom&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt;&lt;/mt:unless&gt; onclick=&quot;setBarPosition(this)&quot; class=&quot;rb&quot; /&gt; &lt;__trans phrase=&quot;Bottom&quot;&gt;&lt;/label&gt;&lt;/li&gt;
-                    &lt;/ul&gt;
-                &lt;/mtapp:setting&gt;
-                &lt;mtapp:setting
-                    id=&quot;reset_display_options&quot;
-                    label=&quot;&lt;__trans phrase=&quot;Reset display options&quot;&gt;&quot;
-                    label_class=&quot;display-options&quot;
-                    show_label=&quot;0&quot;&gt;
-                    &lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;return setFieldGroup('Default');&quot; title=&quot;&lt;__trans phrase=&quot;Reset display options to blog defaults&quot;&gt;&quot; &gt;&lt;__trans phrase=&quot;Reset defaults&quot;&gt;&lt;/a&gt;
-                &lt;/mtapp:setting&gt;
-            &lt;div class=&quot;actions-bar display-options-actions-bar buttons&quot;&gt;
-                &lt;div class=&quot;actions-bar-inner&quot;&gt;
-                    &lt;a href=&quot;javascript:void(0)&quot;
-                        onclick=&quot;saveEntryFieldOptions(); return toggleEntryDisplayOptions();&quot;
-                        title=&quot;&lt;__trans phrase=&quot;Save display options&quot;&gt;&quot;
-                        &gt;&lt;__trans phrase=&quot;OK&quot;&gt;&lt;/a&gt;
-                    &lt;a href=&quot;javascript:void(0)&quot;
-                        onclick=&quot;return toggleEntryDisplayOptions();&quot;
-                        title=&quot;&lt;__trans phrase=&quot;Close display options&quot;&gt;&quot;
-                        &gt;&lt;__trans phrase=&quot;Cancel&quot;&gt;&lt;/a&gt;
-                &lt;/div&gt;
-            &lt;/div&gt;
-        &lt;/form&gt;
     &lt;/mtapp:widget&gt;
     &lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;
         &lt;$MTApp:PageActions from=&quot;edit_page&quot;$&gt;
@@ -213,12 +415,12 @@
     &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;js/edit.js?v=&lt;$mt:var name=&quot;mt_version&quot; escape=&quot;url&quot;$&gt;&quot;&gt;&lt;/script&gt;
 &lt;/mt:setvarblock&gt;
 
-&lt;mt:include name=&quot;include/archetype_editor.tmpl&quot;&gt;
+&lt;mt:if name=&quot;rich_editor&quot;&gt;&lt;mt:var name=&quot;rich_editor&quot;&gt;&lt;mt:else&gt;&lt;mt:include name=&quot;include/archetype_editor.tmpl&quot;&gt;&lt;/mt:if&gt;
 
 &lt;mt:setvarblock name=&quot;html_head&quot; append=&quot;1&quot;&gt;
     &lt;script type=&quot;text/javascript&quot;&gt;
         /* &lt;![CDATA[ */
-        Editor.strings.unsavedChanges = '&lt;__trans phrase=&quot;You have unsaved changes to your [_1] that will be lost.&quot; escape=&quot;js&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;';
+        Editor.strings.unsavedChanges = '&lt;__trans phrase=&quot;You have unsaved changes to your [lc,_1] that will be lost.&quot; escape=&quot;js&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot;$&gt;&quot;&gt;';
         Editor.strings.enterEmailAddress = '&lt;__trans phrase=&quot;Enter email address:&quot; escape=&quot;js&quot;&gt;';
         Editor.strings.enterLinkAddress = '&lt;__trans phrase=&quot;Enter the link address:&quot; escape=&quot;js&quot;&gt;';
         Editor.strings.enterTextToLinkTo = '&lt;__trans phrase=&quot;Enter the text to link to:&quot; escape=&quot;js&quot;&gt;';
@@ -305,7 +507,7 @@ function convertedText(c, result) {
     form.text_more.value = response.result.text_more;
     cur_text_format = 'richtext';
     TC.removeClassName(TC.elementOrId(&quot;editor-content&quot;), &quot;editor-plaintext&quot;);
-    app.setEditorIframeHTML( app.editorInput[ app.currentEditor ].value );
+    app.setEditorIframeHTML();
 }
 
 function changedTextFormat(sel) {
@@ -728,92 +930,98 @@ function listPreviousPings () {
 &lt;mt:include name=&quot;include/calendar.tmpl&quot;&gt;
     &lt;div id=&quot;&lt;$mt:var name=&quot;container_type&quot; lower_case=&quot;1&quot;$&gt;-selector&quot; class=&quot;category-selector &lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;autolayout-flyout-smart&lt;mt:else&gt;autolayout-flyout-left-from-right&lt;/mt:if&gt; flyout&quot;&gt;&lt;div id=&quot;&lt;$mt:var name=&quot;container_type&quot; lower_case=&quot;1&quot;$&gt;-selector-inner&quot; class=&quot;inner&quot;&gt;
         &lt;h3&gt;&lt;$mt:var name=&quot;container_label_plural&quot;$&gt;&lt;/h3&gt;
-        &lt;div id=&quot;add-category-form&quot; class=&quot;add-category-form hidden&quot;&gt;&lt;input id=&quot;add-category-input&quot; class=&quot;add-category-input input-hint&quot; type=&quot;text&quot; value=&quot;&lt;__trans phrase=&quot;Add [_1] name&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;&quot; mt:default=&quot;&lt;__trans phrase=&quot;Add [_1] name&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;&quot; mt:delegate=&quot;default-value&quot; /&gt; &lt;a href=&quot;javascript:void(0);&quot; mt:command=&quot;add&quot; class=&quot;add-category-save-link&quot;&gt;&lt;span&gt;Add&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/a&gt;&lt;a href=&quot;javascript:void(0);&quot; mt:command=&quot;cancel&quot; class=&quot;add-category-cancel-link&quot;&gt;&lt;span&gt;Cancel&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
+        &lt;div id=&quot;add-category-form&quot; class=&quot;add-category-form hidden&quot;&gt;&lt;input id=&quot;add-category-input&quot; class=&quot;add-category-input input-hint&quot; type=&quot;text&quot; value=&quot;&lt;__trans phrase=&quot;Add [lc,_1] name&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot;$&gt;&quot;&gt;&quot; mt:default=&quot;&lt;__trans phrase=&quot;Add [lc,_1] name&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot;$&gt;&quot;&gt;&quot; mt:delegate=&quot;default-value&quot; /&gt; &lt;a href=&quot;javascript:void(0);&quot; mt:command=&quot;add&quot; class=&quot;add-category-save-link&quot;&gt;&lt;span&gt;Add&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/a&gt;&lt;a href=&quot;javascript:void(0);&quot; mt:command=&quot;cancel&quot; class=&quot;add-category-cancel-link&quot;&gt;&lt;span&gt;Cancel&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
         &lt;div id=&quot;&lt;$mt:var name=&quot;container_type&quot; lower_case=&quot;1&quot;$&gt;-selector-list&quot; class=&quot;category-selector-list&quot;&gt;
         &lt;/div&gt;
 &lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;
-        &lt;a class=&quot;add-category-new-parent-link&quot; mt:command=&quot;show-add-category&quot; href=&quot;javascript:void(0);&quot; title=&quot;&lt;__trans phrase=&quot;Add new parent [_1]&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;Add new&quot;&gt;&lt;/a&gt;
+        &lt;a class=&quot;add-category-new-parent-link&quot; mt:command=&quot;show-add-category&quot; href=&quot;javascript:void(0);&quot; title=&quot;&lt;__trans phrase=&quot;Add new parent [lc,_1]&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot;$&gt;&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;Add new&quot;&gt;&lt;/a&gt;
 &lt;/mt:if&gt;
         &lt;a class=&quot;add-category-ok-link&quot; href=&quot;javascript:void(0)&quot; mt:command=&quot;close&quot;&gt;&lt;__trans phrase=&quot;OK&quot;&gt;&lt;/a&gt;
     &lt;/div&gt;&lt;/div&gt;&lt;!-- /category-selector --&gt;
-
 &lt;/mt:setvarblock&gt;
-&lt;mt:setvartemplate name=&quot;action_buttons&quot;&gt;
-    &lt;button
-        mt:mode=&quot;save_entry&quot;
-        type=&quot;submit&quot;
-        accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
-        class=&quot;primary-button&quot;
-        &gt;&lt;__trans phrase=&quot;Save&quot;&gt;&lt;/button&gt;
-    &lt;button
-        mt:mode=&quot;preview_entry&quot;
-        name=&quot;preview_entry&quot;
-        type=&quot;submit&quot;
-        accesskey=&quot;v&quot;
-        title=&quot;&lt;__trans phrase=&quot;Preview this [_1] (v)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
-        &gt;&lt;__trans phrase=&quot;Preview&quot;&gt;&lt;/button&gt;
-    &lt;mt:if name=&quot;id&quot;&gt;
-    &lt;button
-        mt:command=&quot;do-remove-items&quot;
-        mt:object-singular=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot; escape=&quot;html&quot;&gt;&quot;
-        mt:object-plural=&quot;&lt;mt:var name=&quot;object_label_plural&quot; lower_case=&quot;1&quot; escape=&quot;html&quot;&gt;&quot;
-        mt:object-type=&quot;&lt;mt:var name=&quot;object_type&quot; escape=&quot;html&quot;&gt;&quot; mt:blog-id=&quot;&lt;mt:var name=&quot;blog_id&quot;&gt;&quot;
-        type=&quot;submit&quot;
-        accesskey=&quot;x&quot;
-        title=&quot;&lt;__trans phrase=&quot;Delete this [_1] (v)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
-        &gt;&lt;__trans phrase=&quot;Delete&quot;&gt;&lt;/button&gt;
-    &lt;/mt:if&gt;
-    &lt;div id=&quot;autosave-notification-&lt;$mt:var name=&quot;bar_position&quot; default=&quot;top&quot;$&gt;&quot; class=&quot;autosave-notification&quot;&gt;&lt;/div&gt;
-&lt;/mt:setvartemplate&gt;
+&lt;mt:setvarblock name=&quot;html_body_footer&quot;&gt;
+    &lt;$mt:setvar name=&quot;show_display_options_link&quot; value=&quot;1&quot;$&gt;
+    &lt;mtapp:widget
+        id=&quot;display-options-widget&quot;
+        class=&quot;display-options-widget autolayout-flyout-smart hidden&quot;
+        label=&quot;&lt;__trans phrase=&quot;Display Options&quot;&gt;&quot;&gt;
 
-&lt;mt:include name=&quot;include/header.tmpl&quot; id=&quot;header_include&quot;&gt;
-&lt;form name=&quot;entry_form&quot; id=&quot;entry_form&quot; method=&quot;post&quot; action=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;&quot; mt:once=&quot;1&quot; mt:auto-save=&quot;1&quot; mt:auto-save-delay=&quot;&lt;$mt:var name=&quot;autosave_frequency&quot;$&gt;000&quot;&gt;
-&lt;mt:if name=&quot;new_object&quot;&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;author_id&quot; value=&quot;&lt;$mt:var name=&quot;author_id&quot;$&gt;&quot; /&gt;
-&lt;mt:else&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;$mt:var name=&quot;id&quot;$&gt;&quot; /&gt;
-&lt;/mt:if&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;blog_id&quot; value=&quot;&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;__mode&quot; value=&quot;save_entry&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;_type&quot; value=&quot;&lt;$mt:var name=&quot;object_type&quot;$&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;return_args&quot; value=&quot;&lt;$mt:var name=&quot;return_args&quot; escape=&quot;html&quot;$&gt;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;magic_token&quot; value=&quot;&lt;$mt:var name=&quot;magic_token&quot;$&gt;&quot; id=&quot;m_t&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;action_name&quot; value=&quot;&quot; /&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;itemset_action_input&quot; value=&quot;&quot; /&gt;
-    &lt;mt:if name=&quot;id&quot;&gt;
-    &lt;div id=&quot;entry-nav&quot; class=&quot;pkg&quot;&gt;
-        &lt;ul class=&quot;inline-nav right&quot;&gt;
-            &lt;mt:if name=&quot;status_publish&quot;&gt;
-                &lt;mt:if name=&quot;can_send_notifications&quot;&gt;
-                &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;openDialog(null,'entry_notify','blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;entry_id=&lt;mt:var name=&quot;id&quot;&gt;');return false;&quot;&gt;&lt;__trans phrase=&quot;Share this [_1]&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
-                &lt;/mt:if&gt;
-                &lt;mt:if name=&quot;entry_permalink&quot;&gt;
-            &lt;li class=&quot;view-entry-link&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;entry_permalink&quot;$&gt;&quot; target=&quot;&lt;__trans phrase=&quot;_external_link_target&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;View published [_1]&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
-                &lt;/mt:if&gt;
-            &lt;/mt:if&gt;
-        &lt;/ul&gt;
-        &lt;ul class=&quot;inline-nav left&quot;&gt;
-            &lt;li id=&quot;previous-link&quot;&gt;&lt;mt:if name=&quot;previous_entry_id&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;$mt:var name=&quot;object_type&quot; lower_case=&quot;1&quot;$&gt;&amp;amp;id=&lt;$mt:var name=&quot;previous_entry_id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;&amp;laquo; Previous&quot;&gt;&lt;/a&gt;&lt;mt:else&gt;&lt;__trans phrase=&quot;&amp;laquo; Previous&quot;&gt;&lt;/mt:if&gt;&lt;/li&gt;
-            &lt;li&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;$mt:var name=&quot;object_type&quot; lower_case=&quot;1&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;Manage [_1]&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
-            &lt;li id=&quot;next-link&quot;&gt;&lt;mt:if name=&quot;next_entry_id&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;$mt:var name=&quot;object_type&quot; lower_case=&quot;1&quot;$&gt;&amp;amp;id=&lt;$mt:var name=&quot;next_entry_id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;Next &amp;raquo;&quot;&gt;&lt;/a&gt;&lt;mt:else&gt;&lt;__trans phrase=&quot;Next &amp;raquo;&quot;&gt;&lt;/mt:if&gt;&lt;/li&gt;
+        &lt;form name=&quot;display-options-form&quot; method=&quot;post&quot; action=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;&quot;&gt;
+            &lt;input type=&quot;hidden&quot; id=&quot;entry_prefs&quot; name=&quot;entry_prefs&quot; value=&quot;&lt;mt:if name=&quot;disp_prefs_default&quot;&gt;Default&lt;mt:else&gt;Custom&lt;/mt:if&gt;&quot;&gt;
+                &lt;mtapp:setting
+                    id=&quot;entry_fields&quot;
+                    label=&quot;&lt;__trans phrase=&quot;Fields&quot;&gt;&quot;
+                    label_class=&quot;display-options&quot;&gt;
+                    &lt;ul&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-title&quot; value=&quot;title&quot; checked=&quot;checked&quot; disabled=&quot;disabled&quot; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Title&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-body&quot; value=&quot;body&quot; checked=&quot;checked&quot; disabled=&quot;disabled&quot; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Body&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;setCustomFields(); return true;&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-tags&quot; value=&quot;tags&quot; &lt;mt:if name=&quot;disp_prefs_show_tags&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Tags&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;mt:if name=&quot;object_type&quot; ne=&quot;page&quot;&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-category&quot; value=&quot;category&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_category&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Category&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;/mt:if&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-excerpt&quot; value=&quot;excerpt&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_excerpt&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Excerpt&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-keywords&quot; value=&quot;keywords&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_keywords&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Keywords&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-publishing&quot; value=&quot;publishing&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_publishing&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Publishing&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;custom_prefs&quot; id=&quot;custom-prefs-feedback&quot; value=&quot;feedback&quot; onclick=&quot;setCustomFields(); return true&quot;&lt;mt:if name=&quot;disp_prefs_show_feedback&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Feedback&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                    &lt;/ul&gt;
+                &lt;/mtapp:setting&gt;
+                &lt;mtapp:setting
+                    id=&quot;action_bars&quot;
+                    label=&quot;&lt;__trans phrase=&quot;Actions&quot;&gt;&quot;
+                    label_class=&quot;display-options&quot;&gt;
+                    &lt;ul class=&quot;action-button-options&quot;&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;bar_position&quot; id=&quot;bar_position_top&quot; value=&quot;Top&quot;&lt;mt:unless name=&quot;position_actions_both&quot;&gt;&lt;mt:if name=&quot;position_actions_top&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt;&lt;/mt:unless&gt; onclick=&quot;setBarPosition(this)&quot; class=&quot;rb&quot; /&gt; &lt;__trans phrase=&quot;Top&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;bar_position&quot; id=&quot;bar_position_both&quot; value=&quot;Both&quot;&lt;mt:if name=&quot;position_actions_both&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; onclick=&quot;setBarPosition(this)&quot; class=&quot;rb&quot; /&gt; &lt;__trans phrase=&quot;Both&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                        &lt;li&gt;&lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;bar_position&quot; id=&quot;bar_position_bottom&quot; value=&quot;Bottom&quot;&lt;mt:unless name=&quot;position_actions_both&quot;&gt;&lt;mt:if name=&quot;position_actions_bottom&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt;&lt;/mt:unless&gt; onclick=&quot;setBarPosition(this)&quot; class=&quot;rb&quot; /&gt; &lt;__trans phrase=&quot;Bottom&quot;&gt;&lt;/label&gt;&lt;/li&gt;
+                    &lt;/ul&gt;
+                &lt;/mtapp:setting&gt;
+                &lt;mtapp:setting
+                    id=&quot;reset_display_options&quot;
+                    label=&quot;&lt;__trans phrase=&quot;Reset display options&quot;&gt;&quot;
+                    label_class=&quot;display-options&quot;
+                    show_label=&quot;0&quot;&gt;
+                    &lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;return setFieldGroup('Default');&quot; title=&quot;&lt;__trans phrase=&quot;Reset display options to blog defaults&quot;&gt;&quot; &gt;&lt;__trans phrase=&quot;Reset defaults&quot;&gt;&lt;/a&gt;
+                &lt;/mtapp:setting&gt;
+            &lt;div class=&quot;actions-bar display-options-actions-bar buttons&quot;&gt;
+                &lt;div class=&quot;actions-bar-inner&quot;&gt;
+                    &lt;a href=&quot;javascript:void(0)&quot;
+                        onclick=&quot;saveEntryFieldOptions();&quot;
+                        mt:command=&quot;close-flyout&quot;
+                        title=&quot;&lt;__trans phrase=&quot;Save display options&quot;&gt;&quot;
+                        &gt;&lt;__trans phrase=&quot;OK&quot;&gt;&lt;/a&gt;
+                    &lt;a href=&quot;javascript:void(0)&quot;
+                        mt:command=&quot;close-flyout&quot;
+                        title=&quot;&lt;__trans phrase=&quot;Close display options&quot;&gt;&quot;
+                        &gt;&lt;__trans phrase=&quot;Cancel&quot;&gt;&lt;/a&gt;
+                &lt;/div&gt;
+            &lt;/div&gt;
+        &lt;/form&gt;
+    &lt;/mtapp:widget&gt;
+&lt;/mt:setvarblock&gt;
+&lt;mt:unless name=&quot;new_object&quot;&gt;
+    &lt;mt:setvarblock name=&quot;object_nav&quot;&gt;
+        &lt;ul class=&quot;object-nav&quot;&gt;
+            &lt;li id=&quot;previous-link&quot;&gt;&lt;mt:if name=&quot;previous_entry_id&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;$mt:var name=&quot;object_type&quot; lower_case=&quot;1&quot;$&gt;&amp;amp;id=&lt;$mt:var name=&quot;previous_entry_id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;Previous&quot;&gt;&lt;/a&gt;&lt;mt:else&gt;&lt;span&gt;&lt;__trans phrase=&quot;Previous&quot;&gt;&lt;/span&gt;&lt;/mt:if&gt;&lt;/li&gt;
+            &lt;li id=&quot;manage-link&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;$mt:var name=&quot;object_type&quot; lower_case=&quot;1&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;Manage [_1]&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&lt;/a&gt;&lt;/li&gt;
+            &lt;li id=&quot;next-link&quot;&gt;&lt;mt:if name=&quot;next_entry_id&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;$mt:var name=&quot;object_type&quot; lower_case=&quot;1&quot;$&gt;&amp;amp;id=&lt;$mt:var name=&quot;next_entry_id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;Next&quot;&gt;&lt;/a&gt;&lt;mt:else&gt;&lt;span&gt;&lt;__trans phrase=&quot;Next&quot;&gt;&lt;/span&gt;&lt;/mt:if&gt;&lt;/li&gt;
         &lt;/ul&gt;
-    &lt;/div&gt;
-    &lt;/mt:if&gt;
+    &lt;/mt:setvarblock&gt;
+&lt;/mt:unless&gt;
+&lt;mt:include name=&quot;include/header.tmpl&quot; id=&quot;header_include&quot;&gt;
 
     &lt;mt:include name=&quot;include/actions_bar.tmpl&quot; hide_pager=&quot;1&quot;&gt;
 
     &lt;mtapp:setting
         id=&quot;title&quot;
         label=&quot;&lt;__trans phrase=&quot;Title&quot;&gt;&quot;
-        label_class = &quot;no-header&quot;
+        label_class=&quot;top-label&quot;
         help_page=&quot;entries&quot;
         help_section=&quot;entry_title&quot;&gt;
         &lt;input name=&quot;title&quot; id=&quot;title&quot; tabindex=&quot;1&quot; value=&quot;&lt;$mt:var name=&quot;title&quot; escape=&quot;html&quot;$&gt;&quot; maxlength=&quot;255&quot; mt:watch-change=&quot;1&quot; onkeyup=&quot;rebasename(this)&quot; /&gt;
     &lt;/mtapp:setting&gt;
 
         &lt;div id=&quot;editor&quot;&gt;
-            &lt;div class=&quot;editor-header pkg&quot; mt:delegate=&quot;tab-container&quot;&gt;
+            &lt;div id=&quot;editor-inner&quot; class=&quot;editor-header pkg&quot; mt:delegate=&quot;tab-container&quot;&gt;
                 &lt;div class=&quot;tab selected-tab&quot; mt:command=&quot;set-editor-content&quot; mt:tab=&quot;content&quot;&gt;
                     &lt;label&gt;&lt;a href=&quot;javascript:void(0);&quot;&gt;&lt;__trans phrase=&quot;Body&quot;&gt;&lt;/a&gt;&lt;/label&gt;
                 &lt;/div&gt;
@@ -848,9 +1056,6 @@ function listPreviousPings () {
 &lt;mt:include name=&quot;include/editor.tmpl&quot;&gt;
 
 &lt;mt:setvarblock name=&quot;show_metadata&quot;&gt;&lt;$mt:var name=&quot;disp_prefs_show_tags&quot;$&gt;&lt;mt:unless name=&quot;object_type&quot; eq=&quot;page&quot;&gt;&lt;$mt:var name=&quot;disp_prefs_show_category&quot;&gt;&lt;/mt:unless&gt;&lt;$mt:var name=&quot;disp_prefs_show_excerpt&quot;$&gt;&lt;$mt:var name=&quot;disp_prefs_show_keywords&quot;$&gt;&lt;/mtsetvarblock&gt;
-&lt;fieldset id=&quot;entry-metadata-settings&quot; mt:fields=&quot;tags &lt;mt:unless name=&quot;object_type&quot; eq=&quot;page&quot;&gt;category &lt;/mt:unless&gt;excerpt keywords&quot; class=&quot;pkg&lt;mt:unless name=&quot;show_metadata&quot;&gt; hidden&lt;/mt:unless&gt;&quot;&gt;
-
-    &lt;h3&gt;&lt;__trans phrase=&quot;Metadata&quot;&gt;&lt;/h3&gt;
 
     &lt;mt:if name=&quot;auth_pref_tag_delim_comma&quot;&gt;
         &lt;$mt:setvar name=&quot;tags_hint&quot; value=&quot;&lt;__trans phrase=&quot;(comma-delimited list)&quot;&gt;&quot;$&gt;
@@ -867,6 +1072,7 @@ function listPreviousPings () {
         id=&quot;tags&quot;
         shown=&quot;$disp_prefs_show_tags&quot;
         label=&quot;&lt;__trans phrase=&quot;Tags&quot;&gt;&quot;
+        label_class=&quot;top-label&quot;
         help_page=&quot;entries&quot;
         help_section=&quot;entry_tags&quot;&gt;
         &lt;div class=&quot;textarea-wrapper&quot;&gt;
@@ -879,79 +1085,11 @@ function listPreviousPings () {
         &lt;!--[if lte IE 6.5]&gt;&lt;/div&gt;&lt;![endif]--&gt;
     &lt;/mtapp:setting&gt;
 
-&lt;mt:setvarblock name=&quot;category_setting&quot;&gt;
-    &lt;mtapp:setting
-        id=&quot;category&quot;
-        shown=&quot;$disp_prefs_show_category&quot;
-        label=&quot;$container_label&quot;
-        help_page=&quot;entries&quot;
-        help_section=&quot;entry_categories&quot;
-        content_class=&quot;field-content-text&quot;&gt;
-        &lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;
-        &lt;div mt:delegate=&quot;category-list&quot; id=&quot;category-list&quot;&gt;&lt;/div&gt;
-        &lt;a href=&quot;javascript:void(0);&quot; class=&quot;change-folder-link&quot; mt:command=&quot;open-category-selector&quot;&gt;&lt;__trans phrase=&quot;Change [_1]&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;&lt;/a&gt;
-        &lt;mt:else&gt;
-        &lt;a href=&quot;javascript:void(0);&quot; class=&quot;add-new-category-link&quot; mt:command=&quot;open-category-selector&quot;&gt;&lt;__trans phrase=&quot;Add [_1]&quot; params=&quot;&lt;$mt:var name=&quot;container_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;&lt;/a&gt;
-        &lt;div mt:delegate=&quot;category-list&quot; id=&quot;category-list&quot;&gt;&lt;/div&gt;
-        &lt;/mt:if&gt;
-        &lt;input id=&quot;category-ids&quot; type=&quot;hidden&quot; name=&quot;category_ids&quot; value=&quot;&lt;$mt:var name=&quot;selected_category_loop&quot; glue=&quot;,&quot;$&gt;&quot; /&gt;
-    &lt;script type=&quot;text/javascript&quot;&gt;
-        /* &lt;![CDATA[ */
-            MT.App.selectedCategoryList = &lt;$mt:if name=&quot;selected_category_loop&quot;&gt;&lt;$mt:var name=&quot;selected_category_loop&quot; to_json=&quot;1&quot;$&gt;&lt;mt:else&gt;[]&lt;/mt:if&gt;;
-            Template.templates.categoryList = '&lt;mt:section encode_js=&quot;1&quot;&gt;
-                [# if ( !items.length ) { #]
-                    &lt;span class=&quot;disabled&quot;&gt;[#|h trans(&quot;None selected&quot;) #]&lt;/span&gt;
-                    [#* return #]
-                [# } #]
-                &lt;ul class=&quot;&lt;$mt:var name=&quot;container_type&quot; lower_case=&quot;1&quot;$&gt;-list pkg&quot;&gt;
-                [# var map = {}; #]
-                [# for ( var i = 0; i &lt; items.length; i++ ) { #]
-                    [# if ( items[ i ] == 0 &amp;&amp; i == 0 ) { #]
-                        [#-- special case, no primary selected, but has secondaries --#]
-                        [# continue #]
-                    [# } #]
-                    [# var cat = cache.getItem( &quot;cat:&quot;+items[ i ] ); #]
-                    [# if ( !cat ) continue; #]
-                    [# var label; #]
-                    [# if ( cat.path.length ) {
-                        label = [];
-                        for ( var j = 0; j &lt; cat.path.length; j++ ) {
-                            var c = cache.getItem( &quot;cat:&quot;+cat.path[ j ] );
-                            if ( c ) 
-                                label.push( c.label );
-                        }
-                        label.push( cat.label );
-                        for ( var j = 0; j &lt; label.length; j++ )
-                            label[ j ] = context.f.h( label[ j ] );
-                        label = label.join( &lt;mt:if name=&quot;object_type&quot; ne=&quot;page&quot;&gt;' &amp;raquo; '&lt;mt:else&gt;''&lt;/mt:if&gt; );
-                    } else {
-                        label = context.f.h( cat.label );
-                    } #]
-                    &lt;mt:if name=&quot;object_type&quot; ne=&quot;page&quot;&gt;
-                    [# if ( i == 0 ) { #]
-                        &lt;li class=&quot;primary pkg&quot; mt:focus-hover=&quot;1&quot; mt:id=&quot;[#= cat.id #]&quot;&gt;&lt;strong&gt;[#= label #]&lt;/strong&gt;&lt;a href=&quot;javascript:void(0);&quot; mt:command=&quot;remove&quot; class=&quot;delete&quot; title=&quot;[#|h trans(&quot;Remove&quot;) #]&quot;&gt;&amp;nbsp;&lt;span&gt;[#|h trans(&quot;Remove&quot;) #]&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
-                    [# } else { #]
-                        &lt;li class=&quot;pkg&quot; mt:focus-hover=&quot;1&quot; mt:id=&quot;[#= cat.id #]&quot;&gt;&lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;&lt;a mt:focus-hover=&quot;1&quot; href=&quot;javascript:void(0);&quot; mt:command=&quot;primary&quot; class=&quot;primary&quot; title=&quot;[#|h trans(&quot;Make primary&quot;) #]&quot;&gt;[#= label #]&lt;/a&gt;&lt;/mt:if&gt;&lt;a mt:focus-hover=&quot;1&quot; href=&quot;javascript:void(0);&quot; mt:command=&quot;remove&quot; class=&quot;delete&quot; title=&quot;[#|h &quot;Remove&quot; #]&quot;&gt;&amp;nbsp;&lt;span&gt;[#|h trans(&quot;Remove&quot;) #]&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
-                    [# } #]
-                    &lt;mt:else&gt;
-                    &lt;li class=&quot;pkg&quot; mt:focus-hover=&quot;1&quot; mt:id=&quot;[#= cat.id #]&quot;&gt;[#= label #]&lt;/li&gt;
-                    &lt;/mt:if&gt;
-                [# } #]
-                &lt;/ul&gt;
-            &lt;/mt:section&gt;';
-        /* ]]&gt; */
-    &lt;/script&gt;
-    &lt;/mtapp:setting&gt;
-&lt;/mt:setvarblock&gt;
-
-&lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;
-    &lt;$mt:var name=&quot;category_setting&quot;$&gt;
-&lt;/mt:if&gt;
-
     &lt;mtapp:setting
         id=&quot;excerpt&quot;
         shown=&quot;$disp_prefs_show_excerpt&quot;
         label=&quot;&lt;__trans phrase=&quot;Excerpt&quot;&gt;&quot;
+        label_class=&quot;top-label&quot;
         help_page=&quot;entries&quot;
         help_section=&quot;excerpt&quot;&gt;
         &lt;textarea name=&quot;excerpt&quot; id=&quot;excerpt&quot; class=&quot;full-width short&quot; tabindex=&quot;7&quot; cols=&quot;&quot; rows=&quot;&quot; mt:watch-change=&quot;1&quot;&gt;&lt;$mt:var name=&quot;excerpt&quot; escape=&quot;html&quot;$&gt;&lt;/textarea&gt;
@@ -961,139 +1099,21 @@ function listPreviousPings () {
         id=&quot;keywords&quot;
         shown=&quot;$disp_prefs_show_keywords&quot;
         label=&quot;&lt;__trans phrase=&quot;Keywords&quot;&gt;&quot;
+        label_class=&quot;top-label&quot;
         help_page=&quot;entries&quot;
         help_section=&quot;keywords&quot;&gt;
         &lt;div class=&quot;textarea-wrapper&quot;&gt;
             &lt;input name=&quot;keywords&quot; id=&quot;keywords&quot; class=&quot;full-width&quot; tabindex=&quot;8&quot; value=&quot;&lt;$mt:var name=&quot;keywords&quot; escape=&quot;html&quot;$&gt;&quot; mt:watch-change=&quot;1&quot; autocomplete=&quot;off&quot; /&gt;
         &lt;/div&gt;
     &lt;/mtapp:setting&gt;
-&lt;/fieldset&gt;
-
-&lt;fieldset id=&quot;publishing-field&quot; class=&quot;pkg&lt;mt:unless name=&quot;disp_prefs_show_publishing&quot;&gt; hidden&lt;/mt:unless&gt;&quot;&gt;
-
-    &lt;h3&gt;&lt;__trans phrase=&quot;Publishing&quot;&gt;&lt;/h3&gt;
-
-    &lt;mtapp:setting
-        id=&quot;status&quot;
-        label=&quot;&lt;__trans phrase=&quot;Status&quot;&gt;&quot;
-        help_page=&quot;entries&quot;
-        help_section=&quot;status&quot;&gt;
-        &lt;mt:unless name=&quot;sitepath_configured&quot;&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;1&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Unpublished&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;alert-warning-inline&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/status_icons/warning.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Warning&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt; &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=cfg_archives&amp;amp;id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;You must configure blog before you can publish this [_1].&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&lt;/a&gt;&lt;/span&gt;
-        &lt;mt:else&gt;
-            &lt;mt:if name=&quot;can_publish_post&quot;&gt;
-                        &lt;select name=&quot;status&quot; id=&quot;status&quot; class=&quot;full-width&quot; tabindex=&quot;9&quot; onchange=&quot;highlightSwitch(this)&quot;&gt;
-                            &lt;option value=&quot;1&quot;&lt;mt:if name=&quot;status_draft&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Unpublished (Draft)&quot;&gt;&lt;/option&gt;
-                            &lt;option value=&quot;2&quot;&lt;mt:if name=&quot;status_publish&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Published&quot;&gt;&lt;/option&gt;
-                            &lt;mt:if name=&quot;status_review&quot;&gt;
-                            &lt;option value=&quot;3&quot;&lt;mt:if name=&quot;status_review&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Unpublished (Review)&quot;&gt;&lt;/option&gt;
-                            &lt;/mt:if&gt;
-                &lt;mt:if name=&quot;new_object&quot;&gt;
-                                &lt;option value=&quot;4&quot;&lt;mt:if name=&quot;status_future&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&lt;/option&gt;
-                &lt;mt:else&gt;
-                    &lt;mt:unless name=&quot;status_publish&quot;&gt;
-                            &lt;option value=&quot;4&quot;&lt;mt:if name=&quot;status_future&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&lt;/option&gt;
-                    &lt;/mt:unless&gt;
-                &lt;/mt:if&gt;
-                        &lt;/select&gt;
-            &lt;mt:else&gt;
-                &lt;mt:if name=&quot;new_object&quot;&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;1&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Unpublished&quot;&gt;&lt;/span&gt;
-                &lt;mt:else&gt;
-                    &lt;mt:if name=&quot;status_draft&quot;&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;1&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Unpublished (Draft)&quot;&gt;&lt;/span&gt;
-                    &lt;mt:else name=&quot;status_publish&quot;&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;2&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Published&quot;&gt;&lt;/span&gt;
-                    &lt;mt:else name=&quot;status_future&quot;&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;4&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&lt;/span&gt;
-                    &lt;mt:else name=&quot;status_review&quot;&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;status&quot; id=&quot;status&quot; value=&quot;3&quot; /&gt;&lt;span&gt;&lt;__trans phrase=&quot;Unpublished (Review)&quot;&gt;&lt;/span&gt;
-                    &lt;/mt:if&gt;
-                &lt;/mt:if&gt;
-            &lt;/mt:if&gt;
-        &lt;/mt:unless&gt;
-    &lt;/mtapp:setting&gt;
-    &lt;mt:if name=&quot;status_future&quot;&gt;
-        &lt;$mt:setvar name=&quot;authored_on_label&quot; value=&quot;&lt;__trans phrase=&quot;Publish On&quot;&gt;&quot;$&gt;
-    &lt;mt:else&gt;
-        &lt;$mt:setvar name=&quot;authored_on_label&quot; value=&quot;&lt;__trans phrase=&quot;Publish Date&quot;&gt;&quot;$&gt;
-    &lt;/mt:if&gt;
-    &lt;mtapp:setting
-        id=&quot;authored_on&quot;
-        label=&quot;$authored_on_label&quot;
-        help_page=&quot;entries&quot;
-        help_section=&quot;date&quot;&gt;
-        &lt;span class=&quot;date-time-fields&lt;mt:if name=&quot;status_future&quot;&gt;&lt;mt:if name=&quot;can_publish_post&quot;&gt; highlight&lt;/mt:if&gt;&lt;/mt:if&gt;&quot;&gt;
-            &lt;input id=&quot;created-on&quot; class=&quot;entry-date&quot; name=&quot;authored_on_date&quot; tabindex=&quot;10&quot; value=&quot;&lt;$mt:var name=&quot;authored_on_date&quot; escape=&quot;html&quot;$&gt;&quot; /&gt;
-            &lt;a href=&quot;javascript:void(0);&quot; mt:command=&quot;open-calendar-created-on&quot; class=&quot;date-picker&quot; title=&quot;&lt;__trans phrase=&quot;Select entry date&quot;&gt;&quot;&gt;&lt;span&gt;Choose Date&lt;/span&gt;&lt;/a&gt;
-            &lt;input class=&quot;entry-time&quot; name=&quot;authored_on_time&quot; tabindex=&quot;11&quot; value=&quot;&lt;$mt:var name=&quot;authored_on_time&quot; escape=&quot;html&quot;$&gt;&quot; /&gt;
-        &lt;/span&gt;
-    &lt;/mtapp:setting&gt;
-
-&lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;
-    &lt;$mt:var name=&quot;category_setting&quot;$&gt;
-&lt;/mt:if&gt;
-
-    &lt;mtapp:setting
-        id=&quot;basename&quot;
-        label=&quot;$basename_label&quot;
-        help_page=&quot;entries&quot;
-        help_section=&quot;basename&quot;&gt;
-            &lt;input type=&quot;hidden&quot; name=&quot;basename_manual&quot; id=&quot;basename_manual&quot; value=&quot;0&quot; /&gt;
-            &lt;input type=&quot;hidden&quot; name=&quot;basename_old&quot; id=&quot;basename_old&quot; value=&quot;&lt;$mt:var name=&quot;basename_old&quot; escape=&quot;html&quot;$&gt;&quot; /&gt;
-            &lt;input type=&quot;text&quot; &lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;disabled=&quot;disabled&quot;&lt;/mt:if&gt; name=&quot;basename&quot; id=&quot;basename&quot; value=&quot;&lt;$mt:var name=&quot;basename&quot;$&gt;&quot; onchange=&quot;setElementValue('basename', dirify(this.value))&quot; tabindex=&quot;12&quot; /&gt;
-        &lt;mt:if name=&quot;object_type&quot; eq=&quot;page&quot;&gt;
-        &lt;span class=&quot;file-extension&quot;&gt;&lt;$mt:var name=&quot;file_extension&quot;$&gt;&lt;/span&gt;
-        &lt;/mt:if&gt;
-        &lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;
-            &lt;mt:if name=&quot;can_publish_post&quot;&gt;
-            &lt;a href=&quot;javascript:void(0);&quot; id=&quot;basename-lock&quot; title=&quot;&lt;__trans phrase=&quot;Unlock this entry&amp;rsquo;s output filename for editing&quot;&gt;&quot; onclick=&quot;return toggleFile()&quot;&gt;&lt;span&gt;Unlock&lt;/span&gt;&lt;/a&gt;
-            &lt;/mt:if&gt;
-            &lt;p class=&quot;alert-warning-inline&quot; id=&quot;basename-warning&quot; style=&quot;display: none&quot;&gt;
-                &lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/status_icons/warning.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Warning&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;
-            &lt;mt:if name=&quot;new_object&quot;&gt;
-                &lt;__trans phrase=&quot;Warning: If you set the basename manually, it may conflict with another entry.&quot;&gt;
-            &lt;mt:else&gt;
-                &lt;__trans phrase=&quot;Warning: Changing this entry's basename may break inbound links.&quot;&gt;
-            &lt;/mt:if&gt;
-            &lt;/p&gt;
-        &lt;/mt:if&gt;
-    &lt;/mtapp:setting&gt;
-&lt;/fieldset&gt;
-
-&lt;fieldset id=&quot;feedback-field&quot; class=&quot;pkg&lt;mt:unless name=&quot;disp_prefs_show_feedback&quot;&gt; hidden&lt;/mt:unless&gt;&quot;&gt;
-    &lt;h3&gt;&lt;__trans phrase=&quot;Feedback&quot;&gt;&lt;/h3&gt;
-
-    &lt;mtapp:setting
-        id=&quot;allow_feedback&quot;
-        label=&quot;&lt;__trans phrase=&quot;Accept&quot;&gt;&quot;
-        help_page=&quot;entries&quot;
-        help_section=&quot;accept_comments&quot;&gt;
-        &lt;ul&gt;
-            &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;allow_comments&quot; id=&quot;allow_comments&quot; tabindex=&quot;14&quot; value=&quot;1&quot;&lt;mt:if name=&quot;allow_comments&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;Comments&quot;&gt;&lt;/li&gt;
-            &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;allow_pings&quot; id=&quot;allow_pings&quot; tabindex=&quot;15&quot; value=&quot;1&quot;&lt;mt:if name=&quot;allow_pings&quot;&gt; checked=&quot;checked&quot;&lt;/mt:if&gt; class=&quot;cb&quot; /&gt; &lt;__trans phrase=&quot;TrackBacks&quot;&gt;&lt;/li&gt;
-        &lt;/ul&gt;
-    &lt;/mtapp:setting&gt;
-
-    &lt;mtapp:setting
-        id=&quot;ping_urls&quot;
-        label=&quot;&lt;__trans phrase=&quot;Outbound TrackBack URLs&quot;&gt;&quot;
-        help_page=&quot;entries&quot;
-        help_section=&quot;urls_to_ping&quot;&gt;
-            &lt;textarea name=&quot;to_ping_urls&quot; id=&quot;to_ping_urls&quot; class=&quot;full-width short&quot; tabindex=&quot;16&quot; cols=&quot;&quot; rows=&quot;&quot;&gt;&lt;$mt:var name=&quot;to_ping_urls&quot; escape=&quot;html&quot;$&gt;&lt;/textarea&gt;
-        &lt;mt:unless name=&quot;new_object&quot;&gt;
-            &lt;mt:if name=&quot;has_any_pinged_urls&quot;&gt;
-            &lt;div id=&quot;sent-tb&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;listPreviousPings(); return false&quot;&gt;&lt;__trans phrase=&quot;View Previously Sent TrackBacks&quot;&gt;&lt;/a&gt;&lt;/div&gt;
-            &lt;/mt:if&gt;
-        &lt;/mt:unless&gt;
-    &lt;/mtapp:setting&gt;
-&lt;/fieldset&gt;
 
 &lt;mt:include name=&quot;include/actions_bar.tmpl&quot; bar_position=&quot;bottom&quot; hide_pager=&quot;1&quot;&gt;
-&lt;/form&gt;
 
 &lt;div id=&quot;quickpost&quot;&gt;
     &lt;__trans phrase=&quot;[_1]QuickPost to [_2]&lt;/a&gt; - Drag this link to your browser's toolbar then click it when you are on a site you want to blog about.&quot; params=&quot;&lt;a href=&quot;&lt;mt:var name=&quot;quickpost_js&quot; escape=&quot;html&quot;&gt;&quot;&gt;%%&lt;$mt:var name=&quot;blog_name&quot; escape=&quot;html&quot;$&gt;&quot;&gt;
 &lt;/div&gt;
+&lt;mt:setvarblock name=&quot;form_footer&quot;&gt;
+&lt;/form&gt;
+&lt;/mt:setvarblock&gt;
 
 &lt;mt:include name=&quot;include/footer.tmpl&quot; id=&quot;footer_include&quot;&gt;</diff>
      <filename>tmpl/cms/edit_entry.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -101,7 +101,7 @@ TC.attachLoadEvent( init );
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/edit_folder.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -37,14 +37,14 @@
     &lt;button
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
     &lt;button
         onclick=&quot;doRemoveItems(this.form, '&lt;__trans phrase=&quot;TrackBack&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;TrackBack&quot; escape=&quot;js&quot;&gt;', false, { 'return_args' : '__mode=list_pings&amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;'})&quot;
         type=&quot;submit&quot;
         accesskey=&quot;x&quot;
-        title=&quot;&lt;__trans phrase=&quot;Delete this [_1] (x)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Delete this [lc,_1] (x)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         &gt;&lt;__trans phrase=&quot;Delete&quot;&gt;&lt;/button&gt;
     &lt;mt:if name=&quot;is_ip_filter&quot;&gt;
         &lt;mt:if name=&quot;blog_id&quot;&gt;</diff>
      <filename>tmpl/cms/edit_ping.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -16,14 +16,15 @@
             &lt;__trans phrase=&quot;Your changes have been saved.&quot;&gt;
         &lt;/mtapp:statusmsg&gt;
     &lt;/mt:if&gt;
-
-    &lt;p class=&quot;page-desc hidden&quot;&gt;&lt;__trans phrase=&quot;_USAGE_ROLE_PROFILE&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;return openManual('author_permissions', 'permissions')&quot; class=&quot;help-link&quot;&gt;?&lt;/a&gt;&lt;/p&gt;
-
-    &lt;p&gt;&lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=list_roles&quot; class=&quot;icon-left icon-related&quot;&gt;&lt;__trans phrase=&quot;List Roles&quot;&gt;&lt;/a&gt;&lt;/p&gt;
-
-&lt;mt:if name=&quot;id&quot;&gt;
-    &lt;p&gt;&lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=list_associations&amp;amp;role_id=&lt;mt:var name=&quot;id&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;[quant,_1,User,Users] with this role&quot; params=&quot;&lt;mt:var name=&quot;user_count&quot;&gt;&quot;&gt;&lt;/a&gt;&lt;/p&gt;
-&lt;/mt:if&gt;
+    
+    &lt;ul class=&quot;action-link-list&quot;&gt;
+        &lt;li&gt;
+            &lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=list_roles&quot; class=&quot;icon-left icon-related&quot;&gt;&lt;__trans phrase=&quot;List Roles&quot;&gt;&lt;/a&gt;
+    &lt;mt:if name=&quot;id&quot;&gt;
+            - &lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=list_associations&amp;amp;role_id=&lt;mt:var name=&quot;id&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;[quant,_1,User,Users] with this role&quot; params=&quot;&lt;mt:var name=&quot;user_count&quot;&gt;&quot;&gt;&lt;/a&gt;
+    &lt;/mt:if&gt;
+        &lt;/li&gt;
+    &lt;/ul&gt;
 
 &lt;/mt:setvarblock&gt;
 &lt;mt:include name=&quot;include/header.tmpl&quot;&gt;
@@ -355,7 +356,7 @@ TC.attachLoadEvent( rectifyAll );
     &lt;/mt:if&gt;
         type=&quot;submit&quot;
         accesskey=&quot;s&quot;
-        title=&quot;&lt;__trans phrase=&quot;Save changes to this [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+        title=&quot;&lt;__trans phrase=&quot;Save changes to this [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&quot;
         class=&quot;primary-button&quot;
         &gt;&lt;__trans phrase=&quot;Save Changes&quot;&gt;&lt;/button&gt;
 &lt;/mt:setvarblock&gt;</diff>
      <filename>tmpl/cms/edit_role.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -39,7 +39,7 @@
             &lt;/mtapp:statusmsg&gt;
         &lt;mt:else&gt;
             &lt;mtapp:statusmsg
-                id=&quot;saed&quot;
+                id=&quot;saved&quot;
                 class=&quot;success&quot;&gt;
                 &lt;__trans phrase=&quot;Your template changes have been saved.&quot;&gt;
                 &lt;mt:unless name=&quot;build_dynamic&quot;&gt;
@@ -166,7 +166,7 @@ tag_inserts['&lt;mt:var name=&quot;id&quot; escape=&quot;js&quot;&gt;'] = content;
 
 if ( !window.Editor )
     Editor = { strings: {} };
-Editor.strings.unsavedChanges = '&lt;__trans phrase=&quot;You have unsaved changes to your [_1] that will be lost.&quot; escape=&quot;js&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;'; 
+Editor.strings.unsavedChanges = '&lt;__trans phrase=&quot;You have unsaved changes to your [lc,_1] that will be lost.&quot; escape=&quot;js&quot; params=&quot;&lt;$mt:var name=&quot;object_label&quot;$&gt;&quot;&gt;'; 
 
 var fieldStorage = {};
 var dirty = false;
@@ -449,7 +449,7 @@ TC.attachLoadEvent( init );
 
 &lt;form name=&quot;template-listing-form&quot; id=&quot;template-listing-form&quot; method=&quot;post&quot; action=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;&quot; mt:once=&quot;1&quot; mt:auto-save=&quot;1&quot; mt:auto-save-delay=&quot;&lt;$mt:var name=&quot;autosave_frequency&quot;$&gt;000&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;mt:var name=&quot;id&quot;&gt;&quot; /&gt;
-&lt;input type=&quot;hidden&quot; name=&quot;blog_id&quot; value=&quot;&lt;mt:var name=&quot;blog_id&quot;&gt;&quot; /&gt;
+&lt;input type=&quot;hidden&quot; name=&quot;blog_id&quot; value=&quot;&lt;mt:var name=&quot;blog_id&quot; default=&quot;0&quot;&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;type&quot; value=&quot;&lt;mt:var name=&quot;type&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;__mode&quot; value=&quot;save&quot; /&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;_type&quot; value=&quot;template&quot; /&gt;</diff>
      <filename>tmpl/cms/edit_template.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -20,11 +20,8 @@ function selectBlog() {
 &lt;MTSetVarBlock name=&quot;content_nav&quot;&gt;
     &lt;mt:include name=&quot;include/tools_content_nav.tmpl&quot;&gt;
 &lt;/MTSetVarBlock&gt;
-&lt;mt:setvarblock name=&quot;content_header&quot;&gt;
-    &lt;p&gt;&lt;__trans phrase=&quot;_USAGE_EXPORT_1&quot;&gt;&lt;/p&gt; 
-&lt;/mt:setvarblock&gt;
 &lt;mt:include name=&quot;include/header.tmpl&quot;&gt;
-
+&lt;p&gt;&lt;__trans phrase=&quot;_USAGE_EXPORT_1&quot;&gt;&lt;/p&gt; 
 &lt;form method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; action=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;&quot; onsubmit=&quot;return validate(this)&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;__mode&quot; value=&quot;export&quot; /&gt;
 &lt;mt:if name=&quot;blog_id&quot;&gt;</diff>
      <filename>tmpl/cms/export.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,6 @@
                 &lt;th class=&quot;cb&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;id-head&quot; value=&quot;all&quot; class=&quot;select&quot; /&gt;&lt;/th&gt;
                 &lt;th id=&quot;as-file-status&quot; class=&quot;si&quot;&gt;&lt;img src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;images/status_icons/invert-flag.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Status&quot;&gt;&quot; title=&quot;&lt;__trans phrase=&quot;Status&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/th&gt;
                 &lt;th id=&quot;as-file-name&quot;&gt;&lt;__trans phrase=&quot;Title&quot;&gt;&lt;/th&gt;
-                &lt;th id=&quot;as-asset-type&quot;&gt;&lt;__trans phrase=&quot;Type&quot;&gt;&lt;/th&gt;
     &lt;mt:unless name=&quot;edit_blog_id&quot;&gt;
                 &lt;th id=&quot;as-weblog&quot;&gt;&lt;__trans phrase=&quot;Blog&quot;&gt;&lt;/th&gt;
     &lt;/mt:unless&gt;
@@ -27,34 +26,54 @@
         &lt;/thead&gt;
         &lt;tbody&gt;
     &lt;/mt:if&gt;
-            &lt;tr id=&quot;asset-&lt;mt:var name=&quot;id&quot;&gt;&quot; class=&quot;&lt;mt:if name=&quot;__odd__&quot;&gt;odd&lt;mt:else&gt;even&lt;/mt:if&gt;&quot;&gt;
+            &lt;tr id=&quot;asset-&lt;mt:var name=&quot;id&quot;&gt;&quot; class=&quot;&lt;mt:if name=&quot;__odd__&quot;&gt;odd&lt;mt:else&gt;even&lt;/mt:if&gt; status-&lt;mt:if name=&quot;file_is_missing&quot;&gt;missing&lt;mt:else&gt;publish&lt;/mt:if&gt;&lt;mt:unless name=&quot;file_is_missing&quot;&gt; &lt;mt:if name=&quot;has_thumbnail&quot;&gt;asset-thumbnail&lt;mt:else&gt;asset-no-thumbnail&lt;/mt:if&gt;&lt;/mt:unless&gt;&quot;&gt;
                 &lt;td class=&quot;cb&quot;&gt;
                     &lt;input type=&quot;hidden&quot; id=&quot;asset-&lt;mt:var name=&quot;id&quot;&gt;-json&quot; value=&quot;&lt;mt:var name=&quot;metadata_json&quot; escape=&quot;html&quot;&gt;&quot; /&gt;
                     &lt;input type=&quot;checkbox&quot; name=&quot;id&quot; value=&quot;&lt;mt:var name=&quot;id&quot;&gt;&quot; class=&quot;select&quot; /&gt;
                 &lt;/td&gt;
-                &lt;td class=&quot;si status-&lt;mt:if name=&quot;file_is_missing&quot;&gt;missing&lt;mt:else&gt;publish&lt;/mt:if&gt;&quot;&gt;&lt;img src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;images/spacer.gif&quot; &lt;mt:if name=&quot;file_is_missing&quot;&gt;alt=&quot;&lt;__trans phrase=&quot;Pending&quot;&gt;&quot;&lt;mt:else&gt;alt=&quot;&lt;__trans phrase=&quot;Published&quot;&gt;&quot;&lt;/mt:if&gt; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/td&gt;
-                &lt;td&gt;
-    &lt;mt:if name=&quot;has_thumbnail&quot;&gt;
-                    &lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;return toggleAssetDetails('&lt;mt:var name=&quot;id&quot;&gt;');&quot; title=&quot;&lt;$mt:var name=&quot;file_name&quot;$&gt;&quot;&gt;&lt;$mt:var name=&quot;label&quot; escape=&quot;html&quot;$&gt;&lt;/a&gt;
+                &lt;td class=&quot;si as-file-status asset-type-&lt;mt:var name=&quot;asset_class&quot; escape=&quot;html&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;
+                    &lt;div class=&quot;asset-thumb&quot;&gt;
+                        &lt;div class=&quot;asset-thumb-inner&quot;&gt;
+    &lt;mt:if name=&quot;file_is_missing&quot;&gt;
+                            &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;mt:var name=&quot;object_type&quot;&gt;&amp;amp;id=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot; title=&quot;&lt;$mt:var name=&quot;file_name&quot;$&gt;&quot;&gt;&lt;span class=&quot;asset-missing&quot;&gt;&lt;__trans phrase=&quot;Asset Missing&quot;&gt;&lt;/span&gt;&lt;/a&gt;
     &lt;mt:else&gt;
-                    &lt;$mt:var name=&quot;label&quot; escape=&quot;html&quot;$&gt;
+                            &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;mt:var name=&quot;object_type&quot;&gt;&amp;amp;id=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot; title=&quot;&lt;$mt:var name=&quot;file_name&quot;$&gt;&quot;&gt;
+        &lt;mt:if name=&quot;has_thumbnail&quot;&gt;
+                                &lt;img src=&quot;&lt;mt:var name=&quot;thumbnail_url&quot; escape=&quot;html&quot;&gt;&quot; width=&quot;&lt;mt:var name=&quot;thumbnail_width&quot; escape=&quot;html&quot;&gt;&quot; height=&quot;&lt;mt:var name=&quot;thumbnail_height&quot; escape=&quot;html&quot;&gt;&quot;&lt;mt:if name=&quot;thumbnail_width&quot;&gt; style=&quot;padding: &lt;$mt:var name=&quot;thumbnail_height_offset&quot;$&gt;px &lt;$mt:var name=&quot;thumbnail_width_offset&quot;$&gt;px&quot;&lt;/mt:if&gt; /&gt;
+        &lt;mt:else&gt;
+                            &lt;span&gt;&lt;__trans phrase=&quot;No thumbnail image&quot;&gt;&lt;/span&gt;
+        &lt;/mt:if&gt;
+                            &lt;/a&gt;
+        &lt;mt:if name=&quot;has_thumbnail&quot;&gt;
+                            &lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;return toggleAssetDetails('&lt;mt:var name=&quot;id&quot;&gt;');&quot; class=&quot;asset-preview-link&quot;&gt;&lt;span&gt;&lt;__trans phrase=&quot;Preview&quot;&gt;&lt;/span&gt;&lt;/a&gt;
+        &lt;/mt:if&gt;
     &lt;/mt:if&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/td&gt;
+                &lt;td&gt;
+                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;mt:var name=&quot;object_type&quot;&gt;&amp;amp;id=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot; title=&quot;&lt;$mt:var name=&quot;file_name&quot;$&gt;&quot;&gt;&lt;$mt:var name=&quot;label&quot; escape=&quot;html&quot;$&gt;&lt;/a&gt;
+                    &lt;div class=&quot;as-asset-type&quot;&gt;&lt;mt:if name=&quot;file_is_missing&quot;&gt;&lt;__trans phrase=&quot;[_1] is missing&quot; params=&quot;&lt;mt:var name=&quot;asset_class&quot; escape=&quot;html&quot;&gt;&quot;&gt;&lt;mt:else&gt;&lt;mt:var name=&quot;asset_class&quot; escape=&quot;html&quot;&gt;&lt;/mt:if&gt;&lt;/div&gt;
                     &lt;div id=&quot;asset-&lt;mt:var name=&quot;id&quot;&gt;-preview&quot; class=&quot;asset-preview&quot;&gt;
                         &lt;div id=&quot;asset-&lt;mt:var name=&quot;id&quot;&gt;-preview-inner&quot; class=&quot;asset-preview-inner&quot;&gt;&lt;/div&gt;
                     &lt;/div&gt;
                 &lt;/td&gt;
-                &lt;td class=&quot;as-asset-type&quot;&gt;&lt;mt:var name=&quot;asset_class&quot; escape=&quot;html&quot;&gt;&lt;/td&gt;
     &lt;mt:unless name=&quot;edit_blog_id&quot;&gt;
                 &lt;td&gt;&lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=list_assets&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&quot;&gt;&lt;mt:var name=&quot;blog_name&quot; escape=&quot;html&quot;&gt;&lt;/a&gt;&lt;/td&gt;
     &lt;/mt:unless&gt;
+                &lt;td class=&quot;as-file-size&quot; title=&quot;&lt;mt:var name=&quot;file_size&quot;&gt;&quot;&gt;
+    &lt;mt:if name=&quot;class&quot; eq=&quot;image&quot;&gt;
+                    &lt;mt:var name=&quot;image_width&quot; escape=&quot;html&quot;&gt; &amp;times; &lt;mt:var name=&quot;image_height&quot; escape=&quot;html&quot;&gt;px&lt;br /&gt;
+    &lt;/mt:if&gt;
     &lt;mt:if name=&quot;file_size_formatted&quot;&gt;
-                &lt;td class=&quot;as-file-size&quot;&gt;&lt;span title=&quot;&lt;mt:var name=&quot;file_size&quot;&gt;&quot;&gt;&lt;mt:var name=&quot;file_size_formatted&quot;&gt;&lt;/span&gt;&lt;/td&gt;
+                    &lt;mt:var name=&quot;file_size_formatted&quot;&gt;
     &lt;mt:else&gt;
-                &lt;td class=&quot;as-file-size&quot;&gt;&lt;mt:var name=&quot;file_size&quot;&gt;&lt;/td&gt;
+                    &lt;mt:var name=&quot;file_size&quot;&gt;
     &lt;/mt:if&gt;
+                &lt;/td&gt;
                 &lt;td class=&quot;as-created-by&quot;&gt;&lt;mt:if name=&quot;created_by&quot;&gt;&lt;mt:var name=&quot;created_by&quot;&gt;&lt;mt:else&gt;&lt;em&gt;&lt;__trans phrase=&quot;System&quot;&gt;&lt;/em&gt;&lt;/mt:if&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;span title=&quot;&lt;mt:var name=&quot;created_on_formatted&quot;&gt;&quot;&gt;&lt;mt:if name=&quot;created_on_relative&quot;&gt;&lt;mt:if name=&quot;dates_relative&quot;&gt;&lt;mt:var name=&quot;created_on_relative&quot;&gt;&lt;mt:else&gt;&lt;mt:var name=&quot;created_on_formatted&quot;&gt;&lt;/mt:if&gt;&lt;mt:else&gt;&lt;mt:var name=&quot;created_on_formatted&quot;&gt;&lt;/mt:if&gt;&lt;/span&gt;&lt;/td&gt;
-                &lt;td class=&quot;status-view&quot;&gt;&lt;mt:if name=&quot;url&quot;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;url&quot;&gt;&quot; target=&quot;view_uploaded&quot; title=&quot;&lt;__trans phrase=&quot;View&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;View&quot;&gt;&quot; width=&quot;13&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;&lt;mt:else&gt;&amp;nbsp;&lt;/mt:if&gt;&lt;/td&gt;
+                &lt;td class=&quot;si status-view&quot;&gt;&lt;mt:if name=&quot;url&quot;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;url&quot;&gt;&quot; target=&quot;view_uploaded&quot; title=&quot;&lt;__trans phrase=&quot;View&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;View&quot;&gt;&quot; width=&quot;13&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;&lt;mt:else&gt;&amp;nbsp;&lt;/mt:if&gt;&lt;/td&gt;
             &lt;/tr&gt;
     &lt;mt:if __last__&gt;
         &lt;/tbody&gt;</diff>
      <filename>tmpl/cms/include/asset_table.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -35,9 +35,9 @@
             &lt;td align=&quot;right&quot;&gt;&lt;mt:if name=&quot;can_edit_entries&quot;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=list_pings&amp;amp;blog_id=&lt;mt:var name=&quot;id&quot;&gt;&quot;&gt;&lt;mt:var name=&quot;num_pings&quot;&gt;&lt;/a&gt;&lt;mt:else&gt;&lt;mt:var name=&quot;num_pings&quot;&gt;&lt;/mt:if&gt;&lt;/td&gt;
             &lt;td align=&quot;right&quot;&gt;&lt;mt:var name=&quot;num_authors&quot;&gt;&lt;/td&gt;
             &lt;td&gt;&lt;mt:if name=&quot;can_edit_config&quot;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=cfg_prefs&amp;amp;blog_id=&lt;mt:var name=&quot;id&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;Settings&quot;&gt;&lt;/a&gt;&lt;mt:else&gt;&amp;nbsp;&lt;/mt:if&gt;&lt;/td&gt;
-            &lt;mt:unless name=&quot;mode_search_replace&quot;&gt;&lt;mt:unless name=&quot;is_administrator&quot;&gt;&lt;mt:if name=&quot;can_administer_blog&quot;&gt;
+            &lt;mt:unless name=&quot;mode_search_replace&quot;&gt;&lt;mt:if name=&quot;is_administrator&quot;&gt;
             &lt;td&gt;&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;doRemoveBlog('&lt;mt:var name=&quot;id&quot;&gt;'); return false;&quot;&gt;&lt;img src=&quot;&lt;mt:var name=&quot;static_uri&quot;&gt;images/nav_icons/mini/delete.gif&quot; width=&quot;9&quot; height=&quot;11&quot; alt=&quot;&lt;__trans phrase=&quot;Delete&quot;&gt;&quot; /&gt;&lt;/a&gt;&lt;/td&gt;
-            &lt;mt:else&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/mt:if&gt;&lt;/mt:unless&gt;&lt;/mt:unless&gt;
+            &lt;mt:else&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/mt:if&gt;&lt;/mt:unless&gt;
         &lt;/tr&gt;
     &lt;mt:if name=&quot;__last__&quot;&gt;
     &lt;/tbody&gt;</diff>
      <filename>tmpl/cms/include/blog_table.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-&lt;mt:if name=&quot;BLOG_ID&quot;&gt;
+&lt;mt:if name=&quot;BLOG_ID&quot;&gt;&lt;mt:setvarblock id=&quot;more_items&quot; name=&quot;more_items&quot;&gt;&lt;/mt:setvarblock&gt;
 &lt;ul&gt;
     &lt;li&lt;mt:if name=&quot;general-settings&quot;&gt; class=&quot;active&quot;&lt;/mt:if&gt;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;SCRIPT_URL&quot;&gt;?__mode=cfg_prefs&amp;amp;blog_id=&lt;mt:var name=&quot;BLOG_ID&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;General&quot;&gt;&lt;/a&gt;&lt;/li&gt;
     &lt;li&lt;mt:if name=&quot;publishing&quot;&gt; class=&quot;active&quot;&lt;/mt:if&gt;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;SCRIPT_URL&quot;&gt;?__mode=cfg_archives&amp;amp;blog_id=&lt;mt:var name=&quot;BLOG_ID&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;Publishing&quot;&gt;&lt;/a&gt;&lt;/li&gt;
@@ -11,5 +11,6 @@
     &lt;mt:if name=&quot;show_ip_info&quot;&gt;
     &lt;li&lt;mt:if name=&quot;ip_info&quot;&gt; class=&quot;active&quot;&lt;/mt:if&gt;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;SCRIPT_URL&quot;&gt;?__mode=list&amp;amp;_type=banlist&amp;amp;blog_id=&lt;mt:var name=&quot;BLOG_ID&quot;&gt;&quot;&gt;&lt;__trans phrase=&quot;IP Banning&quot;&gt;&lt;/a&gt;&lt;/li&gt;
     &lt;/mt:if&gt;
+    &lt;mt:var name=&quot;more_items&quot;&gt;
 &lt;/ul&gt;
 &lt;/mt:if&gt;</diff>
      <filename>tmpl/cms/include/cfg_content_nav.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,8 @@
-&lt;mt:if name=&quot;IS_ADMINISTRATOR&quot;&gt;
+&lt;mt:if name=&quot;IS_ADMINISTRATOR&quot;&gt;&lt;mt:setvarblock id=&quot;more_items&quot; name=&quot;more_items&quot;&gt;&lt;/mt:setvarblock&gt;
 &lt;ul&gt;
     &lt;li&lt;mt:if name=&quot;system-general-settings&quot;&gt; class=&quot;active&quot;&lt;/mt:if&gt;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;SCRIPT_URL&quot;&gt;?__mode=cfg_system&quot;&gt;&lt;__trans phrase=&quot;General&quot;&gt;&lt;/a&gt;&lt;/li&gt;
     &lt;li&lt;mt:if name=&quot;system-user-settings&quot;&gt; class=&quot;active&quot;&lt;/mt:if&gt;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;SCRIPT_URL&quot;&gt;?__mode=cfg_system_users&quot;&gt;&lt;__trans phrase=&quot;User&quot;&gt;&lt;/a&gt;&lt;/li&gt;
     &lt;li&lt;mt:if name=&quot;system-feedback-settings&quot;&gt; class=&quot;active&quot;&lt;/mt:if&gt;&gt;&lt;a href=&quot;&lt;mt:var name=&quot;SCRIPT_URL&quot;&gt;?__mode=cfg_system_feedback&quot;&gt;&lt;__trans phrase=&quot;Feedback&quot;&gt;&lt;/a&gt;&lt;/li&gt;
+    &lt;mt:var name=&quot;more_items&quot;&gt;
 &lt;/ul&gt;
 &lt;/mt:if&gt;</diff>
      <filename>tmpl/cms/include/cfg_system_content_nav.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@
     &lt;!--[if IE]&gt;
     &lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;css/hacks/ie.css?v=&lt;mt:var name=&quot;mt_version&quot; escape=&quot;url&quot;&gt;&quot; type=&quot;text/css&quot; /&gt;
     &lt;![endif]--&gt;
-&lt;mt:if name=&quot;local_lang_id&quot;&gt;
+&lt;mt:if name=&quot;local_lang_id&quot; ne=&quot;en-us&quot;&gt;
     &lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;styles_&lt;$mt:var name=&quot;local_lang_id&quot;$&gt;.css?v=&lt;mt:var name=&quot;mt_version&quot; escape=&quot;url&quot;&gt;&quot; /&gt;
 &lt;/mt:if&gt;
 
@@ -27,6 +27,9 @@
 &lt;/mt:setvarblock&gt;
 &lt;$mt:var name=&quot;html_head&quot;$&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;mt.js?v=&lt;mt:var name=&quot;mt_version&quot; escape=&quot;url&quot;&gt;&quot;&gt;&lt;/script&gt;
+&lt;mt:if name=&quot;local_lang_id&quot; ne=&quot;en-us&quot;&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;mt_&lt;$mt:var name=&quot;local_lang_id&quot;$&gt;.js?v=&lt;mt:var name=&quot;mt_version&quot; escape=&quot;URL&quot;&gt;&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
+&lt;/mt:if&gt;
 
 &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
 &lt;!--</diff>
      <filename>tmpl/cms/include/chromeless_header.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -3,29 +3,29 @@
         &lt;mt:if name=&quot;state_editable&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot;
             onclick=&quot;doForMarkedInThisWindow(getByID('&lt;$mt:var name=&quot;object_type&quot;$&gt;-listing-form'), '&lt;__trans phrase=&quot;comment&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;comments&quot; escape=&quot;js&quot;&gt;', 'id', 'approve_item', {}, '&lt;__trans phrase=&quot;to publish&quot; escape=&quot;js&quot;&gt;'); return false;&quot;
             accesskey=&quot;a&quot;
-            title=&quot;&lt;__trans phrase=&quot;Publish selected [_1] (a)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Publish selected [lc,_1] (a)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Publish&quot;&gt;&lt;/a&gt;&lt;/mt:if&gt;
     &lt;/mt:unless&gt;
         &lt;a href=&quot;javascript:void(0)&quot;
             onclick=&quot;doRemoveItems(getByID('&lt;$mt:var name=&quot;object_type&quot;$&gt;-listing-form'), '&lt;__trans phrase=&quot;comment&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;comments&quot; escape=&quot;js&quot;&gt;'); return false;&quot;
             accesskey=&quot;x&quot;
-            title=&quot;&lt;__trans phrase=&quot;Delete selected [_1] (x)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Delete selected [lc,_1] (x)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Delete&quot;&gt;&lt;/a&gt;
     &lt;mt:unless name=&quot;filter_spam&quot;&gt;
         &lt;mt:if name=&quot;state_editable&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot;
             onclick=&quot;doItemsAreJunk(getByID('&lt;$mt:var name=&quot;object_type&quot;$&gt;-listing-form'), '&lt;__trans phrase=&quot;comment&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;comments&quot; escape=&quot;js&quot;&gt;'); return false;&quot;
             accesskey=&quot;j&quot;
-            title=&quot;&lt;__trans phrase=&quot;Report selected [_1] as Spam (j)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Report selected [lc,_1] as Spam (j)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Spam&quot;&gt;&lt;/a&gt;&lt;/mt:if&gt;
     &lt;mt:else&gt;
         &lt;mt:if name=&quot;state_editable&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot;
             onclick=&quot;doItemsAreNotJunk(getByID('&lt;$mt:var name=&quot;object_type&quot;$&gt;-listing-form'), '&lt;__trans phrase=&quot;comment&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;comments&quot; escape=&quot;js&quot;&gt;'); return false;&quot;
             accesskey=&quot;j&quot;
-            title=&quot;&lt;__trans phrase=&quot;Report selected [_1] as Not Spam and Publish (j)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Report selected [lc,_1] as Not Spam and Publish (j)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Not Spam&quot;&gt;&lt;/a&gt;&lt;/mt:if&gt;
         &lt;mt:if name=&quot;can_empty_junk&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot; mt:command=&quot;submit&quot; mt:mode=&quot;empty_junk&quot;
             mt:confirm-msg=&quot;&lt;__trans phrase=&quot;Are you sure you want to remove all comments reported as spam?&quot;&gt;&quot;
-            title=&quot;&lt;__trans phrase=&quot;Deletes all [_1] reported as Spam&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
+            title=&quot;&lt;__trans phrase=&quot;Deletes all [lc,_1] reported as Spam&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
             &gt;&lt;__trans phrase=&quot;Empty&quot;&gt;&lt;/a&gt;&lt;/mt:if&gt;
     &lt;/mt:unless&gt;
     &lt;mt:if name=&quot;is_ip_filter&quot;&gt;
@@ -89,7 +89,7 @@
                     &lt;mt:var name=&quot;comment_short&quot; escape=&quot;html&quot;&gt;
                 &lt;/mt:if&gt;
             &lt;/mt:if&gt;
-            &lt;mt:if name=&quot;reply_count&quot;&gt;&lt;mt:if name=&quot;reply_count&quot; eq=&quot;1&quot;&gt;&lt;__trans phrase=&quot;(1 reply)&quot;&gt;&lt;mt:else&gt;&lt;__trans phrase=&quot;([_1] replies)&quot; params=&quot;&lt;mt:var name=&quot;reply_count&quot;&gt;&quot;&gt;&lt;/mt:if&gt;&lt;/mt:if&gt;
+            &lt;mt:if name=&quot;reply_count&quot;&gt;&lt;__trans phrase=&quot;([quant,_1,reply,replies])&quot; params=&quot;&lt;mt:var name=&quot;reply_count&quot;&gt;&quot;&gt;&lt;/mt:if&gt;
             &lt;mt:unless name=&quot;view_expanded&quot;&gt;
             &lt;mt:if name=&quot;has_edit_access&quot;&gt;&lt;mt:if name=&quot;visible&quot;&gt;&lt;span id=&quot;replyto_&lt;mt:var name=&quot;id&quot;&gt;&quot; style=&quot;visibility: hidden; margin-left: 10px&quot;&gt;&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;return openDialog(this.form, 'dialog_post_comment', 'reply_to=&lt;mt:var name=&quot;id&quot;&gt;&amp;amp;magic_token=&lt;mt:var name=&quot;magic_token&quot; encode=&quot;url&quot;&gt;&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&lt;mt:if name=&quot;return_args&quot;&gt;&amp;amp;return_args=&lt;mt:var name=&quot;return_args&quot; escape=&quot;url&quot;&gt;&lt;/mt:if&gt;')&quot;&gt;&lt;__trans phrase=&quot;Reply&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/mt:if&gt;&lt;/mt:if&gt;
             &lt;/mt:unless&gt;
@@ -123,7 +123,7 @@
                         &lt;/mt:if&gt;
                     &lt;/mt:if&gt;
                         &lt;mt:if name=&quot;auth_icon_url&quot;&gt;&lt;img style=&quot;background-image: none&quot; src=&quot;&lt;mt:var name=&quot;auth_icon_url&quot;&gt;&quot; height=&quot;9&quot; width=&quot;9&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/mt:if&gt;
-                        &lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=view&amp;amp;_type=commenter&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;id=&lt;mt:var name=&quot;commenter_id&quot;&gt;&quot; class=&quot;icon-right icon-right-wide icon-&lt;mt:if name=&quot;commenter_approved&quot;&gt;trusted&lt;mt:else&gt;&lt;mt:if name=&quot;commenter_banned&quot;&gt;banned&lt;mt:else&gt;authenticated&lt;/mt:if&gt;&lt;/mt:if&gt;&quot; title=&quot;&lt;__trans phrase=&quot;Edit this [_1] commenter&quot; params=&quot;&lt;$mt:var name=&quot;commenter_status&quot; escape=&quot;html&quot;$&gt;&quot;&gt;&quot;&gt;&lt;mt:var name=&quot;author&quot; escape=&quot;html&quot;&gt;&lt;/a&gt;
+                        &lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=view&amp;amp;_type=commenter&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;id=&lt;mt:var name=&quot;commenter_id&quot;&gt;&quot; class=&quot;icon-right-wide icon-&lt;mt:if name=&quot;commenter_approved&quot;&gt;trusted&lt;mt:else&gt;&lt;mt:if name=&quot;commenter_banned&quot;&gt;banned&lt;mt:else&gt;authenticated&lt;/mt:if&gt;&lt;/mt:if&gt;&quot; title=&quot;&lt;__trans phrase=&quot;Edit this [_1] commenter&quot; params=&quot;&lt;$mt:var name=&quot;commenter_status&quot; escape=&quot;html&quot;$&gt;&quot;&gt;&quot;&gt;&lt;mt:var name=&quot;author&quot; escape=&quot;html&quot;&gt;&lt;/a&gt;
                 &lt;mt:else&gt;
                     &lt;mt:if name=&quot;author&quot;&gt;
                         &lt;mt:if name=&quot;auth_icon_url&quot;&gt;&lt;img src=&quot;&lt;mt:var name=&quot;auth_icon_url&quot;&gt;&quot; height=&quot;9&quot; width=&quot;9&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/mt:if&gt;&lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=search_replace&amp;amp;_type=comment&amp;amp;search_cols=author&amp;amp;is_limited=1&amp;amp;do_search=1&amp;amp;search=&lt;mt:var name=&quot;author&quot; escape=&quot;url&quot;&gt;&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&quot; title=&quot;&lt;__trans phrase=&quot;Search for comments by this commenter&quot;&gt;&quot;&gt;&lt;mt:var name=&quot;author_display&quot; escape=&quot;html&quot;&gt;&lt;/a&gt;
@@ -138,7 +138,7 @@
             &lt;/mt:if&gt;
                     &lt;td class=&quot;entry&quot;&gt;
                 &lt;mt:if name=&quot;entry_title&quot;&gt;
-                    &lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=view&amp;amp;_type=&lt;mt:var name=&quot;entry_class&quot;&gt;&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;id=&lt;mt:var name=&quot;entry_id&quot;&gt;&quot; title=&quot;&lt;__trans phrase=&quot;View this [_1]&quot; params=&quot;&lt;mt:var name=&quot;entry_class_label&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;&gt;&lt;mt:var name=&quot;entry_title&quot; escape=&quot;html&quot;&gt;&lt;/a&gt;
+                    &lt;a href=&quot;&lt;mt:var name=&quot;script_url&quot;&gt;?__mode=view&amp;amp;_type=&lt;mt:var name=&quot;entry_class&quot;&gt;&amp;amp;blog_id=&lt;mt:var name=&quot;blog_id&quot;&gt;&amp;amp;id=&lt;mt:var name=&quot;entry_id&quot;&gt;&quot; title=&quot;&lt;__trans phrase=&quot;View this [lc,_1]&quot; params=&quot;&lt;mt:var name=&quot;entry_class_label&quot;&gt;&quot;&gt;&quot;&gt;&lt;mt:var name=&quot;entry_title&quot; escape=&quot;html&quot;&gt;&lt;/a&gt;
                 &lt;mt:else&gt;
                         &amp;nbsp;
                 &lt;/mt:if&gt;</diff>
      <filename>tmpl/cms/include/comment_table.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
+&lt;$mt:setvar name=&quot;show_display_options_link&quot; value=&quot;1&quot;$&gt;
 &lt;mtapp:widget
     id=&quot;display-options-widget&quot;
-    label=&quot;&lt;__trans phrase=&quot;Display Options&quot;&gt;&quot;
-    label_link=&quot;javascript:void(0)&quot;
-    label_onclick=&quot;return toggleEntryDisplayOptions();&quot;&gt;
+    class=&quot;display-options-widget autolayout-flyout-smart hidden&quot;
+    label=&quot;&lt;__trans phrase=&quot;Display Options&quot;&gt;&quot;&gt;
     &lt;form method=&quot;get&quot; action=&quot;&lt;mt:var name=&quot;SCRIPT_URL&quot;&gt;&quot; id=&quot;display-options-form&quot;&gt;
         &lt;input type=&quot;hidden&quot; name=&quot;__mode&quot; value=&quot;update_list_prefs&quot; /&gt;
         &lt;input type=&quot;hidden&quot; name=&quot;_type&quot; value=&quot;&lt;mt:var name=&quot;OBJECT_TYPE&quot;&gt;&quot; /&gt;
@@ -12,13 +12,10 @@
             label=&quot;&lt;__trans phrase=&quot;_DISPLAY_OPTIONS_SHOW&quot;&gt;&quot;
             label_class=&quot;display-options&quot;&gt;
             &lt;select name=&quot;limit&quot;&gt;
-                &lt;option value=&quot;5&quot;&lt;mt:if name=&quot;LIMIT_5&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;5&quot;&gt;&lt;/option&gt;
-                &lt;option value=&quot;10&quot;&lt;mt:if name=&quot;LIMIT_10&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;10&quot;&gt;&lt;/option&gt;
-                &lt;option value=&quot;15&quot;&lt;mt:if name=&quot;LIMIT_15&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;15&quot;&gt;&lt;/option&gt;
-                &lt;option value=&quot;20&quot;&lt;mt:if name=&quot;LIMIT_20&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;20&quot;&gt;&lt;/option&gt;
+                &lt;option value=&quot;25&quot;&lt;mt:if name=&quot;LIMIT_25&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;25&quot;&gt;&lt;/option&gt;
                 &lt;option value=&quot;50&quot;&lt;mt:if name=&quot;LIMIT_50&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;50&quot;&gt;&lt;/option&gt;
-                &lt;option value=&quot;75&quot;&lt;mt:if name=&quot;LIMIT_75&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;75&quot;&gt;&lt;/option&gt;
                 &lt;option value=&quot;100&quot;&lt;mt:if name=&quot;LIMIT_100&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;100&quot;&gt;&lt;/option&gt;
+                &lt;option value=&quot;200&quot;&lt;mt:if name=&quot;LIMIT_200&quot;&gt; selected=&quot;selected&quot;&lt;/mt:if&gt;&gt;&lt;__trans phrase=&quot;[quant,_1,row,rows]&quot; params=&quot;200&quot;&gt;&lt;/option&gt;
             &lt;/select&gt;
         &lt;/mtapp:setting&gt;
                 
@@ -61,8 +58,7 @@
                 &lt;a href=&quot;javascript:void(0)&quot; mt:command=&quot;submit&quot;
                     title=&quot;&lt;__trans phrase=&quot;Save display options&quot;&gt;&quot;
                     &gt;&lt;__trans phrase=&quot;Save&quot;&gt;&lt;/a&gt;
-                &lt;a href=&quot;javascript:void(0)&quot;
-                    onclick=&quot;toggleEntryDisplayOptions()&quot;
+                &lt;a href=&quot;javascript:void(0)&quot; mt:command=&quot;close-flyout&quot;
                     title=&quot;&lt;__trans phrase=&quot;Close display options&quot;&gt;&quot;
                     &gt;&lt;__trans phrase=&quot;Cancel&quot;&gt;&lt;/a&gt;
             &lt;/div&gt;</diff>
      <filename>tmpl/cms/include/display_options.tmpl</filename>
    </modified>
    <modified>
      <diff>@@ -4,39 +4,39 @@
     &lt;mt:if name=&quot;object_type&quot; eq=&quot;entry&quot;&gt;
         &lt;mt:if name=&quot;is_power_edit&quot;&gt;
                 &lt;a href=&quot;javascript:void(0)&quot; mt:command=&quot;submit&quot; mt:mode=&quot;save_entries&quot; accesskey=&quot;s&quot;
-                    title=&quot;&lt;__trans phrase=&quot;Save these [_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+                    title=&quot;&lt;__trans phrase=&quot;Save these [lc,_1] (s)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;
                     &gt;&lt;__trans phrase=&quot;Save&quot;&gt;&lt;/a&gt;
         &lt;mt:else&gt;
-            &lt;mt:if name=&quot;can_rebuild&quot;&gt;
+            &lt;mt:if name=&quot;can_republish&quot;&gt;
                 &lt;a href=&quot;javascript:void(0)&quot;
                     onclick=&quot;doForMarkedInThisWindow(getByID('&lt;$mt:var name=&quot;object_type&quot;$&gt;-listing-form'), '&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot; escape=&quot;js&quot;&gt;', '&lt;mt:var name=&quot;object_label_plural&quot; lower_case=&quot;1&quot; escape=&quot;js&quot;&gt;', null, 'rebuild_new_phase', {&lt;mt:if name=&quot;blog_id&quot;&gt;'blog_id': '&lt;mt:var name=&quot;blog_id&quot;&gt;'&lt;/mt:if&gt;}, '&lt;__trans phrase=&quot;to republish&quot; escape=&quot;js&quot;&gt;'); return false;&quot;
                     accesskey=&quot;r&quot;
-                    title=&quot;&lt;__trans phrase=&quot;Republish selected [_1] (r)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot; lower_case=&quot;1&quot;&gt;&quot;&gt;&quot;
+                    title=&quot;&lt;__trans phrase=&quot;Republish selected [lc,_1] (r)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;
                     &gt;&lt;__trans phrase=&quot;Republish&quot;&gt;&lt;/a&gt;
             &lt;/mt:if&gt;
                 &lt;a href=&quot;javascript:void(0)&quot;
                     onclick=&quot;doRemoveItems(getByID('&lt;$mt:var name=&quot;object_type&quot;$&gt;-listing-form'), '&lt;mt:var name=&quot;object_label&quot; lower_case=&quot;1&quot; escape=&quot;js&quot;&gt;', '&lt;mt:var name=&quot;object_label_plural&quot; lower_case=&quot;1&quot; escape=&quot;js&quot;&gt;'); return false;&quot;
                     accesskey=&quot;x&quot;
-                    title=&quot;&lt;__trans phrase=&quot;Delete selected [_1] (x)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;
+                    title=&quot;&lt;__trans phrase=&quot;Delete selected [lc,_1] (x)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;
                     &gt;&lt;__trans phrase=&quot;Delete&quot;&gt;&lt;/a&gt;
         &lt;/mt:if&gt;
     &lt;mt:else&gt;
         &lt;mt:if name=&quot;is_power_edit&quot;&gt;
                 &lt;a href=&quot;javascript:void(0)&quot; mt:command=&quot;submit&quot; mt:mode=&quot;save_pages&quot; accesskey=&quot;s&quot;
-                    title=&quot;&lt;__trans phrase=&quot;Save these [_1] (s)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot; lower_case=&quot;1&quot;$&gt;&quot;&gt;&quot;
+                    title=&quot;&lt;__trans phrase=&quot;Save these [lc,_1] (s)&quot; params=&quot;&lt;$mt:var name=&quot;object_label_plural&quot;$&gt;&quot;&gt;&quot;
                     &gt;&lt;__trans phrase=&quot;Save&quot;&gt;&lt;/a&gt;
         &lt;mt:else&gt;
-            &lt;mt:if name=&quot;can_rebuild&quot;&gt;
+            &lt;mt:if name=&quot;can_republish&quot;&gt;
                 &lt;a href=&quot;javascript:void(0)&quot;
                     onclick=&quot;doForMarkedInThisWindow(getByID('&lt;$mt:var name=&quot;object_type&quot;$&gt;-listing-form'), '&lt;__trans phrase=&quot;page&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;pages&quot; escape=&quot;js&quot;&gt;', null, 'rebuild_new_phase', {&lt;mt:if name=&quot;blog_id&quot;&gt;'blog_id': '&lt;mt:var name=&quot;blog_id&quot;&gt;'&lt;/mt:if&gt;}, '&lt;__trans phrase=&quot;to republish&quot; escape=&quot;js&quot;&gt;'); return false;&quot;
                     accesskey=&quot;r&quot;
-                    title=&quot;&lt;__trans phrase=&quot;Republish selected [_1] (r)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;
+                    title=&quot;&lt;__trans phrase=&quot;Republish selected [lc,_1] (r)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;
                     &gt;&lt;__trans phrase=&quot;Republish&quot;&gt;&lt;/a&gt;
             &lt;/mt:if&gt;
                 &lt;a href=&quot;javascript:void(0)&quot;
                     onclick=&quot;doRemoveItems(getByID('&lt;$mt:var name=&quot;object_type&quot;$&gt;-listing-form'), '&lt;__trans phrase=&quot;page&quot; escape=&quot;js&quot;&gt;', '&lt;__trans phrase=&quot;pages&quot; escape=&quot;js&quot;&gt;'); return false;&quot; name=&quot;delete_pages&quot; value=&quot;&lt;__trans phrase=&quot;Delete&quot;&gt;&quot;
                     accesskey=&quot;x&quot;
-                    title=&quot;&lt;__trans phrase=&quot;Delete selected [_1] (x)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;
+                    title=&quot;&lt;__trans phrase=&quot;Delete selected [lc,_1] (x)&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;
                     &gt;&lt;__trans phrase=&quot;Delete&quot;&gt;&lt;/a&gt;
         &lt;/mt:if&gt;
     &lt;/mt:if&gt;
@@ -92,16 +92,16 @@
         &lt;mt:else&gt;
                 &lt;td class=&quot;status si&lt;mt:if name=&quot;status_draft&quot;&gt; status-draft&lt;/mt:if&gt;&lt;mt:if name=&quot;status_publish&quot;&gt; status-publish&lt;/mt:if&gt;&lt;mt:if name=&quot;status_review&quot;&gt; status-review&lt;/mt:if&gt;&lt;mt:if name=&quot;status_future&quot;&gt; status-future&lt;/mt:if&gt;&quot;&gt;
             &lt;mt:if name=&quot;status_draft&quot;&gt;
-                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;mt:var name=&quot;object_type&quot;&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&lt;/mt:if&gt;&amp;amp;filter=status&amp;amp;filter_val=1&quot; title=&quot;&lt;__trans phrase=&quot;Only show unpublished [_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Unpublished (Draft)&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;
+                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;mt:var name=&quot;object_type&quot;&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&lt;/mt:if&gt;&amp;amp;filter=status&amp;amp;filter_val=1&quot; title=&quot;&lt;__trans phrase=&quot;Only show unpublished [lc,_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Unpublished (Draft)&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;
             &lt;/mt:if&gt;
             &lt;mt:if name=&quot;status_publish&quot;&gt;
-                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;mt:var name=&quot;object_type&quot;&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&lt;/mt:if&gt;&amp;amp;filter=status&amp;amp;filter_val=2&quot; title=&quot;&lt;__trans phrase=&quot;Only show published [_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Published&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;
+                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;mt:var name=&quot;object_type&quot;&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&lt;/mt:if&gt;&amp;amp;filter=status&amp;amp;filter_val=2&quot; title=&quot;&lt;__trans phrase=&quot;Only show published [lc,_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Published&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;
             &lt;/mt:if&gt;
             &lt;mt:if name=&quot;status_review&quot;&gt;
-                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;mt:var name=&quot;object_type&quot;&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&lt;/mt:if&gt;&amp;amp;filter=status&amp;amp;filter_val=3&quot; title=&quot;&lt;__trans phrase=&quot;Only show [_1] for review&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Unpublished (Review)&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;
+                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;mt:var name=&quot;object_type&quot;&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&lt;/mt:if&gt;&amp;amp;filter=status&amp;amp;filter_val=3&quot; title=&quot;&lt;__trans phrase=&quot;Only show [lc,_1] for review&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Unpublished (Review)&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;
             &lt;/mt:if&gt;
             &lt;mt:if name=&quot;status_future&quot;&gt;
-                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;mt:var name=&quot;object_type&quot;&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&lt;/mt:if&gt;&amp;amp;filter=status&amp;amp;filter_val=4&quot; title=&quot;&lt;__trans phrase=&quot;Only show scheduled [_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;
+                    &lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=list_&lt;mt:var name=&quot;object_type&quot;&gt;&lt;mt:if name=&quot;blog_id&quot;&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&lt;/mt:if&gt;&amp;amp;filter=status&amp;amp;filter_val=4&quot; title=&quot;&lt;__trans phrase=&quot;Only show scheduled [lc,_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label_plural&quot;&gt;&quot;&gt;&quot;&gt;&lt;img src=&quot;&lt;$mt:var name=&quot;static_uri&quot;$&gt;images/spacer.gif&quot; alt=&quot;&lt;__trans phrase=&quot;Scheduled&quot;&gt;&quot; width=&quot;9&quot; height=&quot;9&quot; /&gt;&lt;/a&gt;
             &lt;/mt:if&gt;
                 &lt;/td&gt;
         &lt;/mt:if&gt;
@@ -133,7 +133,7 @@
             &lt;tr class=&quot;&lt;mt:if name=&quot;__odd__&quot;&gt;odd&lt;mt:else&gt;even&lt;/mt:if&gt; slave&quot;&gt;
                 &lt;td&gt;&amp;#160;&lt;/td&gt;
                 &lt;td&gt;&amp;#160;&lt;/td&gt;
-                &lt;td&gt;&lt;mt:if name=&quot;has_edit_access&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;mt:var name=&quot;object_type&quot;&gt;&amp;amp;id=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;Edit [_1]&quot; params=&quot;&lt;mt:var name=&quot;object_label&quot;&gt;&quot;&gt;&lt;/a&gt;&lt;mt:else&gt;&amp;#160;&lt;/mt:if&gt;&lt;/td&gt;
+                &lt;td&gt;&lt;mt:if name=&quot;has_edit_access&quot;&gt;&lt;a href=&quot;&lt;$mt:var name=&quot;script_url&quot;$&gt;?__mode=view&amp;amp;_type=&lt;mt:var name=&quot;object_type&quot;&gt;&amp;amp;id=&lt;$mt:var name=&quot;id&quot;$&gt;&amp;amp;blog_id=&lt;$mt:var name=&quot;blog_id&quot;$&gt;&quot;&gt;&lt;__trans phrase=&quot;Edit [lc,_1]&quot; params=&quot;&lt;mt:var name=&quot;object_labe