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

@@ -358,7 +358,16 @@ class AdminThemesControllerCore 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',
),
),
);
// adding a new theme, you can create a directory, and copy from an existing theme
if ($this->display == 'add' || !Validate::isLoadedObject($this->object)) {
@@ -644,7 +653,12 @@ class AdminThemesControllerCore extends AdminController
}
$theme->update();
}
Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminThemes').'&conf=29');
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) {
Tools::redirectAdmin(self::$currentIndex.'&update'.$this->table.'&id_theme='.$theme->id.'&token='.$this->token.'&conf=4');
} else {
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=4');
}
}
}