You are here

function birthdays_trigger_info in Birthdays 7

Implements hook_trigger_info().

@todo: Find a better solution to per field instance triggers.

File

./birthdays.module, line 875
The Birthdays module allows users to add their birthday to their profile. It lists birthdays on a seperate page and in different blocks. Users can receive an email on their birthday automatically, and the administrator can receive daily reminders of…

Code

function birthdays_trigger_info() {
  $triggers = array();
  foreach (_birthdays_field_instances() as $instance) {

    // The name is supposed to be a hook name, but we want more granular hooks
    // without implementing them all. So we generate a unique key and implement
    // only hook_birthdays().
    $name = _birthdays_instance_hook($instance);

    // Create a localized label for the trigger.
    $label = _birthdays_instance_description($instance) . ' ' . t('(On Birthdays)');

    // Add it to the list of triggers.
    $triggers['birthdays'][$name] = array(
      'label' => $label,
    );
  }
  return $triggers;
}