You are here

function ife_form_alter in Inline Form Errors 6

Same name and namespace in other branches
  1. 6.2 ife.module \ife_form_alter()
  2. 7.2 ife.module \ife_form_alter()
  3. 7 ife.module \ife_form_alter()

Implementation of hook_form_alter().

File

./ife.module, line 147
Drupal hooks

Code

function ife_form_alter(&$form, $form_state, $form_id) {
  $ife_options = ife_form_id_load($form_id);
  if (!empty($ife_options->status) && $ife_options->status) {
    $display = ife_form_id_display($ife_options);
    ife_filter_form($form, $display);

    //if a general message is set run the validator
    if ($display == 1) {
      $form['#validate'][] = 'ife_form_validator';
    }
  }

  //print form_ids
  if (variable_get('ife_show_form_ids', 0)) {
    $form['ife_form_id'] = array(
      '#type' => 'item',
      '#value' => t('Form ID: @form_id', array(
        '@form_id' => $form_id,
      )),
      '#weight' => -1000,
      '#access' => user_access('administer inline form errors'),
    );
  }
}