+sub setup_amtemplates_display_form_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Edit'),
+ submit => [ '#form', { action => 'edit_template' } ],
+ accesskey => 'enter',
+ only_if => $params{mode} eq 'show',
+ disabled => !$params{template_selected} ? t8('No template has been selected yet.') : undef,
+ ],
+
+ action => [
+ t8('Save'),
+ submit => [ '#form', { action => 'save_template' } ],
+ accesskey => 'enter',
+ only_if => $params{mode} eq 'edit',
+ ],
+
+ action => [
+ t8('Abort'),
+ call => [ 'kivi.history_back' ],
+ only_if => $params{mode} eq 'edit',
+ ],
+ );
+ }
+}
+