You are here

function flag_flag_definitions in Flag 6.2

Same name and namespace in other branches
  1. 5 flag.inc \flag_flag_definitions()
  2. 6 flag.inc \flag_flag_definitions()
  3. 7.2 flag.inc \flag_flag_definitions()

Implementation of hook_flag_definitions().

Defines the flag types this module implements.

Return value

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

1 call to flag_flag_definitions()
flag_fetch_definition in ./flag.inc
Returns a flag definition.

File

./flag.inc, line 18
Implements various flags. Uses object oriented style inspired by that of Views 2.

Code

function flag_flag_definitions() {
  $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',
    );
  }
  return $definitions;
}