You are here

function calendar_ical_post_view_make_args in Calendar 5.2

Same name and namespace in other branches
  1. 5 calendar_ical.module \calendar_ical_post_view_make_args()

helper function -- this function builds a URL for a given feed. It defaults to the built in feed selector, but the 3rd arg can be used to set it up for custom selectors too.

1 call to calendar_ical_post_view_make_args()
calendar_ical_views_feed_argument in ./calendar_ical.module
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

File

./calendar_ical.module, line 270
Adds ical functionality to Calendar.

Code

function calendar_ical_post_view_make_args($view, $feed_id, $arg) {

  // assemble the URL
  $args = array();
  foreach ($view->argument as $id => $argdata) {
    if (isset($view->args[$id])) {
      $args[] = $view->args[$id];
    }
    else {
      if ($argdata['id'] == $feed_id && !in_array($arg, $args)) {
        $args[] = $arg;
      }
      else {
        if ($argdata['argdefault'] != 1 && !in_array($arg, $args)) {
          $args[] = $arg;
        }
      }
    }
  }
  return $args;
}