Merge pull request #210 from engelsystem/fix-register-form

Fix register form
This commit is contained in:
msquare 2015-08-16 23:13:05 +02:00
commit 9d7389baeb
2 changed files with 9 additions and 1 deletions

View File

@ -180,7 +180,7 @@ function guest_register() {
form_text('nick', _("Nick") . ' ' . entry_required(), $nick)
)),
div('col-sm-8', array(
form_text('mail', _("E-Mail") . ' ' . entry_required(), $mail),
form_email('mail', _("E-Mail") . ' ' . entry_required(), $mail),
form_checkbox('email_shiftinfo', _("Please send me an email if my shifts change"), $email_shiftinfo)
))
)),

View File

@ -268,6 +268,14 @@ function form_text($name, $label, $value, $disabled = false) {
return form_element($label, '<input class="form-control" id="form_' . $name . '" type="text" name="' . $name . '" value="' . htmlspecialchars($value) . '" ' . $disabled . '/>', 'form_' . $name);
}
/**
* Rendert ein Formular-Emailfeld
*/
function form_email($name, $label, $value, $disabled = false) {
$disabled = $disabled ? ' disabled="disabled"' : '';
return form_element($label, '<input class="form-control" id="form_' . $name . '" type="email" name="' . $name . '" value="' . htmlspecialchars($value) . '" ' . $disabled . '/>', 'form_' . $name);
}
/**
* Rendert ein Formular-Dateifeld
*/