You are here

function om_user_login_block in OM Tools 6.2

Same name and namespace in other branches
  1. 8.2 tools/user/user.inc \om_user_login_block()
  2. 7.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 406
User Tools

Code

function om_user_login_block($user_defaults = array()) {

  // User Login Block
  $out = array();

  // Reset User Login Block
  if ($user_defaults['user_login_block_reset'] || !isset($user_defaults['user_login_block_label'])) {
    $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' => $user_defaults['user_login_block_switch'],
  );
  $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' => $user_defaults['user_login_block_label'],
    '#description' => t(''),
  );
  $out['user_login_block_settings']['user_login_block_name_label_text'] = array(
    '#type' => 'textfield',
    '#title' => t('User Name Label Text'),
    '#default_value' => $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' => $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' => $user_defaults['user_login_block_size'],
  );
  $out['user_login_block_settings']['user_login_block_name_hover'] = array(
    '#type' => 'textfield',
    '#title' => t('User Name Rollover Text'),
    '#default_value' => $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' => $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' => $user_defaults['user_login_block_button'],
  );
  $out['user_login_block_settings']['user_login_block_register'] = array(
    '#type' => 'textfield',
    '#title' => t('Register Text'),
    '#default_value' => $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' => $user_defaults['user_login_block_password'],
  );
  $out['user_login_block_reset'] = array(
    '#type' => 'checkbox',
    '#title' => t('Reset to default values.'),
    '#default_value' => $user_defaults['user_login_block_reset'],
  );
  return $out;
}