abuse_admin_settings(&$form_state)
abuse/abuse.admin.inc, line 8
<?php
function abuse_admin_settings(&$form_state) {
$form = array();
$form['abuse_reasons_configuration'] = array(
'#title' => t('Reasons'),
'#type' => 'item',
'#value' => t('You can configure the list of reasons at !link', array('!link' => l('Reason configuration settings', 'admin/settings/abuse/reasons')))
);
// Configure which content types can be flagged
$form['contenttypes'] = array(
'#title' => t('Enable flagging for these content types'),
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
foreach (node_get_types() as $type => $name) {
$form['contenttypes'][ABUSE_CONTENT_NODE_TYPE . $type] = array(
'#title' => $name->type,
'#type' => 'checkbox',
'#return_value' => 1,
'#default_value' => variable_get(ABUSE_CONTENT_NODE_TYPE . $type, 0),
);
}
$form['contenttypes'][ABUSE_CONTENT_COMMENTS] = array(
'#title' => t('comments'),
'#type' => 'checkbox',
'#return_value' => 1,
'#default_value' => variable_get(ABUSE_CONTENT_COMMENTS, 0),
);
$form['contenttypes'][ABUSE_CONTENT_USERS] = array(
'#title' => t('users'),
'#type' => 'checkbox',
'#description' => t('Users is still a work in progress - do not bother till fully coded out'),
'#return_value' => 1,
'#default_value' => variable_get(ABUSE_CONTENT_USERS, 0),
);
// Ticketing system settings
$form['assigned'] = array(
'#title' => t('Ticketing settings'),
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['assigned']['abuse_assigned_moderators'] = array(
'#title' => t('Abuse Assigned Moderators'),
'#description' => t('Select this option if you have a pool of moderators and you wish to assign each one a certain number of tickets to work with.'),
'#type' => 'checkbox',
'#return_value' => TRUE,
'#default_value' => variable_get('abuse_assigned_moderators', FALSE)
);
$form['assigned']['abuse_num_assigned'] = array(
'#title' => t('Moderator queue limit'),
'#type' => 'textfield',
'#description' => t('This field is to set a maximum limit on the number of flagged items that will be added to the queue of a moderator'),
'#default_value' => variable_get('abuse_num_assigned', 20),
'#size' => 6,
'#maxlength' => 6,
);
$form['assigned']['abuse_cleanup_hour'] = array(
'#title' => t('Reset assigned ticket items (Please type hour of day)'),
'#type' => 'textfield',
'#default_value' => variable_get('abuse_cleanup_hour', 0),
'#size' => 2,
'#maxlength' => 2,
);
// General settings
$form['general_settings'] = array(
'#title' => t('Settings for all abuse content'),
'#type' => 'fieldset',
'#description' => t('These settings apply to all content that is allowed to be flagged into the abuse administration system'),
'#collapsible' => FALSE,
);
$form['general_settings']['abuse_threshold'] = array(
'#title' => t('Abuse threshold'),
'#type' => 'textfield',
'#default_value' => variable_get('abuse_threshold', 3),
'#size' => 6,
'#maxlength' => 6,
'#required' => TRUE,
);
$form['general_settings']['abuse_warn_subject'] = array(
'#title' => t('Warning subject'),
'#type' => 'textfield',
'#default_value' => variable_get('abuse_warn_subject', t('Abuse warning')),
'#size' => 72,
'#required' => TRUE,
);
$form['general_settings']['abuse_warn_body'] = array(
'#title' => t('Warning body'),
'#type' => 'textarea',
'#default_value' => variable_get('abuse_warn_body', ''),
'#cols' => 72,
'#rows' => 10,
'#required' => TRUE,
);
$form['general_settings']['abuse_warn_bcc'] = array(
'#title' => t('Warning BCC'),
'#type' => 'textfield',
'#default_value' => variable_get('abuse_warn_bcc', ''),
'#size' => 72,
);
$form['general_settings']['abuse_form_pre'] = array(
'#title' => t('Abuse form intro text'),
'#type' => 'textarea',
'#default_value' => variable_get('abuse_form_pre', ''),
'#cols' => 72,
'#rows' => 10,
);
return system_settings_form($form);
}
?>