You are here

function nodeformcols_form_alter in Node form columns 7

Implementation of hook_form_alter().

File

./nodeformcols.module, line 89

Code

function nodeformcols_form_alter(&$form, $form_state, $form_id) {
  if (isset($form['#node_edit_form']) && $form['#node_edit_form']) {
    drupal_alter('nodeformcols_pre_form', $form);
    $variant = isset($form['#nodeformcols_variant']) ? $form['#nodeformcols_variant'] : 'default';
    $placements = nodeformscols_field_placements($form['#node']->type, $variant);
    foreach ($placements as $key => $p) {
      if (isset($p['hidden']) && $p['hidden']) {
        $form[$key]['#access'] = FALSE;
      }
    }
    drupal_alter('nodeformcols_post_form', $form);
  }
}