You are here

function simplify_hide_fields in Simplify 7.3

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

Hide fields from all users without the 'View hidden fields' permission.

8 calls to simplify_hide_fields()
simplify_form_block_add_block_form_alter in ./simplify.module
Implements hook_form_FORM_ID_alter() for block_add_block_form.
simplify_form_block_admin_configure_alter in ./simplify.module
Implements hook_form_FORM_ID_alter() for block_admin_configure.
simplify_form_comment_form_alter in ./simplify.module
Implements hook_form_BASE_FORM_ID_alter() for comment_form.
simplify_form_node_form_alter in ./simplify.module
Implements hook_form_BASE_FORM_ID_alter() for node_form.
simplify_form_profile2_form_alter in ./simplify.module
Implements hook_form_BASE_FORM_ID_alter() for profile2_form.

... See full list

File

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

Code

function simplify_hide_fields($fields, &$form) {
  global $user;
  if (!empty($fields) && (!user_access('view hidden fields') || $user->uid == 1 && variable_get('simplify_user1', 0))) {
    foreach ($fields as $field) {
      simplify_hide_field($field, $form);
    }
  }
}