You are here

function heartbeat_plugins_token_info in Heartbeat 7

Implements hook_token_info().

File

modules/heartbeat_plugins/heartbeat_plugins.module, line 251

Code

function heartbeat_plugins_token_info() {

  // Handy tokens for heartbeat_activity.
  $tokens = array();
  if (module_exists('flag')) {
    $flags = flag_get_flags('heartbeat_activity');
    foreach ($flags as $flag) {
      $tokens['heartbeat_activity']['flag-' . str_replace('_', '-', $flag->name) . '-count-linked'] = array(
        'name' => t('@flag flag count', array(
          '@flag' => $flag
            ->get_title(),
        )),
        'description' => t('Total flag count for flag @flag', array(
          '@flag' => $flag
            ->get_title(),
        )),
      );
    }
  }
  return array(
    'tokens' => $tokens,
  );
}