You are here

function calendar_link in Calendar 7.2

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

Add link to calendar to nodes.

Controlled by value of 'calendar_date_link' in the view.

File

./calendar.module, line 482
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.'),
          ),
        ),
      );
    }
  }
}