You are here

function calendar_get_node_link in Calendar 6.2

Same name and namespace in other branches
  1. 5.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.:

2 calls to calendar_get_node_link()
calendar_build_nodes in ./calendar.module
Take the array of items and alter it to an array of calendar nodes that the theme can handle.
theme_jcalendar_view in jcalendar/jcalendar.module
Overrideable theme for the jcalendar popup view.

File

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

Code

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