function signature_forum_admin_settings in Signatures for Forums 5
Same name and namespace in other branches
- 5.2 signature_forum.module \signature_forum_admin_settings()
- 6 signature_forum.module \signature_forum_admin_settings()
Admin settings form.
1 string reference to 'signature_forum_admin_settings'
- signature_forum_menu in ./
signature_forum.module - Implementation of hook_menu().
File
- ./
signature_forum.module, line 54
Code
function signature_forum_admin_settings() {
$settings = variable_get('signature_forum_settings', signature_forum_defaults());
$form['signature'] = array(
'#type' => 'fieldset',
'#description' => t('Show signatures with nodes and comments for:'),
);
foreach (node_get_types('names') as $type => $name) {
$form['signature']['signature_forum_show_for_' . $type] = array(
'#type' => 'checkbox',
'#title' => $name,
'#return_value' => 1,
'#default_value' => $settings['signature_forum_show_for_' . $type],
);
}
$form['template'] = array(
'#type' => 'textarea',
'#title' => t('Template for signatures'),
'#default_value' => $settings['signature_forum_template'],
'#description' => t('<strong>%s</strong> will be replaced with user\'s signature.'),
);
$form['filter'] = filter_form($settings['signature_forum_format'], NULL, array(
'filter',
));
$form['content_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Content options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['content_settings']['min_content_length'] = array(
'#type' => 'textfield',
'#title' => t('Minimum content length'),
'#size' => 3,
'#maxlength' => 10,
'#default_value' => $settings['signature_forum_min_content_length'],
'#description' => t('The minimum number of characters in the content a signature is being attached to. 0 means no limit.'),
);
$form['content_settings']['min_content_length_action'] = array(
'#type' => 'radios',
'#title' => t('Minimum content action'),
'#default_value' => $settings['signature_forum_min_content_length_action'],
'#options' => array(
MIN_CONTENT_ACTION_DO_NOT_DISPLAY => t('Do not display signature'),
MIN_CONTENT_ACTION_ADDITIONAL_FILTER => t('Run through an additional filter'),
),
'#description' => t('What to do if the content is under the minimum length. Set the filter below.'),
);
$form['content_settings']['min_content_length_filter'] = filter_form($settings['signature_forum_min_content_length_filter'], NULL, array(
'min_content_length_filter',
));
$form['content_settings']['min_content_length_filter']['#title'] = t('Minimum content additional filter format (if enabled)');
// If admin has opted to run signature through additional filter when content too short,
// expand the additional filter selection fieldset
if ($settings['signature_forum_min_content_length_action'] == MIN_CONTENT_ACTION_ADDITIONAL_FILTER) {
$form['content_settings']['min_content_length_filter']['#collapsed'] = 0;
}
if ($roles = user_roles()) {
$form['content_settings']['roles'] = array(
'#type' => 'checkboxes',
'#title' => t('Exempt roles'),
'#default_value' => $settings['signature_forum_roles'],
'#options' => $roles,
'#description' => t('Members of these roles will be exempt from content length settings.'),
);
}
$form['signature_other'] = array(
'#type' => 'fieldset',
'#title' => t('Other options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['signature_other']['line_limit'] = array(
'#type' => 'textfield',
'#title' => t('Line limit'),
'#size' => 3,
'#maxlength' => 10,
'#default_value' => $settings['signature_forum_line_limit'],
'#description' => t('The maximum number of lines allowed in a signature. 0 means no limit. Note: existing signatures that are too long will not be changed.'),
);
$form['signature_other']['delete_signatures'] = array(
'#type' => 'checkbox',
'#title' => t('Delete embedded signatures'),
'#description' => t('Deletes signatures that are embedded in existing comments (warning: cannot be undone!).'),
'#default_value' => FALSE,
);
return system_settings_form($form);
}