You are here

function views_fetch_base_tables in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 8.3 views_ui/admin.inc \views_fetch_base_tables()
  2. 6.2 includes/admin.inc \views_fetch_base_tables()
  3. 7.3 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'.

3 calls to views_fetch_base_tables()
template_preprocess_views_ui_list_views in includes/admin.inc
Preprocess the list views theme
views_ui_add_form in includes/admin.inc
Form constructor callback to create the views Add Form, phase 1.
views_ui_list_views_form in includes/admin.inc
Provide a form for sorting and filtering the list of views.

File

includes/admin.inc, line 3859
admin.inc 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' => $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;
}