You are here

function views_content_views_panes_add_defaults in Chaos Tool Suite (ctools) 7

Add defaults to view pane settings. This helps cover us if $allow settings changed and there are no actual settings for a particular item.

4 calls to views_content_views_panes_add_defaults()
views_content_views_panes_content_type_admin_info in views_content/plugins/content_types/views_panes.inc
Returns the administrative title for a type.
views_content_views_panes_content_type_admin_title in views_content/plugins/content_types/views_panes.inc
Returns the administrative title for a type.
views_content_views_panes_content_type_edit_form in views_content/plugins/content_types/views_panes.inc
Returns an edit form for a block.
views_content_views_panes_content_type_render in views_content/plugins/content_types/views_panes.inc
Output function for the 'views' content type.

File

views_content/plugins/content_types/views_panes.inc, line 326
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_views_panes_add_defaults(&$conf, $view) {
  $pager = $view->display_handler
    ->get_option('pager');
  if (empty($conf)) {
    $conf = array();
  }
  $conf += array(
    'link_to_view' => $view->display_handler
      ->get_option('link_to_view'),
    'more_link' => $view->display_handler
      ->get_option('use_more'),
    'feed_icons' => FALSE,
    'use_pager' => $pager['type'] != 'none' && $pager['type'] != 'some',
    'pager_id' => isset($pager['options']['id']) ? $pager['options']['id'] : 0,
    'items_per_page' => !empty($pager['options']['items_per_page']) ? $pager['options']['items_per_page'] : 10,
    'offset' => !empty($pager['options']['offset']) ? $pager['options']['offset'] : 0,
    'path_override' => FALSE,
    'path' => $view
      ->get_path(),
    'fields_override' => $view->display_handler
      ->get_option('fields_override'),
  );
}