Merge pull request #283 from DrySs/patch-2

[*] BO: add a save and stay button in CMS edit page
This commit is contained in:
Gregory Roussac committed 2013-02-22 06:58:31 -08:00
commit 5f7e9510e9
1 file changed
+7
+7
View File
@@ -73,6 +73,11 @@ class AdminCmsControllerCore extends AdminController
'href' => '#', 'href' => '#',
'desc' => $this->l('Save and preview') 'desc' => $this->l('Save and preview')
); );
$this->toolbar_btn['save-and-stay'] = array(
'short' => 'SaveAndStay',
'href' => '#',
'desc' => $this->l('Save and stay'),
);
$this->initToolbar(); $this->initToolbar();
if (!$this->loadObject(true)) if (!$this->loadObject(true))
return; return;
@@ -325,6 +330,8 @@ class AdminCmsControllerCore extends AdminController
} }
Tools::redirectAdmin($preview_url); Tools::redirectAdmin($preview_url);
} }
elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
$this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=4&update'.$this->table.'&token='.$this->token;
else else
Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=4&token='.Tools::getAdminTokenLite('AdminCmsContent')); Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=4&token='.Tools::getAdminTokenLite('AdminCmsContent'));
} }