You are here

function biblio_form_node_form_alter in Bibliography Module 7

Same name and namespace in other branches
  1. 7.2 biblio.module \biblio_form_node_form_alter()

File

./biblio.module, line 1603
Bibliography Module for Drupal.

Code

function biblio_form_node_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'biblio_node_form') {
    $form['#pre_render'][] = 'biblio_node_form_pre_render';
    if (!isset($form['biblio_tabs']['biblio_full_text']) && isset($form['body'])) {
      unset($form['body']);
    }
    if (empty($form_state['biblio_type']) && empty($form['vid']['#value'])) {
      foreach (element_children($form) as $form_element) {
        if (strstr($form_element, 'biblio_')) {
          continue;
        }
        if (strstr($form_element, 'form_')) {
          continue;
        }
        if (isset($form[$form_element]['#type']) && $form[$form_element]['#type'] != 'value') {
          $form[$form_element]['#access'] = FALSE;
        }
      }
    }
  }
}