You are here

function views_fetch_base_tables in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 8.3 views_ui/admin.inc \views_fetch_base_tables()
  2. 6.3 includes/admin.inc \views_fetch_base_tables()
  3. 6.2 includes/admin.inc \views_fetch_base_tables()

Fetch a list of all base tables available.

Return value

A keyed array of in the form of 'base_table' => 'Description'.

4 calls to views_fetch_base_tables()
views_ui::list_form in plugins/export_ui/views_ui.class.php
Create the filter/sort form at the top of a list of exports.
views_ui_edit_page_title in ./views_ui.module
Page title callback for the Edit View page.
views_ui_get_wizard in ./views_ui.module
Fetch metadata on a specific views ui wizard plugin.
views_ui_get_wizards in ./views_ui.module
Fetch metadata for all content_type plugins.

File

includes/admin.inc, line 5240
Provides the Views' administrative interface.

Code

function views_fetch_base_tables() {
  static $base_tables = array();
  if (empty($base_tables)) {
    $weights = array();
    $tables = array();
    $data = views_fetch_data();
    foreach ($data as $table => $info) {
      if (!empty($info['table']['base'])) {
        $tables[$table] = array(
          'title' => $info['table']['base']['title'],
          'description' => !empty($info['table']['base']['help']) ? $info['table']['base']['help'] : '',
          'weight' => !empty($info['table']['base']['weight']) ? $info['table']['base']['weight'] : 0,
        );
      }
    }
    uasort($tables, '_views_weight_sort');
    $base_tables = $tables;
  }
  return $base_tables;
}