function revision_all_settings_form in Revision All 6
Same name and namespace in other branches
- 8 revision_all.module \revision_all_settings_form()
- 7.2 revision_all.module \revision_all_settings_form()
- 7 revision_all.module \revision_all_settings_form()
Defines the settings form.
1 string reference to 'revision_all_settings_form'
- revision_all_menu in ./
revision_all.module - Implements hook_menu().
File
- ./
revision_all.module, line 27 - Permits configuring content revision settings from a central location. Also makes alterations to existing forms based on user specified settings.
Code
function revision_all_settings_form() {
$path = drupal_get_path('module', 'revision_all');
drupal_add_js("{$path}/revision_all.js");
$settings = variable_get('revision_all', array());
$content_types = node_get_types('names');
$form['revision-all'] = array(
'#tree' => TRUE,
);
$form['revision-all']['revision-all'] = array(
'#title' => t('Revision All'),
'#description' => t('Enable revisioning for all content types.'),
'#type' => 'checkbox',
'#default_value' => $settings['revision-all'],
);
$form['revision-all']['revision-types'] = array(
'#title' => t('Revisioning By Content Type'),
'#description' => t('Select the content types you would like revisioned.
<em>Note</em>: Selecting "Revision All" above overrides these settings.'),
'#type' => 'fieldset',
'#attributes' => array(
'id' => 'revision-all-revision-types',
),
);
while ($type = current($content_types)) {
$key = key($content_types);
$type_settings = variable_get("node_options_{$key}", array());
$default_value = in_array('revision', $type_settings);
$form['revision-all']['revision-types'][$type] = array(
'#title' => t($type),
'#type' => 'checkbox',
'#default_value' => $default_value,
);
next($content_types);
}
$form['revision-all']['enable-future'] = array(
'#title' => t('Enable for all Future Content Types'),
'#description' => t('Automatically checks the "Create new revision" checkbox
when creating new content types.'),
'#type' => 'checkbox',
'#default_value' => $settings['enable-future'],
);
$form['revision-all']['prevent-override'] = array(
'#title' => t('Prevent Revisioning Overrides'),
'#description' => t('Disables the "create revision" checkbox from node
forms.'),
'#type' => 'checkbox',
'#default_value' => $settings['prevent-override'],
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
);
return $form;
}