Changeset 1778 for branches/release-33/lib/MT/CMS/Blog.pm
- Timestamp:
- 04/05/08 01:31:43 (20 months ago)
- Files:
-
- 1 modified
-
branches/release-33/lib/MT/CMS/Blog.pm (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-33/lib/MT/CMS/Blog.pm
r1776 r1778 531 531 } 532 532 } 533 $app->run_callbacks('post_build'); 533 534 $app->call_return; 534 535 } … … 541 542 require MT::Blog; 542 543 my $q = $app->param; 543 my $blog_id = $q->param('blog_id'); 544 my $start_time = $q->param('start_time'); 545 546 if ( ! $start_time ) { 547 # start of build; invoke callback 548 $app->run_callbacks('pre_build'); 549 $start_time = time; 550 } 551 552 my $blog_id = int($q->param('blog_id')); 553 return $app->errtrans("Invalid request.") unless $blog_id; 554 544 555 my $blog = MT::Blog->load($blog_id); 545 556 my $order = $q->param('type'); … … 550 561 my $archiver = $app->publisher->archiver($type); 551 562 my $archive_label = $archiver ? $archiver->archive_label : ''; 563 552 564 $archive_label = $app->translate($type) unless $archive_label; 553 565 $archive_label = $archive_label->() if ( ref $archive_label ) eq 'CODE'; … … 556 568 my $offset = 0; 557 569 my ($total) = $q->param('total'); 558 559 ## Tells MT::_rebuild_entry_archive_type to cache loaded templates so560 ## that each template is only loaded once.561 $app->{cache_templates} = 1;562 570 563 571 my ($tmpl_saved); … … 774 782 offset => $offset, 775 783 complete => $complete, 784 start_time => $start_time, 776 785 incomplete => 100 - $complete, 777 786 entry_id => scalar $q->param('entry_id'), … … 783 792 } 784 793 else { 794 $app->run_callbacks( 'post_build' ); 785 795 if ( $q->param('entry_id') ) { 786 796 require MT::Entry; … … 809 819 } 810 820 my %param = ( 811 all => $all, 812 type => $archive_label, 813 is_one_index => $is_one_index, 814 is_entry => $is_entry, 815 archives => $type ne 'index', 821 all => $all, 822 type => $archive_label, 823 is_one_index => $is_one_index, 824 is_entry => $is_entry, 825 archives => $type ne 'index', 826 start_timestamp => MT::Util::epoch2ts($blog, $start_time), 827 total_time => time - $start_time, 816 828 ); 817 829 if ($is_one_index) { … … 838 850 } 839 851 else { # popup--just go to cnfrmn. page 840 $app->run_callbacks( 'rebuild', $blog );841 852 return $app->load_tmpl( 'popup/rebuilt.tmpl', \%param ); 842 853 } … … 854 865 my $app = shift; 855 866 my $q = $app->param; 867 my $start_time = $q->param('start_time'); 868 869 if ( ! $start_time ) { 870 # start of build; invoke callback 871 $app->run_callbacks('pre_build'); 872 $start_time = time; 873 } 874 856 875 my $type = $q->param('type'); 857 876 my $next = $q->param('next') || 0; … … 906 925 build_next => $next, 907 926 total => $total, 927 start_time => $start_time, 908 928 complete => 0, 909 929 incomplete => 100,
