You are here

function calendar_get_node_link in Calendar 7.2

Same name and namespace in other branches
  1. 5.2 calendar.module \calendar_get_node_link()
  2. 6.2 calendar.module \calendar_get_node_link()
  3. 7 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.:

1 call 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.

File

./calendar.module, line 420
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) && !empty($node->nid) && is_numeric($node->nid)) {
    return url("node/{$node->nid}", array(
      'absolute' => TRUE,
    ));
  }
  elseif (!empty($default)) {
    return url($default, array(
      'absolute' => TRUE,
    ));
  }
}