You are here

function simplify_hide_field in Simplify 7.3

Same name and namespace in other branches
  1. 8 simplify.module \simplify_hide_field()

Hide a given field.

1 call to simplify_hide_field()
simplify_hide_fields in ./simplify.module
Hide fields from all users without the 'View hidden fields' permission.

File

./simplify.module, line 564
Simplifies the user interface by hiding particular fields.

Code

function simplify_hide_field($field, &$form) {
  switch ($field) {

    // Authoring information
    case 'author':
      $form['author']['#access'] = FALSE;
      break;

    // Book outline
    case 'book':
      $form['book']['#access'] = FALSE;
      break;

    // Comment settings
    case 'comment':
      $form['comment_settings']['#access'] = FALSE;
      break;

    // Contact settings
    case 'contact':
      $form['contact']['#access'] = FALSE;
      break;

    // Domain access
    case 'domain':
      $form['domain']['#access'] = FALSE;
      break;

    // Entity translation
    case 'entity_translation':
      $form['translation']['#access'] = FALSE;
      break;

    // Text format selection
    case 'format':
      simplify_hide_text_format_elements($form);
      break;

    // Menu settings
    case 'menu':
      $form['menu']['#access'] = FALSE;
      break;

    // Meta tags
    case 'metatag':
      $form['metatags']['#access'] = FALSE;
      break;

    // Node noindex
    case 'node_noindex':
      $form['node_noindex']['#access'] = FALSE;
      break;

    // Publishing options
    case 'options':
      $form['options']['#access'] = FALSE;
      break;

    // Administrative overlay
    case 'overlay':
      $form['overlay_control']['#access'] = FALSE;
      break;

    // URL path settings
    case 'path':
      $form['path']['#access'] = FALSE;
      break;

    // URL redirects
    case 'redirect':
      $form['redirect']['#access'] = FALSE;
      break;

    // Relations
    case 'relations':
      $form['relations']['#access'] = FALSE;
      break;

    // Revision information
    case 'revision':
      $form['revision_information']['#access'] = FALSE;
      break;

    // Status
    case 'status':
      $form['account']['status']['#access'] = FALSE;
      break;

    // XML sitemap
    case 'xmlsitemap':
      $form['xmlsitemap']['#access'] = FALSE;
      break;
  }

  // Allow other modules to alter the way fields are hidden
  drupal_alter('simplify_hide_field', $form, $field);
}