// Performance optimizations

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16024 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-06-14 14:11:11 +00:00
parent 3e46c466a8
commit b2b29c4270
14 changed files with 98 additions and 93 deletions
+43 -43
View File
@@ -45,49 +45,6 @@ class Blockreinsurance extends Module
$this->displayName = $this->l('Bloc reinsurance');
$this->description = $this->l('Add a block to display more infos to reassure your customers');
$this->fields_list = array(
'id_reinsurance' => array(
'title' => $this->l('Id'),
'width' => 120,
'type' => 'text',
),
'text' => array(
'title' => $this->l('Text'),
'width' => 140,
'type' => 'text',
'filter_key' => 'a!lastname'
),
);
if (Shop::isFeatureActive())
$this->fields_list['id_shop'] = array('title' => $this->l('ID Shop'), 'align' => 'center', 'width' => 25, 'type' => 'int');
$this->fields_form[0]['form'] = array(
'legend' => array(
'title' => $this->l('Reinsurance new block'),
),
'input' => array(
array(
'type' => 'file',
'label' => $this->l('Image:'),
'name' => 'image',
'value' => true
),
array(
'type' => 'textarea',
'label' => $this->l('Text:'),
'lang' => true,
'name' => 'text',
'cols' => 40,
'rows' => 10
)
),
'submit' => array(
'title' => $this->l(' Save '),
'class' => 'button'
)
);
}
public function install()
@@ -254,6 +211,32 @@ class Blockreinsurance extends Module
{
$default_lang = (int)Configuration::get('PS_LANG_DEFAULT');
$this->fields_form[0]['form'] = array(
'legend' => array(
'title' => $this->l('Reinsurance new block'),
),
'input' => array(
array(
'type' => 'file',
'label' => $this->l('Image:'),
'name' => 'image',
'value' => true
),
array(
'type' => 'textarea',
'label' => $this->l('Text:'),
'lang' => true,
'name' => 'text',
'cols' => 40,
'rows' => 10
)
),
'submit' => array(
'title' => $this->l(' Save '),
'class' => 'button'
)
);
$helper = new HelperForm();
$helper->module = $this;
$helper->name_controller = 'blockreinsurance';
@@ -290,6 +273,23 @@ class Blockreinsurance extends Module
protected function initList()
{
$this->fields_list = array(
'id_reinsurance' => array(
'title' => $this->l('Id'),
'width' => 120,
'type' => 'text',
),
'text' => array(
'title' => $this->l('Text'),
'width' => 140,
'type' => 'text',
'filter_key' => 'a!lastname'
),
);
if (Shop::isFeatureActive())
$this->fields_list['id_shop'] = array('title' => $this->l('ID Shop'), 'align' => 'center', 'width' => 25, 'type' => 'int');
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
@@ -96,6 +96,9 @@ class FavoriteProduct extends ObjectModel
public static function isCustomerFavoriteProduct($id_customer, $id_product, Shop $shop = null)
{
if (!$id_customer)
return false;
if (!$shop)
$shop = Context::getContext()->shop;