Show
Ignore:
Timestamp:
06/04/08 03:57:17 (18 months ago)
Author:
fumiakiy
Message:

Show Save&Rebuild button when template has a static map even if the profile is set to dynamic. BugId:80014

Files:
1 modified

Legend:

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

    r2502 r2504  
    113113        $param->{published_url} = $published_url if $published_url; 
    114114        $param->{saved_rebuild} = 1 if $q->param('saved_rebuild'); 
     115        $param->{static_maps} = $obj->build_type == MT::PublishOption::DYNAMIC() ? 0 : 1; 
    115116 
    116117        my $filter = $app->param('filter_key'); 
     
    297298                $param->{object_loop} = $param->{template_map_loop} = $maps 
    298299                  if @$maps; 
    299                 my %archive_types = map { $_->{archive_label} => 1 } @$maps; 
    300                 $param->{enabled_archive_types} = join(", ", sort keys %archive_types); 
     300                my %at; 
     301                my $build_type = MT::PublishOption::DYNAMIC(); 
     302                my $build_type_0 = 0; 
     303                foreach my $map ( @$maps ) { 
     304                    $at{ $map->{archive_label} } = 1; 
     305                    $build_type_0 = $map->{map_build_type}; 
     306                    $build_type = $map->{map_build_type} 
     307                        if MT::PublishOption::DYNAMIC() ne $map->{map_build_type}; 
     308                } 
     309                $param->{enabled_archive_types} = join(", ", sort keys %at); 
     310                $param->{static_maps} = $build_type == MT::PublishOption::DYNAMIC() ? 0 : 1; 
     311                $param->{build_type_0} = 1 unless $build_type_0; 
    301312            } 
    302313        }