You are here

function messaging_method_list in Messaging 7

Same name and namespace in other branches
  1. 5 messaging.module \messaging_method_list()
  2. 6.4 messaging.module \messaging_method_list()
  3. 6 messaging.module \messaging_method_list()
  4. 6.2 messaging.module \messaging_method_list()
  5. 6.3 messaging.module \messaging_method_list()

List sending methods

Parameters

$account: Optional user account, for checking permissions against this account If no account passed it is a list for the administrator

1 call to messaging_method_list()
messaging_requirements in ./messaging.module
Implementation of hook_requirements()

File

./messaging.module, line 338

Code

function messaging_method_list($account = NULL) {
  $info = messaging_method_info(NULL, 'name');
  if ($account) {
    foreach (array_keys($info) as $method) {

      // Check access for each method and check destination
      if (!messaging_method_permission($method, $account) || !messaging_user_destination($account, $method)) {
        unset($info[$method]);
      }
      else {
        $info[$method] = messaging_translate("method:{$method}:name", $info[$method]);
      }
    }
  }
  return $info;
}