You are here

function flag_flag_type_info in Flag 7.3

Implements hook_flag_type_info().

Defines the flag types this module implements.

Return value

array An "array of arrays", keyed by object type. The 'handler' slot should point to the PHP class implementing this flag.

File

./flag.flag.inc, line 17
Contains implementations of flag info hooks.

Code

function flag_flag_type_info() {

  // Entity types we specifically cater for.
  $definitions = array(
    'node' => array(
      'title' => t('Nodes'),
      'description' => t("Nodes are a Drupal site's primary content."),
      'handler' => 'flag_node',
    ),
    'user' => array(
      'title' => t('Users'),
      'description' => t('Users who have created accounts on your site.'),
      'handler' => 'flag_user',
    ),
  );
  if (module_exists('comment')) {
    $definitions['comment'] = array(
      'title' => t('Comments'),
      'description' => t('Comments are responses to node content.'),
      'handler' => 'flag_comment',
      'module' => 'comment',
    );
  }
  if (module_exists('taxonomy')) {
    $definitions['taxonomy_term'] = array(
      'title' => t('Taxonomy Terms'),
      'description' => t('Taxonomy terms are used to categorize content.'),
      'handler' => 'flag_entity',
      'module' => 'taxonomy',
    );
  }
  return $definitions;
}