Skip to content

Commit

Permalink
Translate: Reuse admin/buttons element
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed Mar 10, 2020
1 parent 2e8f9a0 commit a52c447
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Controller/Admin/TranslateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function edit($id = null)
'locale' => $locale,
],
];
if (isset($this->getRequest()->data['apply'])) {
if (isset($this->getRequest()->data['_apply'])) {
$redirect['action'] = 'edit';
}

Expand Down
26 changes: 9 additions & 17 deletions src/Template/Admin/Translate/edit.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,15 @@ $this->end();
$this->start('panels');
echo $this->Html->beginBox(__d('croogo', 'Publishing'));

$out =
$this->Form->button(__d('croogo', 'Apply'), [
'name' => 'apply',
'class' => 'btn-outline-primary',
]) .
$this->Form->button(__d('croogo', 'Save'), [
'class' => 'btn-outline-success',
]) .
$this->Html->link(__d('croogo', 'Cancel'), ['action' => 'index',
'?' => [
'id' => $this->getRequest()->query('id'),
'model' => urldecode($this->getRequest()->query('model')),
echo $this->element('admin/buttons', [
'cancelUrl' => [
'action' => 'index',
'?' => [
'id' => $this->getRequest()->query('id'),
'model' => urldecode($this->getRequest()->query('model')),
],
],
], [
'class' => 'cancel',
'button' => 'outline-danger'
]);
echo $this->Html->div('card-buttons d-flex justify-content-center', $out);

echo $this->Html->endBox();
$this->end();
$this->end();

0 comments on commit a52c447

Please sign in to comment.