You are here

function views_xhtml_hcalendar_views_argument in Views Datasource 5

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

2 calls to views_xhtml_hcalendar_views_argument()
views_xhtml_hcalendar_handler in ./views_xhtml.module
handler for our own XHTML hCalendar argument handler
views_xhtml_views_post_view in ./views_xhtml.module
post view to display the render icons

File

./views_xhtml.module, line 95
Provides Views plugin for rendering node content as XHTML microformats.

Code

function views_xhtml_hcalendar_views_argument($op, &$view, $arg) {
  if ($op == 'argument' && $arg == 'xhtml_hcalendar') {
    $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 == 'xhtml_hcalendar') {
        if ($image = theme('image', drupal_get_path('module', 'views_xhtml') . '/hcalendar.png', t('hCalendar'), t('Show @title as a hCalendar document.', array(
          '@title' => $title,
        )))) {
          $links[] = l($image, $url, array(
            'class' => 'xhtml-icon',
          ), $url_filter, NULL, FALSE, TRUE);
          return implode('  ', $links);
        }
      }
    }
  }
}