You are here

function calendar_link in Calendar 7

Same name and namespace in other branches
  1. 6.2 calendar.module \calendar_link()
  2. 7.2 calendar.module \calendar_link()

Add link to calendar to nodes.

Controlled by value of 'calendar_date_link' in the view.

File

./calendar.module, line 477
Adds calendar filtering and displays to Views.

Code

function calendar_link($type, $object, $teaser = FALSE) {
  if ($type == 'node' && !$teaser) {
    $path = variable_get('calendar_date_link_' . $object->type);
    if (!empty($path)) {
      return array(
        'calendar_link' => array(
          'title' => t('Calendar'),
          'href' => $path,
          'attributes' => array(
            'title' => t('View the calendar.'),
          ),
        ),
      );
    }
  }
}