function _context_contrib_get_views in Context 6
Same name and namespace in other branches
- 6.2 context_contrib/context_contrib.module \_context_contrib_get_views()
Helper function to generate a list of database and module provided views.
1 call to _context_contrib_get_views()
- context_contrib_context_conditions in context_contrib/
context_contrib.module - Implementation of hook_context_conditions().
File
- context_contrib/
context_contrib.module, line 97
Code
function _context_contrib_get_views() {
$enabled_views = array();
$views = views_get_all_views();
foreach ($views as $view) {
if (!isset($views[$view->name]->disabled) || !$views[$view->name]->disabled) {
$enabled_views[$view->name] = $view->name;
// Provide more granular options for each page display
$displays = array();
foreach ($view->display as $id => $display) {
if ($display->display_plugin == 'page') {
$displays[$view->name . ":" . $id] = "-- {$display->display_title}";
}
}
if (count($displays) > 1) {
$enabled_views += $displays;
}
}
}
ksort($enabled_views);
return $enabled_views;
}