You are here

function tvi_get_view_info in Taxonomy Views Integrator 7

Same name and namespace in other branches
  1. 6 tvi.module \tvi_get_view_info()

Return information about the arguments given to the taxonomy term callback.

Parameters

int $tid: The term tid.

Return value

array The information array including the view, the display, the term and the TVI settings object.

2 calls to tvi_get_view_info()
tvi_render_view in ./tvi.module
Replace taxonomy page callback.
tvi_render_view_access in ./tvi.module
Check access for the current taxonomy page.

File

./tvi.module, line 311
Allow to define views to be used instead of default drupal behavior on taxonomy terms pages.

Code

function tvi_get_view_info($tid) {
  $info = tvi_get_term_info($tid, TVI_DATATYPE_ALL);
  $term = isset($info->term) ? $info->term : NULL;
  $view = isset($info->view) ? $info->view : NULL;
  $display = NULL;
  $settings = isset($info->settings) ? $info->settings : NULL;
  if (is_object($view) && is_object($settings) && isset($settings->status) && $settings->status) {
    $display = $settings->display;
  }

  // Important things to consider:
  //
  // * If this is a default view, then $settings will be NULL.
  // * The variable $term might be NULL if this is a multi term request.
  // * If $view or $display are NULL, then nothing was found.
  return array(
    $view,
    $display,
    $term,
    $settings,
  );
}