You are here

function flag_hook_info in Flag 6.2

Same name and namespace in other branches
  1. 8.4 flag.module \flag_hook_info()
  2. 5 includes/flag.actions.inc \flag_hook_info()
  3. 6 includes/flag.actions.inc \flag_hook_info()
  4. 7.3 flag.module \flag_hook_info()

Implementation of hook_hook_info().

File

includes/flag.actions.inc, line 11
Hooks for flag actions.

Code

function flag_hook_info() {
  $hooks = array(
    'flag' => array(
      'flag' => array(
        'flag' => array(
          'runs when' => t('Content has been flagged with any flag'),
        ),
        'unflag' => array(
          'runs when' => t('Content has been unflagged with any flag'),
        ),
      ),
    ),
  );
  foreach (flag_get_flags() as $flag) {
    $hooks['flag']['flag']['flag_' . $flag->name]['runs when'] = t('A %type has been flagged with %name', array(
      '%type' => $flag->content_type,
      '%name' => $flag->name,
    ));
    $hooks['flag']['flag']['unflag_' . $flag->name]['runs when'] = t('A %type has been unflagged with %name', array(
      '%type' => $flag->content_type,
      '%name' => $flag->name,
    ));
  }
  return $hooks;
}