Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.781 diff -u -p -r1.781 user.module --- modules/user/user.module 16 May 2007 13:45:16 -0000 1.781 +++ modules/user/user.module 17 May 2007 08:42:31 -0000 @@ -2452,15 +2452,94 @@ function user_admin_settings() { $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t("This text is displayed at the top of the user registration form. It's useful for helping or instructing your users.")); // User e-mail settings. - $form['email'] = array('#type' => 'fieldset', '#title' => t('User e-mail settings')); - $form['email']['user_mail_welcome_subject'] = array('#type' => 'textfield', '#title' => t('Subject of welcome e-mail'), '#default_value' => _user_mail_text('welcome_subject'), '#maxlength' => 180, '#description' => t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.'); - $form['email']['user_mail_welcome_body'] = array('#type' => 'textarea', '#title' => t('Body of welcome e-mail'), '#default_value' => _user_mail_text('welcome_body'), '#rows' => 15, '#description' => t('Customize the body of the welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' !username, !site, !password, !uri, !uri_brief, !mailto, !login_uri, !edit_uri, !login_url.'); - $form['email']['user_mail_admin_subject'] = array('#type' => 'textfield', '#title' => t('Subject of welcome e-mail (user created by administrator)'), '#default_value' => _user_mail_text('admin_subject'), '#maxlength' => 180, '#description' => t('Customize the subject of your welcome e-mail, which is sent to new member accounts created by an administrator.') .' '. t('Available variables are:') .' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.'); - $form['email']['user_mail_admin_body'] = array('#type' => 'textarea', '#title' => t('Body of welcome e-mail (user created by administrator)'), '#default_value' => _user_mail_text('admin_body'), '#rows' => 15, '#description' => t('Customize the body of the welcome e-mail, which is sent to new member accounts created by an administrator.') .' '. t('Available variables are:') .' !username, !site, !password, !uri, !uri_brief, !mailto, !login_uri, !edit_uri, !login_url.'); - $form['email']['user_mail_approval_subject'] = array('#type' => 'textfield', '#title' => t('Subject of welcome e-mail (awaiting admin approval)'), '#default_value' => _user_mail_text('approval_subject'), '#maxlength' => 180, '#description' => t('Customize the subject of your awaiting approval welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.'); - $form['email']['user_mail_approval_body'] = array('#type' => 'textarea', '#title' => t('Body of welcome e-mail (awaiting admin approval)'), '#default_value' => _user_mail_text('approval_body'), '#rows' => 15, '#description' => t('Customize the body of the awaiting approval welcome e-mail, which is sent to new members upon registering.') .' '. t('Available variables are:') .' !username, !site, !password, !uri, !uri_brief, !mailto, !login_uri, !edit_uri, !login_url.'); - $form['email']['user_mail_pass_subject'] = array('#type' => 'textfield', '#title' => t('Subject of password recovery e-mail'), '#default_value' => _user_mail_text('pass_subject'), '#maxlength' => 180, '#description' => t('Customize the subject of your forgotten password e-mail.') .' '. t('Available variables are:') .' !username, !site, !login_url, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri.'); - $form['email']['user_mail_pass_body'] = array('#type' => 'textarea', '#title' => t('Body of password recovery e-mail'), '#default_value' => _user_mail_text('pass_body'), '#rows' => 15, '#description' => t('Customize the body of the forgotten password e-mail.') .' '. t('Available variables are:') .' !username, !site, !login_url, !uri, !uri_brief, !mailto, !login_uri, !edit_uri.'); + $form['email'] = array( + '#type' => 'fieldset', + '#title' => t('User e-mail settings'), + ); + // 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.'; + + $form['email']['welcome_admin'] = array( + '#type' => 'fieldset', + '#title' => t('Welcome message (user created by administrator)'), + '#collapsible' => TRUE, + '#collapsed' => (variable_get('user_register', 1) != 0), + ); + $form['email']['welcome_admin']['user_mail_admin_subject'] = array( + '#type' => 'textfield', + '#title' => t('Subject'), + '#default_value' => _user_mail_text('admin_subject'), + '#maxlength' => 180, + '#description' => t('Customize the subject of your welcome e-mail, which is sent to new member accounts created by an administrator.') .' '. $email_token_help, + ); + $form['email']['welcome_admin']['user_mail_admin_body'] = array( + '#type' => 'textarea', + '#title' => t('Body'), + '#default_value' => _user_mail_text('admin_body'), + '#rows' => 15, + '#description' => t('Customize the body of the welcome e-mail, which is sent to new member accounts created by an administrator.') .' '. $email_token_help, + ); + $form['email']['welcome_open'] = array( + '#type' => 'fieldset', + '#title' => t('Welcome message (no approval required)'), + '#collapsible' => TRUE, + '#collapsed' => (variable_get('user_register', 1) != 1), + ); + $form['email']['welcome_open']['user_mail_welcome_subject'] = array( + '#type' => 'textfield', + '#title' => t('Subject'), + '#default_value' => _user_mail_text('welcome_subject'), + '#maxlength' => 180, + '#description' => t('Customize the subject of your welcome e-mail, which is sent to new members upon registering.') .' '. $email_token_help + ); + $form['email']['welcome_open']['user_mail_welcome_body'] = array( + '#type' => 'textarea', + '#title' => t('Body'), + '#default_value' => _user_mail_text('welcome_body'), + '#rows' => 15, + '#description' => t('Customize the body of the welcome e-mail, which is sent to new members upon registering.') .' '. $email_token_help, + ); + $form['email']['welcome_approval'] = array( + '#type' => 'fieldset', + '#title' => t('Welcome message (awaiting administrator approval)'), + '#collapsible' => TRUE, + '#collapsed' => (variable_get('user_register', 1) != 2), + ); + $form['email']['welcome_approval']['user_mail_approval_subject'] = array( + '#type' => 'textfield', + '#title' => t('Subject'), + '#default_value' => _user_mail_text('approval_subject'), + '#maxlength' => 180, + '#description' => t('Customize the subject of your awaiting approval welcome e-mail, which is sent to new members upon registering.') .' '. $email_token_help, + ); + $form['email']['welcome_approval']['user_mail_approval_body'] = array( + '#type' => 'textarea', + '#title' => t('Body'), + '#default_value' => _user_mail_text('approval_body'), + '#rows' => 15, + '#description' => t('Customize the body of the awaiting approval welcome e-mail, which is sent to new members upon registering.') .' '. $email_token_help, + ); + $form['email']['pass_recover'] = array( + '#type' => 'fieldset', + '#title' => t('Password recovery message'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['email']['pass_recover']['user_mail_pass_subject'] = array( + '#type' => 'textfield', + '#title' => t('Subject'), + '#default_value' => _user_mail_text('pass_subject'), + '#maxlength' => 180, + '#description' => t('Customize the subject of your forgotten password e-mail.') .' '. $email_token_help, + ); + $form['email']['pass_recover']['user_mail_pass_body'] = array( + '#type' => 'textarea', + '#title' => t('Body'), + '#default_value' => _user_mail_text('pass_body'), + '#rows' => 15, + '#description' => t('Customize the body of the forgotten password e-mail.') .' '. $email_token_help, + ); // User signatures. $form['signatures'] = array(