Add 'Save and stay' button on missing pages at back office

This commit is contained in:
Abhishek Kumar
2024-01-16 17:09:13 +05:30
parent 1f9b7098e6
commit 87e45007bf
24 changed files with 299 additions and 32 deletions

View File

@@ -105,7 +105,19 @@ class AdminCmsCategoriesControllerCore extends AdminController
$object = parent::postProcess();
$this->updateAssoShop((int)Tools::getValue('id_cms_category'));
if ($object !== false) {
Tools::redirectAdmin(self::$currentIndex.'&conf=3&id_cms_category='.(int)$object->id.'&token='.Tools::getValue('token'));
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) {
if ($this->id_object) {
Tools::redirectAdmin(self::$currentIndex.'&update'.$this->table.'&conf=4&id_cms_category='.(int)$object->id.'&token='.Tools::getValue('token'));
} else {
Tools::redirectAdmin(self::$currentIndex.'&update'.$this->table.'&conf=3&id_cms_category='.(int)$object->id.'&token='.Tools::getValue('token'));
}
} else {
if ($this->id_object) {
Tools::redirectAdmin(self::$currentIndex.'&conf=4&id_cms_category='.(int)$object->id.'&token='.Tools::getValue('token'));
} else {
Tools::redirectAdmin(self::$currentIndex.'&conf=3&id_cms_category='.(int)$object->id.'&token='.Tools::getValue('token'));
}
}
}
return $object;
}
@@ -289,7 +301,16 @@ class AdminCmsCategoriesControllerCore extends AdminController
),
'submit' => array(
'title' => $this->l('Save'),
)
),
'buttons' => array(
'save-and-stay' => array(
'title' => $this->l('Save and stay'),
'name' => 'submitAdd'.$this->table.'AndStay',
'type' => 'submit',
'class' => 'btn btn-default pull-right',
'icon' => 'process-icon-save',
),
),
);
if (Shop::isFeatureActive()) {