#455576 by Xano and sirkitree: Revamp user settings page with vertical tabs, better organization, etc. Awesomeness.
parent
2002b9616d
commit
b62fb8299f
|
|
@ -1203,13 +1203,6 @@ function system_site_information_settings() {
|
|||
'#default_value' => '',
|
||||
'#description' => t("Your site's motto, tag line, or catchphrase (often displayed alongside the title of the site).")
|
||||
);
|
||||
$form['anonymous'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Anonymous user'),
|
||||
'#default_value' => t('Anonymous'),
|
||||
'#description' => t('The name used to indicate anonymous users.'),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
$form['site_frontpage'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Default front page'),
|
||||
|
|
|
|||
|
|
@ -244,272 +244,100 @@ function user_admin_account_validate($form, &$form_state) {
|
|||
* @see system_settings_form()
|
||||
*/
|
||||
function user_admin_settings() {
|
||||
// User registration settings.
|
||||
$form['registration'] = array('#type' => 'fieldset', '#title' => t('User registration settings'));
|
||||
$form['registration']['user_register'] = array('#type' => 'radios', '#title' => t('Public registrations'), '#default_value' => variable_get('user_register', 1), '#options' => array(t('Only site administrators can create new user accounts.'), t('Visitors can create accounts and no administrator approval is required.'), t('Visitors can create accounts but administrator approval is required.')));
|
||||
$form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#default_value' => variable_get('user_email_verification', TRUE), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));
|
||||
|
||||
// Account cancellation settings.
|
||||
module_load_include('inc', 'user', 'user.pages');
|
||||
$form['cancel'] = array(
|
||||
// Settings for anonymous users.
|
||||
$form['anonymous_settings'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account cancellation settings'),
|
||||
'#title' => t('Anonymous users'),
|
||||
);
|
||||
$form['cancel']['user_cancel_method'] = array(
|
||||
$form['anonymous_settings']['anonymous'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Name'),
|
||||
'#default_value' => variable_get('anonymous', t('Anonymous')),
|
||||
'#description' => t('The name used to indicate anonymous users.'),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
|
||||
// User registration settings.
|
||||
$form['registration_cancellation'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Registration and cancellation'),
|
||||
);
|
||||
$form['registration_cancellation']['user_register'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Who can register accounts?'),
|
||||
'#default_value' => variable_get('user_register', 1),
|
||||
'#options' => array(
|
||||
t('Administrators only'),
|
||||
t('Visitors'),
|
||||
t('Visitors, but administrator approval is required'),
|
||||
)
|
||||
);
|
||||
$form['registration_cancellation']['user_email_verification'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Require e-mail verification when a visitor creates an account.'),
|
||||
'#default_value' => variable_get('user_email_verification', TRUE),
|
||||
'#description' => t('New users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. If disabled, users will be logged in immediately upon registering, and may select their own passwords during registration.')
|
||||
);
|
||||
module_load_include('inc', 'user', 'user.pages');
|
||||
$form['registration_cancellation']['user_cancel_method'] = array(
|
||||
'#type' => 'item',
|
||||
'#title' => t('When cancelling a user account'),
|
||||
'#description' => t('This default applies to all users who want to cancel their accounts. Users with the %select-cancel-method or %administer-users <a href="@permissions-url">permissions</a> can override this default method.', array('%select-cancel-method' => t('Select method for cancelling account'), '%administer-users' => t('Administer users'), '@permissions-url' => url('admin/user/permissions'))),
|
||||
'#description' => t('Users with the %select-cancel-method or %administer-users <a href="@permissions-url">permissions</a> can override this default method.', array('%select-cancel-method' => t('Select method for cancelling account'), '%administer-users' => t('Administer users'), '@permissions-url' => url('admin/user/permissions'))),
|
||||
);
|
||||
$form['cancel']['user_cancel_method'] += user_cancel_methods();
|
||||
foreach (element_children($form['cancel']['user_cancel_method']) as $element) {
|
||||
$form['registration_cancellation']['user_cancel_method'] += user_cancel_methods();
|
||||
foreach (element_children($form['registration_cancellation']['user_cancel_method']) as $element) {
|
||||
// Remove all account cancellation methods that have #access defined, as
|
||||
// those cannot be configured as default method.
|
||||
if (isset($form['cancel']['user_cancel_method'][$element]['#access'])) {
|
||||
$form['cancel']['user_cancel_method'][$element]['#access'] = FALSE;
|
||||
if (isset($form['registration_cancellation']['user_cancel_method'][$element]['#access'])) {
|
||||
$form['registration_cancellation']['user_cancel_method'][$element]['#access'] = FALSE;
|
||||
}
|
||||
// Remove the description (only displayed on the confirmation form).
|
||||
else {
|
||||
unset($form['cancel']['user_cancel_method'][$element]['#description']);
|
||||
unset($form['registration_cancellation']['user_cancel_method'][$element]['#description']);
|
||||
}
|
||||
}
|
||||
|
||||
// User e-mail settings.
|
||||
$form['email'] = array(
|
||||
// Account settings.
|
||||
$form['personalization'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('User e-mail settings'),
|
||||
'#description' => t('Drupal sends emails whenever new users register on your site, and optionally, may also notify users after other account actions. Using a simple set of content templates, notification e-mails can be customized to fit the specific needs of your site.'),
|
||||
'#title' => t('Personalization'),
|
||||
);
|
||||
// These email tokens are shared for all settings, so just define
|
||||
// the list once to help ensure they stay in sync.
|
||||
$email_token_help = t('Available variables are:') . ' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url, !cancel_url.';
|
||||
|
||||
$form['email']['admin_created'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Welcome, new user created by administrator'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => (variable_get('user_register', 1) != 0),
|
||||
'#description' => t('Customize welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help,
|
||||
);
|
||||
$form['email']['admin_created']['user_mail_register_admin_created_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('register_admin_created_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email']['admin_created']['user_mail_register_admin_created_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('register_admin_created_body'),
|
||||
'#rows' => 15,
|
||||
);
|
||||
|
||||
$form['email']['no_approval_required'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Welcome, no approval required'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => (variable_get('user_register', 1) != 1),
|
||||
'#description' => t('Customize welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') . ' ' . $email_token_help
|
||||
);
|
||||
$form['email']['no_approval_required']['user_mail_register_no_approval_required_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('register_no_approval_required_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email']['no_approval_required']['user_mail_register_no_approval_required_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('register_no_approval_required_body'),
|
||||
'#rows' => 15,
|
||||
);
|
||||
|
||||
$form['email']['pending_approval'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Welcome, awaiting administrator approval'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => (variable_get('user_register', 1) != 2),
|
||||
'#description' => t('Customize welcome e-mail messages sent to new members upon registering, when administrative approval is required.') . ' ' . $email_token_help,
|
||||
);
|
||||
$form['email']['pending_approval']['user_mail_register_pending_approval_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('register_pending_approval_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email']['pending_approval']['user_mail_register_pending_approval_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('register_pending_approval_body'),
|
||||
'#rows' => 8,
|
||||
);
|
||||
|
||||
$form['email']['password_reset'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Password recovery email'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Customize e-mail messages sent to users who request a new password.') . ' ' . $email_token_help,
|
||||
);
|
||||
$form['email']['password_reset']['user_mail_password_reset_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('password_reset_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email']['password_reset']['user_mail_password_reset_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('password_reset_body'),
|
||||
'#rows' => 12,
|
||||
);
|
||||
|
||||
$form['email']['activated'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account activation email'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Enable and customize e-mail messages sent to users upon account activation (when an administrator activates an account of a user who has already registered, on a site where administrative approval is required).') . ' ' . $email_token_help,
|
||||
);
|
||||
$form['email']['activated']['user_mail_status_activated_notify'] = array(
|
||||
$form['personalization']['user_signatures'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Notify user when account is activated.'),
|
||||
'#default_value' => variable_get('user_mail_status_activated_notify', TRUE),
|
||||
);
|
||||
$form['email']['activated']['user_mail_status_activated_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('status_activated_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email']['activated']['user_mail_status_activated_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('status_activated_body'),
|
||||
'#rows' => 15,
|
||||
);
|
||||
|
||||
$form['email']['blocked'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account blocked email'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Enable and customize e-mail messages sent to users when their accounts are blocked.') . ' ' . $email_token_help,
|
||||
);
|
||||
$form['email']['blocked']['user_mail_status_blocked_notify'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Notify user when account is blocked.'),
|
||||
'#default_value' => variable_get('user_mail_status_blocked_notify', FALSE),
|
||||
);
|
||||
$form['email']['blocked']['user_mail_status_blocked_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('status_blocked_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email']['blocked']['user_mail_status_blocked_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('status_blocked_body'),
|
||||
'#rows' => 3,
|
||||
);
|
||||
|
||||
$form['email']['cancel_confirm'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account cancellation confirmation email'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Customize e-mail messages sent to users when they attempt to cancel their accounts.') . ' ' . $email_token_help,
|
||||
);
|
||||
$form['email']['cancel_confirm']['user_mail_cancel_confirm_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('cancel_confirm_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email']['cancel_confirm']['user_mail_cancel_confirm_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('cancel_confirm_body'),
|
||||
'#rows' => 3,
|
||||
);
|
||||
|
||||
$form['email']['canceled'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account canceled email'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Enable and customize e-mail messages sent to users when their accounts are canceled.') . ' ' . $email_token_help,
|
||||
);
|
||||
$form['email']['canceled']['user_mail_status_canceled_notify'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Notify user when account is canceled.'),
|
||||
'#default_value' => variable_get('user_mail_status_canceled_notify', FALSE),
|
||||
);
|
||||
$form['email']['canceled']['user_mail_status_canceled_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('status_canceled_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email']['canceled']['user_mail_status_canceled_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('status_canceled_body'),
|
||||
'#rows' => 3,
|
||||
);
|
||||
|
||||
// User signatures.
|
||||
$form['signatures'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Signatures'),
|
||||
);
|
||||
$form['signatures']['user_signatures'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Signature support'),
|
||||
'#title' => t('Enable signatures.'),
|
||||
'#default_value' => variable_get('user_signatures', 0),
|
||||
'#options' => array(t('Disabled'), t('Enabled')),
|
||||
);
|
||||
|
||||
// If picture support is enabled, check whether the picture directory exists:
|
||||
// If picture support is enabled, check whether the picture directory exists.
|
||||
if (variable_get('user_pictures', 0)) {
|
||||
$picture_path = file_create_path(variable_get('user_picture_path', 'pictures'));
|
||||
file_check_directory($picture_path, FILE_CREATE_DIRECTORY, 'user_picture_path');
|
||||
}
|
||||
|
||||
$form['pictures'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Pictures'),
|
||||
);
|
||||
$picture_support = variable_get('user_pictures', 0);
|
||||
$form['pictures']['user_pictures'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Picture support'),
|
||||
$form['personalization']['user_pictures'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Enable user pictures.'),
|
||||
'#default_value' => $picture_support,
|
||||
'#options' => array(t('Disabled'), t('Enabled')),
|
||||
'#prefix' => '<div class="user-admin-picture-radios">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
drupal_add_js(drupal_get_path('module', 'user') . '/user.js');
|
||||
// If JS is enabled, and the radio is defaulting to off, hide all
|
||||
// the settings on page load via .css using the js-hide class so
|
||||
// that there's no flicker.
|
||||
// If JS is enabled, and the checkbox defaults to off, hide all the settings
|
||||
// on page load via CSS using the js-hide class so there's no flicker.
|
||||
$css_class = 'user-admin-picture-settings';
|
||||
if (!$picture_support) {
|
||||
$css_class .= ' js-hide';
|
||||
}
|
||||
$form['pictures']['settings'] = array(
|
||||
$form['personalization']['pictures'] = array(
|
||||
'#prefix' => '<div class="' . $css_class . '">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
$form['pictures']['settings']['user_picture_path'] = array(
|
||||
$form['personalization']['pictures']['user_picture_path'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Picture image path'),
|
||||
'#title' => t('Picture directory'),
|
||||
'#default_value' => variable_get('user_picture_path', 'pictures'),
|
||||
'#size' => 30,
|
||||
'#maxlength' => 255,
|
||||
'#description' => t('Subdirectory in the directory %dir where pictures will be stored.', array('%dir' => file_directory_path() . '/')),
|
||||
);
|
||||
$form['pictures']['settings']['user_picture_default'] = array(
|
||||
$form['personalization']['pictures']['user_picture_default'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Default picture'),
|
||||
'#default_value' => variable_get('user_picture_default', ''),
|
||||
|
|
@ -517,7 +345,7 @@ function user_admin_settings() {
|
|||
'#maxlength' => 255,
|
||||
'#description' => t('URL of picture to display for users with no custom picture selected. Leave blank for none.'),
|
||||
);
|
||||
$form['pictures']['settings']['user_picture_dimensions'] = array(
|
||||
$form['personalization']['pictures']['user_picture_dimensions'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Picture maximum dimensions'),
|
||||
'#default_value' => variable_get('user_picture_dimensions', '85x85'),
|
||||
|
|
@ -525,7 +353,7 @@ function user_admin_settings() {
|
|||
'#maxlength' => 10,
|
||||
'#description' => t('Maximum dimensions for pictures, in pixels.'),
|
||||
);
|
||||
$form['pictures']['settings']['user_picture_file_size'] = array(
|
||||
$form['personalization']['pictures']['user_picture_file_size'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Picture maximum file size'),
|
||||
'#default_value' => variable_get('user_picture_file_size', '30'),
|
||||
|
|
@ -533,13 +361,208 @@ function user_admin_settings() {
|
|||
'#maxlength' => 10,
|
||||
'#description' => t('Maximum file size for pictures, in kB.'),
|
||||
);
|
||||
$form['pictures']['settings']['user_picture_guidelines'] = array(
|
||||
$form['personalization']['pictures']['user_picture_guidelines'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Picture guidelines'),
|
||||
'#default_value' => variable_get('user_picture_guidelines', ''),
|
||||
'#description' => t("This text is displayed at the picture upload form in addition to the default guidelines. It's useful for helping or instructing your users."),
|
||||
);
|
||||
|
||||
$form['email_title'] = array(
|
||||
'#type' => 'item',
|
||||
'#title' => t('E-mails'),
|
||||
);
|
||||
$form['email'] = array(
|
||||
'#type' => 'vertical_tabs',
|
||||
);
|
||||
// These email tokens are shared for all settings, so just define
|
||||
// the list once to help ensure they stay in sync.
|
||||
$email_token_help = t('Available variables are:') . ' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url, !cancel_url.';
|
||||
|
||||
$form['email_admin_created'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Welcome (new user created by administrator)'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => (variable_get('user_register', 1) != 0),
|
||||
'#description' => t('Customize welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help,
|
||||
'#group' => 'email',
|
||||
);
|
||||
$form['email_admin_created']['user_mail_register_admin_created_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('register_admin_created_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email_admin_created']['user_mail_register_admin_created_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('register_admin_created_body'),
|
||||
'#rows' => 15,
|
||||
);
|
||||
|
||||
$form['email_no_approval_required'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Welcome (no approval required)'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => (variable_get('user_register', 1) != 1),
|
||||
'#description' => t('Customize welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') . ' ' . $email_token_help,
|
||||
'#group' => 'email',
|
||||
);
|
||||
$form['email_no_approval_required']['user_mail_register_no_approval_required_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('register_no_approval_required_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email_no_approval_required']['user_mail_register_no_approval_required_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('register_no_approval_required_body'),
|
||||
'#rows' => 15,
|
||||
);
|
||||
|
||||
$form['email_pending_approval'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Welcome (awaiting approval)'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => (variable_get('user_register', 1) != 2),
|
||||
'#description' => t('Customize welcome e-mail messages sent to new members upon registering, when administrative approval is required.') . ' ' . $email_token_help,
|
||||
'#group' => 'email',
|
||||
);
|
||||
$form['email_pending_approval']['user_mail_register_pending_approval_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('register_pending_approval_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email_pending_approval']['user_mail_register_pending_approval_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('register_pending_approval_body'),
|
||||
'#rows' => 8,
|
||||
);
|
||||
|
||||
$form['email_password_reset'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Password recovery'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Customize e-mail messages sent to users who request a new password.') . ' ' . $email_token_help,
|
||||
'#group' => 'email',
|
||||
'#weight' => 10,
|
||||
);
|
||||
$form['email_password_reset']['user_mail_password_reset_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('password_reset_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email_password_reset']['user_mail_password_reset_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('password_reset_body'),
|
||||
'#rows' => 12,
|
||||
);
|
||||
|
||||
$form['email_activated'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account activation'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Enable and customize e-mail messages sent to users upon account activation (when an administrator activates an account of a user who has already registered, on a site where administrative approval is required).') . ' ' . $email_token_help,
|
||||
'#group' => 'email',
|
||||
);
|
||||
$form['email_activated']['user_mail_status_activated_notify'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Notify user when account is activated.'),
|
||||
'#default_value' => variable_get('user_mail_status_activated_notify', TRUE),
|
||||
);
|
||||
$form['email_activated']['user_mail_status_activated_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('status_activated_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email_activated']['user_mail_status_activated_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('status_activated_body'),
|
||||
'#rows' => 15,
|
||||
);
|
||||
|
||||
$form['email_blocked'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account blocked'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Enable and customize e-mail messages sent to users when their accounts are blocked.') . ' ' . $email_token_help,
|
||||
'#group' => 'email',
|
||||
);
|
||||
$form['email_blocked']['user_mail_status_blocked_notify'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Notify user when account is blocked.'),
|
||||
'#default_value' => variable_get('user_mail_status_blocked_notify', FALSE),
|
||||
);
|
||||
$form['email_blocked']['user_mail_status_blocked_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('status_blocked_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email_blocked']['user_mail_status_blocked_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('status_blocked_body'),
|
||||
'#rows' => 3,
|
||||
);
|
||||
|
||||
$form['email_cancel_confirm'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account cancellation confirmation'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Customize e-mail messages sent to users when they attempt to cancel their accounts.') . ' ' . $email_token_help,
|
||||
'#group' => 'email',
|
||||
);
|
||||
$form['email_cancel_confirm']['user_mail_cancel_confirm_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('cancel_confirm_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email_cancel_confirm']['user_mail_cancel_confirm_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('cancel_confirm_body'),
|
||||
'#rows' => 3,
|
||||
);
|
||||
|
||||
$form['email_canceled'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Account canceled'),
|
||||
'#collapsible' => TRUE,
|
||||
'#collapsed' => TRUE,
|
||||
'#description' => t('Enable and customize e-mail messages sent to users when their accounts are canceled.') . ' ' . $email_token_help,
|
||||
'#group' => 'email',
|
||||
);
|
||||
$form['email_canceled']['user_mail_status_canceled_notify'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Notify user when account is canceled.'),
|
||||
'#default_value' => variable_get('user_mail_status_canceled_notify', FALSE),
|
||||
);
|
||||
$form['email_canceled']['user_mail_status_canceled_subject'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Subject'),
|
||||
'#default_value' => _user_mail_text('status_canceled_subject'),
|
||||
'#maxlength' => 180,
|
||||
);
|
||||
$form['email_canceled']['user_mail_status_canceled_body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Body'),
|
||||
'#default_value' => _user_mail_text('status_canceled_body'),
|
||||
'#rows' => 3,
|
||||
);
|
||||
|
||||
return system_settings_form($form, FALSE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,14 +161,13 @@ Drupal.evaluatePasswordStrength = function (password, translate) {
|
|||
};
|
||||
|
||||
/**
|
||||
* On the admin/user/settings page, conditionally show all of the
|
||||
* picture-related form elements depending on the current value of the
|
||||
* "Picture support" radio buttons.
|
||||
* Show all of the picture-related form elements at admin/user/settings
|
||||
* depending on whether user pictures are enabled or not.
|
||||
*/
|
||||
Drupal.behaviors.userSettings = {
|
||||
attach: function (context, settings) {
|
||||
$('div.user-admin-picture-radios input[type=radio]:not(.userSettings-processed)', context).addClass('userSettings-processed').click(function () {
|
||||
$('div.user-admin-picture-settings', context)[['hide', 'show'][this.value]]();
|
||||
$('#edit-user-pictures', context).change(function () {
|
||||
$('div.user-admin-picture-settings', context).toggle();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue