Commit ccc66002 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1788238 by dawehner: Cleanup display and seperate options from instances.

parent 277f8195
This diff is collapsed.
......@@ -69,7 +69,7 @@ function views_ajax() {
// Override the display's pager_element with the one actually used.
if (isset($pager_element)) {
$commands[] = views_ajax_command_scroll_top('.view-dom-id-' . $dom_id);
$view->display[$display_id]->handler->setOption('pager_element', $pager_element);
$view->displayHandlers[$display_id]->setOption('pager_element', $pager_element);
}
// Reuse the same DOM id so it matches that in Drupal.settings.
$view->dom_id = $dom_id;
......
......@@ -23,14 +23,14 @@ function views_ui_views_analyze($view) {
// You can give a page display the same path as an alias existing in the
// system, so the alias will not work anymore. Report this to the user,
// because he probably wanted something else.
foreach ($view->display as $id => $display) {
if (empty($display->handler)) {
foreach ($view->displayHandlers as $display) {
if (empty($display)) {
continue;
}
if ($display->handler->hasPath() && $path = $display->handler->getOption('path')) {
if ($display->hasPath() && $path = $display->getOption('path')) {
$normal_path = drupal_get_normal_path($path);
if ($path != $normal_path) {
$ret[] = Analyzer::formatMessage(t('You have configured display %display with a path which is an path alias as well. This might lead to unwanted effects so better use an internal path.', array('%display' => $display->display_title)), 'warning');
$ret[] = Analyzer::formatMessage(t('You have configured display %display with a path which is an path alias as well. This might lead to unwanted effects so better use an internal path.', array('%display' => $display['display_title'])), 'warning');
}
}
}
......
......@@ -326,7 +326,7 @@ public function buildGroupByForm(&$form, &$form_state) {
$type = $form_state['type'];
$id = $form_state['id'];
$form['#title'] = check_plain($view->display[$display_id]->display_title) . ': ';
$form['#title'] = check_plain($view->display[$display_id]['display_title']) . ': ';
$form['#title'] .= t('Configure aggregation settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $this->adminLabel()));
$form['#section'] = $display_id . '-' . $type . '-' . $id;
......
......@@ -26,6 +26,17 @@ abstract class PluginBase extends ComponentPluginBase {
*/
public $view = NULL;
/**
* The display object this plugin is for.
*
* For display plugins this is empty.
*
* @todo find a better description
*
* @var Drupal\views\Plugin\views\display\DisplayPluginBase
*/
public $displayHandler;
/**
* Plugins's definition
*
......@@ -40,6 +51,7 @@ abstract class PluginBase extends ComponentPluginBase {
*/
protected $usesOptions = FALSE;
/**
* Constructs a Plugin object.
*/
......@@ -164,7 +176,7 @@ public function query() { }
* Provide a full list of possible theme templates used by this style.
*/
public function themeFunctions() {
return views_theme_functions($this->definition['theme'], $this->view, $this->display);
return views_theme_functions($this->definition['theme'], $this->view, $this->view->display_handler->display);
}
/**
......@@ -174,7 +186,7 @@ public function additionalThemeFunctions() {
$funcs = array();
if (!empty($this->definition['additional themes'])) {
foreach ($this->definition['additional themes'] as $theme => $type) {
$funcs[] = views_theme_functions($theme, $this->view, $this->display);
$funcs[] = views_theme_functions($theme, $this->view, $this->view->display_handler->display);
}
}
return $funcs;
......
......@@ -36,10 +36,10 @@ abstract class AccessPluginBase extends PluginBase {
public function init(&$view, &$display) {
$this->setOptionDefaults($this->options, $this->defineOptions());
$this->view = &$view;
$this->display = &$display;
$this->displayHandler = &$display;
if (is_object($display->handler)) {
$options = $display->handler->getOption('access');
if (is_object($display)) {
$options = $display->getOption('access');
// Overlay incoming options on top of defaults
$this->unpackOptions($this->options, $options);
}
......
......@@ -65,10 +65,10 @@ abstract class CachePluginBase extends PluginBase {
public function init(&$view, &$display) {
$this->setOptionDefaults($this->options, $this->defineOptions());
$this->view = &$view;
$this->display = &$display;
$this->displayHandler = &$display;
if (is_object($display->handler)) {
$options = $display->handler->getOption('cache');
if (is_object($display)) {
$options = $display->getOption('cache');
// Overlay incoming options on top of defaults
$this->unpackOptions($this->options, $options);
}
......@@ -302,7 +302,7 @@ function get_results_key() {
}
}
$this->_results_key = $this->view->name . ':' . $this->display->id . ':results:' . md5(serialize($key_data));
$this->_results_key = $this->view->name . ':' . $this->displayHandler->display['id'] . ':results:' . md5(serialize($key_data));
}
return $this->_results_key;
......@@ -320,7 +320,7 @@ function get_output_key() {
'base_url' => $GLOBALS['base_url'],
);
$this->_output_key = $this->view->name . ':' . $this->display->id . ':output:' . md5(serialize($key_data));
$this->_output_key = $this->view->name . ':' . $this->displayHandler->display['id'] . ':output:' . md5(serialize($key_data));
}
return $this->_output_key;
......
......@@ -50,7 +50,7 @@ protected function defineOptions() {
}
public function execute() {
return $this->view->render($this->display->id);
return $this->view->render($this->display['id']);
}
public function attachmentPositions($position = NULL) {
......@@ -91,7 +91,7 @@ public function optionsSummary(&$categories, &$options) {
elseif (count($displays) == 1) {
$display = array_shift($displays);
if (!empty($this->view->display[$display])) {
$attach_to = check_plain($this->view->display[$display]->display_title);
$attach_to = check_plain($this->view->display[$display]['display_title']);
}
}
......@@ -194,8 +194,8 @@ public function buildOptionsForm(&$form, &$form_state) {
$form['#title'] .= t('Attach to');
$displays = array();
foreach ($this->view->display as $display_id => $display) {
if (!empty($display->handler) && $display->handler->acceptAttachments()) {
$displays[$display_id] = $display->display_title;
if (!empty($this->view->displayHandlers[$display_id]) && $this->view->displayHandlers[$display_id]->acceptAttachments()) {
$displays[$display_id] = $display['display_title'];
}
}
$form['displays'] = array(
......@@ -247,13 +247,13 @@ public function attachTo($display_id) {
$args = $this->getOption('inherit_arguments') ? $this->view->args : array();
$view->setArguments($args);
$view->setDisplay($this->display->id);
$view->setDisplay($this->display['id']);
if ($this->getOption('inherit_pager')) {
$view->display_handler->usesPager = $this->view->display[$display_id]->handler->usesPager();
$view->display_handler->setOption('pager', $this->view->display[$display_id]->handler->getOption('pager'));
}
$attachment = $view->executeDisplay($this->display->id, $args);
$attachment = $view->executeDisplay($this->display['id'], $args);
switch ($this->getOption('attachment_position')) {
case 'before':
......
......@@ -73,7 +73,7 @@ public function isDefaultDisplay() { return TRUE; }
* data if necessary.
*/
public function execute() {
return $this->view->render($this->display->id);
return $this->view->render($this->display['id']);
}
}
......@@ -153,7 +153,7 @@ public function optionsSummary(&$categories, &$options) {
elseif (count($displays) == 1) {
$display = array_shift($displays);
if (!empty($this->view->display[$display])) {
$attach_to = check_plain($this->view->display[$display]->display_title);
$attach_to = check_plain($this->view->display[$display]['display_title']);
}
}
......@@ -196,8 +196,9 @@ public function buildOptionsForm(&$form, &$form_state) {
$form['#title'] .= t('Attach to');
$displays = array();
foreach ($this->view->display as $display_id => $display) {
if (!empty($display->handler) && $display->handler->acceptAttachments()) {
$displays[$display_id] = $display->display_title;
// @todo The display plugin should have display_title and id as well.
if (!empty($this->view->displayHandlers[$display_id]) && $this->view->displayHandlers[$display_id]->acceptAttachments()) {
$displays[$display_id] = $display['display_title'];
}
}
$form['displays'] = array(
......@@ -244,7 +245,7 @@ public function attachTo($display_id) {
$plugin = $this->getPlugin('style', $name);
if ($plugin) {
$clone = $this->view->cloneView();
$clone->setDisplay($this->display->id);
$clone->setDisplay($this->display['id']);
$clone->buildTitle();
$plugin->attach_to($display_id, $this->getPath(), $clone->getTitle());
......
......@@ -80,7 +80,7 @@ public function executeHookMenu($callbacks) {
// views_arg_load -- which lives in views.module
$bits = explode('/', $this->getOption('path'));
$page_arguments = array($this->view->name, $this->display->id);
$page_arguments = array($this->view->name, $this->display['id']);
$this->view->initHandlers();
$view_arguments = $this->view->argument;
......@@ -141,7 +141,7 @@ public function executeHookMenu($callbacks) {
'access callback' => 'views_access',
'access arguments' => $access_arguments,
// Identify URL embedded arguments and correlate them to a handler
'load arguments' => array($this->view->name, $this->display->id, '%index'),
'load arguments' => array($this->view->name, $this->display['id'], '%index'),
);
$menu = $this->getOption('menu');
if (empty($menu)) {
......@@ -202,7 +202,7 @@ public function executeHookMenu($callbacks) {
'access callback' => 'views_access',
'access arguments' => $access_arguments,
// Identify URL embedded arguments and correlate them to a handler
'load arguments' => array($this->view->name, $this->display->id, '%index'),
'load arguments' => array($this->view->name, $this->display['id'], '%index'),
'title' => $tab_options['title'],
'description' => $tab_options['description'],
'menu_name' => $tab_options['name'],
......@@ -609,7 +609,7 @@ public function submitOptionsForm(&$form, &$form_state) {
$this->setOption('menu', $form_state['values']['menu']);
// send ajax form to options page if we use it.
if ($form_state['values']['menu']['type'] == 'default tab') {
views_ui_add_form_to_stack('display', $this->view, $this->display->id, array('tab_options'));
views_ui_add_form_to_stack('display', $this->view, $this->display['id'], array('tab_options'));
}
break;
case 'tab_options':
......@@ -623,13 +623,13 @@ public function validate() {
$menu = $this->getOption('menu');
if (!empty($menu['type']) && $menu['type'] != 'none' && empty($menu['title'])) {
$errors[] = t('Display @display is set to use a menu but the menu link text is not set.', array('@display' => $this->display->display_title));
$errors[] = t('Display @display is set to use a menu but the menu link text is not set.', array('@display' => $this->display['display_title']));
}
if ($menu['type'] == 'default tab') {
$tab_options = $this->getOption('tab_options');
if (!empty($tab_options['type']) && $tab_options['type'] != 'none' && empty($tab_options['title'])) {
$errors[] = t('Display @display is set to use a parent menu but the parent menu link text is not set.', array('@display' => $this->display->display_title));
$errors[] = t('Display @display is set to use a parent menu but the parent menu link text is not set.', array('@display' => $this->display['display_title']));
}
}
......
......@@ -40,7 +40,7 @@ abstract class ExposedFormPluginBase extends PluginBase {
public function init(&$view, &$display, $options = array()) {
$this->setOptionDefaults($this->options, $this->defineOptions());
$this->view = &$view;
$this->display = &$display;
$this->displayHandler = &$display;
$this->unpackOptions($this->options, $options);
}
......
......@@ -85,10 +85,10 @@ function pre_render($values) {
);
$handler = views_get_handler('views', 'area', 'area');
$handler->init($this->view, $options);
$this->display->handler->handlers['empty'] = array(
$this->displayHandler->handlers['empty'] = array(
'area' => $handler,
);
$this->display->handler->setOption('empty', array('text' => $options));
$this->displayHandler->setOption('empty', array('text' => $options));
}
}
......
......@@ -1608,15 +1608,15 @@ public function themeFunctions() {
$display = $this->view->display[$this->view->current_display];
if (!empty($display)) {
$themes[] = $hook . '__' . $this->view->name . '__' . $display->id . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->name . '__' . $display->id;
$themes[] = $hook . '__' . $display->id . '__' . $this->options['id'];
$themes[] = $hook . '__' . $display->id;
if ($display->id != $display->display_plugin) {
$themes[] = $hook . '__' . $this->view->name . '__' . $display->display_plugin . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->name . '__' . $display->display_plugin;
$themes[] = $hook . '__' . $display->display_plugin . '__' . $this->options['id'];
$themes[] = $hook . '__' . $display->display_plugin;
$themes[] = $hook . '__' . $this->view->name . '__' . $display['id'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->name . '__' . $display['id'];
$themes[] = $hook . '__' . $display['id'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $display['id'];
if ($display['id'] != $display['display_plugin']) {
$themes[] = $hook . '__' . $this->view->name . '__' . $display['display_plugin'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->name . '__' . $display['display_plugin'];
$themes[] = $hook . '__' . $display['display_plugin'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $display['display_plugin'];
}
}
$themes[] = $hook . '__' . $this->view->name . '__' . $this->options['id'];
......
......@@ -67,7 +67,7 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$pager_text = $this->display->handler->getPagerText();
$pager_text = $this->displayHandler->getPagerText();
$form['items_per_page'] = array(
'#title' => $pager_text['items per page title'],
'#type' => 'number',
......@@ -291,7 +291,7 @@ public function query() {
}
function render($input) {
$pager_theme = views_theme_functions('pager', $this->view, $this->display);
$pager_theme = views_theme_functions('pager', $this->view, $this->view->display[$this->view->current_display]);
// The 0, 1, 3, 4 index are correct. See theme_pager documentation.
$tags = array(
0 => $this->options['tags']['first'],
......
......@@ -32,7 +32,7 @@ public function summaryTitle() {
}
function render($input) {
$pager_theme = views_theme_functions('views_mini_pager', $this->view, $this->display);
$pager_theme = views_theme_functions('views_mini_pager', $this->view, $this->view->display[$this->view->current_display]);
return theme($pager_theme, array(
'parameters' => $input, 'element' => $this->options['id']));
}
......
......@@ -45,7 +45,7 @@ abstract class PagerPluginBase extends PluginBase {
public function init(&$view, &$display, $options = array()) {
$this->setOptionDefaults($this->options, $this->defineOptions());
$this->view = &$view;
$this->display = &$display;
$this->displayHandler = &$display;
$this->unpackOptions($this->options, $options);
}
......
......@@ -44,7 +44,7 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$pager_text = $this->display->handler->getPagerText();
$pager_text = $this->displayHandler->getPagerText();
$form['items_per_page'] = array(
'#title' => $pager_text['items per page title'],
'#type' => 'textfield',
......
......@@ -128,7 +128,7 @@ public function buildOptionsForm(&$form, &$form_state) {
// Only get views that are suitable:
// - base must the base that our relationship joins towards
// - must have fields.
if ($view->base_table == $this->definition['base'] && !empty($view->display['default']->display_options['fields'])) {
if ($view->base_table == $this->definition['base'] && !empty($view->display['default']['display_options']['fields'])) {
// TODO: check the field is the correct sort?
// or let users hang themselves at this stage and check later?
if ($view->type == 'Default') {
......@@ -195,7 +195,7 @@ function left_query($options) {
if ($options['subquery_view']) {
$temp_view = views_get_view($options['subquery_view']);
// Remove all fields from default display
unset($temp_view->display['default']->display_options['fields']);
unset($temp_view->display['default']['display_options']['fields']);
}
else {
// Create a new view object on the fly, which we use to generate a query
......
......@@ -50,7 +50,7 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$options = $this->display->handler->getFieldLabels();
$options = $this->displayHandler->getFieldLabels();
if (empty($this->options['inline'])) {
$this->options['inline'] = array();
......
......@@ -44,10 +44,10 @@ abstract class RowPluginBase extends PluginBase {
public function init(&$view, &$display, $options = NULL) {
$this->setOptionDefaults($this->options, $this->defineOptions());
$this->view = &$view;
$this->display = &$display;
$this->displayHandler = &$display;
// Overlay incoming options on top of defaults
$this->unpackOptions($this->options, isset($options) ? $options : $display->handler->getOption('row_options'));
// Overlay incoming options on top of defaults.
$this->unpackOptions($this->options, isset($options) ? $options : $display->getOption('row_options'));
}
/**
......
......@@ -46,7 +46,7 @@ public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$initial_labels = array('' => t('- None -'));
$view_fields_labels = $this->display->handler->getFieldLabels();
$view_fields_labels = $this->displayHandler->getFieldLabels();
$view_fields_labels = array_merge($initial_labels, $view_fields_labels);
$form['title_field'] = array(
......
......@@ -80,7 +80,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$options = array_intersect_key($this->options['mapping'], $mapping);
// Get the labels of the fields added to this display.
$field_labels = $this->display->handler->getFieldLabels();
$field_labels = $this->displayHandler->getFieldLabels();
// Provide some default values.
$defaults = array(
......
......@@ -33,7 +33,7 @@ class Rss extends StylePluginBase {
protected $usesRowPlugin = TRUE;
function attach_to($display_id, $path, $title) {
$display = $this->view->display[$display_id]->handler;
$display = $this->view->displayHandlers[$display_id];
$url_options = array();
$input = $this->view->getExposedInput();
if ($input) {
......
......@@ -92,13 +92,13 @@ abstract class StylePluginBase extends PluginBase {
public function init(&$view, &$display, $options = NULL) {
$this->setOptionDefaults($this->options, $this->defineOptions());
$this->view = &$view;
$this->display = &$display;
$this->displayHandler = &$display;
// Overlay incoming options on top of defaults
$this->unpackOptions($this->options, isset($options) ? $options : $display->handler->getOption('style_options'));
$this->unpackOptions($this->options, isset($options) ? $options : $display->getOption('style_options'));
if ($this->usesRowPlugin() && $display->handler->getOption('row_plugin')) {
$this->row_plugin = $display->handler->getPlugin('row');
if ($this->usesRowPlugin() && $display->getOption('row_plugin')) {
$this->row_plugin = $display->getPlugin('row');
}
$this->options += array(
......@@ -243,7 +243,7 @@ public function buildOptionsForm(&$form, &$form_state) {
// @TODO: Document "usesGrouping" in docs.php when docs.php is written.
if ($this->usesFields() && $this->usesGrouping()) {
$options = array('' => t('- None -'));
$field_labels = $this->display->handler->getFieldLabels(TRUE);
$field_labels = $this->displayHandler->getFieldLabels(TRUE);
$options += $field_labels;
// If there are no fields, we can't group on them.
if (count($options) > 1) {
......@@ -438,7 +438,7 @@ function render_grouping_sets($sets, $level = 0) {
$row = reset($set['rows']);
// Render as a grouping set.
if (is_array($row) && isset($row['group'])) {
$output .= theme(views_theme_functions('views_view_grouping', $this->view, $this->display),
$output .= theme(views_theme_functions('views_view_grouping', $this->view, $this->view->display[$this->view->current_display]),
array(
'view' => $this->view,
'grouping' => $this->options['grouping'][$level],
......@@ -662,8 +662,8 @@ public function validate() {
$errors = parent::validate();
if ($this->usesRowPlugin()) {
$name = $this->display->handler->getOption('row_plugin');
$plugin = $this->display->handler->getPlugin('row', $name);
$name = $this->displayHandler->getOption('row_plugin');
$plugin = $this->displayHandler->getPlugin('row', $name);
if (empty($plugin)) {
$errors[] = t('Style @style requires a row style but the row plugin is invalid.', array('@style' => $this->definition['title']));
}
......
......@@ -164,7 +164,7 @@ function build_sort_post() {
function sanitize_columns($columns, $fields = NULL) {
$sanitized = array();
if ($fields === NULL) {
$fields = $this->display->handler->getOption('fields');
$fields = $this->displayHandler->getOption('fields');
}
// Preconfigure the sanitized array so that the order is retained.
foreach ($fields as $field => $info) {
......@@ -197,7 +197,7 @@ function sanitize_columns($columns, $fields = NULL) {
*/
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$handlers = $this->display->handler->getHandlers('field');
$handlers = $this->displayHandler->getHandlers('field');
if (empty($handlers)) {
$form['error_markup'] = array(
'#markup' => '<div class="error messages">' . t('You need at least one field before you can configure your table settings') . '</div>',
......@@ -233,7 +233,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$columns = $this->sanitize_columns($this->options['columns']);
// Create an array of allowed columns from the data we know:
$field_names = $this->display->handler->getFieldLabels();
$field_names = $this->displayHandler->getFieldLabels();
if (isset($this->options['default'])) {
$default = $this->options['default'];
......
......@@ -662,8 +662,7 @@ protected function addDisplays($view, $display_options, $form, $form_state) {
* or a different row plugin.
*
* @return array
* Returns an array of display options, which are used in
* ViewDisplay::$display_options.
* Returns an array of display options.
*/
protected function default_display_options() {
$display_options = array();
......@@ -869,8 +868,7 @@ protected function default_display_sorts_user($form, $form_state) {
* The current state of the wizard form.
*
* @return array
* Returns an array of display options, which are used in
* ViewDisplay::$display_options.
* Returns an array of display options.
*/
protected function page_display_options(array $form, array &$form_state) {
$display_options = array();
......@@ -916,8 +914,7 @@ protected function page_display_options(array $form, array &$form_state) {
* The current state of the wizard form.
*
* @return array
* Returns an array of display options, which are used in
* ViewDisplay::$display_options.
* Returns an array of display options.
*/
protected function block_display_options(array $form, array &$form_state) {
$display_options = array();
......@@ -939,8 +936,7 @@ protected function block_display_options(array $form, array &$form_state) {
* The current state of the wizard form.
*
* @return array
* Returns an array of display options, which are used in
* ViewDisplay::$display_options.
* Returns an array of display options.
*/
protected function page_feed_display_options($form, $form_state) {
$display_options = array();
......
......@@ -50,7 +50,7 @@ public function testSimpleFiltering() {
$view = $this->getView();
// Add a filter.
$view->display['default']->handler->overrideOption('filters', array(
$view->displayHandlers['default']->overrideOption('filters', array(
'age' => array(
'operator' => '<',
'value' => array(
......@@ -108,7 +108,7 @@ public function testSimpleArgument() {
$view = $this->getView();
// Add a argument.
$view->display['default']->handler->overrideOption('arguments', array(
$view->displayHandlers['default']->overrideOption('arguments', array(
'age' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
......
......@@ -61,9 +61,9 @@ protected function setUp() {
}
foreach ($this->fields as $key => $field) {
$this->view->display_handler->display->display_options['fields'][$field['field_name']]['id'] = $field['field_name'];
$this->view->display_handler->display->display_options['fields'][$field['field_name']]['table'] = 'field_data_' . $field['field_name'];
$this->view->display_handler->display->display_options['fields'][$field['field_name']]['field'] = $field['field_name'];
$this->view->display_handler->display['display_options']['fields'][$field['field_name']]['id'] = $field['field_name'];
$this->view->display_handler->display['display_options']['fields'][$field['field_name']]['table'] = 'field_data_' . $field['field_name'];
$this->view->display_handler->display['display_options']['fields'][$field['field_name']]['field'] = $field['field_name'];
}
}
......@@ -100,8 +100,8 @@ public function _testSimpleFieldRender() {
*/
public function _testFormatterSimpleFieldRender() {
$view = $this->getView();
$view->display['default']->handler->options['fields'][$this->fields[0]['field_name']]['type'] = 'text_trimmed';
$view->display['default']->handler->options['fields'][$this->fields[0]['field_name']]['settings'] = array(
$view->displayHandlers['default']->options['fields'][$this->fields[0]['field_name']]['type'] = 'text_trimmed';
$view->displayHandlers['default']->options['fields'][$this->fields[0]['field_name']]['settings'] = array(
'trim_length' => 3,
);
$this->executeView($view);
......@@ -118,8 +118,8 @@ public function _testMultipleFieldRender() {
$view = $this->getView();
// Test delta limit.
$view->display['default']->handler->options['fields'][$this->fields[3]['field_name']]['group_rows'] = TRUE;
$view->display['default']->handler->options['fields'][$this->fields[3]['field_name']]['delta_limit'] = 3;
$view->displayHandlers['default']->options['fields'][$this->fields[3]['field_name']]['group_rows'] = TRUE;
$view->displayHandlers['default']->options['fields'][$this->fields[3]['field_name']]['delta_limit'] = 3;
$this->executeView($view);
for ($i = 0; $i < 3; $i++) {
......@@ -139,9 +139,9 @@ public function _testMultipleFieldRender() {
$view->destroy();
// Test delta limit + offset
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['group_rows'] = TRUE;
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['delta_limit'] = 3;
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['delta_offset'] = 1;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['group_rows'] = TRUE;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['delta_limit'] = 3;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['delta_offset'] = 1;
$this->executeView($view);
for ($i = 0; $i < 3; $i++) {
......@@ -157,10 +157,10 @@ public function _testMultipleFieldRender() {
$view->destroy();
// Test delta limit + reverse.
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['delta_offset'] = 0;
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['group_rows'] = TRUE;
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['delta_limit'] = 3;
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['delta_reversed'] = TRUE;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['delta_offset'] = 0;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['group_rows'] = TRUE;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['delta_limit'] = 3;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['delta_reversed'] = TRUE;
$this->executeView($view);
for ($i = 0; $i < 3; $i++) {
......@@ -177,10 +177,10 @@ public function _testMultipleFieldRender() {
$view->destroy();
// Test delta first last.
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['group_rows'] = TRUE;
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['delta_limit'] = 0;
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['delta_first_last'] = TRUE;
$view->display['default']->display_options['fields'][$this->fields[3]['field_name']]['delta_reversed'] = FALSE;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['group_rows'] = TRUE;
$view->display['default']['display_options']['fields'][$this->fields[3]['field_name']]['delta_limit'] = 0;