You are here

function notifications_digest_token_values in Notifications 6.4

Implementation of hook_token_values()

File

notifications_digest/notifications_digest.module, line 355
Notifications digest module

Code

function notifications_digest_token_values($type, $object = NULL, $options = array()) {
  switch ($type) {
    case 'events':

      // $object is an array of event objects
      if ($object) {
        $list = $detail = array();

        // @ To do: some better event summary.
        foreach ($object as $event) {
          $list[] = $detail[] = $event
            ->get_type('description');
        }
        $values['event-list'] = implode("\n", $list);
        $values['event-detail'] = implode("\n", $detail);
        return $values;
      }
      break;
  }
}