Changeset 2115
- Timestamp:
- 04/26/08 06:54:49 (7 months ago)
- Files:
-
- branches/release-36/lib/MT/CMS/Blog.pm (modified) (3 diffs)
- branches/release-36/lib/MT/CMS/Common.pm (modified) (1 diff)
- branches/release-36/lib/MT/CMS/Template.pm (modified) (1 diff)
- branches/release-36/tmpl/cms/edit_template.tmpl (modified) (4 diffs)
- branches/release-36/tmpl/cms/rebuilding.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-36/lib/MT/CMS/Blog.pm
r2103 r2115 588 588 my $no_static = $q->param('no_static'); 589 589 my $template_id = $q->param('template_id'); 590 my $map_id = $q->param('templatemap_id'); 590 591 591 592 my ($tmpl_saved); … … 709 710 FilterCallback => $cb, 710 711 $no_static ? ( NoStatic => 1 ) : (), 711 $template_id ? ( TemplateID => $template_id ) : (), 712 $template_id ? ( TemplateID => $template_id, Force => 1 ) : (), 713 $map_id ? ( TemplateMap => $template_id, Force => 1 ) : (), 712 714 ) or return $app->publish_error(); 713 715 $offset += $count; … … 906 908 } 907 909 908 my $type = $q->param('type') ;910 my $type = $q->param('type') || ''; 909 911 my $next = $q->param('next') || 0; 910 912 my @order = split /,/, $type; branches/release-36/lib/MT/CMS/Common.pm
r2113 r2115 374 374 $app->add_return_arg( id => $obj->id ); 375 375 } 376 $q->param( 'type', 'index-' . $obj->id ); 377 $q->param( 'tmpl_id', $obj->id ); 378 $q->param( 'single_template', 1 ); 379 require MT::CMS::Blog; 380 return MT::CMS::Blog::start_rebuild_pages($app); 376 if ( $obj->type eq 'index' ) { 377 $q->param( 'type', 'index-' . $obj->id ); 378 $q->param( 'tmpl_id', $obj->id ); 379 $q->param( 'single_template', 1 ); 380 return $app->forward( 'start_rebuild' ); 381 } else { 382 # archive rebuild support 383 $q->param( 'id', $obj->id ); 384 return $app->forward( 'publish_archive_templates' ); 385 } 381 386 } 382 387 elsif ( $type eq 'template' ) { branches/release-36/lib/MT/CMS/Template.pm
r2110 r2115 1980 1980 || $perms->can_rebuild; 1981 1981 1982 my $blog = $app->blog; 1983 my $templates = 1984 MT->model('template')->lookup_multi( [ $app->param('id') ] ); 1982 my @ids = $app->param('id'); 1983 if (scalar @ids == 1) { 1984 # we also support a list of comma-delimited ids like this 1985 @ids = split /,/, $ids[0]; 1986 } 1987 return $app->error($app->translate("Invalid request.")) 1988 unless @ids; 1989 1990 my $tmpl_id; 1991 my %ats; 1985 1992 require MT::TemplateMap; 1986 # FIXME: Need multi-request support! 1987 TEMPLATE: for my $tmpl (@$templates) { 1988 next TEMPLATE if !defined $tmpl; 1989 next TEMPLATE if $tmpl->blog_id != $blog->id; 1990 my @tmpl_maps = MT::TemplateMap->load( { template_id => $tmpl->id } ); 1993 while (!$tmpl_id && @ids) { 1994 $tmpl_id = shift @ids; 1995 my @tmpl_maps = MT::TemplateMap->load( { template_id => $tmpl_id } ); 1991 1996 foreach my $map (@tmpl_maps) { 1992 1997 next unless $map->build_type; 1993 $app->rebuild( 1994 Blog => $blog, 1995 ArchiveType => $map->archive_type, 1996 TemplateMap => $map, 1997 NoIndexes => 1, 1998 Force => 1, 1999 ); 2000 } 2001 } 2002 2003 $app->call_return( published => 1 ); 1998 $ats{ $map->archive_type } = 1; 1999 } 2000 undef $tmpl_id unless keys %ats; 2001 } 2002 2003 # we have a template and archive types to publish! 2004 2005 require MT::CMS::Blog; 2006 my $return_args; 2007 if (@ids) { 2008 # we have more to do after this, so save the list 2009 # of remaining archive templates... 2010 $return_args = $app->uri_params( 2011 mode => 'publish_archive_templates', 2012 args => { 2013 magic_token => $app->current_magic, 2014 blog_id => scalar $app->param('blog_id'), 2015 id => join(",", @ids), 2016 } 2017 ); 2018 } else { 2019 # nothing left after this publish operation; just return 2020 # to the listing screen. 2021 $return_args = $app->uri_params( 2022 mode => 'list', 2023 args => { 2024 _type => 'template', 2025 blog_id => scalar $app->param('blog_id'), 2026 published => 1 2027 } 2028 ); 2029 } 2030 $return_args =~ s/^\?//; 2031 2032 $app->return_args( $return_args ); 2033 $app->param( 'template_id', $tmpl_id ); 2034 $app->param( 'single_template', 1 ); # forces fullscreen mode 2035 $app->param( 'type', join(",", keys %ats) ); 2036 return MT::CMS::Blog::start_rebuild_pages($app); 2004 2037 } 2005 2038 branches/release-36/tmpl/cms/edit_template.tmpl
r2054 r2115 154 154 type="submit" 155 155 accesskey="v" 156 tabindex="13" 156 157 title="Preview" 157 158 onclick="return validate(this.form);" … … 160 161 <mt:unless name="build_dynamic"> 161 162 <mt:if name="can_rebuild"> 162 <mt:if name="t ype_index">163 <mt:if name="template_group" like="/^(archive|index)$/"> 163 164 <button 164 165 type="submit" 165 166 accesskey="r" 166 tabindex="1 3"167 tabindex="14" 167 168 title="<__trans phrase="Save and Publish this template (r)">" 168 169 onclick="return validate(this.form, 1);" … … 564 565 help_section="output_file"> 565 566 <div class="textarea-wrapper"> 566 <input name="outfile" id="outfile" tabindex=" 5" value="<mt:var name="outfile" escape="html">" class="full-width" mt:watch-change="1" />567 <input name="outfile" id="outfile" tabindex="4" value="<mt:var name="outfile" escape="html">" class="full-width" mt:watch-change="1" /> 567 568 </div> 568 569 </mtapp:setting> … … 575 576 help_page="templates" 576 577 help_section="template_type"> 577 <select name="identifier" id="identifier" tabindex=" 4" class="full-width">578 <select name="identifier" id="identifier" tabindex="5" class="full-width"> 578 579 <option value="" <mt:unless name="identifier">selected="selected"</mt:unless>><__trans phrase="Custom Index Template"></option> 579 580 <mt:loop name="index_identifiers"> branches/release-36/tmpl/cms/rebuilding.tmpl
r2026 r2115 6 6 window.location='<mt:var name="redirect_target">'; 7 7 <mt:else> 8 window.location='<mt:var name="script_url">?__mode=rebuild&blog_id=<mt:var name="blog_id">&type=<mt:var name="build_type">&next=<mt:var name="build_next">&offset=<mt:var name="offset">&limit=<mt:var name="limit">&total=<mt:var name="total">&start_time=<mt:var name="start_time">&entry_id=<mt:var name="entry_id">&is_new=<mt:var name="is_new">&old_status=<mt:var name="old_status">&old_previous=<mt:var name="old_previous">&old_next=<mt:var name="old_next"><mt:if name="is_full_screen">&fs=1</mt:if><mt:if name="with_indexes">&with_indexes=1</mt:if><mt:if name="no_static">&no_static=1</mt:if><mt:if name="template_id">&template_id=<mt:var name="template_id"></mt:if><mt:if name=" return_args">&return_args=<mt:var name="return_args" escape="url"></mt:if>';8 window.location='<mt:var name="script_url">?__mode=rebuild&blog_id=<mt:var name="blog_id">&type=<mt:var name="build_type">&next=<mt:var name="build_next">&offset=<mt:var name="offset">&limit=<mt:var name="limit">&total=<mt:var name="total">&start_time=<mt:var name="start_time">&entry_id=<mt:var name="entry_id">&is_new=<mt:var name="is_new">&old_status=<mt:var name="old_status">&old_previous=<mt:var name="old_previous">&old_next=<mt:var name="old_next"><mt:if name="is_full_screen">&fs=1</mt:if><mt:if name="with_indexes">&with_indexes=1</mt:if><mt:if name="no_static">&no_static=1</mt:if><mt:if name="template_id">&template_id=<mt:var name="template_id"></mt:if><mt:if name="templatemap_id">&templatemap_id=<mt:var name="templatemap_id"></mt:if><mt:if name="return_args">&return_args=<mt:var name="return_args" escape="url"></mt:if>'; 9 9 </mt:if> 10 10 }
