--- formfilter.module
+++ formfilter.module
@@ -46,6 +46,12 @@
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => 'Simplify the node form by pulling the Promote and Sticky options out of fieldsets and then putting all the fieldsets in one Advanced options fieldset.',
);
+ $form['formfilter_simplify_node_cck'] = array(
+ '#type' => 'checkbox',
+ '#title' => 'Exclude CCK fieldsets from Advanced options',
+ '#description' => 'Prevents custom CCK fieldsets from being placed under the Advanced options fieldset.',
+ '#default_value' => variable_get('formfilter_simplify_node_cck', 1),
+ );
return system_settings_form($form);
}
@@ -119,10 +125,21 @@
'#title' => 'Advanced options',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
+ '#weight' => 100,
);
// ...and move all first-level fieldsets there.
foreach (element_children($form) as $key) {
- if (!(in_array($key, array('advanced', 'taxonomy'))) && $form[$key]['#type'] && $form[$key]['#type'] == 'fieldset') {
+ //test for cck fieldset option and fieldset
+ if (variable_get('formfilter_simplify_node_cck', 1)) {
+ if (strpos($key, 'group_') === false) {
+ $cck_fieldset = false;
+ }else{
+ $cck_fieldset = true;
+ };
+ }else{
+ $cck_fieldset = false;
+ }
+ if (!(in_array($key, array('advanced', 'taxonomy'))) && !($cck_fieldset) && $form[$key]['#type'] && $form[$key]['#type'] == 'fieldset') {
$form['advanced'][$key] = $form[$key];
unset($form[$key]);
}