You are here

function quicktabs_get_views in Quick Tabs 5

Same name and namespace in other branches
  1. 6.3 includes/admin.inc \quicktabs_get_views()
  2. 6 quicktabs.module \quicktabs_get_views()
  3. 6.2 includes/admin.inc \quicktabs_get_views()
  4. 7.3 quicktabs.admin.inc \quicktabs_get_views()
  5. 7.2 includes/admin.inc \quicktabs_get_views()
1 call to quicktabs_get_views()
_quicktabs_form in ./quicktabs.module

File

./quicktabs.module, line 100

Code

function quicktabs_get_views() {
  views_load_cache();
  $result = db_query("SELECT v.name, v.description, f.field FROM {view_view} v LEFT JOIN {view_exposed_filter} f ON v.vid=f.vid");
  $views = array();
  while ($view = db_fetch_object($result)) {
    if (!$view->field) {
      $views[$view->name] = $view->name . ': ' . $view->description;
    }
  }
  $default_views = _views_get_default_views();
  $views_status = variable_get('views_defaults', array());
  foreach ($default_views as $view) {
    if (!$views[$view->name] && ($views_status[$view->name] == 'enabled' || !$views_status[$view->name] && !$view->disabled) && empty($view->exposed_filter)) {
      $views[$view->name] = check_plain($view->name . ': ' . $view->description);
    }
  }
  return $views;
}