You are here

function cck_blocks_form_field_ui_field_edit_form_alter in CCK Blocks 7

Implements hook_form_FORM_ID_alter().

Adds options to the field configuration page for making the field available as a block for this specific content type or for every content type that uses it.

File

./cck_blocks.module, line 295

Code

function cck_blocks_form_field_ui_field_edit_form_alter(&$form, $form_state) {

  // Global settings form
  $form['field']['global_block_settings'] = array(
    '#type' => 'radios',
    '#title' => t('Provide a block for this field using CCK Blocks'),
    '#default_value' => variable_get('cck_blocks_' . $form['#field']['field_name'] . '_block_availability', CCK_BLOCKS_FIELD_BLOCK_DISABLED),
    '#description' => t('When enabled, this field becomes available as a block in the block admin page. Overridden by content-type-specific settings'),
    '#options' => array(
      CCK_BLOCKS_FIELD_BLOCK_DISABLED => t('Disabled'),
      CCK_BLOCKS_FIELD_BLOCK_ENABLED => t('Enabled'),
    ),
  );

  // Add custom form handler to the submit function
  $form['#submit'][] = 'cck_blocks_field_settings_submit';
}