diff --git a/modules/landingpages/AdminLandingPages.php b/modules/landingpages/AdminLandingPages.php index 66b4807e..9c732a84 100755 --- a/modules/landingpages/AdminLandingPages.php +++ b/modules/landingpages/AdminLandingPages.php @@ -22,6 +22,7 @@ class AdminLandingPages extends AdminTab { VALUES ( DEFAULT, '.(int) (bool) Tools::getValue('enabled').', + '.(int) (bool) Tools::getValue('connect_button').', "'.pSQL(Tools::str2url($name)).'", "'.pSQL(Tools::getValue('text1')).'", "'.pSQL(Tools::getValue('text2')).'", @@ -74,9 +75,10 @@ class AdminLandingPages extends AdminTab { Db::getInstance()->ExecuteS(' UPDATE `'._DB_PREFIX_.'landing_page` SET `enabled` = '.(int) (bool) Tools::getValue('enabled').', + `connect_button` = '.(int) (bool) Tools::getValue('connect_button').', `name` = "'.pSQL(Tools::str2url($name)).'", `text1` = "'.pSQL(Tools::getValue('text1')).'", - `text2` = "'.pSQL(Tools::getValue('text2')).'", + `text2` = "'.pSQL(Tools::getValue('text2')).'", `tag` = "'.pSQL(Tools::getValue('tag'), true).'" WHERE `id_landing_page` = '.$id_landing_page.' '); @@ -147,6 +149,7 @@ class AdminLandingPages extends AdminTab { '.$this->l('URL chunk').' '.$this->l('Customers').' '.$this->l('Enabled').' + '.$this->l('Connect').' '.$this->l('Actions').' '; @@ -157,6 +160,7 @@ class AdminLandingPages extends AdminTab { http://'.$_SERVER['SERVER_NAME'].'/authentification?create_account=1&lp='.$page['name'].' '.(isset($counts[$page['id_landing_page']])? $counts[$page['id_landing_page']]: '0').' '.($page['enabled']? $this->l('Yes'): $this->l('No')).' + '.($page['connect_button']? $this->l('Yes'): $this->l('No')).' @@ -286,6 +290,15 @@ class AdminLandingPages extends AdminTab {
'; + echo ' +
+
+ curlp? ($this->curlp['connect_button'] == 0? ' checked="checked"': ''):' checked="checked"').' /> '.$this->l('No').'   curlp && $this->curlp['connect_button'] == 1? ' checked="checked"': '').' /> '.$this->l('Yes').' + * +
+
+
'; + echo '
diff --git a/modules/landingpages/authentication_bottom.tpl b/modules/landingpages/authentication_bottom.tpl new file mode 100644 index 00000000..a8bc0212 --- /dev/null +++ b/modules/landingpages/authentication_bottom.tpl @@ -0,0 +1,12 @@ +{if $connect_button == 1} + +

+ {l s='log in'} +

+{/if} \ No newline at end of file diff --git a/modules/landingpages/landingpages.php b/modules/landingpages/landingpages.php index e600e5f6..b47575b1 100755 --- a/modules/landingpages/landingpages.php +++ b/modules/landingpages/landingpages.php @@ -68,6 +68,7 @@ class LandingPages extends Module { CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'landing_page` ( `id_landing_page` INTEGER NOT NULL AUTO_INCREMENT, `enabled` BOOL NOT NULL, + `connect_button` BOOL NOT NULL, `name` VARCHAR(255) NOT NULL, `text1` VARCHAR(255) NOT NULL, `text2` VARCHAR(255) NOT NULL, @@ -93,6 +94,7 @@ class LandingPages extends Module { if(!parent::install() || !$this->registerHook('adminCustomers') || !$this->registerHook('createAccountForm') + || !$this->registerHook('createAccountFormBottom') || !$this->registerHook('createAccount')) { return FALSE; } @@ -224,4 +226,24 @@ class LandingPages extends Module { return $this->display(__FILE__, 'authentication.tpl'); } } + + public function hookCreateAccountFormBottom($params) { + global $smarty, $cookie; + $connect_button = 0; + if($name = Tools::getValue('lp')) { + if($landing = Db::getInstance()->getRow(' + SELECT `connect_button` + FROM `'._DB_PREFIX_.'landing_page` + WHERE `enabled` = 1 + AND `name` = "'.pSQL($name).'" + ')) { + $connect_button = $landing['connect_button']; + } + } + + $smarty->assign(array( + 'connect_button' => $connect_button, + )); + return $this->display(__FILE__, 'authentication_bottom.tpl'); + } } diff --git a/override/controllers/AuthController.php b/override/controllers/AuthController.php index 48886737..4f8b13f6 100755 --- a/override/controllers/AuthController.php +++ b/override/controllers/AuthController.php @@ -328,6 +328,7 @@ class AuthController extends AuthControllerCore { public function displayContent() { Tools::safePostVars(); self::$smarty->assign('errors', $this->errors); + self::$smarty->assign('HOOK_CREATE_ACCOUNT_FORM_BOTTOM', Module::hookExec('createAccountFormBottom', array())); self::$smarty->display(_PS_THEME_DIR_.'authentication.tpl'); } diff --git a/themes/site/authentication.tpl b/themes/site/authentication.tpl index bcf631b9..4fbddeb5 100755 --- a/themes/site/authentication.tpl +++ b/themes/site/authentication.tpl @@ -431,6 +431,7 @@ $(function(){ldelim} *{l s='Required field'}

+ {$HOOK_CREATE_ACCOUNT_FORM_BOTTOM}