You are here

function tvi_get_view_displays in Taxonomy Views Integrator 6

Same name and namespace in other branches
  1. 8 tvi.module \tvi_get_view_displays()
  2. 7 includes/tvi.admin.inc \tvi_get_view_displays()

Gathers the available display options for the view operating on this term or vocabulary.

Related topics

2 calls to tvi_get_view_displays()
tvi_display_options_ahah in includes/tvi.admin.inc
Returns html option set of available displays for view with specified view id
tvi_taxonomy_admin_form in includes/tvi.admin.inc
Form builder for the main TVI administration form.

File

includes/tvi.admin.inc, line 244
TVI Administration Interface

Code

function tvi_get_view_displays($view = NULL) {
  $displays = array();
  if ($view === NULL) {
    foreach (tvi_get_views(TRUE) as $view_name => $view) {
      foreach ($view->display as $display_name => $display) {

        // Suppress the 'default' plugin display
        $add = $display->display_plugin != 'default' ? ' - ' . $display->display_plugin : '';
        $displays[$view_name . ':' . $display_name] = $view->name . ' - ' . $display->display_title . $add;
      }
    }
  }
  else {

    // If it is a name or vid we can use this...
    if (!is_object($view)) {
      $view = views_get_view($view);
    }
    if (is_object($view)) {
      foreach ($view->display as $display_name => $display) {

        // Suppress the 'default' plugin display
        $add = $display->display_plugin != 'default' ? ' - ' . $display->display_plugin : '';
        $displays[$view->name . ':' . $display_name] = $display->display_title . $add;
      }
    }
  }
  return $displays;
}