You are here

function node_gallery_api_build_views_select in Node Gallery 7

Builds a list of all views tagged with 'node_gallery'.

Return value

array 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.
1 call to node_gallery_api_build_views_select()
node_gallery_api_relationship_type_settings_form in ./node_gallery_api.admin.inc
Form definition for Relationship Type settings form.

File

./node_gallery_api.admin.inc, line 578
Node Gallery API admin interface.

Code

function node_gallery_api_build_views_select($tags = 'node_gallery') {

  // Load list of views into array for select lists.
  $tags = is_array($tags) ? $tags : array(
    $tags,
  );
  $select = array(
    '' => t('None'),
  );
  foreach (views_get_all_views() as $view) {
    if (!in_array($view->tag, $tags)) {
      continue;
    }
    foreach ($view->display as $display) {

      // Don't show the "Master" view.
      if ($display->id != 'default') {
        $select[$view->name][$view->name . ':' . $display->id] = $display->display_title;
      }
    }
  }
  return $select;
}