// Context part 31

This commit is contained in:
tDidierjean
2011-08-17 10:07:12 +00:00
parent a9a1706085
commit 3d733ae6e2
57 changed files with 200 additions and 165 deletions
+3 -6
View File
@@ -27,13 +27,10 @@
require_once('../../config/config.inc.php');
require_once('../../init.php');
/*
if (!$cookie->isLogged())
Tools::redirect('../../authentication.php?back=modules/referralprogram/referralprogram-program.php');
*/
$shop_name = htmlentities(Configuration::get('PS_SHOP_NAME'), NULL, 'utf-8');
$shop_url = Tools::getHttpHost(true, true);
$customer = new Customer((int)($cookie->id_customer));
$customer = Context::getContext()->customer;
if (!preg_match("#.*\.html$#Ui", Tools::getValue('mail')) OR !preg_match("#.*\.html$#Ui", Tools::getValue('mail')))
die(Tools::displayError());
@@ -49,7 +46,7 @@ $file = str_replace('{email}', $customer->email, $file);
$file = str_replace('{firstname_friend}', 'XXXXX', $file);
$file = str_replace('{lastname_friend}', 'xxxxxx', $file);
$file = str_replace('{link}', 'authentication.php?create_account=1', $file);
$file = str_replace('{discount}', Discount::display((float)(Configuration::get('REFERRAL_DISCOUNT_VALUE_' . $cookie->id_currency)), (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE')), new Currency($cookie->id_currency)), $file);
$file = str_replace('{discount}', Discount::display((float)(Configuration::get('REFERRAL_DISCOUNT_VALUE_' . Context::getContext()->currency->id)), (int)(Configuration::get('REFERRAL_DISCOUNT_TYPE')), Context::getContext()->currency), $file);
echo $file;
@@ -32,10 +32,10 @@ require_once(dirname(__FILE__).'/../../init.php');
include_once(dirname(__FILE__).'/ReferralProgramModule.php');
if (!$cookie->isLogged())
$context = Context::getContext();
if (!$context->customer->isLogged())
Tools::redirect('index.php?controller=authentication&back=modules/referralprogram/referralprogram-program.php');
$context = Context::getContext();
$context->controller->addCSS(_PS_CSS_DIR_.'thickbox.css', 'all');
$context->controller->addJS(array(_PS_JS_DIR_.'jquery/thickbox-modified.js',_PS_JS_DIR_.'jquery/jquery.idTabs.modified.js'));