You are here

function privatemsg_get_enabled_headers in Privatemsg 6.2

Same name and namespace in other branches
  1. 7.2 privatemsg.module \privatemsg_get_enabled_headers()

Returns an array of enabled header keys.

Return value

A indexed array with the header keys as value, ordered by their weight.

3 calls to privatemsg_get_enabled_headers()
privatemsg_filter_form_privatemsg_list_alter in privatemsg_filter/privatemsg_filter.module
Implements hook_form_FORM_ID_alter().
privatemsg_sql_list in ./privatemsg.module
Query definition to load a list of threads.
_privatemsg_list_thread in ./privatemsg.module
Formats a row in the message list.

File

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

Code

function privatemsg_get_enabled_headers() {
  static $header_keys = NULL;
  if ($header_keys === NULL) {
    $header_keys = array();
    $headers = privatemsg_get_headers();
    foreach ($headers as $key => $header) {
      if ($header['#enabled']) {
        $header_keys[] = $key;
      }
    }
  }
  return $header_keys;
}