Changeset 1395

Show
Ignore:
Timestamp:
02/22/08 01:28:27 (5 months ago)
Author:
bchoate
Message:

Updates to combine archive/index templates listing. BugId:68695

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-30/lib/MT/App/CMS.pm

    r1392 r1395  
    10301030        }, 
    10311031        template => { 
    1032             index_templates => { 
    1033                 label   => "Index Templates", 
     1032            templates => { 
     1033                label   => "Templates", 
    10341034                order   => 100, 
    10351035                handler => sub { 
    10361036                    my ( $terms, $args ) = @_; 
    1037                     $terms->{type} = 'index'; 
     1037                    # FIXME: enumeration of types 
     1038                    $terms->{type} = ['index', 'individual', 'page', 'category', 'archive']; 
    10381039                }, 
    10391040                condition => sub { 
  • branches/release-30/lib/MT/CMS/Template.pm

    r1392 r1395  
    443443        return $app->return_to_dashboard( permission => 1 ); 
    444444    } 
     445    my $blog = $app->blog; 
    445446 
    446447    require MT::Template; 
     
    448449    my $filter  = $app->param('filter_key'); 
    449450    if ( !$filter ) { 
    450         if ($app->blog) { 
    451             $filter = 'index_templates'; 
    452             $app->param( 'filter_key', 'index_templates' ); 
     451        if ($blog) { 
     452            $filter = 'templates'; 
     453            $app->param( 'filter_key', 'templates' ); 
    453454        } 
    454455        else { 
     
    459460    else { 
    460461        # global index templates redirect to module templates 
    461         if ( !$app->blog && $filter eq 'index_templates' ) { 
     462        if ( !$blog && $filter eq 'templates' ) { 
    462463            $filter = 'module_templates'; 
    463464            $app->param( 'filter_key', 'module_templates' ); 
     
    473474        if ( $type =~ m/^(individual|page|category|archive)$/ ) { 
    474475            $template_type = 'archive'; 
     476            # populate context with templatemap loop 
     477            my $tblog = $obj->blog_id == $blog->id ? $blog : MT::Blog->load( $obj->blog_id ); 
     478            if ($tblog) { 
     479                $row->{archive_types} = _populate_archive_loop( $app, $tblog, $obj ); 
     480            } 
    475481        } 
    476482        elsif ( $type eq 'widget' ) { 
     
    507513    $params->{template_type}       = $template_type; 
    508514    $params->{template_type_label} = $template_type_label; 
    509  
    510     #@tt_loop = sort { $a->{label} cmp $b->{label} } @tt_loop; 
    511     #$params->{template_type_loop} = \@tt_loop; 
    512515 
    513516    $app->load_list_actions( 'template', $params );