// Normalize + use $this->smarty instead of $this->context->smarty in modules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11944 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-30 14:59:57 +00:00
parent 9033c9c294
commit 58433f1881
27 changed files with 87 additions and 86 deletions
+7 -7
View File
@@ -61,23 +61,23 @@ class Feeder extends Module
$id_category = (int)(Tools::getValue('id_category'));
if (!$id_category)
{
if (isset($_SERVER['HTTP_REFERER']) AND preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) AND !strstr($_SERVER['HTTP_REFERER'], '.html'))
if (isset($_SERVER['HTTP_REFERER']) && preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) && !strstr($_SERVER['HTTP_REFERER'], '.html'))
{
if (isset($regs[2]) AND is_numeric($regs[2]))
if (isset($regs[2]) && is_numeric($regs[2]))
$id_category = (int)($regs[2]);
elseif (isset($regs[5]) AND is_numeric($regs[5]))
$id_category = (int)($regs[5]);
elseif (isset($regs[5]) && is_numeric($regs[5]))
$id_category = (int)$regs[5];
}
elseif ($id_product = (int)(Tools::getValue('id_product')))
elseif ($id_product = (int)Tools::getValue('id_product'))
{
$product = new Product($id_product);
$id_category = $product->id_category_default;
}
}
$category = new Category($id_category);
$orderBy = Tools::getProductsOrder('by', Tools::getValue('orderby'));
$orderWay = Tools::getProductsOrder('way', Tools::getValue('orderway'));
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'feedUrl' => Tools::getShopDomain(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/rss.php?id_category='.$id_category.'&orderby='.$orderBy.'&orderway='.$orderWay,
));
return $this->display(__FILE__, 'feederHeader.tpl');