From 1f1bebab8eae8f303eeeaaf62f7ca862d4fb67f2 Mon Sep 17 00:00:00 2001 From: dSevere Date: Thu, 3 Nov 2011 17:58:19 +0000 Subject: [PATCH] // #PSFV-94 : Submit button integrated to the toolbar on add/edit form view --- .../themes/template/helper/form/form.tpl | 4 ++- admin-dev/themes/template/toolbar.tpl | 33 +++++++++++++++++-- classes/AdminController.php | 10 ++++-- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/admin-dev/themes/template/helper/form/form.tpl b/admin-dev/themes/template/helper/form/form.tpl index 0fda75e53..81effb159 100644 --- a/admin-dev/themes/template/helper/form/form.tpl +++ b/admin-dev/themes/template/helper/form/form.tpl @@ -69,7 +69,7 @@ {include file="toolbar.tpl" toolbar_btn=$toolbar_btn} {/if} {if isset($fields.title)}

{$fields.title}

{/if} -
+ {if $form_id} {/if} @@ -301,6 +301,7 @@ {elseif $key == 'submit'}
@@ -320,6 +321,7 @@ {/if} + {block name="other_fieldsets"}{/block}

diff --git a/admin-dev/themes/template/toolbar.tpl b/admin-dev/themes/template/toolbar.tpl index 51346bb3e..9b89bcfa6 100644 --- a/admin-dev/themes/template/toolbar.tpl +++ b/admin-dev/themes/template/toolbar.tpl @@ -29,8 +29,9 @@
+ {/block} diff --git a/classes/AdminController.php b/classes/AdminController.php index a8c441d51..4267eb7f1 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -735,6 +735,11 @@ class AdminControllerCore extends Controller // @todo defining default buttons case 'add': case 'edit': + $this->toolbar_btn['save'] = array( + 'href' => '#', + 'desc' => $this->l('Save') + ); + break; case 'options': break; default: // list @@ -1200,7 +1205,6 @@ class AdminControllerCore extends Controller $helper->token = $this->token; $helper->specificConfirmDelete = $this->specificConfirmDelete; $helper->imageType = $this->imageType; - $helper->no_add = isset($this->no_add) ? $this->no_add : false; $helper->simple_header = isset($this->simple_header) ? $this->simple_header : false; $helper->no_link = $this->list_no_link; $helper->colorOnBackground = $this->colorOnBackground; @@ -1240,9 +1244,9 @@ class AdminControllerCore extends Controller if ($this->tabAccess['view']) { if (Tools::getValue('back')) - $this->tpl_vars['back'] = Tools::safeOutput(Tools::getValue('back')); + $helper->tpl_vars['back'] = Tools::safeOutput(Tools::getValue('back')); else - $this->tpl_vars['back'] = Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token)); + $helper->tpl_vars['back'] = Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token)); } return $helper->generateForm($this->fields_form); }