function panels_views_get_all_views in Panels 5.2
Get a list of all views as an option array.
This really should be included with views.
1 call to panels_views_get_all_views()
- panels_views_add_view_form in panels_views/
panels_views.module - Form to select a view for creating a new view pane.
File
- panels_views/
panels_views.module, line 1076 - panels_views.module
Code
function panels_views_get_all_views() {
views_load_cache();
$result = db_query("SELECT name, description FROM {view_view} ORDER BY name");
$views = array();
while ($view = db_fetch_object($result)) {
$views[$view->name] = check_plain($view->name);
}
$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)) {
$views[$view->name] = check_plain($view->name);
}
}
return $views;
}