You are here

function finder_views_get_displays in Finder 7

Same name and namespace in other branches
  1. 6 modules/finder_views/finder_views.module \finder_views_get_displays()

Get an array of content types for use in select forms.

2 calls to finder_views_get_displays()
finder_views_form_finder_admin_edit_alter in modules/finder_views/finder_views.module
Implements hook_form_FORM_ID_alter().
finder_views_form_finder_admin_element_edit_alter in modules/finder_views/finder_views.module
Implements hook_form_FORM_ID_alter().

File

modules/finder_views/finder_views.module, line 315
The finder views module.

Code

function finder_views_get_displays($view_name = NULL) {
  if (!$view_name) {
    return array(
      'default' => t('Defaults'),
    );
  }
  $options = array();
  $all_views = views_get_all_views();
  $view = $all_views[$view_name];
  foreach ($view->display as $key => $display) {
    $options[$key] = $display->display_title . ' (' . $key . ')';
  }
  return $options;
}