function om_user in OM Tools 7
Same name and namespace in other branches
- 8 tools/user/user.inc \om_user()
- 6 tools/user/user.inc \om_user()
OM Tools User Form Settings
File
- tools/
user/ user.inc, line 11 - User form alters
Code
function om_user(&$form) {
drupal_add_js(drupal_get_path('module', 'om_tools') . '/tools/user/js/user.js', 'file');
$form['user_forms'] = array(
'#type' => 'fieldset',
'#title' => t('User Forms'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
// Reset User Login Block
if (variable_get('om_tools_user_login_block_reset', 0)) {
variable_set('om_tools_user_login_block_label', 1);
variable_set('om_tools_user_login_block_name_label_text', 'User Name');
variable_set('om_tools_user_login_block_pass_label_text', 'Password');
variable_set('om_tools_user_login_block_size', 15);
variable_set('om_tools_user_login_block_name_hover', 'Enter your user name.');
variable_set('om_tools_user_login_block_pass_hover', 'Enter your password.');
variable_set('om_tools_user_login_block_button', 'Login');
variable_set('om_tools_user_login_block_register', 'Create new account');
variable_set('om_tools_user_login_block_password', 'Request new password');
variable_set('om_tools_user_login_block_reset', 0);
}
// User Login Block
$form['user_forms']['user_login_block_alter'] = array(
'#type' => 'fieldset',
'#title' => t('User Login Block Form'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['user_forms']['user_login_block_alter']['user_login_block_alter_switch'] = array(
'#type' => 'checkbox',
'#title' => t('Change User Login Form'),
'#default_value' => variable_get('om_tools_user_login_block_alter_switch', 0),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings'] = array(
'#type' => 'fieldset',
'#attributes' => array(
'id' => 'om-group-user-login-block-settings',
),
'#title' => t('User Login Block Settings'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_label'] = array(
'#type' => 'checkbox',
'#title' => t('Put label inside the boxes.'),
'#default_value' => variable_get('om_tools_user_login_block_label', 1),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_name_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User Name Label Text'),
'#default_value' => variable_get('om_tools_user_login_block_name_label_text', 'User Name'),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_pass_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User Password Label Text'),
'#default_value' => variable_get('om_tools_user_login_block_pass_label_text', 'Password'),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_size'] = array(
'#type' => 'textfield',
'#title' => t('Login box size'),
'#default_value' => variable_get('om_tools_user_login_block_size', 15),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_name_hover'] = array(
'#type' => 'textfield',
'#title' => t('User Name Rollover Text'),
'#default_value' => variable_get('om_tools_user_login_block_name_hover', 'Enter your user name.'),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_pass_hover'] = array(
'#type' => 'textfield',
'#title' => t('User Password Rollover Text'),
'#default_value' => variable_get('om_tools_user_login_block_pass_hover', 'Enter your password.'),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_button'] = array(
'#type' => 'textfield',
'#title' => t('Button Text'),
'#default_value' => variable_get('om_tools_user_login_block_button', 'Login'),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_register'] = array(
'#type' => 'textfield',
'#title' => t('Register Text'),
'#default_value' => variable_get('om_tools_user_login_block_register', 'Create new account'),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_settings']['user_login_block_password'] = array(
'#type' => 'textfield',
'#title' => t('Password Request Text'),
'#default_value' => variable_get('om_tools_user_login_block_password', 'Request new password'),
'#description' => t(''),
);
$form['user_forms']['user_login_block_alter']['user_login_block_reset'] = array(
'#type' => 'checkbox',
'#title' => t('Reset to default values.'),
'#default_value' => variable_get('om_tools_user_login_block_reset', 0),
'#description' => t(''),
);
// Reset User Login Page
if (variable_get('om_tools_user_login_reset', 0)) {
variable_set('om_tools_user_login_title', 'Log In');
variable_set('om_tools_user_login_label', 1);
variable_set('om_tools_user_login_name_label_text', 'User Name');
variable_set('om_tools_user_login_name_description', 'Enter your username.');
variable_set('om_tools_user_login_pass_label_text', 'Password');
variable_set('om_tools_user_login_pass_description', 'Enter the password that accompanies your username.');
variable_set('om_tools_user_login_size', 30);
variable_set('om_tools_user_login_name_hover', 'Enter your user name.');
variable_set('om_tools_user_login_pass_hover', 'Enter your password.');
variable_set('om_tools_user_login_button', 'Login');
variable_set('om_tools_user_login_reset', 0);
}
// User Login Page
$form['user_forms']['user_login_alter'] = array(
'#type' => 'fieldset',
'#title' => t('User Login Page Form'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_alter_switch'] = array(
'#type' => 'checkbox',
'#title' => t('Change User Login Page Form'),
'#default_value' => variable_get('om_tools_user_login_alter_switch', 0),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings'] = array(
'#type' => 'fieldset',
'#attributes' => array(
'id' => 'om-group-user-login-settings',
),
'#title' => t('User Login Page Settings'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_title'] = array(
'#type' => 'textfield',
'#title' => t('User log in page title'),
'#default_value' => variable_get('om_tools_user_login_title', 'Log In'),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_label'] = array(
'#type' => 'checkbox',
'#title' => t('Put label inside the boxes.'),
'#default_value' => variable_get('om_tools_user_login_label', 1),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_name_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User Name Label Text'),
'#default_value' => variable_get('om_tools_user_login_name_label_text', 'User Name'),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_name_description'] = array(
'#type' => 'textfield',
'#title' => t('User Name Description'),
'#default_value' => variable_get('om_tools_user_login_name_description', 'Enter your username.'),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_pass_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User Password Label Text'),
'#default_value' => variable_get('om_tools_user_login_pass_label_text', 'Password'),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_pass_description'] = array(
'#type' => 'textfield',
'#title' => t('User Password Description'),
'#default_value' => variable_get('om_tools_user_login_pass_description', 'Enter the password that accompanies your username.'),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_size'] = array(
'#type' => 'textfield',
'#title' => t('Text box size'),
'#default_value' => variable_get('om_tools_user_login_size', 30),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_name_hover'] = array(
'#type' => 'textfield',
'#title' => t('User Name Rollover Text'),
'#default_value' => variable_get('om_tools_user_login_name_hover', 'Enter your user name.'),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_pass_hover'] = array(
'#type' => 'textfield',
'#title' => t('User Password Rollover Text'),
'#default_value' => variable_get('om_tools_user_login_pass_hover', 'Enter your password.'),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_settings']['user_login_button'] = array(
'#type' => 'textfield',
'#title' => t('Button Text'),
'#default_value' => variable_get('om_tools_user_login_button', 'Login'),
'#description' => t(''),
);
$form['user_forms']['user_login_alter']['user_login_reset'] = array(
'#type' => 'checkbox',
'#title' => t('Reset to default values.'),
'#default_value' => variable_get('om_tools_user_login_reset', 0),
'#description' => t(''),
);
// User Reset Registration
if (variable_get('om_tools_user_register_reset', 0)) {
variable_set('om_tools_user_register_title', 'Register');
variable_set('om_tools_user_register_label', 1);
variable_set('om_tools_user_register_name_label_text', 'User Name');
variable_set('om_tools_user_register_name_description', 'Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.');
variable_set('om_tools_user_register_mail_label_text', 'E-mail Address');
variable_set('om_tools_user_register_mail_description', 'A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.');
variable_set('om_tools_user_register_size', 30);
variable_set('om_tools_user_register_name_hover', 'Enter your user name.');
variable_set('om_tools_user_register_mail_hover', 'Enter your e-mail address.');
variable_set('om_tools_user_register_button', 'Create new account');
variable_set('om_tools_user_register_reset', 0);
}
// User Registration Page
$form['user_forms']['user_register_alter'] = array(
'#type' => 'fieldset',
'#title' => t('User Register Page Form'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_alter_switch'] = array(
'#type' => 'checkbox',
'#title' => t('Change User Register Page Form'),
'#default_value' => variable_get('om_tools_user_register_alter_switch', 0),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings'] = array(
'#type' => 'fieldset',
'#attributes' => array(
'id' => 'om-group-user-register-settings',
),
'#title' => t('User register Page Settings'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_title'] = array(
'#type' => 'textfield',
'#title' => t('User register page title'),
'#default_value' => variable_get('om_tools_user_register_title', 'Register'),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_label'] = array(
'#type' => 'checkbox',
'#title' => t('Put label inside the boxes.'),
'#default_value' => variable_get('om_tools_user_register_label', 1),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_name_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User Name Label Text'),
'#default_value' => variable_get('om_tools_user_register_name_label_text', 'User Name'),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_name_description'] = array(
'#type' => 'textarea',
'#title' => t('User Name Description'),
'#default_value' => variable_get('om_tools_user_register_name_description', 'Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.'),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_mail_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User E-mail Label Text'),
'#default_value' => variable_get('om_tools_user_register_mail_label_text', 'E-mail Address'),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_mail_description'] = array(
'#type' => 'textarea',
'#title' => t('User E-mail Description'),
'#default_value' => variable_get('om_tools_user_register_mail_description', 'A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_size'] = array(
'#type' => 'textfield',
'#title' => t('Text box size'),
'#default_value' => variable_get('om_tools_user_register_size', 30),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_name_hover'] = array(
'#type' => 'textfield',
'#title' => t('User Name Rollover Text'),
'#default_value' => variable_get('om_tools_user_register_name_hover', 'Enter your user name.'),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_mail_hover'] = array(
'#type' => 'textfield',
'#title' => t('User E-mail Rollover Text'),
'#default_value' => variable_get('om_tools_user_register_mail_hover', 'Enter your e-mail address.'),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_settings']['user_register_button'] = array(
'#type' => 'textfield',
'#title' => t('Button Text'),
'#default_value' => variable_get('om_tools_user_register_button', 'Create new account'),
'#description' => t(''),
);
$form['user_forms']['user_register_alter']['user_register_reset'] = array(
'#type' => 'checkbox',
'#title' => t('Reset to default values.'),
'#default_value' => variable_get('om_tools_user_register_reset', 0),
'#description' => t(''),
);
// Reset New Request Password
if (variable_get('om_tools_user_pass_reset', 0)) {
variable_set('om_tools_user_psss_title', 'New Password Request');
variable_set('om_tools_user_pass_label', 1);
variable_set('om_tools_user_pass_name_label_text', 'User Name or E-mail');
variable_set('om_tools_user_pass_name_description', '');
variable_set('om_tools_user_pass_size', 30);
variable_set('om_tools_user_pass_name_hover', 'Enter your user name or e-mail.');
variable_set('om_tools_user_pass_button', 'E-mail new password');
variable_set('om_tools_user_pass_reset', 0);
}
// User Request for New Password Page
$form['user_forms']['user_pass_alter'] = array(
'#type' => 'fieldset',
'#title' => t('User New Password Request Page Form'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_alter_switch'] = array(
'#type' => 'checkbox',
'#title' => t('Change User New Password Request Page Form'),
'#default_value' => variable_get('om_tools_user_pass_alter_switch', 0),
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_settings'] = array(
'#type' => 'fieldset',
'#attributes' => array(
'id' => 'om-group-user-pass-settings',
),
'#title' => t('User New Password Request Page Settings'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_settings']['user_pass_title'] = array(
'#type' => 'textfield',
'#title' => t('User new password request page title'),
'#default_value' => variable_get('om_tools_user_pass_title', 'New Password Request'),
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_settings']['user_pass_label'] = array(
'#type' => 'checkbox',
'#title' => t('Put label inside the boxes.'),
'#default_value' => variable_get('om_tools_user_pass_label', 1),
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_settings']['user_pass_name_label_text'] = array(
'#type' => 'textfield',
'#title' => t('User Name or E-mail Label Text'),
'#default_value' => variable_get('om_tools_user_pass_name_label_text', 'Username or E-mail Address'),
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_settings']['user_pass_name_description'] = array(
'#type' => 'textarea',
'#title' => t('User Name or E-mail Description'),
'#default_value' => variable_get('om_tools_user_pass_name_description', ''),
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_settings']['user_pass_size'] = array(
'#type' => 'textfield',
'#title' => t('Text box size'),
'#default_value' => variable_get('om_tools_user_pass_size', 30),
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_settings']['user_pass_name_hover'] = array(
'#type' => 'textfield',
'#title' => t('User Name or E-mail Rollover Text'),
'#default_value' => variable_get('om_tools_user_pass_name_hover', 'Enter your user name or e-mail.'),
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_settings']['user_pass_button'] = array(
'#type' => 'textfield',
'#title' => t('Button Text'),
'#default_value' => variable_get('om_tools_user_pass_button', 'E-mail new password'),
'#description' => t(''),
);
$form['user_forms']['user_pass_alter']['user_pass_reset'] = array(
'#type' => 'checkbox',
'#title' => t('Reset to default values.'),
'#default_value' => variable_get('om_tools_user_pass_reset', 0),
'#description' => t(''),
);
return $form;
}