You are here

function formblock_form_alter in Form Block 5

Same name and namespace in other branches
  1. 6 formblock.module \formblock_form_alter()
  2. 7 formblock.module \formblock_form_alter()

Implementation of hook_form_alter().

File

./formblock.module, line 6

Code

function formblock_form_alter($form_id, &$form) {
  if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
    $options = array(
      t('Disabled'),
      t('Enabled'),
    );
    $form['formblock'] = array(
      '#type' => 'fieldset',
      '#title' => t('Form block'),
      '#weight' => 0,
    );
    $form['formblock']['formblock_expose'] = array(
      '#type' => 'radios',
      '#title' => t('Enable data entry from a block'),
      '#default_value' => variable_get('formblock_expose_' . $form['#node_type']->type, 0),
      '#options' => $options,
      '#description' => t('Enable this option to make the entry form for this content type available as a block.'),
    );
  }
}