1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-13 17:12:07 +02:00

Issue #1767 - Signup template cleanup.

This commit is contained in:
Cameron 2020-04-20 12:37:39 -07:00
parent ab925f43cc
commit 31e197ccce
4 changed files with 62 additions and 43 deletions

View File

@ -173,7 +173,7 @@ class signup_shortcodes extends e_shortcode
// return $SIGNUP_TEXT." ";
}
*/
return null;
}
@ -189,6 +189,8 @@ class signup_shortcodes extends e_shortcode
return e107::getForm()->text('username', $val, $dis_name_len);
}
return null;
}
/* example {SIGNUP_LOGINNAME} */
@ -228,7 +230,7 @@ class signup_shortcodes extends e_shortcode
function sc_signup_realname($parm=null)
{
$pref = e107::getPref('signup_option_realname');
if($pref < 1){ return; }
if($pref < 1){ return null; }
$options = array('size'=>30);
$options['required'] = ($pref==2) ? 1 : 0;
@ -259,7 +261,8 @@ class signup_shortcodes extends e_shortcode
$options = array('size'=>30,'class'=>'e-password tbox','required'=>1);
// $options['title'] = 'Password must contain at least 6 characters, including UPPER/lowercase and numbers';
$len = vartrue(e107::getPref('signup_pass_len'),6);
$preLen = e107::getPref('signup_pass_len');
$len = vartrue($preLen,6);
$options['title'] = str_replace("[x]", $len, LAN_SIGNUP_107); // Password must contain at least
// $options['pattern'] = '(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\w{'.$len.',}'; // at least one number, one lowercase and uppercase.
$options['required'] = true;
@ -320,6 +323,8 @@ class signup_shortcodes extends e_shortcode
{
return $SIGNUP_PASSWORD_LEN;
}
return null;
}
/* example {SIGNUP_EMAIL} */
@ -350,7 +355,7 @@ class signup_shortcodes extends e_shortcode
function sc_signup_email_confirm($parm=null)
{
$pref = e107::getPref('signup_option_email_confirm');
if($pref < 1){ return; }
if($pref < 1){ return null; }
$options = array('size'=>30);
$options['required'] = ($pref==2) ? 1 : 0;
@ -375,6 +380,8 @@ class signup_shortcodes extends e_shortcode
{
return $rs->form_radio("hideemail", 1, $default_email_setting==1)." <label for='hideemail1'>".LAN_YES."</label> &nbsp;&nbsp;".$rs->form_radio("hideemail", 0,$default_email_setting==0)." <label for='hideemail0'>".LAN_NO."</label>";
}
return null;
}
@ -404,7 +411,7 @@ class signup_shortcodes extends e_shortcode
private function show_signup_class( $classnum, $current_value='', $nest_level=0)
private function show_signup_class( $classnum, $current_value='')
{
$tp = e107::getParser();
$uc = e107::getUserClass();
@ -424,7 +431,7 @@ class signup_shortcodes extends e_shortcode
// }
// code below is too unpredictable for reliable BC.
/*
global $USERCLASS_SUBSCRIBE_ROW;
e107::getDebug()->log($USERCLASS_SUBSCRIBE_ROW);
@ -435,11 +442,11 @@ class signup_shortcodes extends e_shortcode
'USERCLASS_ID' => $classnum,
'USERCLASS_NAME' => $tp->toHTML($uc->getName($classnum),false, 'defs'),
'USERCLASS_DESCRIPTION' => $tp->toHTML($uc->getDescription($classnum),false,'defs'),
'USERCLASS_INDENT' => " style='text-indent:".(1.2*$nest_level)."em'",
'USERCLASS_INDENT' => " style='text-indent:".(1.2 * $nest_level)."em'",
'USERCLASS_CHECKED' => (in_array($classnum, $tmp) ? " checked='checked'" : '')
);
return $tp->simpleParse($USERCLASS_SUBSCRIBE_ROW, $shortcodes);
return $tp->simpleParse($USERCLASS_SUBSCRIBE_ROW, $shortcodes);*/
}
@ -517,6 +524,8 @@ class signup_shortcodes extends e_shortcode
$frm = e107::getForm();
return $frm->bbarea('signature', '', 'signature','helpb', 'tiny');
}
return null;
}
/* {SIGNUP_IMAGES} */
@ -529,6 +538,8 @@ class signup_shortcodes extends e_shortcode
{
return e107::getForm()->avatarpicker('avatar', '', $parm);
}
return null;
}
@ -540,6 +551,8 @@ class signup_shortcodes extends e_shortcode
return e107::getSecureImg()->r_image()."<div>".e107::getSecureImg()->renderInput()."</div>";
// return $rs->form_hidden("rand_num", $sec_img->random_number). $sec_img->r_image()."<br />".$rs->form_text("code_verify", 20, "", 20);
}
unset($rs, $sec_img);
return null;
}
function sc_signup_imagecode_label()
@ -548,7 +561,9 @@ class signup_shortcodes extends e_shortcode
if($signup_imagecode)
{
return $sec_img->renderLabel();
}
}
return null;
}
@ -592,6 +607,8 @@ class signup_shortcodes extends e_shortcode
}
}
return null;
// if((int) $val === 2)
{
// return "<span class='required'><!-- empty --><</span>";
@ -635,11 +652,13 @@ class signup_shortcodes extends e_shortcode
}
/**
* Create Privacy policy link
* @example {SIGNUP_GDPR_PRIVACYPOLICY_LINK}
* @example {SIGNUP_GDPR_PRIVACYPOLICY_LINK: class=label label-info}
*/
/**
* Create Privacy policy link
* @param null $parm
* @return string
* @example {SIGNUP_GDPR_PRIVACYPOLICY_LINK}
* @example {SIGNUP_GDPR_PRIVACYPOLICY_LINK: class=label label-info}
*/
function sc_signup_gdpr_privacypolicy_link($parm=null)
{
$pp = e107::getPref('gdpr_privacypolicy', '');
@ -649,15 +668,17 @@ class signup_shortcodes extends e_shortcode
}
$pp = e107::getParser()->replaceConstants($pp, 'full');
$class = (!empty($parm['class'])) ? $parm['class'] : '';
$text = sprintf('<span class="%s"><a href="%s" target="_blank">%s</a></span>', $class, $pp, LAN_SIGNUP_122);
return $text;
return sprintf('<span class="%s"><a href="%s" target="_blank">%s</a></span>', $class, $pp, LAN_SIGNUP_122);
}
/**
* Create Terms and conditions link
* @example {SIGNUP_GDPR_TERMSANDCONDITIONS_LINK}
* @example {SIGNUP_GDPR_TERMSANDCONDITIONS_LINK: class=label label-info}
*/
/**
* Create Terms and conditions link
* @param null $parm
* @return string
* @example {SIGNUP_GDPR_TERMSANDCONDITIONS_LINK}
* @example {SIGNUP_GDPR_TERMSANDCONDITIONS_LINK: class=label label-info}
*/
function sc_signup_gdpr_termsandconditions_link($parm=null)
{
$pp = e107::getPref('gdpr_termsandconditions', '');
@ -667,8 +688,8 @@ class signup_shortcodes extends e_shortcode
}
$pp = e107::getParser()->replaceConstants($pp, 'full');
$class = (!empty($parm['class'])) ? $parm['class'] : '';
$text = sprintf('<span class="%s"><a href="%s" target="_blank">%s</a></span>', $class, $pp, LAN_SIGNUP_123);
return $text;
return sprintf('<span class="%s"><a href="%s" target="_blank">%s</a></span>', $class, $pp, LAN_SIGNUP_123);
}
/**
@ -682,11 +703,11 @@ class signup_shortcodes extends e_shortcode
return '';
}
$text = e107::getParser()->lanVars(LAN_SIGNUP_124,
return e107::getParser()->lanVars(LAN_SIGNUP_124,
array($this->sc_signup_gdpr_privacypolicy_link(), $this->sc_signup_gdpr_termsandconditions_link()));
return $text;
}
}
?>

View File

@ -41,13 +41,13 @@ $sc_style['SIGNUP_REALNAME']['post'] = "
if(!defined($SIGNUP_PASSWORD_LEN))
if(!isset($SIGNUP_PASSWORD_LEN))
{
$SIGNUP_PASSWORD_LEN = "
<span class='smalltext'> (".LAN_SIGNUP_1." {$pref['signup_pass_len']} ".LAN_SIGNUP_2.")</span>";
}
if(!defined($SIGNUP_EXTENDED_USER_FIELDS))
if(!isset($SIGNUP_EXTENDED_USER_FIELDS))
{
$SIGNUP_EXTENDED_USER_FIELDS = "
<tr>
@ -134,7 +134,7 @@ $sc_style['SIGNUP_USERCLASS_SUBSCRIBE']['post'] = "</td>
</tr>";
if(!defined($COPPA_TEMPLATE))
if(!isset($COPPA_TEMPLATE))
{
$COPPA_TEMPLATE =
LAN_SIGNUP_77." <a target='_blank' href='http://www.ftc.gov/privacy/coppafaqs.shtm'>".LAN_SIGNUP_14."</a>. "
@ -145,7 +145,7 @@ if(!defined($COPPA_TEMPLATE))
</div>";
}
if(!defined($COPPA_FAIL))
if(!isset($COPPA_FAIL))
{
$COPPA_FAIL = "<div style='text-align:center'>".LAN_SIGNUP_9."</div>";
}
@ -158,13 +158,13 @@ if(!defined($COPPA_FAIL))
//LAN_SIGNUP_85;
}
if(!defined($SIGNUP_BEGIN))
if(!isset($SIGNUP_BEGIN))
{
$SIGNUP_BEGIN = "
{SIGNUP_FORM_OPEN} {SIGNUP_ADMINOPTIONS} {SIGNUP_SIGNUP_TEXT}";
}
if(!defined($SIGNUP_BODY))
if(!isset($SIGNUP_BODY))
{
$SIGNUP_BODY = "
{SIGNUP_XUP}
@ -207,7 +207,7 @@ if(!defined($SIGNUP_BODY))
{SIGNUP_FORM_CLOSE}";
}
if(!defined($SIGNUP_EXTENDED_CAT))
if(!isset($SIGNUP_EXTENDED_CAT))
{
$SIGNUP_EXTENDED_CAT = "
<tr>
@ -217,7 +217,7 @@ if(!defined($SIGNUP_EXTENDED_CAT))
</tr>";
}
if(!defined($SIGNUP_END))
if(!isset($SIGNUP_END))
{
$SIGNUP_END = '';
}
@ -226,9 +226,12 @@ if(!defined($SIGNUP_END))
// v2.x to-do
$SIGNUP_TEMPLATE = array();
$SIGNUP_TEMPLATE['start'] = $SIGNUP_BEGIN;
$SIGNUP_TEMPLATE['end'] = $SIGNUP_END;
$SIGNUP_TEMPLATE['body'] = $SIGNUP_BODY;
$SIGNUP_TEMPLATE['extended-user-fields'] = $SIGNUP_EXTENDED_USER_FIELDS;
$SIGNUP_TEMPLATE['coppa']= '';
$SIGNUP_TEMPLATE['coppa'] = '';
$SIGNUP_TEMPLATE['coppa-fail'] = '';

View File

@ -21,13 +21,11 @@ class e_signup_class
{
private $testMode = false;
private $pref = array();
private $pref;
function __construct()
{
$pref = e107::pref('core');
$this->pref = $pref;
$this->pref = e107::pref('core');
$this->pref['user_reg_veri'] = intval($this->pref['user_reg_veri']);

View File

@ -625,7 +625,7 @@ function req($field)
function headerjs()
{
$script_txt = "
return "
<script type=\"text/javascript\">
function addtext3(sc){
document.getElementById('signupform').image.value = sc;
@ -639,7 +639,4 @@ function headerjs()
}
</script>\n";
//global $cal; // XXX - can this be removed completely?
//$script_txt .= $cal->load_files();
return $script_txt;
}