[-] MO : #PSTEST-303 - Fixed problems using deprecated methods

// Change baseDir vars to use the current domain
// Change css rules
This commit is contained in:
mDeflotte committed 2012-01-04 16:31:47 +00:00
1 parent fe8950308e
commit 2ea4951a5d
17 files changed
+122 -68

No files matched your search

+12 -8
View File
@@ -232,15 +232,19 @@ class FrontControllerCore extends Controller
setlocale(LC_NUMERIC, 'en_US.UTF-8'); setlocale(LC_NUMERIC, 'en_US.UTF-8');
/* get page name to display it in body id */ /* get page name to display it in body id */
// @todo check here
// Are we in a payment module
$module_name = Tools::getValue('module');
if (Tools::getValue('controller') == 'module' && $module_name != '' && new $module_name() instanceof PaymentModule)
$page_name = 'module-payment-submit';
// Are we in a module
else if (preg_match('#^'.preg_quote($this->context->shop->getPhysicalURI(), '#').'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m))
$page_name = 'module-'.$m[1].'-'.str_replace(array('.php', '/'), array('', '-'), $m[2]);
else
{
$page_name = Dispatcher::getInstance()->getController(); $page_name = Dispatcher::getInstance()->getController();
$page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name; $page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name;
}
// Are we in a module ?
if (preg_match('#^'.preg_quote($this->context->shop->getPhysicalURI(), '#').'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m))
$page_name = 'module-'.$m[1].'-'.str_replace(array('.php', '/'), array('', '-'), $m[2]);
if (Tools::getValue('controller') == 'module' && Tools::getValue('module') != '')
$page_name = 'module-paypal-payment-submit';
$this->context->smarty->assign(Tools::getMetaTags($this->context->language->id, $page_name)); $this->context->smarty->assign(Tools::getMetaTags($this->context->language->id, $page_name));
$this->context->smarty->assign('request_uri', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI']))); $this->context->smarty->assign('request_uri', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])));
@@ -272,7 +276,7 @@ class FrontControllerCore extends Controller
'page_name' => $page_name, 'page_name' => $page_name,
'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__, 'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__,
'base_dir_ssl' => $protocol_link.Tools::getShopDomainSsl().__PS_BASE_URI__, 'base_dir_ssl' => $protocol_link.Tools::getShopDomainSsl().__PS_BASE_URI__,
'content_dir' => $protocol_content.(($useSSL)?Tools::getShopDomainSsl():Tools::getShopDomain()).__PS_BASE_URI__, 'content_dir' => $protocol_content.Tools::getServerName().__PS_BASE_URI__,
'tpl_dir' => _PS_THEME_DIR_, 'tpl_dir' => _PS_THEME_DIR_,
'modules_dir' => _MODULE_DIR_, 'modules_dir' => _MODULE_DIR_,
'mail_dir' => _MAIL_DIR_, 'mail_dir' => _MAIL_DIR_,
+4 -5
View File
@@ -214,11 +214,11 @@ class Blocknewsletter extends Module
else if ($_POST['action'] == '0') else if ($_POST['action'] == '0')
{ {
$register_status = $this->isNewsletterRegistered($_POST['email']); $register_status = $this->isNewsletterRegistered($_POST['email']);
if ($register_status > 0) //if ($register_status > 0)
return $this->error = $this->l('E-mail address already registered'); // return $this->error = $this->l('E-mail address already registered');
$email = pSQL($_POST['email']); $email = pSQL($_POST['email']);
if (!$this->isRegistered($register_status)) if (true || !$this->isRegistered($register_status))
{ {
if (Configuration::get('NW_VERIFICATION_EMAIL')) if (Configuration::get('NW_VERIFICATION_EMAIL'))
{ {
@@ -229,7 +229,6 @@ class Blocknewsletter extends Module
if (!$token = $this->getToken($email, $register_status)) if (!$token = $this->getToken($email, $register_status))
return $this->error = $this->l('Error during subscription'); return $this->error = $this->l('Error during subscription');
$this->sendVerificationEmail($email, $token);
return $this->valid = $this->l('A verification email has been sent. Please check your email.'); return $this->valid = $this->l('A verification email has been sent. Please check your email.');
} }
else else
@@ -450,7 +449,7 @@ class Blocknewsletter extends Module
*/ */
protected function sendVerificationEmail($email, $token) protected function sendVerificationEmail($email, $token)
{ {
$verif_url = Tools::getShopDomain(true)._MODULE_DIR_.$this->name.'/verification.php?token='.$token; $verif_url = Context::getContext()->link->getModuleLink('blocknewsletter', 'verification').'&token='.$token;
return Mail::Send($this->context->language->id, 'newsletter_verif', Mail::l('Email verification', $this->context->language->id), array('{verif_url}' => $verif_url), $email, null, null, null, null, null, dirname(__FILE__).'/mails/'); return Mail::Send($this->context->language->id, 'newsletter_verif', Mail::l('Email verification', $this->context->language->id), array('{verif_url}' => $verif_url), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
} }
@@ -0,0 +1,74 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* @since 1.5.0
*/
class ModuleBlocknewsletterController extends ModuleController
{
private $message = '';
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$this->display_column_left = true;
if ($this->process == 'verification')
$this->processVerification();
}
/**
* Validate cheque payment
*/
public function processVerification()
{
$module = new Blocknewsletter();
$this->message = $module->confirmEmail(Tools::getValue('token'));
}
/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
if ($this->process == 'verification')
$this->assignVerificationExecution();
}
/**
* Assign cheque payment template
*/
public function assignVerificationExecution()
{
$this->context->smarty->assign('message', $this->message);
$this->setTemplate('verification_execution.tpl');
}
}
+2
View File
@@ -1,5 +1,7 @@
<?php <?php
require_once(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../config/config.inc.php');
Tools::displayFileAsDeprecated();
require_once('blocknewsletter.php'); require_once('blocknewsletter.php');
$module = new Blocknewsletter(); $module = new Blocknewsletter();
@@ -0,0 +1,26 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{$message}
-6
View File
@@ -23,12 +23,6 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript">
// <![CDATA[
var baseDir = '{$base_dir_ssl}';
//]]>
</script>
{* {*
** Compatibility code for Prestashop older than 1.4.2 using a recent theme ** Compatibility code for Prestashop older than 1.4.2 using a recent theme
** Ignore list isn't require here ** Ignore list isn't require here
-1
View File
@@ -78,7 +78,6 @@
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
var baseDir = '{$base_dir_ssl}';
{literal} {literal}
$(document).ready(function() $(document).ready(function()
{ {
+4 -3
View File
@@ -1000,6 +1000,7 @@ margin: 10px 0 0 0;*/
#order .delivery_option.alternate_item, #orderopc .delivery_option.alternate_item { #order .delivery_option.alternate_item, #orderopc .delivery_option.alternate_item {
border-top: 1px solid #bdc2c9; border-top: 1px solid #bdc2c9;
background: #f1f2f4; background: #f1f2f4;
border-bottom: 1px solid #bdc2c9;
} }
#order .delivery_option label > table.resume td, #orderopc .delivery_option label > table.resume td { #order .delivery_option label > table.resume td, #orderopc .delivery_option label > table.resume td {
padding: 0 8px; padding: 0 8px;
@@ -1018,7 +1019,7 @@ margin: 10px 0 0 0;*/
padding-left:10px; padding-left:10px;
width: 160px; width: 160px;
} }
#order .delivery_options_address .delivery_option_logo img, #orderopc .delivery_options_address .delivery_option_logo img { height: 40px; } #order .delivery_options_address .delivery_option_logo img, #orderopc .delivery_options_address .delivery_option_logo img { /*height: 40px;*/ }
#orderopc .delivery_option_carrier { #orderopc .delivery_option_carrier {
margin: 0 0 0 45px; margin: 0 0 0 45px;
padding: 5px; padding: 5px;
@@ -1609,8 +1610,8 @@ ul#suppliers_list li .right_side {float:right;}
/* ************************************************************************************************ /* ************************************************************************************************
addons paypal addons paypal
************************************************************************************************ */ ************************************************************************************************ */
#module-paypal-payment-submit #left_column {display:none} #module-payment-submit #left_column {display:none}
#module-paypal-payment-submit #center_column{width:757px} #module-payment-submit #center_column{width:757px}
/* ************************************************************************************************ /* ************************************************************************************************
-7
View File
@@ -23,13 +23,6 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript">
//<![CDATA[
var baseDir = '{$base_dir_ssl}';
//]]>
</script>
{capture name=path}<a href="{$link->getPageLink('my-account.php', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='My Vouchers'}{/capture} {capture name=path}<a href="{$link->getPageLink('my-account.php', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='My Vouchers'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"} {include file="$tpl_dir./breadcrumb.tpl"}
-6
View File
@@ -24,12 +24,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript">
//<![CDATA[
var baseDir = '{$base_dir_ssl}';
//]]>
</script>
{capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Order history'}{/capture} {capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Order history'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"} {include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"} {include file="$tpl_dir./errors.tpl"}
-6
View File
@@ -24,12 +24,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript">
//<![CDATA[
var baseDir = '{$base_dir_ssl}';
//]]>
</script>
{capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Your personal information'}{/capture} {capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Your personal information'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"} {include file="$tpl_dir./breadcrumb.tpl"}
-6
View File
@@ -24,12 +24,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript">
//<![CDATA[
var baseDir = '{$base_dir_ssl}';
//]]>
</script>
{capture name=path}{l s='My account'}{/capture} {capture name=path}{l s='My account'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"} {include file="$tpl_dir./breadcrumb.tpl"}
-6
View File
@@ -24,12 +24,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript">
//<![CDATA[
var baseDir = '{$base_dir_ssl}';
//]]>
</script>
{capture name=path}{l s='Order confirmation'}{/capture} {capture name=path}{l s='Order confirmation'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"} {include file="$tpl_dir./breadcrumb.tpl"}
-6
View File
@@ -24,12 +24,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript">
//<![CDATA[
var baseDir = '{$base_dir_ssl}';
//]]>
</script>
{capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Return Merchandise Authorization (RMA)'}{/capture} {capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Return Merchandise Authorization (RMA)'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"} {include file="$tpl_dir./breadcrumb.tpl"}
-1
View File
@@ -32,7 +32,6 @@
{else} {else}
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
var baseDir = '{$base_dir_ssl}';
var imgDir = '{$img_dir}'; var imgDir = '{$img_dir}';
var authenticationUrl = '{$link->getPageLink("authentication", true)}'; var authenticationUrl = '{$link->getPageLink("authentication", true)}';
var orderOpcUrl = '{$link->getPageLink("order-opc", true)}'; var orderOpcUrl = '{$link->getPageLink("order-opc", true)}';
-1
View File
@@ -27,7 +27,6 @@
{if !$opc} {if !$opc}
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
var baseDir = '{$base_dir_ssl}';
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}'; var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
var currencyRate = '{$currencyRate|floatval}'; var currencyRate = '{$currencyRate|floatval}';
var currencyFormat = '{$currencyFormat|intval}'; var currencyFormat = '{$currencyFormat|intval}';
-6
View File
@@ -24,12 +24,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<script type="text/javascript">
//<![CDATA[
var baseDir = '{$base_dir_ssl}';
//]]>
</script>
{capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Credit slips'}{/capture} {capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Credit slips'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"} {include file="$tpl_dir./breadcrumb.tpl"}