mirror of
https://github.com/e107inc/e107.git
synced 2025-04-20 12:41:51 +02:00
Merge pull request #1579 from Jimmi08/signup-shortcodes
added parameters to some signup shortcodes
This commit is contained in:
commit
0e9be6404b
@ -185,8 +185,12 @@ class signup_shortcodes extends e_shortcode
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sc_signup_loginname()
|
||||
/* example {SIGNUP_LOGINNAME} */
|
||||
/* example {SIGNUP_LOGINNAME: class=btn input-lg} */
|
||||
/* example {SIGNUP_LOGINNAME: placeholder=LAN_LOGINNAME} */
|
||||
/* example {SIGNUP_LOGINNAME: class=input-lg&placeholder=LAN_LOGINNAME} */
|
||||
|
||||
function sc_signup_loginname($parm=null)
|
||||
{
|
||||
|
||||
$pref = e107::getPref();
|
||||
@ -194,20 +198,26 @@ class signup_shortcodes extends e_shortcode
|
||||
{
|
||||
return LAN_SIGNUP_67;
|
||||
}
|
||||
|
||||
|
||||
// if ($pref['signup_option_loginname'])
|
||||
{
|
||||
$log_name_length = varset($pref['loginname_maxlength'],30);
|
||||
$options = array('size'=>30,'required'=>1);
|
||||
$options['title'] = str_replace("[x]",$log_name_length,LAN_SIGNUP_109); // Password must be at least
|
||||
$options['pattern'] = '[\S]*';
|
||||
|
||||
$options['class'] = vartrue($parm['class'],'');
|
||||
$options['placeholder'] = vartrue($parm['placeholder']) ? $parm['placeholder'] : '';
|
||||
|
||||
return e107::getForm()->text('loginname', ($_POST['loginname'] ? $_POST['loginname'] : ''), $log_name_length, $options);
|
||||
}
|
||||
}
|
||||
|
||||
/* example {SIGNUP_REALNAME} */
|
||||
/* example {SIGNUP_REALNAME: class=btn input-lg} */
|
||||
/* example {SIGNUP_REALNAME: placeholder=LAN_SIGNUP_91} */
|
||||
/* example {SIGNUP_REALNAME: class=input-lg&placeholder=LAN_SIGNUP_91} */
|
||||
|
||||
function sc_signup_realname()
|
||||
function sc_signup_realname($parm=null)
|
||||
{
|
||||
$pref = e107::getPref('signup_option_realname');
|
||||
if($pref < 1){ return; }
|
||||
@ -215,13 +225,19 @@ class signup_shortcodes extends e_shortcode
|
||||
$options = array('size'=>30);
|
||||
$options['required'] = ($pref==2) ? 1 : 0;
|
||||
$options['title'] = LAN_SIGNUP_110;
|
||||
|
||||
$options['class'] = vartrue($parm['class'],'');
|
||||
$options['placeholder'] = vartrue($parm['placeholder'],'');
|
||||
|
||||
return e107::getForm()->text('realname', ($_POST['realname'] ? $_POST['realname'] : ''), 100, $options);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function sc_signup_password1()
|
||||
/* example {SIGNUP_PASSWORD1} */
|
||||
/* example {SIGNUP_PASSWORD1: class=btn input-lg} */
|
||||
/* example {SIGNUP_PASSWORD1: placeholder=LAN_PASSWORD} */
|
||||
/* example {SIGNUP_PASSWORD1: class=input-lg&placeholder=LAN_PASSWORD} */
|
||||
|
||||
function sc_signup_password1($parm=null)
|
||||
{
|
||||
|
||||
$pref = e107::getPref('signup_option_password', 2);
|
||||
@ -239,14 +255,20 @@ class signup_shortcodes extends e_shortcode
|
||||
$options['required'] = true;
|
||||
$options['pattern'] = '(?=^.{'.$len.',}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$';
|
||||
$options['autocomplete'] = 'off';
|
||||
$options['class'] = vartrue($parm['class'],'');
|
||||
$options['placeholder'] = vartrue($parm['placeholder'],'');
|
||||
|
||||
// $options['pattern'] = '\w{'.$len.',}'; // word of minimum length
|
||||
|
||||
|
||||
return e107::getForm()->password('password1', '', 20, $options);
|
||||
}
|
||||
|
||||
/* example {SIGNUP_PASSWORD2} */
|
||||
/* example {SIGNUP_PASSWORD2: class=btn input-lg} */
|
||||
/* example {SIGNUP_PASSWORD2: placeholder=LAN_SIGNUP_84} */
|
||||
/* example {SIGNUP_PASSWORD2: class=input-lg&placeholder=LAN_SIGNUP_84} */
|
||||
|
||||
function sc_signup_password2()
|
||||
function sc_signup_password2($parm=null)
|
||||
{
|
||||
|
||||
$pref = e107::getPref('signup_option_password', 2);
|
||||
@ -255,8 +277,11 @@ class signup_shortcodes extends e_shortcode
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return e107::getForm()->password('password2', '', 20, array('size'=>30,'class'=>'tbox','required'=>1));
|
||||
$options = array('size'=>30,'class'=>'e-password tbox','required'=>1);
|
||||
$options['class'] = vartrue($parm['class'],'');
|
||||
$options['placeholder'] = vartrue($parm['placeholder'],'');
|
||||
|
||||
return e107::getForm()->password('password2', '', 20, $options);
|
||||
}
|
||||
|
||||
|
||||
@ -269,11 +294,17 @@ class signup_shortcodes extends e_shortcode
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sc_signup_email()
|
||||
/* example {SIGNUP_EMAIL} */
|
||||
/* example {SIGNUP_EMAIL: class=btn input-lg} */
|
||||
/* example {SIGNUP_EMAIL: placeholder=LAN_USER_60} */
|
||||
/* example {SIGNUP_EMAIL: class=input-lg&placeholder=LAN_USER_60} */
|
||||
|
||||
function sc_signup_email($parm=null)
|
||||
{
|
||||
$options = array('size'=>30,'required'=>1,'class'=>'tbox form-control input-text e-email');
|
||||
$options['title'] = LAN_SIGNUP_108; // Must be a valid email address.
|
||||
$options['class'] = vartrue($parm['class'],'');
|
||||
$options['placeholder'] = vartrue($parm['placeholder'],'');
|
||||
|
||||
$text = e107::getForm()->email('email',vartrue($_POST['email'], ''),100,$options);
|
||||
$text .= "<div class='e-email-hint alert-warning' style='display:none; padding:10px' data-hint='Did you mean <b>[x]</b>?'><!-- --></div>";
|
||||
@ -281,16 +312,22 @@ class signup_shortcodes extends e_shortcode
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
function sc_signup_email_confirm()
|
||||
/* example {SIGNUP_EMAIL_CONFIRM} */
|
||||
/* example {SIGNUP_EMAIL_CONFIRM: class=btn input-lg} */
|
||||
/* example {SIGNUP_EMAIL_CONFIRM: placeholder=LAN_SIGNUP_39} */
|
||||
/* example {SIGNUP_EMAIL_CONFIRM: class=input-lg&placeholder=LAN_SIGNUP_39} */
|
||||
|
||||
function sc_signup_email_confirm($parm=null)
|
||||
{
|
||||
$pref = e107::getPref('signup_option_email_confirm');
|
||||
if($pref < 1){ return; }
|
||||
|
||||
$options = array('size'=>30);
|
||||
$options['required'] = ($pref==2) ? 1 : 0;
|
||||
$options['class'] = 'tbox input-text e-email';
|
||||
|
||||
$options['class'] = 'tbox input-text e-email';
|
||||
$options['class'] = vartrue($parm['class'],'tbox input-text e-email');
|
||||
$options['placeholder'] = vartrue($parm['placeholder'],'');
|
||||
|
||||
return e107::getForm()->email('email_confirm', vartrue($_POST['email_confirm']), 100, $options);
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user