function om_user_login_block in OM Tools 7.2
Same name and namespace in other branches
- 8.2 tools/user/user.inc \om_user_login_block()
- 6.2 tools/user/user.inc \om_user_login_block()
User Login Block Form
1 call to om_user_login_block()
- om_user_tools in tools/
user/ user.inc - User Tools Form
File
- tools/
user/ user.inc, line 342 - OM Tools - User Tools for Drupal
Code
function om_user_login_block($user_defaults = array()) {
// User Login Block
$out = array();
// Reset User Login Block
if (!isset($user_defaults['user_login_block_label']) || $user_defaults['user_login_block_reset'] == 1) {
$user_defaults['user_login_block_label'] = 1;
$user_defaults['user_login_block_name_label_text'] = 'User Name';
$user_defaults['user_login_block_pass_label_text'] = 'Password';
$user_defaults['user_login_block_size'] = 15;
$user_defaults['user_login_block_name_hover'] = 'Enter your user name.';
$user_defaults['user_login_block_pass_hover'] = 'Enter your password.';
$user_defaults['user_login_block_button'] = 'Login';
$user_defaults['user_login_block_register'] = 'Create new account';
$user_defaults['user_login_block_password'] = 'Request new password';
$user_defaults['user_login_block_reset'] = 0;
}
$out['user_login_block_switch'] = array(
'#type' => 'checkbox',
'#title' => t('Change User Login Form'),
'#default_value' => isset($user_defaults['user_login_block_switch']) ? $user_defaults['user_login_block_switch'] : 0,
);
$out['user_login_block_settings'] = array(
'#type' => 'fieldset',
'#attributes' => array(
'id' => 'om-group-user-login-block-settings',
),
'#title' => t('User Login Block Settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$out['user_login_block_settings']['user_login_block_label'] = array(
'#type' => 'checkbox',
'#title' => t('Put label inside the boxes.'),
'#default_value' => isset($user_defaults['user_login_block_label']) ? $user_defaults['user_login_block_label'] : 1,
);
$out['user_login_block_settings']['user_login_block_name_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User Name Label Text'),
'#default_value' => isset($user_defaults['user_login_block_name_label_text']) ? $user_defaults['user_login_block_name_label_text'] : '',
);
$out['user_login_block_settings']['user_login_block_pass_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User Password Label Text'),
'#default_value' => isset($user_defaults['user_login_block_pass_label_text']) ? $user_defaults['user_login_block_pass_label_text'] : '',
);
$out['user_login_block_settings']['user_login_block_size'] = array(
'#type' => 'textfield',
'#title' => t('Login box size'),
'#default_value' => isset($user_defaults['user_login_block_size']) ? $user_defaults['user_login_block_size'] : 15,
);
$out['user_login_block_settings']['user_login_block_name_hover'] = array(
'#type' => 'textfield',
'#title' => t('User Name Rollover Text'),
'#default_value' => isset($user_defaults['user_login_block_name_hover']) ? $user_defaults['user_login_block_name_hover'] : '',
);
$out['user_login_block_settings']['user_login_block_pass_hover'] = array(
'#type' => 'textfield',
'#title' => t('User Password Rollover Text'),
'#default_value' => isset($user_defaults['user_login_block_pass_hover']) ? $user_defaults['user_login_block_pass_hover'] : '',
);
$out['user_login_block_settings']['user_login_block_button'] = array(
'#type' => 'textfield',
'#title' => t('Button Text'),
'#default_value' => isset($user_defaults['user_login_block_button']) ? $user_defaults['user_login_block_button'] : '',
);
$out['user_login_block_settings']['user_login_block_register'] = array(
'#type' => 'textfield',
'#title' => t('Register Text'),
'#default_value' => isset($user_defaults['user_login_block_register']) ? $user_defaults['user_login_block_register'] : '',
);
$out['user_login_block_settings']['user_login_block_password'] = array(
'#type' => 'textfield',
'#title' => t('Password Request Text'),
'#default_value' => isset($user_defaults['user_login_block_password']) ? $user_defaults['user_login_block_password'] : '',
);
$out['user_login_block_reset'] = array(
'#type' => 'checkbox',
'#title' => t('Reset to default values.'),
'#default_value' => isset($user_defaults['user_login_block_reset']) ? $user_defaults['user_login_block_reset'] : 0,
);
return $out;
}