You are here

function kml_link in KML 5

Same name and namespace in other branches
  1. 6 kml.module \kml_link()

Implementation of hook_link(). Adds KML links to individual nodes

File

./kml.module, line 516
KML Module

Code

function kml_link($type, $node = 0, $main = 0) {
  $links = array();

  // if node type is location enabled and has location info
  if (variable_get('location_maxnum_' . $node->type, 0) && $node->location) {
    if (variable_get('kml_nodelink', 1) && $main == 0 || variable_get('kml_nodelink_teaser', 0) && $main == 1) {
      $url = 'kml/node/' . $node->nid;
      if (variable_get('kml_usenetworklinks', 1)) {
        $url .= '/networklink';
      }
      $links['kml_link_node'] = array(
        'title' => t('KML'),
        'href' => $url,
        'attributes' => array(
          'title' => t('View location in Google Earth'),
        ),
      );
    }
  }
  return $links;
}