Show
Ignore:
Timestamp:
04/13/08 05:15:03 (20 months ago)
Author:
bchoate
Message:

Fixes to preserve return_args for template listing screen; display 'clear filter' link when viewing a specific template type.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-34/lib/MT/CMS/Template.pm

    r1873 r1875  
    638638        @types = ( $template_type ); 
    639639    } 
     640    $app->delete_param('filter_key') if $filter; 
    640641    foreach my $tmpl_type (@types) { 
    641         $app->delete_param('filter_key') if $filter; 
    642642        if ( $tmpl_type eq 'index' ) { 
    643             $filter = 'index_templates'; 
    644643            $app->param( 'filter_key', 'index_templates' ); 
    645644        } 
    646645        elsif ( $tmpl_type eq 'archive' ) { 
    647             $filter = 'archive_templates'; 
    648646            $app->param( 'filter_key', 'archive_templates' ); 
    649647        } 
    650648        elsif ( $tmpl_type eq 'system' ) { 
    651             $filter = 'system_templates'; 
    652649            $app->param( 'filter_key', 'system_templates' ); 
    653650        } 
    654651        elsif ( $tmpl_type eq 'email' ) { 
    655             $filter = 'email_templates'; 
    656652            $app->param( 'filter_key', 'email_templates' ); 
    657653        } 
     
    672668        $tmpl_param->{template_type_label} = $template_type_label; 
    673669        push @tmpl_loop, $tmpl_param; 
     670    } 
     671    if ($filter) { 
     672        $params->{filter_key} = $filter; 
     673        $params->{filter_label} = $types{$template_type}{label} 
     674            if exists $types{$template_type}; 
     675        $app->param('filter_key', $filter); 
     676    } else { 
     677        # restore filter_key param (we modified it for the 
     678        # sake of the individual table listings) 
     679        $app->delete_param('filter_key'); 
    674680    } 
    675681