You are here

function hrules_token_list in Heartbeat 6.4

Implementation of hook_token_list().

File

modules/heartbeat_rules/hrules.module, line 54
Heartbeat rules implementation module

Code

function hrules_token_list($type = 'all') {
  $tokens = array();
  if ($type == 'boolean') {
    $tokens['boolean']['1-or-0'] = t("1 for true, 0 for false");
  }
  if ($type == 'rules_data_type_heartbeat_message_id') {
    $tokens['heartbeat_message']['message-id-raw'] = t("The message chosen by the user in raw");
    $tokens['heartbeat_message']['message-id'] = t("The message chosen by the user");
  }
  if ($type == 'rules_data_type_heartbeat_access') {
    $tokens['heartbeat_message']['message-access'] = t("The message access chosen by user");
  }
  if ($type == 'heartbeat_message') {
    $tokens['heartbeat_message']['heartbeat-message-uaid'] = t("Activity message ID");
    $tokens['heartbeat_message']['heartbeat-message-type'] = t("Machine name of the activity message template");
    $tokens['heartbeat_message']['heartbeat-message-uid'] = t("Message owner's user id");
    $tokens['heartbeat_message']['heartbeat-message-nid'] = t("Attached node's ID");
    $tokens['heartbeat_message']['heartbeat-message-language'] = t("Activity message language");
    $tokens['heartbeat_message']['heartbeat-message-nid-target'] = t("Target node ID");
    $tokens['heartbeat_message']['heartbeat-message-uid-target'] = t("Target user ID");
    $tokens['heartbeat_message']['heartbeat-message'] = t("The logged heartbeat message");
    $tokens['heartbeat_message']['heartbeat-message-raw'] = t("The logged heartbeat message in raw format");
    $tokens['heartbeat_message']['heartbeat-message-url'] = t("Absolute url to the parent activity message");
    $tokens['heartbeat_message']['heartbeat-message-link'] = t("Link to the parent activity message, the title is the moment it occurred");
    $tokens['heartbeat_message']['heartbeat-actor-picture'] = t("Avatar of the actor with a link to it leading to the user account page.");
  }
  if ($type == 'node') {
    $tokens['node']['title-link'] = t("The node's title with a link to it");
    $tokens['node']['author-name-url'] = t("The users name with a link to it");
    if (module_exists('image')) {
      $tokens['image']['node-image-thumbnail-link'] = t("An image thumbnail with a link to it");
      $tokens['image']['node-image-preview-link'] = t("An image preview with a link to it");
    }
  }
  if ($type == 'user') {
    $tokens['user']['user-name-url'] = t("The currently logged-in username with a link to it");
    $tokens['user']['user-profile-url'] = t("The currently logged-in username with a link to his/her profile page. <strong>USE ONLY when url-path is set to profile/username </strong>");
    $tokens['user']['heartbeat-user-picture'] = t("Avatar of the actor with a link to it leading to the user account page.");
  }
  return $tokens;
}