Changeset 1120

Show
Ignore:
Timestamp:
09/22/08 20:17:20 (14 months ago)
Author:
mpaschal
Message:

Merge actual remaining changes from 4.2 (by manually applying the diff)

Location:
trunk/StyleCatcher/plugins/StyleCatcher
Files:
1 added
7 removed
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/StyleCatcher/plugins/StyleCatcher/lib/StyleCatcher/CMS.pm

    r817 r1120  
    33# GNU General Public License, version 2. 
    44# 
    5 # $Id: CMS.pm 2576 2008-06-14 00:35:33Z bchoate $ 
     5# $Id: CMS.pm 2923 2008-08-14 18:45:46Z bchoate $ 
    66 
    77package StyleCatcher::CMS; 
     
    135135    # The remixer only uses name, author, description at the moment. 
    136136    my $app = shift; 
     137    return $app->json_error( $app->errstr ) unless $app->validate_magic; 
    137138 
    138139    my $data = fetch_themes($app->param('url')) 
     
    254255    } 
    255256     
    256  
    257     my $url2 = $mtthemebase . "blog.css"; 
     257    my $blog = MT->model('blog')->load($blog_id)     
     258      or return $app->json_error( $app->translate('No such blog [_1]', $blog_id) ); 
     259 
     260    my $r = MT->registry; 
     261    my $base_css = $r->{"template_sets"}{$blog->template_set}{"base_css"}; 
    258262 
    259263    # Replacing the theme import or adding a new one at the beginning 
     
    263267'/* This is the StyleCatcher theme addition. Do not remove this block. */'; 
    264268    my $footer = '/* end StyleCatcher imports */'; 
    265     my $styles = $header . "\n" . <<"EOT" . $footer; 
    266 \@import url($url2); 
    267 \@import url($url); 
    268 EOT 
     269    my $styles = $header . "\n"; 
     270    $styles .= "\@import url(".MT::Util::caturl($app->static_path, $base_css).");\n" if $base_css; 
     271    $styles .= "\@import url($url);\n"; 
     272    $styles .= $footer; 
     273    print STDERR "styles=$styles\n"; 
     274 
    269275    if ($template_text =~ s/\Q$header\E.*\Q$footer\E/$styles/s) { 
    270276        $tmpl->text( $template_text ); 
     
    299305    $tmpl->save or return $app->json_error( $tmpl->errstr ); 
    300306 
    301     my $blog = MT->model('blog')->load($blog_id)     
    302       or return $app->json_error( $app->translate('No such blog [_1]', $blog_id) ); 
    303307    $blog->page_layout($layout); 
    304308    $blog->touch(); 
  • trunk/StyleCatcher/plugins/StyleCatcher/tmpl/view.tmpl

    r817 r1120  
    491491            'arguments': { 
    492492                '__mode': 'stylecatcher_js', 
     493                'magic_token': '<mt:var name="magic_token">', 
    493494                'url': url 
    494495            } 
     
    546547            </div> 
    547548            <mt:loop name="style_library"> 
    548             <div class="category" id="category-repo-<mt:var name="key">" title="<mt:var name="description_label" escape="html">"><img src="<mt:var name="plugin_static_uri">images/featured.gif" alt="more-designs" /><span><mt:var name="label"></span> 
     549            <div class="category" id="category-repo-<mt:var name="key">" title="<mt:var name="description_label" escape="html">"><img src="<mt:var name="plugin_static_uri">images/featured.gif" alt="more-designs" /><span><mt:var name="label" escape="html"></span> 
    549550            </div> 
    550551            </mt:loop>