Changeset 4917

Show
Ignore:
Timestamp:
10/29/09 05:31:36 (4 weeks ago)
Author:
asawada
Message:

Added warning message after failed applying theme. bugzid:102865.

Location:
branches/greyhound
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/greyhound/lib/MT/CMS/Theme.pm

    r4869 r4917  
    5353    $param{theme_uninstalled} = $q->param('theme_uninstalled'); 
    5454    $param{uninstalled_theme_name} = $q->param('uninstalled_theme_name'); 
     55    $param{warning_on_apply} = $q->param('warning_on_apply'); 
    5556    $app->load_tmpl( 'list_theme.tmpl', \%param ); 
    5657} 
     
    158159                applied => 1, 
    159160                blog_id => $blog->id, 
     161                warning_on_apply => $theme->{warning_on_apply}, 
    160162            }, 
    161163        ) 
  • branches/greyhound/lib/MT/Theme.pm

    r4916 r4917  
    270270    MT->run_callbacks('pre_apply_theme', $theme, $blog); 
    271271    my $importer_filter = $opts{importer_filter}; 
     272    $theme->{warning_on_apply} = 0; 
    272273 
    273274    ## run all element handlers. 
     
    287288            } 
    288289            else { 
     290                $theme->{warning_on_apply} = 1; 
    289291                require MT::Log; 
    290292                my $log = MT::Log->new; 
  • branches/greyhound/tmpl/cms/list_theme.tmpl

    r4862 r4917  
    2020            rebuild="all"> 
    2121            <__trans phrase="Theme [_1] has been applied." params="<mt:var name="current_theme_name">" escape="html"> 
     22        </mtapp:statusmsg> 
     23    </mt:if> 
     24    <mt:if name="warning_on_apply"> 
     25        <mtapp:statusmsg 
     26            id="theme_warning" 
     27            class="alert"> 
     28            <__trans phrase="Some error occured while applying theme."> <a href="<mt:var name="script_url">?__mode=view_log&blog_id=<mt:var name="blog_id">"><__trans phrase="see more detail."></a> 
    2229        </mtapp:statusmsg> 
    2330    </mt:if>