function og_get_available_views in Organic groups 5.7
Same name and namespace in other branches
- 5.8 og.module \og_get_available_views()
- 5 og.module \og_get_available_views()
- 5.2 og.module \og_get_available_views()
- 5.3 og.module \og_get_available_views()
1 call to og_get_available_views()
File
- ./
og.module, line 2820
Code
function og_get_available_views() {
$views = array();
$result = db_query("SELECT name, description FROM {view_view} WHERE name LIKE 'og_ghp_%'");
while ($view = db_fetch_object($result)) {
$views[$view->name] = check_plain("{$view->description} ({$view->name})");
}
views_load_cache();
// the function below was not loaded without this call
$default_views = _views_get_default_views();
$views_status = variable_get('views_defaults', array());
foreach ($default_views as $view) {
// filter this list to simplify for admins.
if (substr($view->name, 0, 7) == 'og_ghp_') {
if (!$views[$view->name] && ($views_status[$view->name] == 'enabled' || !$views_status[$view->name] && !$view->disabled)) {
$views[$view->name] = check_plain("{$view->description} ({$view->name})");
}
}
}
ksort($views);
return $views;
}