You are here

function node_gallery_build_views_select in Node Gallery 6.3

Builds a list of all views tagged with 'node_gallery'

Return value

An associative array where the key is a serialized array, and the value is the title of the view display. The serialized array key is:

  • name: the name of the view.
  • display_id: the display_id of the display.
2 calls to node_gallery_build_views_select()
node_gallery_relationship_settings_form in ./node_gallery.admin.inc
Returns a FAPI form array that renders the settings form when adding/editing a Gallery-to-Image relationship
node_gallery_settings_form in ./node_gallery.admin.inc
Displays the form at admin/settings/node_gallery/settings.

File

./node_gallery.admin.inc, line 49

Code

function node_gallery_build_views_select($tags = 'node_gallery') {

  // load list of views into array for select lists
  $tags = is_array($tags) ? $tags : array(
    $tags,
  );
  $select = array();
  foreach (views_get_all_views() as $view) {
    if (!in_array($view->tag, $tags)) {
      continue;
    }
    foreach ($view->display as $display) {
      $key = array();
      $key['name'] = $view->name;
      $key['display_id'] = $display->id;
      $select[$view->name][serialize($key)] = $display->display_title;
    }
  }
  return $select;
}