calendar_ical_views_feed_argument

Versions
5
calendar_ical_views_feed_argument($op, &$view, $arg, $argtype = NULL)

feed argument hook that will convert us to ical or display an icon. the 4th argument isn't part of the hook, but we use it to differentiate when called as a hook or when called manually from calendar_ical_views_post_view

▾ 2 functions call calendar_ical_views_feed_argument()

calendar_ical_views_post_view in contributions/calendar/calendar_ical.module
post view for our own op -- mimics the feed selector
views_handler_arg_ical in contributions/calendar/calendar_ical.module
handler for our own ical argument; mimics the feed selector

Code

contributions/calendar/calendar_ical.module, line 337

<?php
function calendar_ical_views_feed_argument($op, &$view, $arg, $argtype = NULL) {
	if ($op == 'argument' && $arg == 'ical') {
    // Keep devel module from appending queries to ical export.
  	$GLOBALS['devel_shutdown'] = FALSE;
    $view->page_type = 'calendar_ical';
    // reset the 'real url' to the URL without the feed argument.
    $view_args = array();
    $max = count($view->args);
    foreach ($view->args as $id => $view_arg) {
      ++$count;
      if ($view_arg == $arg && $view->argument[$id]['id'] == $argtype['id']) {
        if ($count != $max) {
          $view_args[] = $argtype['wildcard'];
        }
      }
      else {
        $view_args[] = $view_arg;
      }
    }
    $view->feed_url = views_get_url($view, $view_args);
  }
  else if ($op == 'post_view') {
    $args = calendar_ical_post_view_make_args($view, $arg, 'ical');
    $url = views_get_url($view, $args);
    $title = views_get_title($view, 'page', $args);
    if ($view->used_filters) {
      $filters = drupal_query_string_encode($view->used_filters);
    }
    return implode(calendar_ical_add_ical(url($url, $filters), $title));
  }
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.