| 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); |