Changeset 2504

Show
Ignore:
Timestamp:
06/04/08 03:57:17 (17 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

Location:
branches/release-39
Files:
3 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        } 
  • branches/release-39/lib/MT/WeblogPublisher.pm

    r2445 r2504  
    988988    # 404 will be triggered. 
    989989    require MT::PublishOption; 
    990     if ( $tmpl->build_dynamic 
    991       || ( $map->build_type == MT::PublishOption::DYNAMIC() ) ) 
     990    if ( $map->build_type == MT::PublishOption::DYNAMIC() )  
    992991    { 
    993992        rename( 
     
    10031002    } 
    10041003 
    1005     return 1 if ( $tmpl->build_dynamic ) 
    1006         || ( $map->build_type == MT::PublishOption::DYNAMIC() ); 
     1004    return 1 if ( $map->build_type == MT::PublishOption::DYNAMIC() ); 
    10071005    return 1 if ( $entry && $entry->status != MT::Entry::RELEASE() ); 
    1008     return 1 unless ( $tmpl->build_type ); 
     1006    return 1 unless ( $map->build_type ); 
    10091007 
    10101008    my $timer = MT->get_timer; 
  • branches/release-39/tmpl/cms/edit_template.tmpl

    r2407 r2504  
    161161    </mt:if> 
    162162    <mt:unless name="build_type_0"> 
    163     <mt:unless name="build_dynamic"> 
     163    <mt:if name="static_maps"> 
    164164        <mt:if name="can_rebuild"> 
    165165            <mt:if name="template_group" like="/^(archive|index)$/"> 
     
    173173            </mt:if> 
    174174        </mt:if> 
    175     </mt:unless> 
     175    </mt:if> 
    176176    </mt:unless> 
    177177    <div id="autosave-notification-<$mt:var name="bar_position" default="top"$>" class="autosave-notification"></div>