You are here

function views_rdf_foaf_views_argument in Views Datasource 5

argument hook that will display the RDF data document or display export icons.

2 calls to views_rdf_foaf_views_argument()
views_rdf_foaf_handler in ./views_rdf.module
handler for our own RDF FOAF argument handler
views_rdf_views_post_view in ./views_rdf.module
post view to display the render icons

File

./views_rdf.module, line 76
Provides Views plugin for rendering node content as RDF.

Code

function views_rdf_foaf_views_argument($op, &$view, $arg) {
  if ($op == 'argument' && $arg == 'rdf_foaf') {
    $view->page_type = 'views_' . $arg;
  }
  else {
    if ($op == 'post_view' && $view->build_type != 'block') {
      $args = views_post_view_make_args($view, $arg, $arg);
      $url = views_get_url($view, $args);
      $title = views_get_title($view, 'page', $args);
      $links = array();
      if ($arg == 'rdf_foaf') {
        if ($image = theme('image', drupal_get_path('module', 'views_rdf') . '/foaf80x15.png', t('FOAF'), t('Show @title as a FOAF document.', array(
          '@title' => $title,
        )))) {
          $links[] = l($image, $url, array(
            'class' => 'rdf-icon',
          ), $url_filter, NULL, FALSE, TRUE);
          return implode('  ', $links);
        }
      }
    }
  }
}