function panels_views_panes_content_types in Panels 6.2
Return all views that have panel pane displays on them.
1 string reference to 'panels_views_panes_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 321 - panels_views.module
Code
function panels_views_panes_content_types() {
$types = array();
$views = views_get_all_views();
foreach ($views as $view) {
$view
->init_display();
foreach ($view->display as $id => $display) {
if (empty($display->handler->panel_pane_display)) {
continue;
}
$title = $display->handler
->get_option('pane_title');
if (!$title) {
$title = $view->name;
}
$description = $display->handler
->get_option('pane_description');
if (!$description) {
$description = $view->description;
}
$category = $display->handler
->get_option('pane_category');
if (!$category['name']) {
$category['name'] = t('View panes');
}
$icon = 'icon_views_page.png';
$contexts = array();
$arguments = $display->handler
->get_argument_input();
foreach ($arguments as $argument) {
if ($argument['type'] == 'context') {
$contexts[] = new panels_required_context($argument['label'], $argument['context']);
}
}
$types[$view->name . '-' . $id] = array(
'title' => $title,
'icon' => $icon,
'description' => filter_xss_admin($description),
'required context' => $contexts,
'category' => array(
$category['name'],
$category['weight'],
),
);
}
}
return $types;
}