Changeset 1391

Show
Ignore:
Timestamp:
02/21/08 19:47:17 (17 months ago)
Author:
bchoate
Message:

Added support for 'component' argument when 'name' argument is used with the include tag (useful for plugin app templating).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-30/lib/MT/Template/ContextHandlers.pm

    r1379 r1391  
    23152315    } elsif (my $app_file = $arg->{name}) { 
    23162316        # app template include mode 
     2317        my $mt = MT->instance; 
     2318        local $mt->{component} = $arg->{component} if exists $arg->{component}; 
    23172319        my $stash_id = 'template_file::' . $app_file; 
    23182320        return $ctx->error(MT->translate("Recursion attempt on file: [_1]", $app_file)) 
    23192321            if $include_stack{$stash_id}; 
    23202322        local $include_stack{$stash_id} = 1; 
    2321         my $tmpl = MT->instance->load_tmpl($app_file); 
     2323        my $tmpl = $mt->load_tmpl($app_file); 
    23222324        if ($tmpl) { 
    23232325            $tmpl->name($app_file); 
     
    23292331                $tmpl_file = '.' . $tmpl_file; 
    23302332            } 
    2331             my $mt = MT->instance; 
    23322333            $mt->run_callbacks('template_param' . $tmpl_file, $mt, $tmpl->param, $tmpl); 
    23332334