function modr8_settings_form in modr8 5
Same name and namespace in other branches
- 6 modr8_admin.inc \modr8_settings_form()
- 7 modr8_admin.inc \modr8_settings_form()
1 string reference to 'modr8_settings_form'
- modr8_settings in ./
modr8.module - menu callback for settings form.
File
- ./
modr8_admin.inc, line 3
Code
function modr8_settings_form() {
$form['modr8_default_option'] = array(
'#type' => 'radios',
'#title' => t('Default action'),
'#options' => array(
'approve' => t('approve'),
'delete' => t('delete'),
'nada' => t('no action'),
),
'#default_value' => variable_get('modr8_default_option', 'nada'),
);
$form['modr8_nodes_per_page'] = array(
'#type' => 'select',
'#title' => t('Number of moderated posts to display per page'),
'#options' => drupal_map_assoc(array(
5,
10,
15,
20,
25,
50,
75,
100,
150,
200,
)),
'#default_value' => variable_get('modr8_nodes_per_page', 10),
);
$period = drupal_map_assoc(array(
86400,
172800,
259200,
604800,
1209600,
2419200,
4838400,
7257600,
), 'format_interval');
$period[0] = t('Never');
$form['modr8_log_clear'] = array(
'#type' => 'select',
'#title' => t('Discard log entries older than'),
'#default_value' => variable_get('modr8_log_clear', 0),
'#options' => $period,
'#description' => t('The time log entries should be kept. Older entries will be automatically discarded. Requires crontab.'),
);
$form['text'] = array(
'#type' => 'fieldset',
'#title' => t('E-mail'),
);
$form['text']['modr8_email_from'] = array(
'#type' => 'textfield',
'#title' => t('Moderator email address'),
'#description' => t('E-mail notices sent by modr8 will have this as the "From" address. Leave empty to use same "From" address as is used for user registration other administrative notices as set at <a href="@site-info">Site information</a>.', array(
'@site-info' => url('admin/settings/site-information'),
)),
'#default_value' => variable_get('modr8_email_from', ''),
);
$form['text']['modr8_send_approve'] = array(
'#type' => 'checkbox',
'#title' => t('Send approval messages'),
'#default_value' => variable_get('modr8_send_approve', FALSE),
);
$form['text']['modr8_accepted_subject'] = array(
'#type' => 'textfield',
'#title' => t('Acceptance e-mail subject'),
'#default_value' => variable_get('modr8_accepted_subject', "[%site] %title has been approved"),
);
$macros = implode(', ', array_keys(modr8_replacements()));
$accept_default = modr8_accept_default();
$form['text']['modr8_accepted_text'] = array(
'#type' => 'textarea',
'#title' => t('Acceptance e-mail'),
'#default_value' => variable_get('modr8_accepted_text', $accept_default),
'#description' => t('Replacement strings are: %macros', array(
'%macros' => $macros,
)),
);
$form['text']['modr8_send_deny'] = array(
'#type' => 'checkbox',
'#title' => t('Send denial messages'),
'#default_value' => variable_get('modr8_send_deny', FALSE),
);
$form['text']['modr8_denial_subject'] = array(
'#type' => 'textfield',
'#title' => t('Denial e-mail subject'),
'#default_value' => variable_get('modr8_denial_subject', "[%site] %title has been denied"),
);
$denial_default = modr8_denial_default();
$form['text']['modr8_denial_text'] = array(
'#type' => 'textarea',
'#title' => t('Denial e-mail'),
'#default_value' => variable_get('modr8_denial_text', $denial_default),
'#description' => t('Replacement strings are: %macros', array(
'%macros' => $macros,
)),
);
$form['text']['modr8_send_noact'] = array(
'#type' => 'checkbox',
'#title' => t('Send a message when taking no action, but only if the moderator enters a "Note to author".'),
'#default_value' => variable_get('modr8_send_noact', FALSE),
);
$form['text']['modr8_noact_subject'] = array(
'#type' => 'textfield',
'#title' => t('No action e-mail subject'),
'#default_value' => variable_get('modr8_noact_subject', "[%site] note to author about %title"),
);
$noact_default = modr8_noact_default();
$form['text']['modr8_noact_text'] = array(
'#type' => 'textarea',
'#title' => t('No action e-mail note'),
'#default_value' => variable_get('modr8_noact_text', $noact_default),
'#description' => t('Replacement strings are: %macros', array(
'%macros' => $macros,
)),
);
$form['#validate'] = array(
'modr8_settings_validate' => array(),
);
return system_settings_form($form);
}