[+] MO: Add Module->smartyAssign method, in order to assign variables with module name as prefix in module's templates
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8718 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
b24d2fa274
commit
2dbea99b61
19 files changed
+174
-155
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -51,13 +51,12 @@ class BlockManufacturer extends Module
|
||||
Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', true);
|
||||
return (parent::install() AND $this->registerHook('leftColumn') AND $this->registerHook('header'));
|
||||
}
|
||||
|
||||
|
||||
function hookLeftColumn($params)
|
||||
{
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'manufacturers' => Manufacturer::getManufacturers(),
|
||||
'link' => $this->context->link,
|
||||
'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'),
|
||||
'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'),
|
||||
'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'),
|
||||
@@ -65,12 +64,12 @@ class BlockManufacturer extends Module
|
||||
));
|
||||
return $this->display(__FILE__, 'blockmanufacturer.tpl');
|
||||
}
|
||||
|
||||
|
||||
function hookRightColumn($params)
|
||||
{
|
||||
return $this->hookLeftColumn($params);
|
||||
}
|
||||
|
||||
|
||||
function getContent()
|
||||
{
|
||||
$output = '<h2>'.$this->displayName.'</h2>';
|
||||
@@ -96,7 +95,7 @@ class BlockManufacturer extends Module
|
||||
}
|
||||
return $output.$this->displayForm();
|
||||
}
|
||||
|
||||
|
||||
public function displayForm()
|
||||
{
|
||||
$output = '
|
||||
@@ -124,9 +123,9 @@ class BlockManufacturer extends Module
|
||||
</form>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
function hookHeader($params)
|
||||
{
|
||||
$this->context->controller->addCSS(($this->_path).'blockmanufacturer.css', 'all');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user