function panels_views_content_types in Panels 5.2
Return a list of each view type we support.
1 string reference to 'panels_views_content_types'
- panels_views_panels_content_types in panels_views/
panels_views.module - Implementation of hook_panels_content_types().
File
- panels_views/
panels_views.module, line 718 - panels_views.module
Code
function panels_views_content_types() {
$panes = panels_views_load_all();
$types = array();
foreach ($panes as $name => $pv) {
// Skip default but disabled panel views.
if (!empty($pv->disabled)) {
continue;
}
$contexts = array();
if (!empty($pv->contexts)) {
foreach ($pv->contexts as $context) {
if ($context['type'] == 'context') {
$contexts[] = new panels_required_context($context['label'], $context['context']);
}
}
}
$types[$name] = array(
'title' => filter_xss_admin($pv->title),
'icon' => $pv->view_type == 'block' ? 'icon_views_block.png' : 'icon_views_page.png',
'description' => filter_xss_admin($pv->description),
'path' => panels_get_path('content_types/views'),
'required context' => $contexts,
'category' => empty($pv->category) ? array(
t('Views'),
-1,
) : array(
$pv->category,
$pv->category_weight,
),
);
}
return $types;
}