// Retro-compatibility fix of front controllers
This commit is contained in:
@@ -268,6 +268,8 @@ class AddressControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
/* Secure restriction for guest */
|
||||
if ($this->context->customer->is_guest)
|
||||
Tools::redirect('index.php?controller=addresses');
|
||||
@@ -297,7 +299,6 @@ class AddressControllerCore extends FrontController
|
||||
}
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'address.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,6 +60,8 @@ class AddressesControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$total = 0;
|
||||
$multiple_addresses_formated = array();
|
||||
$ordered_fields = array();
|
||||
@@ -102,7 +104,6 @@ class AddressesControllerCore extends FrontController
|
||||
));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'addresses.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ class AuthControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign('genders', Gender::getGenders());
|
||||
|
||||
$this->assignDate();
|
||||
@@ -146,7 +148,6 @@ class AuthControllerCore extends FrontController
|
||||
die(Tools::jsonEncode($return));
|
||||
}
|
||||
$this->setTemplate(_PS_THEME_DIR_.'authentication.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,6 +31,8 @@ class BestSalesControllerCore extends FrontController
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->productSort();
|
||||
$nbProducts = (int)ProductSale::getNbSales();
|
||||
$this->pagination($nbProducts);
|
||||
@@ -43,7 +45,6 @@ class BestSalesControllerCore extends FrontController
|
||||
));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'best-sales.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
|
||||
@@ -88,6 +88,8 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (isset($this->context->cookie->id_compare))
|
||||
$this->context->smarty->assign('compareProducts', CompareProduct::getCompareProducts((int)$this->context->cookie->id_compare));
|
||||
|
||||
@@ -116,7 +118,6 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'category.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,6 +80,8 @@ class CmsControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$parent_cat = new CMSCategory(1, $this->context->language->id);
|
||||
$this->context->smarty->assign('id_current_lang', $this->context->language->id);
|
||||
$this->context->smarty->assign('home_title', $parent_cat->name);
|
||||
@@ -107,6 +109,5 @@ class CmsControllerCore extends FrontController
|
||||
}
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'cms.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ class CompareControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
//Clean compare product table
|
||||
CompareProduct::cleanCompareProducts('week');
|
||||
|
||||
@@ -153,7 +155,6 @@ class CompareControllerCore extends FrontController
|
||||
$this->context->smarty->assign('hasProduct', $hasProduct);
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'products-comparison.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -203,6 +203,8 @@ class ContactControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->assignOrderList();
|
||||
|
||||
$email = Tools::safeOutput(Tools::getValue('from',
|
||||
@@ -226,7 +228,6 @@ class ContactControllerCore extends FrontController
|
||||
));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'contact-form.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,8 @@ class DiscountControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$discounts = Discount::getCustomerDiscounts($this->context->language->id, $this->context->customer->id, true, false);
|
||||
$nbDiscounts = 0;
|
||||
foreach ($discounts as $discount)
|
||||
@@ -46,7 +48,6 @@ class DiscountControllerCore extends FrontController
|
||||
|
||||
$this->context->smarty->assign(array('nbDiscounts' => (int)($nbDiscounts), 'discount' => $discounts));
|
||||
$this->setTemplate(_PS_THEME_DIR_.'discount.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +96,8 @@ class GuestTrackingControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
/* Handle brute force attacks */
|
||||
if (count($this->errors))
|
||||
sleep(1);
|
||||
@@ -105,7 +107,6 @@ class GuestTrackingControllerCore extends FrontController
|
||||
'errors' => $this->errors,
|
||||
));
|
||||
$this->setTemplate(_PS_THEME_DIR_.'guest-tracking.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,6 +50,8 @@ class HistoryControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if ($orders = Order::getCustomerOrders($this->context->customer->id))
|
||||
foreach ($orders as &$order)
|
||||
{
|
||||
@@ -64,7 +66,6 @@ class HistoryControllerCore extends FrontController
|
||||
));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'history.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,8 @@ class IdentityControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if ($this->customer->birthday)
|
||||
$birthday = explode('-', $this->customer->birthday);
|
||||
else
|
||||
@@ -118,7 +120,6 @@ class IdentityControllerCore extends FrontController
|
||||
$this->context->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'identity.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
|
||||
@@ -35,8 +35,9 @@ class IndexControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign('HOOK_HOME', Hook::exec('displayHome'));
|
||||
$this->setTemplate(_PS_THEME_DIR_.'index.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,8 @@ class ManufacturerControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToGroupShop())
|
||||
{
|
||||
$this->productSort();
|
||||
@@ -81,7 +83,6 @@ class ManufacturerControllerCore extends FrontController
|
||||
$this->assignAll();
|
||||
$this->setTemplate(_PS_THEME_DIR_.'manufacturer-list.tpl');
|
||||
}
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,6 +44,8 @@ class MyAccountControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$has_address = $this->context->customer->getAddresses($this->context->language->id);
|
||||
$this->context->smarty->assign(array(
|
||||
'has_customer_an_address' => empty($has_address),
|
||||
@@ -53,7 +55,6 @@ class MyAccountControllerCore extends FrontController
|
||||
$this->context->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Hook::exec('displayCustomerAccount'));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'my-account.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ class NewProductsControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->productSort();
|
||||
|
||||
$nbProducts = (int)Product::getNewProducts(
|
||||
@@ -60,7 +62,6 @@ class NewProductsControllerCore extends FrontController
|
||||
));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'new-products.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'is_guest' => $this->context->customer->is_guest,
|
||||
'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),
|
||||
@@ -87,7 +89,6 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
}
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -92,6 +92,8 @@ class OrderControllerCore extends ParentOrderController
|
||||
{
|
||||
global $isVirtualCart;
|
||||
|
||||
parent::initContent();
|
||||
|
||||
if (Tools::isSubmit('ajax') && Tools::getValue('method') == 'updateExtraCarrier')
|
||||
{
|
||||
// Change virtualy the currents delivery options
|
||||
@@ -186,7 +188,6 @@ class OrderControllerCore extends ParentOrderController
|
||||
'currencyFormat' => $this->context->currency->format,
|
||||
'currencyBlank' => $this->context->currency->blank,
|
||||
));
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
protected function processAddressFormat()
|
||||
|
||||
@@ -132,6 +132,8 @@ class OrderDetailControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (!($id_order = (int)Tools::getValue('id_order')) || !Validate::isUnsignedId($id_order))
|
||||
$this->errors[] = Tools::displayError('Order ID required');
|
||||
else
|
||||
@@ -204,7 +206,6 @@ class OrderDetailControllerCore extends FrontController
|
||||
}
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-detail.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
|
||||
@@ -78,6 +78,8 @@ class OrderFollowControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$ordersReturn = OrderReturn::getOrdersReturn($this->context->customer->id);
|
||||
if (Tools::isSubmit('errorQuantity'))
|
||||
$this->context->smarty->assign('errorQuantity', true);
|
||||
@@ -93,7 +95,6 @@ class OrderFollowControllerCore extends FrontController
|
||||
$this->context->smarty->assign('ordersReturn', $ordersReturn);
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-follow.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
|
||||
@@ -271,6 +271,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
// SHOPPING CART
|
||||
$this->_assignSummaryInformations();
|
||||
// WRAPPING AND TOS
|
||||
@@ -324,7 +326,6 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
|
||||
$this->_processAddressFormat();
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-opc.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
protected function _getGuestInformations()
|
||||
|
||||
@@ -78,12 +78,13 @@ class OrderReturnControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'errors' => $this->errors,
|
||||
'nbdaysreturn' => (int)(Configuration::get('PS_ORDER_RETURN_NB_DAYS'))
|
||||
));
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-return.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function displayAjax()
|
||||
|
||||
@@ -47,9 +47,10 @@ class OrderSlipControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)$this->context->cookie->id_customer));
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-slip.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,9 @@ class PageNotFoundControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
$this->setTemplate(_PS_THEME_DIR_.'404.tpl');
|
||||
parent::initContent();
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'404.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,8 +111,9 @@ class PasswordControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
$this->setTemplate(_PS_THEME_DIR_.'password.tpl');
|
||||
parent::initContent();
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'password.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ class PricesDropControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->productSort();
|
||||
$nbProducts = Product::getPricesDrop($this->context->language->id, null, null, true);
|
||||
$this->pagination($nbProducts);
|
||||
@@ -53,7 +55,6 @@ class PricesDropControllerCore extends FrontController
|
||||
));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'prices-drop.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,6 +132,8 @@ class ProductControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (!$this->errors)
|
||||
{
|
||||
// Assign to the template the id of the virtual product. "0" if the product is not downloadable.
|
||||
@@ -228,7 +230,6 @@ class ProductControllerCore extends FrontController
|
||||
$this->context->smarty->assign('errors', $this->errors);
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'product.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,6 +56,8 @@ class SearchControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$query = urldecode(Tools::getValue('q'));
|
||||
if ($this->ajax_search)
|
||||
{
|
||||
@@ -122,7 +124,6 @@ class SearchControllerCore extends FrontController
|
||||
$this->context->smarty->assign('add_prod_display', Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'search.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function displayHeader($display = true)
|
||||
|
||||
@@ -42,6 +42,8 @@ class SitemapControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign('categoriesTree', Category::getRootCategory()->recurseLiteCategTree(0));
|
||||
$this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1));
|
||||
$this->context->smarty->assign('voucherAllowed', (int)Configuration::get('PS_VOUCHERS'));
|
||||
@@ -54,6 +56,5 @@ class SitemapControllerCore extends FrontController
|
||||
$this->context->smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'sitemap.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,6 +238,8 @@ class StoresControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (Configuration::get('PS_STORES_SIMPLIFIED'))
|
||||
$this->assignStoresSimplified();
|
||||
else
|
||||
@@ -251,7 +253,6 @@ class StoresControllerCore extends FrontController
|
||||
));
|
||||
|
||||
$this->setTemplate(_PS_THEME_DIR_.'stores.tpl');
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
|
||||
@@ -72,6 +72,8 @@ class SupplierControllerCore extends FrontController
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (Validate::isLoadedObject($this->supplier) && $this->supplier->active && $this->supplier->isAssociatedToGroupShop())
|
||||
{
|
||||
$this->productSort(); // productSort must be called before assignOne
|
||||
@@ -83,7 +85,6 @@ class SupplierControllerCore extends FrontController
|
||||
$this->assignAll();
|
||||
$this->setTemplate(_PS_THEME_DIR_.'supplier-list.tpl');
|
||||
}
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user