[*] classes : new module architecture
This commit is contained in:
1 parent
2e221dae56
commit
59cad13bdb
71 files changed
+815
-622
No files matched your search
@@ -218,7 +218,7 @@ class Blocknewsletter extends Module
|
||||
// return $this->error = $this->l('E-mail address already registered');
|
||||
|
||||
$email = pSQL($_POST['email']);
|
||||
if (true || !$this->isRegistered($register_status))
|
||||
if (!$this->isRegistered($register_status))
|
||||
{
|
||||
if (Configuration::get('NW_VERIFICATION_EMAIL'))
|
||||
{
|
||||
@@ -451,7 +451,9 @@ class Blocknewsletter extends Module
|
||||
*/
|
||||
protected function sendVerificationEmail($email, $token)
|
||||
{
|
||||
$verif_url = Context::getContext()->link->getModuleLink('blocknewsletter', 'verification').'&token='.$token;
|
||||
$verif_url = Context::getContext()->link->getModuleLink('blocknewsletter', 'verification', array(
|
||||
'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/');
|
||||
}
|
||||
|
||||
|
||||
+2
-23
@@ -28,7 +28,7 @@
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class ModuleBlocknewsletterController extends ModuleController
|
||||
class BlocknewsletterVerificationModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
private $message = '';
|
||||
|
||||
@@ -37,18 +37,7 @@ class ModuleBlocknewsletterController extends ModuleController
|
||||
*/
|
||||
public function postProcess()
|
||||
{
|
||||
$this->display_column_left = true;
|
||||
if ($this->process == 'verification')
|
||||
$this->processVerification();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process email confirmation
|
||||
*/
|
||||
public function processVerification()
|
||||
{
|
||||
$module = new Blocknewsletter();
|
||||
$this->message = $module->confirmEmail(Tools::getValue('token'));
|
||||
$this->message = $this->module->confirmEmail(Tools::getValue('token'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,17 +47,7 @@ class ModuleBlocknewsletterController extends ModuleController
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if ($this->process == 'verification')
|
||||
$this->assignVerificationExecution();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign verification return message
|
||||
*/
|
||||
public function assignVerificationExecution()
|
||||
{
|
||||
$this->context->smarty->assign('message', $this->message);
|
||||
|
||||
$this->setTemplate('verification_execution.tpl');
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user