You are here

function jammer_form_alter in Jammer 5

Same name and namespace in other branches
  1. 6 jammer.module \jammer_form_alter()
  2. 7 jammer.module \jammer_form_alter()
  3. 1.0.x jammer.module \jammer_form_alter()

Implementation of hook_form_alter().

File

./jammer.module, line 39
Modify forms.

Code

function jammer_form_alter($form_id, &$form) {
  if ($form['#id'] == 'node-form') {
    if (in_array($form['type']['#value'], variable_get('jammer_revision_log_textarea_unset_node_types', array())) && isset($form['log'])) {
      unset($form['log']);
    }
    if (in_array($form['type']['#value'], variable_get('jammer_preview_button_unset_node_types', array())) && isset($form['preview'])) {
      unset($form['preview']);
    }
    if (in_array($form['type']['#value'], variable_get('jammer_submit_button_unset_node_types', array())) && isset($form['submit'])) {
      unset($form['submit']);
    }
    if (in_array($form['type']['#value'], variable_get('jammer_delete_button_unset_node_types', array())) && isset($form['delete'])) {
      unset($form['delete']);
    }
  }
}