[-] FO : BugFix : #PSCFV-2099 : Block reinsurance doesn't appear in front office (style was not loaded + install fixtures)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15034 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2012-05-03 09:37:42 +00:00
parent effe71e913
commit f9892ed7cd
2 changed files with 31 additions and 5 deletions
+26 -5
View File
@@ -47,7 +47,9 @@ class Blockreinsurance extends Module
public function install()
{
return (parent::install() && $this->installDB() && Configuration::updateValue('blockreinsurance_nbblocks', 5) && $this->registerHook('footer'));
$return = (parent::install() && $this->installDB() && Configuration::updateValue('blockreinsurance_nbblocks', 5) && $this->registerHook('footer'));
$return &= $this->installFixtures();
return $return;
}
public function installDB()
@@ -188,15 +190,34 @@ class Blockreinsurance extends Module
public function hookFooter($params)
{
global $smarty;
$infos = $this->getAllFromDB();
global $smarty;
$this->context->controller->addCSS($this->_path.'style.css', 'all');
$infos = $this->getAllFromDB();
$smarty->assign(array(
'nbblocks' => Configuration::get('blockreinsurance_nbblocks'),
'infos' => $infos
));
return $this->display(__FILE__, 'blockreinsurance.tpl');
}
public function installFixtures()
{
$nb_blocks = Configuration::get('blockreinsurance_nbblocks');
$tab_texts = array(
$this->l('Money back'),
$this->l('Exchange in-store'),
$this->l('Payment for shipping'),
$this->l('Free Shipping'),
$this->l('100% secured payment'),
);
$success = true;
for ($a = 1; $a <= $nb_blocks; $a++)
$success &= Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'reinsurance` (`filename`, `text`)
VALUES ("reassurance'.$a.'", "'.$tab_texts[($a-1)].'")');
return $success;
}
}
?>
@@ -11,3 +11,8 @@ $_MODULE['<{blockreinsurance}prestashop>blockreinsurance_0845a5f7fbe242ef2472a78
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_0dbf96dfb0a180d634c89bff8b258fba'] = 'Image pour ce bloc';
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_b7be073d3d2f885cc9ab4e5cb69a57d1'] = 'Texte alternatif pour ce bloc';
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour la configuration';
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_212ec5c1ad6e7811c9ceca38b29f0aff'] = 'Satisfait ou remboursé';
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_488ec823efaa6f1a629d149ecc0eacf9'] = 'Echange en magasin';
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_a21370d82da7f44320dd7f6177abab19'] = 'Paiement à l\'expédition';
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_b00b85425e74ed2c85dc3119b78ff2c3'] = 'Livraison gratuite';
$_MODULE['<{blockreinsurance}prestashop>blockreinsurance_1bb4719012d79b9dba021844dd57f116'] = 'Paiement 100% sécurisé';