function tvi_get_view_depth in Taxonomy Views Integrator 6
Views only saves the depth to the default display if it is not overridden in other displays.
1 call to tvi_get_view_depth()
- tvi_render_view in ./
tvi.module - Replaces taxonomy page callback
File
- ./
tvi.module, line 391 - Enables use of views for taxonomy pages.
Code
function tvi_get_view_depth($view, $display) {
// Depth set for preferred display plugin?
$view_depth = !empty($view->display[$display]->display_options['arguments']) && array_key_exists('term_node_tid_depth', $view->display[$display]->display_options['arguments']) ? $view->display[$display]->display_options['arguments']['term_node_tid_depth']['depth'] : NULL;
if (is_null($view_depth)) {
// Depth set for default?
$view_depth = array_key_exists('term_node_tid_depth', $view->display[TVI_DEFAULT_DISPLAY]->display_options['arguments']) ? $view->display[TVI_DEFAULT_DISPLAY]->display_options['arguments']['term_node_tid_depth']['depth'] : FALSE;
if ($view_depth && is_integer($view_depth)) {
return $view_depth;
// Default plugin depth
}
return 0;
}
return $view_depth;
// Preferred pugin depth
}