You are here

function calendar_get_node_link in Calendar 5.2

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

Get the url for a calendar node.

Parameters

$node - a calendar node object:

$default - a default url to use when nothing specific is provided.:

4 calls to calendar_get_node_link()
calendar_build_nodes in ./calendar.inc
Take the array of items and alter it to an array of calendar nodes that the theme can handle.
calendar_ical_add_feeds in ./calendar_ical.module
Bring an ical feed into the calendar.
theme_calendar_ical_feed in ./calendar_ical.module
plugin that actually displays an ical feed
theme_jcalendar_view in jcalendar/jcalendar.module
Overrideable theme for the jcalendar popup view.

File

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

Code

function calendar_get_node_link($node, $default = NULL) {
  if (isset($node->url)) {
    return url($node->url, NULL, NULL, TRUE);
  }
  elseif (empty($node->remote) && is_numeric($node->nid)) {
    return url("node/{$node->nid}", NULL, NULL, TRUE);
  }
  elseif (!empty($default)) {
    return url($default, NULL, NULL, TRUE);
  }
}