';
foreach ($languages as $language)
@@ -247,7 +278,7 @@ class blocktopmenu extends Module
';
-
+
$this->_html .= '
';
- echo $this->_html;
+ return $this->_html;
}
private function getMenuItems()
{
- $items = Configuration::get('MOD_BLOCKTOPMENU_ITEMS');
- $items = explode(',', $items);
- return $items;
+ if (Context::shop() == Shop::CONTEXT_SHOP)
+ {
+ if (!Configuration::isOverridenByCurrentContext('MOD_BLOCKTOPMENU_ITEMS'))
+ $items_shop = Configuration::get('MOD_BLOCKTOPMENU_ITEMS');
+ }
+ if (!isset($items_shop))
+ $items_shop = '';
+
+ $items_shop = explode(',', $items_shop);
+ $items_global = Configuration::getGlobalValue('MOD_BLOCKTOPMENU_ITEMS');
+ $items_global = explode(',', $items_global);
+
+ return array('global' => $items_global, 'shop' => $items_shop);
}
private function makeMenuOption()
{
global $cookie;
- foreach($this->getMenuItems() as $item)
+ foreach($this->getMenuItems() as $type => $items)
{
- $id = (int)substr($item, 3, strlen($item));
- switch(substr($item, 0, 3))
- {
- case'CAT':
- $this->getCategoryOption($id, $cookie->id_lang, false);
- break;
- case'PRD':
- $product = new Product($id, true, $cookie->id_lang);
- if(!is_null($product->id))
- $this->_html .= '
'.PHP_EOL;
- break;
- case'CMS':
- $cms = CMS::getLinks($cookie->id_lang, array($id));
- if(count($cms))
- $this->_html .= '
'.PHP_EOL;
- break;
- case'MAN':
- $manufacturer = new Manufacturer($id, $cookie->id_lang);
- if(!is_null($manufacturer->id))
- $this->_html .= '
'.PHP_EOL;
- break;
- case'SUP':
- $supplier = new Supplier($id, $cookie->id_lang);
- if(!is_null($supplier->id))
- $this->_html .= '
'.PHP_EOL;
- break;
- case'LNK':
- $link = MenuTopLinks::get($id, $cookie->id_lang);
- if(count($link))
- $this->_html .= '
'.PHP_EOL;
- break;
+ foreach ($items as $item)
+ {
+ $id = (int)substr($item, 3, strlen($item));
+ $disabled = ((Context::shop() == Shop::CONTEXT_SHOP && $type == 'global') ? ' disabled="disabled"': '');
+ switch(substr($item, 0, 3))
+ {
+ case'CAT':
+ $this->getCategoryOption($id, $cookie->id_lang, false);
+ break;
+ case'PRD':
+ $product = new Product($id, true, $cookie->id_lang);
+ if(!is_null($product->id))
+ $this->_html .= '
'.PHP_EOL;
+ break;
+ case'CMS':
+ $cms = CMS::getLinks($cookie->id_lang, array($id));
+ if(count($cms))
+ $this->_html .= '
'.PHP_EOL;
+ break;
+ case'MAN':
+ $manufacturer = new Manufacturer($id, $cookie->id_lang);
+ if(!is_null($manufacturer->id))
+ $this->_html .= '
'.PHP_EOL;
+ break;
+ case'SUP':
+ $supplier = new Supplier($id, $cookie->id_lang);
+ if(!is_null($supplier->id))
+ $this->_html .= '
'.PHP_EOL;
+ break;
+ case'LNK':
+ $link = MenuTopLinks::get($id, $cookie->id_lang, (int)$this->context->shop->id);
+ if(count($link))
+ $this->_html .= '
'.PHP_EOL;
+ break;
+ }
}
}
}
private function makeMenu()
{
- global $cookie, $page_name;
- foreach($this->getMenuItems() as $item)
+ global $cookie, $page_name;
+ foreach($this->getMenuItems() as $type => $items)
{
- $id = (int)substr($item, 3, strlen($item));
- switch(substr($item, 0, 3))
- {
- case'CAT':
- $this->getCategory($id, $cookie->id_lang);
- break;
- case'PRD':
- $selected = ($page_name == 'product' && (Tools::getValue('id_product') == $id)) ? ' class="sfHover"' : '';
- $product = new Product($id, true, $cookie->id_lang);
- if(!is_null($product->id))
- $this->_menu .= '
'.$product->name.''.PHP_EOL;
- break;
- case'CMS':
- $selected = ($page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : '';
- $cms = CMS::getLinks($cookie->id_lang, array($id));
- if(count($cms))
- $this->_menu .= '
'.$cms[0]['meta_title'].''.PHP_EOL;
- break;
- case'MAN':
- $selected = ($page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : '';
- $manufacturer = new Manufacturer($id, $cookie->id_lang);
- if(!is_null($manufacturer->id))
- {
- if (intval(Configuration::get('PS_REWRITING_SETTINGS')))
- $manufacturer->link_rewrite = Tools::link_rewrite($manufacturer->name, false);
- else
- $manufacturer->link_rewrite = 0;
- $link = new Link;
- $this->_menu .= '
'.$manufacturer->name.''.PHP_EOL;
- }
- break;
- case'SUP':
- $selected = ($page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
- $supplier = new Supplier($id, $cookie->id_lang);
- if(!is_null($supplier->id))
- {
- $link = new Link;
- $this->_menu .= '
'.$supplier->name.''.PHP_EOL;
- }
- break;
- case'LNK':
- $link = MenuTopLinks::get($id, $cookie->id_lang);
- if(count($link))
- $this->_menu .= '
'.$link[0]['label'].''.PHP_EOL;
- break;
- }
- }
+ foreach ($items as $item)
+ {
+ $id = (int)substr($item, 3, strlen($item));
+ switch(substr($item, 0, 3))
+ {
+ case'CAT':
+ $this->getCategory($id, $cookie->id_lang);
+ break;
+ case'PRD':
+ $selected = ($page_name == 'product' && (Tools::getValue('id_product') == $id)) ? ' class="sfHover"' : '';
+ $product = new Product($id, true, $cookie->id_lang);
+ if(!is_null($product->id))
+ $this->_menu .= '
'.$product->name.''.PHP_EOL;
+ break;
+ case'CMS':
+ $selected = ($page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : '';
+ $cms = CMS::getLinks($cookie->id_lang, array($id));
+ if(count($cms))
+ $this->_menu .= '
'.$cms[0]['meta_title'].''.PHP_EOL;
+ break;
+ case'MAN':
+ $selected = ($page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : '';
+ $manufacturer = new Manufacturer($id, $cookie->id_lang);
+ if(!is_null($manufacturer->id))
+ {
+ if (intval(Configuration::get('PS_REWRITING_SETTINGS')))
+ $manufacturer->link_rewrite = Tools::link_rewrite($manufacturer->name, false);
+ else
+ $manufacturer->link_rewrite = 0;
+ $link = new Link;
+ $this->_menu .= '
'.$manufacturer->name.''.PHP_EOL;
+ }
+ break;
+ case'SUP':
+ $selected = ($page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
+ $supplier = new Supplier($id, $cookie->id_lang);
+ if(!is_null($supplier->id))
+ {
+ $link = new Link;
+ $this->_menu .= '
'.$supplier->name.''.PHP_EOL;
+ }
+ break;
+ case'LNK':
+ $link = MenuTopLinks::get($id, $cookie->id_lang, (int)$this->context->shop->id);
+ if(count($link))
+ $this->_menu .= '
'.$link[0]['label'].''.PHP_EOL;
+ break;
+ }
+ }
+ }
}
private function getCategoryOption($id_category, $id_lang, $children = true)
@@ -440,4 +488,4 @@ class blocktopmenu extends Module
return $this->display(__FILE__, 'blocktopmenu.tpl');
}
}
-?>
\ No newline at end of file
+?>
diff --git a/modules/blocktopmenu/index.php b/modules/blocktopmenu/index.php
index 4a2aa31b2..56129df6a 100644
--- a/modules/blocktopmenu/index.php
+++ b/modules/blocktopmenu/index.php
@@ -1,4 +1,29 @@
+* @copyright 2007-2011 PrestaShop SA
+* @version Release: $Revision: 7095 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
@@ -9,4 +34,4 @@ header("Pragma: no-cache");
header("Location: ../");
exit;
-?>
\ No newline at end of file
+?>
diff --git a/modules/blocktopmenu/menutoplinks.class.php b/modules/blocktopmenu/menutoplinks.class.php
index d0727e695..8de71b1f1 100644
--- a/modules/blocktopmenu/menutoplinks.class.php
+++ b/modules/blocktopmenu/menutoplinks.class.php
@@ -1,22 +1,50 @@
+* @copyright 2007-2011 PrestaShop SA
+* @version Release: $Revision: 7095 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
class MenuTopLinks
{
- public static function gets($id_lang, $id_link = null)
+ public static function gets($id_lang, $id_link = null, $id_shop)
{
- return Db::getInstance()->ExecuteS('
+ return Db::getInstance()->executeS('
SELECT l.id_link, l.new_window, l.link, ll.label
FROM '._DB_PREFIX_.'linksmenutop l
- LEFT JOIN '._DB_PREFIX_.'linksmenutop_lang ll ON (l.id_link = ll.id_link AND ll.id_lang = "'.$id_lang.'")
- '.((!is_null($id_link)) ? 'WHERE l.id_link = "'.$id_link.'"' : '').'
+ LEFT JOIN '._DB_PREFIX_.'linksmenutop_lang ll ON (l.id_link = ll.id_link AND ll.id_lang = '.(int)$id_lang.' AND ll.id_shop='.(int)$id_shop.')
+ WHERE 1
+ '.((!is_null($id_link)) ? ' AND l.id_link = "'.(int)$id_link.'"' : '').'
+ AND l.id_shop IN (0, '.(int)$id_shop.')
');
}
- public static function get($id_link, $id_lang)
+ public static function get($id_link, $id_lang, $id_shop)
{
- return self::gets($id_lang, $id_link);
+ return self::gets($id_lang, $id_link, $id_shop);
}
- public static function add($link, $label, $newWindow = 0)
+ public static function add($link, $label, $newWindow = 0, $id_shop)
{
if(!is_array($label))
return false;
@@ -25,7 +53,8 @@ class MenuTopLinks
_DB_PREFIX_.'linksmenutop',
array(
'new_window'=>(int)$newWindow,
- 'link'=>$link
+ 'link'=>pSQL($link),
+ 'id_shop' => (int)$id_shop
),
'INSERT'
);
@@ -35,19 +64,20 @@ class MenuTopLinks
Db::getInstance()->autoExecute(
_DB_PREFIX_.'linksmenutop_lang',
array(
- 'id_link'=>$id_link,
- 'id_lang'=>$id_lang,
- 'label'=>$label
+ 'id_link'=>(int)$id_link,
+ 'id_lang'=>(int)$id_lang,
+ 'id_shop'=>(int)$id_shop,
+ 'label'=>pSQL($label)
),
'INSERT'
);
}
}
- public static function remove($id_link)
+ public static function remove($id_link, $id_shop)
{
- Db::getInstance()->delete(_DB_PREFIX_.'linksmenutop', "id_link = '{$id_link}'");
- Db::getInstance()->delete(_DB_PREFIX_.'linksmenutop_lang', "id_link = '{$id_link}'");
+ Db::getInstance()->delete(_DB_PREFIX_.'linksmenutop', 'id_link = '.(int)$id_link.' AND id_shop = '.(int)$id_shop);
+ Db::getInstance()->delete(_DB_PREFIX_.'linksmenutop_lang', 'id_link = '.(int)$id_link);
}
}
-?>
\ No newline at end of file
+?>
diff --git a/modules/cashondelivery/validation.php b/modules/cashondelivery/validation.php
index fa0b68c7c..5066d3340 100644
--- a/modules/cashondelivery/validation.php
+++ b/modules/cashondelivery/validation.php
@@ -1,6 +1,6 @@
id_customer);
if (!Validate::isLoadedObject($customer))
@@ -60,7 +60,7 @@ if (Tools::getValue('confirm'))
}
else
{
- /* or ask for confirmation */
+ /* or ask for confirmation */
$smarty->assign(array(
'total' => $cart->getOrderTotal(true, Cart::BOTH),
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/cashondelivery/'
@@ -68,7 +68,7 @@ else
$smarty->assign('this_path', __PS_BASE_URI__.'modules/cashondelivery/');
$template = 'validation.tpl';
- echo Module::display('cashondelivery', $template);
+ echo $cashOnDelivery->display('cashondelivery', $template);
}
include(dirname(__FILE__).'/../../footer.php');
diff --git a/modules/cashticket/PrepaidServices.php b/modules/cashticket/PrepaidServices.php
index 389855808..e409cdd29 100644
--- a/modules/cashticket/PrepaidServices.php
+++ b/modules/cashticket/PrepaidServices.php
@@ -540,7 +540,7 @@ abstract class PrepaidServices extends PaymentModule
}
if (!empty($params))
- $dataSync = '

';
+ $dataSync = '

';
return $this->displayConfirmation($this->getL('settings_updated').$dataSync);
}
diff --git a/modules/cashticket/cashticket.php b/modules/cashticket/cashticket.php
index 475c84708..0af6c588a 100644
--- a/modules/cashticket/cashticket.php
+++ b/modules/cashticket/cashticket.php
@@ -49,9 +49,9 @@ class CashTicket extends PrepaidServices
protected $certificat_dir;
- protected $register_url = array('en' => 'http://www.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/uk',
- 'fr' => 'http://www.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/fr',
- 'es' => 'http://www.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/es');
+ protected $register_url = array('en' => 'http://api.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/uk',
+ 'fr' => 'http://api.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/fr',
+ 'es' => 'http://api.prestashop.com/partner/url.php?to=http://www.cash-ticket.com/es');
public function __construct()
{
diff --git a/modules/cheque/cheque.php b/modules/cheque/cheque.php
index 066752fe3..11ad59444 100644
--- a/modules/cheque/cheque.php
+++ b/modules/cheque/cheque.php
@@ -173,6 +173,7 @@ class Cheque extends PaymentModule
$state = $params['objOrder']->getCurrentState();
if ($state == Configuration::get('PS_OS_CHEQUE') OR $state == Configuration::get('PS_OS_OUTOFSTOCK'))
+ {
$this->context->smarty->assign(array(
'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false),
'chequeName' => $this->chequeName,
@@ -180,6 +181,9 @@ class Cheque extends PaymentModule
'status' => 'ok',
'id_order' => $params['objOrder']->id
));
+ if (isset($params['objOrder']->reference) && !empty($params['objOrder']->reference))
+ $this->context->smarty->assign('reference', $params['objOrder']->reference);
+ }
else
$this->context->smarty->assign('status', 'failed');
return $this->display(__FILE__, 'payment_return.tpl');
diff --git a/modules/criteo/criteo.php b/modules/criteo/criteo.php
index 441da44f5..173271a54 100755
--- a/modules/criteo/criteo.php
+++ b/modules/criteo/criteo.php
@@ -84,7 +84,7 @@ class Criteo extends Module
{
return '