1 views.block.inc protected ViewsBlock::setDefaultsFromView(View $view)

Given the loaded View object, populate the default settings for this block.

Parameters

View $view: The View being displayed within this block.

File

core/modules/views/includes/views.block.inc, line 31

Class

ViewsBlock
Displays a view listing as a block, with overriding options.

Code

protected function setDefaultsFromView(View $view) {
  $pager = $view->display_handler->get_option('pager');

  $this->settings = array_merge(array(
    'link_to_view' => $view->display_handler->get_option('link_to_view'),
    'more_link' => $view->display_handler->get_option('use_more'),
    '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' => $view->get_path(),
    'fields_override' => $view->display_handler->get_option('fields_override'),
  ), $this->settings);
}