You are here

function _views_content_panes_content_type in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 views_content/plugins/content_types/views_panes.inc \_views_content_panes_content_type()
2 calls to _views_content_panes_content_type()
views_content_views_panes_content_type_content_type in views_content/plugins/content_types/views_panes.inc
Return a single content type.
views_content_views_panes_content_type_content_types in views_content/plugins/content_types/views_panes.inc
Return all content types available.

File

views_content/plugins/content_types/views_panes.inc, line 83
Content type plugin to allow Views to be exposed as a display type, leaving most of the configuration on the view.

Code

function _views_content_panes_content_type($view, $display) {

  // Ensure the handler is the right type, as Views will fall back to
  // the default display if something is broken:
  if (!is_a($display->handler, 'views_content_plugin_display_panel_pane')) {
    return;
  }
  $title = views_content_get_display_title($view, $display->id);
  $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();
  ctools_include('views');
  foreach ($arguments as $argument) {
    $contexts[] = ctools_views_get_argument_context($argument);
  }
  $allow = $display->handler
    ->get_option('allow');
  return array(
    'title' => $title,
    'icon' => $icon,
    'description' => filter_xss_admin($description),
    'required context' => $contexts,
    'category' => array(
      $category['name'],
      $category['weight'],
    ),
    'no title override' => empty($allow['title_override']),
  );
}