Changeset 680
- Timestamp:
- 09/09/06 15:28:59 (2 years ago)
- Files:
-
- branches/wheeljack/lib/MT/App/CMS.pm (modified) (10 diffs)
- branches/wheeljack/tmpl/cms/rebuild_confirm.tmpl (modified) (1 diff)
- branches/wheeljack/tmpl/cms/rebuilding.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/wheeljack/lib/MT/App/CMS.pm
r671 r680 7593 7593 my $order = join ',', @at, 'index'; 7594 7594 require MT::Entry; 7595 my $total = MT::Entry->count({ blog_id => $blog_id, status => MT::Entry::RELEASE() }); 7595 my $total_entries = MT::Entry->count({ blog_id => $blog_id, status => MT::Entry::RELEASE() }); 7596 require MT::Category; 7597 my $total_cats = MT::Category->count({ blog_id => $blog_id }); 7596 7598 my %param = ( archive_type_loop => \@data, 7597 7599 build_order => $order, 7598 7600 build_next => 0, 7599 total_entries => $total ); 7601 total_cats => $total_cats, 7602 total_entries => $total_entries ); 7600 7603 $param{index_selected} = ($app->param('prompt')||"") eq 'index'; 7601 7604 if (my $tmpl_id = $app->param('tmpl_id')) { … … 7630 7633 my $type_name = $order[$next]; 7631 7634 my $total_entries = $q->param('total_entries'); 7635 my $total_cats = $q->param('total_cats'); 7632 7636 my %param = ( build_type => $type, 7633 7637 build_next => $next, 7634 7638 total_entries => $total_entries, 7639 total_cats => $total_cats, 7635 7640 build_type_name => $app->translate($type_name) ); 7636 7641 my $static_count; … … 7643 7648 $param{dynamic} = 1; 7644 7649 } else { 7650 my $total = $type_name eq 'Category' ? $total_cats : $total_entries; 7645 7651 $param{limit} = int($entries_per_rebuild * $mult / $static_count); 7646 7652 $param{is_individual} = 1; 7647 7653 $param{limit} = $entries_per_rebuild * $mult; 7648 7654 $param{indiv_range} = "1 - " . 7649 ($param{limit} > $total _entries ? $total_entries: $param{limit});7655 ($param{limit} > $total ? $total : $param{limit}); 7650 7656 } 7651 7657 } elsif ($type_name =~ /^index-(\d+)$/) { … … 7702 7708 7703 7709 my $total_entries = $q->param('total_entries'); 7710 my $total_cats = $q->param('total_cats'); 7711 my $total = $type eq 'Category' ? $total_cats : $total_entries; 7704 7712 7705 7713 ## Tells MT::_rebuild_entry_archive_type to cache loaded templates so … … 7755 7763 unless $perms->can_rebuild; 7756 7764 $offset = $q->param('offset') || 0; 7757 my $total_cats = MT::Category->count({blog_id => $blog_id});7758 7765 if ($offset < $total_cats) { 7759 7766 $app->rebuild( BlogID => $blog_id, … … 7765 7772 $offset += $limit; 7766 7773 } 7767 if ($offset < $total _cats) {7774 if ($offset < $total) { 7768 7775 $done-- if $done; 7769 7776 $next--; … … 7775 7782 unless $perms->can_rebuild; 7776 7783 $offset = $q->param('offset') || 0; 7777 if ($offset < $total _entries) {7784 if ($offset < $total) { 7778 7785 $app->rebuild( BlogID => $blog_id, 7779 7786 ArchiveType => $type, … … 7784 7791 $offset += $limit; 7785 7792 } 7786 if ($offset < $total _entries) {7793 if ($offset < $total) { 7787 7794 $done-- if $done; 7788 7795 $next--; … … 7837 7844 build_type_name => $app->translate($type_name), 7838 7845 total_entries => $total_entries, 7846 total_cats => $total_cats, 7839 7847 offset => $offset, limit => $limit, 7840 7848 is_bm => scalar $q->param('is_bm'), … … 7847 7855 $param{is_individual} = 1; 7848 7856 $param{indiv_range} = sprintf "%d - %d", $offset+1, 7849 $offset + $limit > $total _entries ? $total_entries:7857 $offset + $limit > $total ? $total : 7850 7858 $offset + $limit; 7851 7859 } branches/wheeljack/tmpl/cms/rebuild_confirm.tmpl
r2 r680 6 6 <input type="hidden" name="next" value="<TMPL_VAR NAME=BUILD_NEXT>" /> 7 7 <input type="hidden" name="total_entries" value="<TMPL_VAR NAME=TOTAL_ENTRIES>" /> 8 <input type="hidden" name="total_cats" value="<TMPL_VAR NAME=TOTAL_CATS>" /> 8 9 9 10 <h2><span class="weblog-title-highlight"><TMPL_VAR NAME=BLOG_NAME ESCAPE=HTML>:</span> <MT_TRANS phrase="Rebuild"></h2> branches/wheeljack/tmpl/cms/rebuilding.tmpl
r2 r680 11 11 window.location='<TMPL_VAR NAME=REDIRECT_TARGET>'; 12 12 <TMPL_ELSE> 13 window.location='<TMPL_VAR NAME=SCRIPT_URL>?__mode=rebuild&blog_id=<TMPL_VAR NAME=BLOG_ID>&type=<TMPL_VAR NAME=BUILD_TYPE>&next=<TMPL_VAR NAME=BUILD_NEXT>&offset=<TMPL_VAR NAME=OFFSET>&limit=<TMPL_VAR NAME=LIMIT>&total_ entries=<TMPL_VAR NAME=TOTAL_ENTRIES>&is_bm=<TMPL_VAR NAME=IS_BM>&entry_id=<TMPL_VAR NAME=ENTRY_ID>&is_new=<TMPL_VAR NAME=IS_NEW>&old_status=<TMPL_VAR NAME=OLD_STATUS>&old_previous=<TMPL_VAR NAME=OLD_PREVIOUS>&old_next=<TMPL_VAR NAME=OLD_NEXT><TMPL_IF NAME=IS_FULL_SCREEN>&fs=1</TMPL_IF>';13 window.location='<TMPL_VAR NAME=SCRIPT_URL>?__mode=rebuild&blog_id=<TMPL_VAR NAME=BLOG_ID>&type=<TMPL_VAR NAME=BUILD_TYPE>&next=<TMPL_VAR NAME=BUILD_NEXT>&offset=<TMPL_VAR NAME=OFFSET>&limit=<TMPL_VAR NAME=LIMIT>&total_cats=<TMPL_VAR NAME=TOTAL_CATS>&total_entries=<TMPL_VAR NAME=TOTAL_ENTRIES>&is_bm=<TMPL_VAR NAME=IS_BM>&entry_id=<TMPL_VAR NAME=ENTRY_ID>&is_new=<TMPL_VAR NAME=IS_NEW>&old_status=<TMPL_VAR NAME=OLD_STATUS>&old_previous=<TMPL_VAR NAME=OLD_PREVIOUS>&old_next=<TMPL_VAR NAME=OLD_NEXT><TMPL_IF NAME=IS_FULL_SCREEN>&fs=1</TMPL_IF>'; 14 14 </TMPL_IF> 15 15 }
