diff --git a/src/Template/Element/form.ctp b/src/Template/Element/form.ctp index 4431aa50..4ffc9a13 100644 --- a/src/Template/Element/form.ctp +++ b/src/Template/Element/form.ctp @@ -19,22 +19,7 @@
-
- Form->button(__d('crud', 'Save'), ['class' => 'btn btn-primary', 'name' => '_save']); - if (empty($disableExtraButtons)) { - if (!in_array('save_and_continue', $extraButtonsBlacklist)) { - echo $this->Form->button(__d('crud', 'Save & continue editing'), ['class' => 'btn btn-success btn-save-continue', 'name' => '_edit', 'value' => true]); - } - if (!in_array('save_and_create', $extraButtonsBlacklist)) { - echo $this->Form->button(__d('crud', 'Save & create new'), ['class' => 'btn btn-success', 'name' => '_add', 'value' => true]); - } - if (!in_array('back', $extraButtonsBlacklist)) { - echo $this->Html->link(__d('crud', 'Back'), ['action' => 'index'], ['class' => 'btn btn-default', 'role' => 'button', 'value' => true]); - } - } - ?> -
+ element('form/buttons') ?>
diff --git a/src/Template/Element/form/buttons.ctp b/src/Template/Element/form/buttons.ctp new file mode 100644 index 00000000..3626192b --- /dev/null +++ b/src/Template/Element/form/buttons.ctp @@ -0,0 +1,16 @@ +
+ Form->button(__d('crud', 'Save'), ['class' => 'btn btn-primary', 'name' => '_save']); + if (empty($disableExtraButtons)) { + if (!in_array('save_and_continue', $extraButtonsBlacklist)) { + echo $this->Form->button(__d('crud', 'Save & continue editing'), ['class' => 'btn btn-success btn-save-continue', 'name' => '_edit', 'value' => true]); + } + if (!in_array('save_and_create', $extraButtonsBlacklist)) { + echo $this->Form->button(__d('crud', 'Save & create new'), ['class' => 'btn btn-success', 'name' => '_add', 'value' => true]); + } + if (!in_array('back', $extraButtonsBlacklist)) { + echo $this->Html->link(__d('crud', 'Back'), ['action' => 'index'], ['class' => 'btn btn-default', 'role' => 'button', 'value' => true]); + } + } + ?> +