You are here

function privatemsg_account_fieldset_remove_if_empty in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 privatemsg.module \privatemsg_account_fieldset_remove_if_empty()
  2. 7.2 privatemsg.module \privatemsg_account_fieldset_remove_if_empty()

Hides the settings fieldset if there are no options to be displayed.

1 string reference to 'privatemsg_account_fieldset_remove_if_empty'
privatemsg_form_alter in ./privatemsg.module
Implements hook_form_alter().

File

./privatemsg.module, line 1382
Allows users to send private messages to other users.

Code

function privatemsg_account_fieldset_remove_if_empty($element) {
  if (count(element_children($element)) == 0) {
    $element['#access'] = FALSE;
  }
  return $element;
}