// delete confirm message when updating module configuration

This commit is contained in:
vChabot
2012-05-09 08:29:07 +00:00
parent f887b7546d
commit 67c108ddd3
13 changed files with 29 additions and 22 deletions
@@ -57,6 +57,7 @@ class Blockreinsurance extends Module
return Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'reinsurance` (
`id_contactinfos` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_shop` int(10) unsigned NOT NULL ,
`filename` VARCHAR(100) NOT NULL,
`text` VARCHAR(300) NOT NULL,
PRIMARY KEY (`id_contactinfos`)
@@ -123,13 +124,14 @@ class Blockreinsurance extends Module
public function getContent()
{
// If we try to update the settings
$output = '';
if (isset($_POST['submitModule']))
{
Configuration::updateValue('blockreinsurance_nbblocks', ((isset($_POST['nbblocks']) && $_POST['nbblocks'] != '') ? (int)$_POST['nbblocks'] : ''));
if ($this->removeFromDB() && $this->addToDB())
echo '<div class="conf confirm"><img src="../img/admin/ok.gif"/>'.$this->l('Configuration updated').'</div>';
$output = '<div class="conf confirm">'.$this->l('Configuration updated').'</div>';
else
echo '<div class="conf error"><img src="../img/admin/disabled.gif"/>'.$this->l('An error occurred during the save').'</div>';
$output = '<div class="conf error"><img src="../img/admin/disabled.gif"/>'.$this->l('An error occurred during the save').'</div>';
}
$nb_blocks = Configuration::get('blockreinsurance_nbblocks');
@@ -161,6 +163,7 @@ class Blockreinsurance extends Module
});
</script>
<h2>'.$this->displayName.'</h2>
'.$output.'
<form method="post" action="'.Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']).'" enctype="multipart/form-data">
<fieldset class="width2">
<select name="nbblocks">';