Skip to content

Commit

Permalink
Merge pull request #49 from okom3pom/okom3pom-good-wording
Browse files Browse the repository at this point in the history
ps_mainmenu edit link get insert link dialog
  • Loading branch information
atomiix authored Jul 7, 2021
2 parents 85e6a1b + 4724361 commit 24beaa3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ps_mainmenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function install($delete_params = true)
if ($delete_params) {
if ($this->uninstallPrestaShop16Module()) {
Configuration::deleteByName('MOD_BLOCKTOPMENU_SEARCH');

return true;
}
if (!$this->installDb() || !Configuration::updateGlobalValue('MOD_BLOCKTOPMENU_ITEMS', 'CAT3,CAT6,CAT9')) {
Expand Down Expand Up @@ -184,12 +185,13 @@ public function uninstallPrestaShop16Module()
if ($oldModule) {
// This closure calls the parent class to prevent data to be erased
// It allows the new module to be configured without migration
$parentUninstallClosure = function() {
$parentUninstallClosure = function () {
return parent::uninstall();
};
$parentUninstallClosure = $parentUninstallClosure->bindTo($oldModule, get_class($oldModule));
$parentUninstallClosure();
}

return true;
}

Expand Down Expand Up @@ -1127,7 +1129,7 @@ public function renderAddForm()
$fields_form = [
'form' => [
'legend' => [
'title' => (Tools::getIsset('updatelinksmenutop') && Tools::getValue('updatelinksmenutop')) ?
'title' => Tools::getValue('id_linksmenutop') && !Tools::isSubmit('updatelink') ?
$this->trans('Update link', [], 'Modules.Mainmenu.Admin') : $this->trans('Add a new link', [], 'Modules.Mainmenu.Admin'),
'icon' => 'icon-link',
],
Expand Down Expand Up @@ -1180,7 +1182,7 @@ public function renderAddForm()
$helper->identifier = $this->identifier;
$helper->fields_value = $this->getAddLinkFieldsValues();

if (Tools::getIsset('updatelinksmenutop') && Tools::getValue('updatelinksmenutop')) {
if (Tools::getValue('id_linksmenutop') && !Tools::isSubmit('updatelink')) {
$fields_form['form']['submit'] = [
'name' => 'updatelinksmenutop',
'title' => $this->trans('Update', [], 'Admin.Actions'),
Expand Down

0 comments on commit 24beaa3

Please sign in to comment.