You are here

function messaging_tokens_get_list in Messaging 5

Same name and namespace in other branches
  1. 6 messaging.admin.inc \messaging_tokens_get_list()
  2. 6.2 messaging.admin.inc \messaging_tokens_get_list()
  3. 6.3 messaging.admin.inc \messaging_tokens_get_list()

Get list of tokens for text replacement

Parameters

$group: Message group to get tokens for

$tokens:

1 call to messaging_tokens_get_list()
messaging_admin_message_form in ./messaging.module
Edit message formats

File

./messaging.module, line 251

Code

function messaging_tokens_get_list($group) {

  // First compile token types for this message group
  $type_list = module_invoke_all('messaging', 'tokens', $group);

  // Now get token list from token module for each type
  $return = array();
  foreach ($type_list as $type) {
    if ($list = token_get_list($type)) {
      foreach ($list as $category => $tokens) {
        foreach ($tokens as $token => $description) {
          $return[$token] = $description;
        }
      }
    }
  }
  return $return;
}