Changeset 2502
- Timestamp:
- 06/04/08 02:10:09 (6 months ago)
- Files:
-
- branches/release-39/lib/MT/CMS/Common.pm (modified) (1 diff)
- branches/release-39/lib/MT/CMS/Template.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-39/lib/MT/CMS/Common.pm
r2406 r2502 366 366 || $obj->type eq 'individual' ) 367 367 { 368 my $static_maps = delete $app->{static_dynamic_maps}; 368 369 require MT::TemplateMap; 369 my @maps = MT::TemplateMap->load( 370 { 371 template_id => $obj->id, 372 build_type => MT::PublishOption::DYNAMIC() 373 } 374 ); 375 my @ats = map { $_->archive_type } @maps; 376 if ($#ats >= 0) { 377 $q->param( 'type', join( ',', @ats ) ); 378 $q->param( 'with_indexes', 1 ); 379 $q->param( 'no_static', 1 ); 380 $q->param( 'template_id', $obj->id ); 381 $q->param( 'single_template', 1 ); 382 require MT::CMS::Blog; 383 return MT::CMS::Blog::start_rebuild_pages($app); 370 my $terms = {}; 371 if ( $static_maps && @$static_maps ) { 372 $terms->{id} = $static_maps; 373 } 374 else { 375 # all existing maps have been dynamic 376 # do nothing 377 } 378 if ( %$terms ) { 379 my @maps = MT::TemplateMap->load($terms); 380 my @ats = map { $_->archive_type } @maps; 381 if ($#ats >= 0) { 382 $q->param( 'type', join( ',', @ats ) ); 383 $q->param( 'with_indexes', 1 ); 384 $q->param( 'no_static', 1 ); 385 $q->param( 'template_id', $obj->id ); 386 $q->param( 'single_template', 1 ); 387 require MT::CMS::Blog; 388 return MT::CMS::Blog::start_rebuild_pages($app); 389 } 384 390 } 385 391 } branches/release-39/lib/MT/CMS/Template.pm
r2491 r2502 1397 1397 require MT::TemplateMap; 1398 1398 my @p = $q->param; 1399 my @static_maps; 1399 1400 for my $p (@p) { 1400 1401 my $map; … … 1419 1420 my $build_type = $q->param($p); 1420 1421 require MT::PublishOption; 1422 # Populate maps that are changed from static to dynamic 1423 # This should capture new map as well 1424 push @static_maps, $map->id 1425 if ( ( $build_type ne $map->build_type ) 1426 && ( MT::PublishOption::DYNAMIC() eq $build_type ) ); 1421 1427 $map->build_type($build_type); 1422 1428 if ( $build_type == MT::PublishOption::SCHEDULED() ) { … … 1434 1440 } 1435 1441 } 1442 $app->{static_dynamic_maps} = @static_maps ? \@static_maps : 0; 1436 1443 } 1437 1444
