// Fix strict standard on controllers + modules header / footer include
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8727 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -412,9 +412,9 @@ class FrontControllerCore extends ControllerCore
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function canonicalRedirection($canonicalURL)
|
protected function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
if (!Configuration::get('PS_CANONICAL_REDIRECT'))
|
if (!$canonicalURL || !Configuration::get('PS_CANONICAL_REDIRECT'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$matchUrl = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
$matchUrl = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||||
@@ -599,11 +599,11 @@ class FrontControllerCore extends ControllerCore
|
|||||||
asort($nArray);
|
asort($nArray);
|
||||||
$this->n = abs((int)(Tools::getValue('n', ((isset($this->context->cookie->nb_item_per_page) AND $this->context->cookie->nb_item_per_page >= 10) ? $this->context->cookie->nb_item_per_page : (int)(Configuration::get('PS_PRODUCTS_PER_PAGE'))))));
|
$this->n = abs((int)(Tools::getValue('n', ((isset($this->context->cookie->nb_item_per_page) AND $this->context->cookie->nb_item_per_page >= 10) ? $this->context->cookie->nb_item_per_page : (int)(Configuration::get('PS_PRODUCTS_PER_PAGE'))))));
|
||||||
$this->p = abs((int)(Tools::getValue('p', 1)));
|
$this->p = abs((int)(Tools::getValue('p', 1)));
|
||||||
|
|
||||||
$current_url = tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']);
|
$current_url = tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']);
|
||||||
//delete parameter page
|
//delete parameter page
|
||||||
$current_url = preg_replace('/(\?)?(&)?p=\d+/', '$1', $current_url);
|
$current_url = preg_replace('/(\?)?(&)?p=\d+/', '$1', $current_url);
|
||||||
|
|
||||||
$range = 2; /* how many pages around page selected */
|
$range = 2; /* how many pages around page selected */
|
||||||
|
|
||||||
if ($this->p < 0)
|
if ($this->p < 0)
|
||||||
|
|||||||
@@ -281,13 +281,13 @@ class AddressControllerCore extends FrontController
|
|||||||
$this->context->smarty->assign('ordered_adr_fields', $dlv_adr_fields);
|
$this->context->smarty->assign('ordered_adr_fields', $dlv_adr_fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('ajax') != 'true')
|
if (Tools::getValue('ajax') != 'true')
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayFooter()
|
public function displayFooter($display = true)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('ajax') != 'true')
|
if (Tools::getValue('ajax') != 'true')
|
||||||
parent::displayFooter();
|
parent::displayFooter();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class CartControllerCore extends FrontController
|
|||||||
public $php_self = 'cart';
|
public $php_self = 'cart';
|
||||||
|
|
||||||
// This is not a public page, so the canonical redirection is disabled
|
// This is not a public page, so the canonical redirection is disabled
|
||||||
public function canonicalRedirection(){}
|
public function canonicalRedirection($canonicalURL = ''){}
|
||||||
|
|
||||||
public function ajaxProcess()
|
public function ajaxProcess()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ class CategoryControllerCore extends FrontController
|
|||||||
$this->addJS(_THEME_JS_DIR_.'products-comparison.js');
|
$this->addJS(_THEME_JS_DIR_.'products-comparison.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
$this->productSort();
|
$this->productSort();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canonicalRedirection()
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
if (!Tools::getValue('noredirect') && Validate::isLoadedObject($this->category))
|
if (!Tools::getValue('noredirect') && Validate::isLoadedObject($this->category))
|
||||||
parent::canonicalRedirection($this->context->link->getCategoryLink($this->category));
|
parent::canonicalRedirection($this->context->link->getCategoryLink($this->category));
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class CmsControllerCore extends FrontController
|
|||||||
public $cms;
|
public $cms;
|
||||||
public $cms_category;
|
public $cms_category;
|
||||||
|
|
||||||
public function canonicalRedirection()
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms)))
|
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms)))
|
||||||
parent::canonicalRedirection($canonicalURL);
|
parent::canonicalRedirection($canonicalURL);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ManufacturerControllerCore extends FrontController
|
|||||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canonicalRedirection()
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
if (Validate::isLoadedObject($this->manufacturer))
|
if (Validate::isLoadedObject($this->manufacturer))
|
||||||
parent::canonicalRedirection($this->context->link->getManufacturerLink($this->manufacturer));
|
parent::canonicalRedirection($this->context->link->getManufacturerLink($this->manufacturer));
|
||||||
@@ -103,7 +103,7 @@ class ManufacturerControllerCore extends FrontController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
$this->productSort();
|
$this->productSort();
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class OrderControllerCore extends ParentOrderController
|
|||||||
$this->context->smarty->assign('virtual_cart', $isVirtualCart);
|
$this->context->smarty->assign('virtual_cart', $isVirtualCart);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
if (!Tools::getValue('ajax'))
|
if (!Tools::getValue('ajax'))
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
@@ -149,7 +149,7 @@ class OrderControllerCore extends ParentOrderController
|
|||||||
'dlv_adr_fields' => $deliveryAddressFields));
|
'dlv_adr_fields' => $deliveryAddressFields));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayFooter()
|
public function displayFooter($display = true)
|
||||||
{
|
{
|
||||||
if (!Tools::getValue('ajax'))
|
if (!Tools::getValue('ajax'))
|
||||||
parent::displayFooter();
|
parent::displayFooter();
|
||||||
|
|||||||
@@ -194,13 +194,13 @@ class OrderDetailControllerCore extends FrontController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('ajax') != 'true')
|
if (Tools::getValue('ajax') != 'true')
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayFooter()
|
public function displayFooter($display = true)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('ajax') != 'true')
|
if (Tools::getValue('ajax') != 'true')
|
||||||
parent::displayFooter();
|
parent::displayFooter();
|
||||||
|
|||||||
@@ -278,13 +278,13 @@ class OrderOpcControllerCore extends ParentOrderController
|
|||||||
$this->setTemplate(_PS_THEME_DIR_.'order-opc.tpl');
|
$this->setTemplate(_PS_THEME_DIR_.'order-opc.tpl');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('ajax') != 'true')
|
if (Tools::getValue('ajax') != 'true')
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayFooter()
|
public function displayFooter($display = true)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('ajax') != 'true')
|
if (Tools::getValue('ajax') != 'true')
|
||||||
parent::displayFooter();
|
parent::displayFooter();
|
||||||
|
|||||||
@@ -78,13 +78,13 @@ class OrderReturnControllerCore extends FrontController
|
|||||||
$this->setTemplate(_PS_THEME_DIR_.'order-return.tpl');
|
$this->setTemplate(_PS_THEME_DIR_.'order-return.tpl');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('ajax') != 'true')
|
if (Tools::getValue('ajax') != 'true')
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayFooter()
|
public function displayFooter($display = true)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('ajax') != 'true')
|
if (Tools::getValue('ajax') != 'true')
|
||||||
parent::displayFooter();
|
parent::displayFooter();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class ProductControllerCore extends FrontController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canonicalRedirection()
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
if (Validate::isLoadedObject($this->product))
|
if (Validate::isLoadedObject($this->product))
|
||||||
parent::canonicalRedirection($this->context->link->getProductLink($this->product));
|
parent::canonicalRedirection($this->context->link->getProductLink($this->product));
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class SearchControllerCore extends FrontController
|
|||||||
$this->setTemplate(_PS_THEME_DIR_.'search.tpl');
|
$this->setTemplate(_PS_THEME_DIR_.'search.tpl');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
if (!$this->instantSearch AND !$this->ajaxSearch)
|
if (!$this->instantSearch AND !$this->ajaxSearch)
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
@@ -117,7 +117,7 @@ class SearchControllerCore extends FrontController
|
|||||||
$this->context->smarty->assign('static_token', Tools::getToken(false));
|
$this->context->smarty->assign('static_token', Tools::getToken(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayFooter()
|
public function displayFooter($display = true)
|
||||||
{
|
{
|
||||||
if (!$this->instantSearch AND !$this->ajaxSearch)
|
if (!$this->instantSearch AND !$this->ajaxSearch)
|
||||||
parent::displayFooter();
|
parent::displayFooter();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class SupplierControllerCore extends FrontController
|
|||||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canonicalRedirection()
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
if (Validate::isLoadedObject($this->supplier))
|
if (Validate::isLoadedObject($this->supplier))
|
||||||
parent::canonicalRedirection($this->context->link->getSupplierLink($this->supplier))
|
parent::canonicalRedirection($this->context->link->getSupplierLink($this->supplier))
|
||||||
@@ -105,7 +105,7 @@ class SupplierControllerCore extends FrontController
|
|||||||
$this->setTemplate(_PS_THEME_DIR_.'supplier-list.tpl');
|
$this->setTemplate(_PS_THEME_DIR_.'supplier-list.tpl');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayHeader()
|
public function displayHeader($display = true)
|
||||||
{
|
{
|
||||||
parent::displayHeader();
|
parent::displayHeader();
|
||||||
$this->productSort();
|
$this->productSort();
|
||||||
|
|||||||
+7
-3
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* 2007-2011 PrestaShop
|
* 2007-2011 PrestaShop
|
||||||
*
|
*
|
||||||
* NOTICE OF LICENSE
|
* NOTICE OF LICENSE
|
||||||
*
|
*
|
||||||
@@ -28,6 +28,10 @@
|
|||||||
if (isset(Context::getContext()->controller))
|
if (isset(Context::getContext()->controller))
|
||||||
$controller = Context::getContext()->controller;
|
$controller = Context::getContext()->controller;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
$controller = new FrontController();
|
$controller = new FrontController();
|
||||||
|
$controller->init();
|
||||||
$controller->displayFooter();
|
}
|
||||||
|
|
||||||
|
$controller->processFooter();
|
||||||
|
Context::getContext()->smarty->display(_PS_THEME_DIR_.'footer.tpl');
|
||||||
+6
-3
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* 2007-2011 PrestaShop
|
* 2007-2011 PrestaShop
|
||||||
*
|
*
|
||||||
* NOTICE OF LICENSE
|
* NOTICE OF LICENSE
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,10 @@
|
|||||||
if (isset(Context::getContext()->controller))
|
if (isset(Context::getContext()->controller))
|
||||||
$controller = Context::getContext()->controller;
|
$controller = Context::getContext()->controller;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
$controller = new FrontController();
|
$controller = new FrontController();
|
||||||
|
$controller->init();
|
||||||
|
}
|
||||||
|
|
||||||
$controller->displayHeader();
|
$controller->processHeader();
|
||||||
|
Context::getContext()->smarty->display(_PS_THEME_DIR_.'header.tpl');
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* 2007-2011 PrestaShop
|
* 2007-2011 PrestaShop
|
||||||
*
|
*
|
||||||
* NOTICE OF LICENSE
|
* NOTICE OF LICENSE
|
||||||
*
|
*
|
||||||
@@ -34,7 +34,7 @@ include(dirname(__FILE__).'/cheque.php');
|
|||||||
|
|
||||||
if (!Context::getContext()->customer->isLogged(true))
|
if (!Context::getContext()->customer->isLogged(true))
|
||||||
Tools::redirect('index.php?controller=authentication&back=order.php');
|
Tools::redirect('index.php?controller=authentication&back=order.php');
|
||||||
|
|
||||||
$cheque = new Cheque();
|
$cheque = new Cheque();
|
||||||
echo $cheque->execPayment($cart);
|
echo $cheque->execPayment($cart);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user