You are here

function formblock_form_alter in Form Block 6

Same name and namespace in other branches
  1. 5 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, $form_state, $form_id) {
  if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
    $form['formblock'] = array(
      '#type' => 'fieldset',
      '#title' => t('Form block'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form['formblock']['formblock_expose'] = array(
      '#type' => 'checkbox',
      '#title' => t('Enable data entry from a block'),
      '#default_value' => variable_get('formblock_expose_' . $form['#node_type']->type, 0),
      '#description' => t('Enable this option to make the entry form for this content type available as a block.'),
    );
    $form['formblock']['formblock_show_help'] = array(
      '#type' => 'checkbox',
      '#title' => t('Show submission guidelines'),
      '#default_value' => variable_get('formblock_show_help_' . $form['#node_type']->type, 0),
      '#options' => $options,
      '#description' => t('Enable this option to show the submission guidelines in the block above the form.'),
      '#process' => array(
        'formblock_dependent_process',
      ),
      '#dependency' => array(
        'edit-formblock-expose' => array(
          '1',
        ),
      ),
    );
  }
}