Changeset 1395
- Timestamp:
- 02/22/08 01:28:27 (5 months ago)
- Files:
-
- branches/release-30/lib/MT/App/CMS.pm (modified) (1 diff)
- branches/release-30/lib/MT/CMS/Template.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-30/lib/MT/App/CMS.pm
r1392 r1395 1030 1030 }, 1031 1031 template => { 1032 index_templates => {1033 label => " IndexTemplates",1032 templates => { 1033 label => "Templates", 1034 1034 order => 100, 1035 1035 handler => sub { 1036 1036 my ( $terms, $args ) = @_; 1037 $terms->{type} = 'index'; 1037 # FIXME: enumeration of types 1038 $terms->{type} = ['index', 'individual', 'page', 'category', 'archive']; 1038 1039 }, 1039 1040 condition => sub { branches/release-30/lib/MT/CMS/Template.pm
r1392 r1395 443 443 return $app->return_to_dashboard( permission => 1 ); 444 444 } 445 my $blog = $app->blog; 445 446 446 447 require MT::Template; … … 448 449 my $filter = $app->param('filter_key'); 449 450 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' ); 453 454 } 454 455 else { … … 459 460 else { 460 461 # global index templates redirect to module templates 461 if ( !$ app->blog && $filter eq 'index_templates' ) {462 if ( !$blog && $filter eq 'templates' ) { 462 463 $filter = 'module_templates'; 463 464 $app->param( 'filter_key', 'module_templates' ); … … 473 474 if ( $type =~ m/^(individual|page|category|archive)$/ ) { 474 475 $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 } 475 481 } 476 482 elsif ( $type eq 'widget' ) { … … 507 513 $params->{template_type} = $template_type; 508 514 $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;512 515 513 516 $app->load_list_actions( 'template', $params );
