Changeset 1002

Show
Ignore:
Timestamp:
09/02/08 19:01:13 (3 months ago)
Author:
mpaschal
Message:

Don't include the basic blog.css if the theme is labeled for an unknown template set (such as sandbox)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/StyleCatcher-2.1-dev/plugins/StyleCatcher/lib/StyleCatcher/CMS.pm

    r998 r1002  
    219219    my $app = shift; 
    220220 
    221     my $blog_id = $app->param('blog_id'); 
    222     my $url     = $app->param('url'); 
    223     my $layout  = $app->param('layout'); 
    224     my $name    = $app->param('name'); 
     221    my ($blog_id, $url, $layout, $name, $template_set) 
     222        = map { $app->param($_) || q{} } (qw( blog_id url layout name template_set )); 
    225223 
    226224    # Load the default stylesheet for this blog 
     
    245243    } 
    246244 
    247     my $mtthemebase  = $app->static_path . 'themes-base/'; 
    248     my $url2 = $mtthemebase . "blog.css"; 
     245    my $base_css = q{}; 
     246    my %use_base_css = ( 
     247        q{}                  => 1, 
     248        mt_blog              => 1, 
     249        mt_community_blog    => 1, 
     250        mt_community_forum   => 1, 
     251        professional_website => 1, 
     252        universal_website    => 1, 
     253        my_set               => 1,  # universal website from plugin 
     254    ); 
     255    if ($use_base_css{$template_set}) { 
     256        my $base_css_url = $app->static_path . "theme-base/blog.css"; 
     257        $base_css = "\@import url($base_css_url);"; 
     258    } 
    249259 
    250260    # Replacing the theme import or adding a new one at the beginning 
    251261    my $template_text  = $tmpl->text(); 
    252262    my $replaced       = 0; 
    253     my $header = 
    254 '/* This is the StyleCatcher theme addition. Do not remove this block. */'; 
     263    my $header = '/* This is the StyleCatcher theme addition. Do not remove this block. */'; 
    255264    my $footer = '/* end StyleCatcher imports */'; 
    256     my $styles = $header . "\n" . <<"EOT" . $footer; 
    257 \@import url($url2); 
     265    my $styles = <<"EOT"; 
     266$header 
     267$base_css 
    258268\@import url($url); 
     269$footer 
    259270EOT 
    260271    if ($template_text =~ s/\Q$header\E.*\Q$footer\E/$styles/s) { 
  • branches/StyleCatcher-2.1-dev/plugins/StyleCatcher/tmpl/view.tmpl

    r998 r1002  
    226226        selected = mixer.name; 
    227227        var url = mixer.entries[mixer.name].url; 
     228        var tset = mixer.entries[mixer.name].template_set; 
    228229 
    229230        TC.addClassName(btn, "disabled-button"); 
     
    236237            'magic_token': '<mt:var name="magic_token">', 
    237238            'blog_id': blog_id, 
    238             'name': mixer.name 
     239            'name': mixer.name, 
     240            'template_set': tset 
    239241        }; 
    240242        if (layout)