You are here

function context_contrib_views_pre_view in Context 6

Same name and namespace in other branches
  1. 6.2 context_contrib/context_contrib.module \context_contrib_views_pre_view()

Implementation of hook_views_pre_view().

File

context_contrib/context_contrib.module, line 81

Code

function context_contrib_views_pre_view($view, $args) {
  switch ($view->display_handler->display->display_plugin) {
    case 'page':
    case 'calendar':
      context_set_by_condition('views', $view->name);

      // Set any contexts associated with the current display
      if (!empty($view->current_display)) {
        context_set_by_condition('views', "{$view->name}:{$view->current_display}");
      }
      break;
  }
}