function simplelogin_form_alter in SimpleLogin 7
Same name and namespace in other branches
- 8.6 simplelogin.module \simplelogin_form_alter()
Implements hook_form_alter().
File
- ./
simplelogin.module, line 57 - The Login screens, which controls the customized background image.
Code
function simplelogin_form_alter(&$form, &$form_state, $form_id) {
$types = array(
'textfield',
'email',
'textarea',
'password',
'container',
);
foreach ($form as $key => $value) {
switch ($form_id) {
case 'user_register_form':
foreach ($form['account'] as $key => $val) {
if (isset($form['account'][$key]['#type'])) {
if (in_array($form['account'][$key]['#type'], $types)) {
$form['account'][$key]['#attributes']["placeholder"] = $form['account'][$key]["#title"];
$form['account'][$key]['#title_display'] = 'invisible';
$form['account'][$key]['#description'] = '';
}
}
}
break;
case 'user_login':
$form['actions']['submit']['#value'] = t('Login to Account');
case 'user_pass':
if (isset($value['#type']) && in_array($value['#type'], $types)) {
$form[$key]['#attributes']["placeholder"] = $value["#title"];
$form[$key]['#title_display'] = 'invisible';
$form[$key]['#description'] = '';
}
break;
}
}
if (module_exists('captcha')) {
$form['captcha']['#after_build'][] = 'simplelogin_set_captcha';
}
}