You are here

function kml_views_feed_argument in KML 5

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

File

./kml.module, line 633
KML Module

Code

function kml_views_feed_argument($op, &$view, $arg) {
  if ($op == 'argument' && $arg == 'kml') {
    $view->page_type = 'kml';
  }
  else {
    if ($op == 'post_view') {
      $path = views_post_view_make_url($view, $arg, 'kml');
      if (variable_get('kml_usenetworklinks', 1)) {

        // TODO: need a better way of dealing with network links using args.
        $path = 'kml/view/' . $view->name . '/networklink';
      }
      $url = url($path, NULL, NULL, TRUE);
      drupal_add_link(array(
        'rel' => 'alternate',
        'type' => 'application/vnd.google-earth.kml+xml',
        'title' => t('kml'),
        'href' => $url,
      ));
      return theme('kml_icon', $url, 'kml');
    }
  }
}