You are here

function simplify_form_alter_unset in Simplify 7.2

Hide specified form items.

1 call to simplify_form_alter_unset()
simplify_form_alter in ./simplify.module
Implements hook_form_alter().

File

./simplify.module, line 83
Simplifies the admin interface.

Code

function simplify_form_alter_unset(&$form, $node_type) {
  $node_type_type = $node_type['type'];
  $simplify_node_type = $node_type_type == 'node' ? '' : '_' . $node_type_type;

  // Hide specified form items if they are checked
  if (variable_get('simplify' . $simplify_node_type . '_node_hide_filter')) {
    drupal_add_js('jQuery().ready(function(){jQuery(".filter-wrapper").hide();});', 'inline');
  }
  if (variable_get('simplify' . $simplify_node_type . '_node_hide_menu')) {
    $form['menu']['#access'] = FALSE;
  }
  if (variable_get('simplify' . $simplify_node_type . '_node_hide_revision_information')) {
    $form['revision_information']['#access'] = FALSE;
  }
  if (variable_get('simplify' . $simplify_node_type . '_node_hide_path')) {
    $form['path']['#access'] = FALSE;
  }
  if (variable_get('simplify' . $simplify_node_type . '_node_hide_comment_settings')) {
    $form['comment_settings']['#access'] = FALSE;
  }
  if (variable_get('simplify' . $simplify_node_type . '_node_hide_author')) {
    $form['author']['#access'] = FALSE;
  }
  if (variable_get('simplify' . $simplify_node_type . '_node_hide_options')) {
    $form['options']['#access'] = FALSE;
  }
}