| 645 | | publish_index_templates => { |
|---|
| 646 | | label => "Publish Template(s)", |
|---|
| 647 | | code => "${pkg}Template::publish_index_templates", |
|---|
| 648 | | permission => 'rebuild', |
|---|
| 649 | | condition => sub { |
|---|
| 650 | | my $app = MT->app; |
|---|
| 651 | | my $tmpl_type = $app->param('filter_key'); |
|---|
| 652 | | return $app->mode eq 'itemset_action' ? 1 |
|---|
| 653 | | : !$app->blog ? 0 |
|---|
| 654 | | : !$tmpl_type ? 0 |
|---|
| 655 | | : $tmpl_type eq 'index_templates' ? 1 |
|---|
| 656 | | : 0 |
|---|
| 657 | | ; |
|---|
| 658 | | }, |
|---|
| 659 | | order => 200, |
|---|
| 660 | | }, |
|---|
| 661 | | publish_archive_templates => { |
|---|
| 662 | | label => "Publish Template(s)", |
|---|
| 663 | | code => "${pkg}Template::publish_archive_templates", |
|---|
| 664 | | permission => 'rebuild', |
|---|
| 665 | | condition => sub { |
|---|
| 666 | | my $app = MT->app; |
|---|
| 667 | | my $tmpl_type = $app->param('filter_key'); |
|---|
| 668 | | return $app->mode eq 'itemset_action' ? 1 |
|---|
| 669 | | : !$app->blog ? 0 |
|---|
| 670 | | : !$tmpl_type ? 0 |
|---|
| 671 | | : $tmpl_type eq 'archive_templates' ? 1 |
|---|
| 672 | | : 0; |
|---|
| 673 | | }, |
|---|
| 674 | | order => 300, |
|---|
| 675 | | }, |
|---|
| | 645 | # Now a button! |
|---|
| | 646 | # publish_index_templates => { |
|---|
| | 647 | # label => "Publish Template(s)", |
|---|
| | 648 | # code => "${pkg}Template::publish_index_templates", |
|---|
| | 649 | # permission => 'rebuild', |
|---|
| | 650 | # condition => sub { |
|---|
| | 651 | # my $app = MT->app; |
|---|
| | 652 | # my $tmpl_type = $app->param('filter_key'); |
|---|
| | 653 | # return $app->mode eq 'itemset_action' ? 1 |
|---|
| | 654 | # : !$app->blog ? 0 |
|---|
| | 655 | # : !$tmpl_type ? 0 |
|---|
| | 656 | # : $tmpl_type eq 'index_templates' ? 1 |
|---|
| | 657 | # : 0 |
|---|
| | 658 | # ; |
|---|
| | 659 | # }, |
|---|
| | 660 | # order => 200, |
|---|
| | 661 | # }, |
|---|
| | 662 | # Now a button! |
|---|
| | 663 | # publish_archive_templates => { |
|---|
| | 664 | # label => "Publish Template(s)", |
|---|
| | 665 | # code => "${pkg}Template::publish_archive_templates", |
|---|
| | 666 | # permission => 'rebuild', |
|---|
| | 667 | # condition => sub { |
|---|
| | 668 | # my $app = MT->app; |
|---|
| | 669 | # my $tmpl_type = $app->param('filter_key'); |
|---|
| | 670 | # return $app->mode eq 'itemset_action' ? 1 |
|---|
| | 671 | # : !$app->blog ? 0 |
|---|
| | 672 | # : !$tmpl_type ? 0 |
|---|
| | 673 | # : $tmpl_type eq 'archive_templates' ? 1 |
|---|
| | 674 | # : 0; |
|---|
| | 675 | # }, |
|---|
| | 676 | # order => 300, |
|---|
| | 677 | # }, |
|---|