diff --git a/core/modules/search-log b/core/modules/search-log new file mode 100644 index 0000000..e344de8 --- /dev/null +++ b/core/modules/search-log @@ -0,0 +1,68 @@ +lib/Drupal/views/Plugin/views/filter/Numeric.php: $value = &$input[$this->options['expose']['identifier']]; +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: $item = &$this->options; +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: $item = &$this->options; +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: $session = &$_SESSION['views'][$this->view->storage->id()][$display_id]; +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: $session = &$_SESSION['views'][$this->view->storage->id()][$display_id]; +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: $session = &$_SESSION['views'][$this->view->storage->id()][$display_id]; +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: $session = &$_SESSION['views'][$this->view->storage->id()][$display_id]; + + +lib/Drupal/views/Plugin/views/filter/Date.php: $value = &$form_state['values'][$this->options['expose']['identifier']]; + +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: $options = &$form_state['values']['options']['argument_default'][$default_id]; +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: $options = &$form_state['values']['options']['summary']['options'][$summary_id]; +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: $options = &$form_state['values']['options']['validate']['options'][$validate_id]; +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: $options = &$form_state['values']['options']; + +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: $this->display = &$display; +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: $this->handlers[$type][$id] = &$handler; +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: $element['#attached'] = &$this->view->element['#attached']; + + +lib/Drupal/views/Plugin/views/HandlerBase.php: $this->query = &$view->query; +lib/Drupal/views/Plugin/views/HandlerBase.php: $item = &$this->options; + +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: $options = &$form_state['values']['options']; + +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: $style_form = &$form['displays']['page']['options']['style']; +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: $style_form = &$form['displays']['block']['options']['style']; +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: $style_form = &$form['displays'][$type]['options']['style']; + +lib/Drupal/views/Plugin/views/query/QueryPluginBase.php: $groups = &$this->$where; +lib/Drupal/views/Plugin/views/argument_validator/Php.php: $handler = &$this->argument; +lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php: $fields = &$subquery->getFields(); +lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php: $tables = &$subquery->getTables(); +lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php: $where = &$subquery->conditions(); +lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php: $orders = &$subquery->getOrderBy(); +lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php: $sub_conditions = &$condition['field']->conditions(); + + +lib/Drupal/views/Plugin/views/style/StylePluginBase.php: $set = &$sets; +lib/Drupal/views/Plugin/views/style/StylePluginBase.php: $set = &$set[$grouping]['rows']; + + +lib/Drupal/views/Plugin/views/argument_default/Php.php: $argument = &$this->argument; +lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php: $display = &$view->getDisplay('feed_1'); +lib/Drupal/views/Tests/ViewExecutableTest.php: $display = &$view->storage->getDisplay('default'); +lib/Drupal/views/Tests/Handler/AreaTest.php: $empty_handler = &$view->empty['test_example']; +lib/Drupal/views/Tests/Handler/FieldWebTest.php: $alter = &$id_field->options['alter']; +lib/Drupal/views/ViewExecutable.php: $handlers = &$this->$key; +lib/Drupal/views/ViewExecutable.php: $handlers = &$this->$key; +lib/Drupal/views/ViewExecutable.php: $handlers = &$this->$key; +lib/Drupal/views/ViewExecutable.php: $handlers = &$this->$key; +lib/Drupal/views/DisplayBag.php: $display = &$this->view->storage->getDisplay($display_id); + + +views.module: $display = &$form_state['display']; +views.module: $handlers = &$form_state['view']->$type; +views.module: $handlers = &$form_state['view']->$type; +views.module: $tables = &$query->getTables(); +views.module: $where = &$query->conditions(); +views.module: $sub_conditions = &$condition['field']->conditions(); + +views.theme.inc: $fields = &$view->field; +views.theme.inc: $options = &$vars['options']; +views.theme.inc: $items = &$vars['rows']; +views.theme.inc: $options = &$vars['options']; +views.theme.inc: $item = &$vars['row']; +views.theme.inc: $form = &$vars['form']; diff --git a/core/modules/views/lib/Drupal/views/DisplayBag.php b/core/modules/views/lib/Drupal/views/DisplayBag.php index 72023f3..e32c1b2 100644 --- a/core/modules/views/lib/Drupal/views/DisplayBag.php +++ b/core/modules/views/lib/Drupal/views/DisplayBag.php @@ -76,7 +76,7 @@ protected function initializePlugin($display_id) { } // Retrieve and initialize the new display handler with data. - $display = &$this->view->storage->getDisplay($display_id); + $display = $this->view->storage->getDisplay($display_id); $this->pluginInstances[$display_id] = $this->manager->createInstance($display['display_plugin']); if (empty($this->pluginInstances[$display_id])) { // Provide a 'default' handler as an emergency. This won't work well but diff --git a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php index 1209901..34e7e17 100644 --- a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php +++ b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php @@ -125,8 +125,8 @@ function summary_join() { // shortcuts $options = $this->handler->options; - $view = &$this->handler->view; - $query = &$this->handler->query; + $view = $this->handler->view; + $query = $this->handler->query; if (!empty($options['require_value'])) { $join->type = 'INNER'; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php index 3f510aa..bc4daa2 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -136,7 +136,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o } } - $this->query = &$view->query; + $this->query = $view->query; } protected function defineOptions() { @@ -341,9 +341,7 @@ public function buildGroupByForm(&$form, &$form_state) { * There is no need for this function to actually store the data. */ public function submitGroupByForm(&$form, &$form_state) { - $item =& $form_state['handler']->options; - - $item['group_type'] = $form_state['values']['options']['group_type']; + $form_state['handler']->options['group_type'] = $form_state['values']['options']['group_type']; } /** @@ -822,7 +820,7 @@ public static function breakPhraseString($str, &$handler = NULL) { * Displays the Expose form. */ public function displayExposedForm($form, &$form_state) { - $item = &$this->options; + $item = $this->options; // flip $item['exposed'] = empty($item['exposed']); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php index 117ade9..6292946 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php @@ -428,7 +428,7 @@ public function submitOptionsForm(&$form, &$form_state) { } // Clear out the content of title if it's not enabled. - $options =& $form_state['values']['options']; + $options = &$form_state['values']['options']; if (empty($options['title_enable'])) { $options['title'] = ''; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/Php.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/Php.php index cf5a574..19e8b6d 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/Php.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/Php.php @@ -52,8 +52,8 @@ public function access() { function get_argument() { // set up variables to make it easier to reference during the argument. - $view = &$this->view; - $argument = &$this->argument; + $view = $this->view; + $argument = $this->argument; ob_start(); $result = eval($this->options['code']); ob_end_clean(); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Php.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Php.php index 9b23895..b9b0d7f 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Php.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Php.php @@ -51,8 +51,8 @@ public function access() { function validate_argument($argument) { // set up variables to make it easier to reference during the argument. - $view = &$this->view; - $handler = &$this->argument; + $view = $this->view; + $handler = $this->argument; ob_start(); $result = eval($this->options['code']); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index d527836..1ee2182 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -2468,7 +2468,7 @@ public function render() { '#theme' => $this->themeFunctions(), '#view' => $this->view, ); - $element['#attached'] = &$this->view->element['#attached']; + $element['#attached'] = $this->view->element['#attached']; return $element; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php~ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php~ new file mode 100644 index 0000000..d527836 --- /dev/null +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php~ @@ -0,0 +1,2805 @@ +setOptionDefaults($this->options, $this->defineOptions()); + $this->view = $view; + $this->display = &$display; + + // Load extenders as soon as possible. + $this->extender = array(); + $extenders = views_get_enabled_display_extenders(); + if (!empty($extenders)) { + $manager = Views::pluginManager('display_extender'); + foreach ($extenders as $extender) { + $plugin = $manager->createInstance($extender); + if ($plugin) { + $plugin->init($this->view, $this); + $this->extender[$extender] = $plugin; + } + } + } + + // Track changes that the user should know about. + $changed = FALSE; + + // Make some modifications: + if (!isset($options) && isset($display['display_options'])) { + $options = $display['display_options']; + } + + if ($this->isDefaultDisplay() && isset($options['defaults'])) { + unset($options['defaults']); + } + + // Cache for unpackOptions, but not if we are in the ui. + static $unpack_options = array(); + if (empty($view->editing)) { + $cid = 'unpackOptions:' . hash('sha256', serialize(array($this->options, $options))); + if (empty($unpack_options[$cid])) { + $cache = views_cache_get($cid, TRUE); + if (!empty($cache->data)) { + $this->options = $cache->data; + } + else { + $this->unpackOptions($this->options, $options); + views_cache_set($cid, $this->options, TRUE); + } + $unpack_options[$cid] = $this->options; + } + else { + $this->options = $unpack_options[$cid]; + } + } + else { + $this->unpackOptions($this->options, $options); + } + + // Convert the field_language and field_language_add_to_query settings. + $field_language = $this->getOption('field_language'); + $field_language_add_to_query = $this->getOption('field_language_add_to_query'); + if (isset($field_langcode)) { + $this->setOption('field_langcode', $field_language); + $this->setOption('field_langcode_add_to_query', $field_language_add_to_query); + $changed = TRUE; + } + + // Mark the view as changed so the user has a chance to save it. + if ($changed) { + $this->view->changed = TRUE; + } + } + + public function destroy() { + parent::destroy(); + + foreach ($this->handlers as $type => $handlers) { + foreach ($handlers as $id => $handler) { + if (is_object($handler)) { + $this->handlers[$type][$id]->destroy(); + } + } + } + + if (isset($this->default_display)) { + unset($this->default_display); + } + + foreach ($this->extender as $extender) { + $extender->destroy(); + } + } + + /** + * Determine if this display is the 'default' display which contains + * fallback settings + */ + public function isDefaultDisplay() { return FALSE; } + + /** + * Determine if this display uses exposed filters, so the view + * will know whether or not to build them. + */ + public function usesExposed() { + if (!isset($this->has_exposed)) { + foreach ($this->handlers as $type => $value) { + foreach ($this->view->$type as $id => $handler) { + if ($handler->canExpose() && $handler->isExposed()) { + // one is all we need; if we find it, return true. + $this->has_exposed = TRUE; + return TRUE; + } + } + } + $pager = $this->getPlugin('pager'); + if (isset($pager) && $pager->uses_exposed()) { + $this->has_exposed = TRUE; + return TRUE; + } + $this->has_exposed = FALSE; + } + + return $this->has_exposed; + } + + /** + * Determine if this display should display the exposed + * filters widgets, so the view will know whether or not + * to render them. + * + * Regardless of what this function + * returns, exposed filters will not be used nor + * displayed unless usesExposed() returns TRUE. + */ + public function displaysExposed() { + return TRUE; + } + + /** + * Whether the display allows the use of AJAX or not. + * + * @return bool + */ + public function usesAJAX() { + return $this->usesAJAX; + } + + /** + * Whether the display is actually using AJAX or not. + * + * @return bool + */ + public function ajaxEnabled() { + if ($this->usesAJAX()) { + return $this->getOption('use_ajax'); + } + return FALSE; + } + + /** + * Whether the display is enabled. + * + * @return bool + * Returns TRUE if the display is marked as enabled, else FALSE. + */ + public function isEnabled() { + return (bool) $this->getOption('enabled'); + } + + /** + * Whether the display allows the use of a pager or not. + * + * @return bool + */ + + public function usesPager() { + return $this->usesPager; + } + + /** + * Whether the display is using a pager or not. + * + * @return bool + */ + public function isPagerEnabled() { + if ($this->usesPager()) { + $pager = $this->getPlugin('pager'); + if ($pager) { + return $pager->use_pager(); + } + } + return FALSE; + } + + /** + * Whether the display allows the use of a 'more' link or not. + * + * @return bool + */ + public function usesMore() { + return $this->usesMore; + } + + /** + * Whether the display is using the 'more' link or not. + * + * @return bool + */ + public function isMoreEnabled() { + if ($this->usesMore()) { + return $this->getOption('use_more'); + } + return FALSE; + } + + /** + * Does the display have groupby enabled? + */ + public function useGroupBy() { + return $this->getOption('group_by'); + } + + /** + * Should the enabled display more link be shown when no more items? + */ + public function useMoreAlways() { + if ($this->usesMore()) { + return $this->getOption('use_more_always'); + } + return FALSE; + } + + /** + * Does the display have custom link text? + */ + public function useMoreText() { + if ($this->usesMore()) { + return $this->getOption('use_more_text'); + } + return FALSE; + } + + /** + * Determines whether this display can use attachments. + * + * @return bool + */ + public function acceptAttachments() { + // To be able to accept attachments this display have to be able to use + // attachments but at the same time, you cannot attach a display to itself. + if (!$this->usesAttachments() || ($this->definition['id'] == $this->view->current_display)) { + return FALSE; + } + + if (!empty($this->view->argument) && $this->getOption('hide_attachment_summary')) { + foreach ($this->view->argument as $argument_id => $argument) { + if ($argument->needsStylePlugin() && empty($argument->argument_validated)) { + return FALSE; + } + } + } + + return TRUE; + } + + /** + * Returns whether the display can use attachments. + * + * @return bool + */ + public function usesAttachments() { + return $this->usesAttachments; + } + + /** + * Returns whether the display can use areas. + * + * @return bool + * TRUE if the display can use areas, or FALSE otherwise. + */ + public function usesAreas() { + return $this->usesAreas; + } + + /** + * Allow displays to attach to other views. + */ + public function attachTo(ViewExecutable $view, $display_id) { } + + /** + * Static member function to list which sections are defaultable + * and what items each section contains. + */ + public function defaultableSections($section = NULL) { + $sections = array( + 'access' => array('access'), + 'cache' => array('cache'), + 'title' => array('title'), + 'css_class' => array('css_class'), + 'use_ajax' => array('use_ajax'), + 'hide_attachment_summary' => array('hide_attachment_summary'), + 'show_admin_links' => array('show_admin_links'), + 'group_by' => array('group_by'), + 'query' => array('query'), + 'use_more' => array('use_more', 'use_more_always', 'use_more_text'), + 'use_more_always' => array('use_more', 'use_more_always', 'use_more_text'), + 'use_more_text' => array('use_more', 'use_more_always', 'use_more_text'), + 'link_display' => array('link_display', 'link_url'), + + // Force these to cascade properly. + 'style' => array('style', 'row'), + 'row' => array('style', 'row'), + + 'pager' => array('pager', 'pager_options'), + 'pager_options' => array('pager', 'pager_options'), + + 'exposed_form' => array('exposed_form', 'exposed_form_options'), + 'exposed_form_options' => array('exposed_form', 'exposed_form_options'), + + // These guys are special + 'header' => array('header'), + 'footer' => array('footer'), + 'empty' => array('empty'), + 'relationships' => array('relationships'), + 'fields' => array('fields'), + 'sorts' => array('sorts'), + 'arguments' => array('arguments'), + 'filters' => array('filters', 'filter_groups'), + 'filter_groups' => array('filters', 'filter_groups'), + ); + + // If the display cannot use a pager, then we cannot default it. + if (!$this->usesPager()) { + unset($sections['pager']); + unset($sections['items_per_page']); + } + + foreach ($this->extender as $extender) { + $extender->defaultableSections($sections, $section); + } + + if ($section) { + if (!empty($sections[$section])) { + return $sections[$section]; + } + } + else { + return $sections; + } + } + + protected function defineOptions() { + $options = array( + 'defaults' => array( + 'default' => array( + 'access' => TRUE, + 'cache' => TRUE, + 'query' => TRUE, + 'title' => TRUE, + 'css_class' => TRUE, + + 'display_description' => FALSE, + 'use_ajax' => TRUE, + 'hide_attachment_summary' => TRUE, + 'show_admin_links' => TRUE, + 'pager' => TRUE, + 'use_more' => TRUE, + 'use_more_always' => TRUE, + 'use_more_text' => TRUE, + 'exposed_form' => TRUE, + + 'link_display' => TRUE, + 'link_url' => '', + 'group_by' => TRUE, + + 'style' => TRUE, + 'row' => TRUE, + + 'header' => TRUE, + 'footer' => TRUE, + 'empty' => TRUE, + + 'relationships' => TRUE, + 'fields' => TRUE, + 'sorts' => TRUE, + 'arguments' => TRUE, + 'filters' => TRUE, + 'filter_groups' => TRUE, + ), + ), + + 'title' => array( + 'default' => '', + 'translatable' => TRUE, + ), + 'enabled' => array( + 'default' => TRUE, + 'translatable' => FALSE, + 'bool' => TRUE, + ), + 'display_comment' => array( + 'default' => '', + ), + 'css_class' => array( + 'default' => '', + 'translatable' => FALSE, + ), + 'display_description' => array( + 'default' => '', + 'translatable' => TRUE, + ), + 'use_ajax' => array( + 'default' => FALSE, + 'bool' => TRUE, + ), + 'hide_attachment_summary' => array( + 'default' => FALSE, + 'bool' => TRUE, + ), + 'show_admin_links' => array( + 'default' => TRUE, + 'bool' => TRUE, + ), + 'use_more' => array( + 'default' => FALSE, + 'bool' => TRUE, + ), + 'use_more_always' => array( + 'default' => FALSE, + 'bool' => TRUE, + ), + 'use_more_text' => array( + 'default' => 'more', + 'translatable' => TRUE, + ), + 'link_display' => array( + 'default' => '', + ), + 'link_url' => array( + 'default' => '', + ), + 'group_by' => array( + 'default' => FALSE, + 'bool' => TRUE, + ), + 'field_langcode' => array( + 'default' => '***CURRENT_LANGUAGE***', + ), + 'field_langcode_add_to_query' => array( + 'default' => TRUE, + 'bool' => TRUE, + ), + + // These types are all plugins that can have individual settings + // and therefore need special handling. + 'access' => array( + 'contains' => array( + 'type' => array('default' => 'none'), + 'options' => array('default' => array()), + ), + 'merge_defaults' => array($this, 'mergePlugin'), + ), + 'cache' => array( + 'contains' => array( + 'type' => array('default' => 'none'), + 'options' => array('default' => array()), + ), + 'merge_defaults' => array($this, 'mergePlugin'), + ), + 'query' => array( + 'contains' => array( + 'type' => array('default' => 'views_query'), + 'options' => array('default' => array()), + ), + 'merge_defaults' => array($this, 'mergePlugin'), + ), + 'exposed_form' => array( + 'contains' => array( + 'type' => array('default' => 'basic'), + 'options' => array('default' => array()), + ), + 'merge_defaults' => array($this, 'mergePlugin'), + ), + 'pager' => array( + 'contains' => array( + 'type' => array('default' => 'mini'), + 'options' => array('default' => array()), + ), + 'merge_defaults' => array($this, 'mergePlugin'), + ), + 'style' => array( + 'contains' => array( + 'type' => array('default' => 'default'), + 'options' => array('default' => array()), + ), + 'merge_defaults' => array($this, 'mergePlugin'), + ), + 'row' => array( + 'contains' => array( + 'type' => array('default' => 'fields'), + 'options' => array('default' => array()), + ), + 'merge_defaults' => array($this, 'mergePlugin'), + ), + + 'exposed_block' => array( + 'default' => FALSE, + ), + + 'header' => array( + 'default' => array(), + 'merge_defaults' => array($this, 'mergeHandler'), + ), + 'footer' => array( + 'default' => array(), + 'merge_defaults' => array($this, 'mergeHandler'), + ), + 'empty' => array( + 'default' => array(), + 'merge_defaults' => array($this, 'mergeHandler'), + ), + + // We want these to export last. + // These are the 5 handler types. + 'relationships' => array( + 'default' => array(), + 'merge_defaults' => array($this, 'mergeHandler'), + ), + 'fields' => array( + 'default' => array(), + 'merge_defaults' => array($this, 'mergeHandler'), + ), + 'sorts' => array( + 'default' => array(), + 'merge_defaults' => array($this, 'mergeHandler'), + ), + 'arguments' => array( + 'default' => array(), + 'merge_defaults' => array($this, 'mergeHandler'), + ), + 'filter_groups' => array( + 'contains' => array( + 'operator' => array('default' => 'AND'), + 'groups' => array('default' => array(1 => 'AND')), + ), + ), + 'filters' => array( + 'default' => array(), + ), + ); + + if (!$this->usesPager()) { + $options['defaults']['default']['use_pager'] = FALSE; + $options['defaults']['default']['items_per_page'] = FALSE; + $options['defaults']['default']['offset'] = FALSE; + $options['defaults']['default']['pager'] = FALSE; + $options['pager']['contains']['type']['default'] = 'some'; + } + + if ($this->isDefaultDisplay()) { + unset($options['defaults']); + } + + foreach ($this->extender as $extender) { + $extender->defineOptionsAlter($options); + } + + return $options; + } + + /** + * Check to see if the display has a 'path' field. + * + * This is a pure function and not just a setting on the definition + * because some displays (such as a panel pane) may have a path based + * upon configuration. + * + * By default, displays do not have a path. + */ + public function hasPath() { return FALSE; } + + /** + * Check to see if the display has some need to link to another display. + * + * For the most part, displays without a path will use a link display. However, + * sometimes displays that have a path might also need to link to another display. + * This is true for feeds. + */ + public function usesLinkDisplay() { return !$this->hasPath(); } + + /** + * Check to see if the display can put the exposed formin a block. + * + * By default, displays that do not have a path cannot disconnect + * the exposed form and put it in a block, because the form has no + * place to go and Views really wants the forms to go to a specific + * page. + */ + public function usesExposedFormInBlock() { return $this->hasPath(); } + + /** + * Find out all displays which are attached to this display. + * + * The method is just using the pure storage object to avoid loading of the + * sub displays which would kill lazy loading. + */ + public function getAttachedDisplays() { + $current_display_id = $this->display['id']; + $attached_displays = array(); + + // Go through all displays and search displays which link to this one. + foreach ($this->view->storage->get('display') as $display_id => $display) { + if (isset($display['display_options']['displays'])) { + $displays = $display['display_options']['displays']; + if (isset($displays[$current_display_id])) { + $attached_displays[] = $display_id; + } + } + } + + return $attached_displays; + } + + /** + * Check to see which display to use when creating links within + * a view using this display. + */ + public function getLinkDisplay() { + $display_id = $this->getOption('link_display'); + // If unknown, pick the first one. + if (empty($display_id) || !$this->view->displayHandlers->has($display_id)) { + foreach ($this->view->displayHandlers as $display_id => $display) { + if (!empty($display) && $display->hasPath()) { + return $display_id; + } + } + } + else { + return $display_id; + } + // fall-through returns NULL + } + + /** + * Return the base path to use for this display. + * + * This can be overridden for displays that do strange things + * with the path. + */ + public function getPath() { + if ($this->hasPath()) { + return $this->getOption('path'); + } + + $display_id = $this->getLinkDisplay(); + if ($display_id && $this->view->displayHandlers->has($display_id) && is_object($this->view->displayHandlers->get($display_id))) { + return $this->view->displayHandlers->get($display_id)->getPath(); + } + } + + public function getUrl() { + return $this->view->getUrl(); + } + + /** + * Check to see if the display needs a breadcrumb + * + * By default, displays do not need breadcrumbs + */ + public function usesBreadcrumb() { return FALSE; } + + /** + * Determine if a given option is set to use the default display or the + * current display + * + * @return + * TRUE for the default display + */ + public function isDefaulted($option) { + return !$this->isDefaultDisplay() && !empty($this->default_display) && !empty($this->options['defaults'][$option]); + } + + /** + * Intelligently get an option either from this display or from the + * default display, if directed to do so. + */ + public function getOption($option) { + if ($this->isDefaulted($option)) { + return $this->default_display->getOption($option); + } + + if (array_key_exists($option, $this->options)) { + return $this->options[$option]; + } + } + + /** + * Determine if the display's style uses fields. + * + * @return bool + */ + public function usesFields() { + return $this->getPlugin('style')->usesFields(); + } + + /** + * Get the instance of a plugin, for example style or row. + * + * @param string $type + * The type of the plugin. + * + * @return \Drupal\views\Plugin\views\PluginBase + */ + public function getPlugin($type) { + // Look up the plugin name to use for this instance. + $options = $this->getOption($type); + $name = $options['type']; + + // Query plugins allow specifying a specific query class per base table. + if ($type == 'query') { + $views_data = Views::viewsData()->get($this->view->storage->get('base_table')); + $name = isset($views_data['table']['base']['query_id']) ? $views_data['table']['base']['query_id'] : 'views_query'; + } + + // Plugin instances are stored on the display for re-use. + if (!isset($this->plugins[$type][$name])) { + $plugin = Views::pluginManager($type)->createInstance($name); + + // Initialize the plugin. + $plugin->init($this->view, $this, $options['options']); + + $this->plugins[$type][$name] = $plugin; + } + + return $this->plugins[$type][$name]; + } + + /** + * Get the handler object for a single handler. + */ + public function &getHandler($type, $id) { + if (!isset($this->handlers[$type])) { + $this->getHandlers($type); + } + + if (isset($this->handlers[$type][$id])) { + return $this->handlers[$type][$id]; + } + + // So we can return a reference. + $null = NULL; + return $null; + } + + /** + * Get a full array of handlers for $type. This caches them. + */ + public function getHandlers($type) { + if (!isset($this->handlers[$type])) { + $this->handlers[$type] = array(); + $types = ViewExecutable::viewsHandlerTypes(); + $plural = $types[$type]['plural']; + + foreach ($this->getOption($plural) as $id => $info) { + // If this is during form submission and there are temporary options + // which can only appear if the view is in the edit cache, use those + // options instead. This is used for AJAX multi-step stuff. + if (isset($_POST['form_id']) && isset($this->view->temporary_options[$type][$id])) { + $info = $this->view->temporary_options[$type][$id]; + } + + if ($info['id'] != $id) { + $info['id'] = $id; + } + + // If aggregation is on, the group type might override the actual + // handler that is in use. This piece of code checks that and, + // if necessary, sets the override handler. + $override = NULL; + if ($this->useGroupBy() && !empty($info['group_type'])) { + if (empty($this->view->query)) { + $this->view->initQuery(); + } + $aggregate = $this->view->query->get_aggregation_info(); + if (!empty($aggregate[$info['group_type']]['handler'][$type])) { + $override = $aggregate[$info['group_type']]['handler'][$type]; + } + } + + if (!empty($types[$type]['type'])) { + $handler_type = $types[$type]['type']; + } + else { + $handler_type = $type; + } + + if ($handler = views_get_handler($info, $handler_type, $override)) { + // Special override for area types so they know where they come from. + if ($handler instanceof AreaPluginBase) { + $handler->areaType = $type; + } + + $handler->init($this->view, $this, $info); + $this->handlers[$type][$id] = &$handler; + } + + // Prevent reference problems. + unset($handler); + } + } + + return $this->handlers[$type]; + } + + /** + * Retrieves a list of fields for the current display. + * + * This also takes into account any associated relationships, if they exist. + * + * @param bool $groupable_only + * (optional) TRUE to only return an array of field labels from handlers + * that support the use_string_group_by method, defaults to FALSE. + * + * @return array + * An array of applicable field options, keyed by ID. + */ + public function getFieldLabels($groupable_only = FALSE) { + $options = array(); + foreach ($this->getHandlers('relationship') as $relationship => $handler) { + $relationships[$relationship] = $handler->adminLabel(); + } + + foreach ($this->getHandlers('field') as $id => $handler) { + if ($groupable_only && !$handler->use_string_group_by()) { + // Continue to next handler if it's not groupable. + continue; + } + if ($label = $handler->label()) { + $options[$id] = $label; + } + else { + $options[$id] = $handler->adminLabel(); + } + if (!empty($handler->options['relationship']) && !empty($relationships[$handler->options['relationship']])) { + $options[$id] = '(' . $relationships[$handler->options['relationship']] . ') ' . $options[$id]; + } + } + return $options; + } + + /** + * Intelligently set an option either from this display or from the + * default display, if directed to do so. + */ + public function setOption($option, $value) { + if ($this->isDefaulted($option)) { + return $this->default_display->setOption($option, $value); + } + + // Set this in two places: On the handler where we'll notice it + // but also on the display object so it gets saved. This should + // only be a temporary fix. + $this->display['display_options'][$option] = $value; + return $this->options[$option] = $value; + } + + /** + * Set an option and force it to be an override. + */ + public function overrideOption($option, $value) { + $this->setOverride($option, FALSE); + $this->setOption($option, $value); + } + + /** + * Because forms may be split up into sections, this provides + * an easy URL to exactly the right section. Don't override this. + */ + public function optionLink($text, $section, $class = '', $title = '') { + if (!empty($class)) { + $text = '' . $text . ''; + } + + if (!trim($text)) { + $text = t('Broken field'); + } + + if (empty($title)) { + $title = $text; + } + + return l($text, 'admin/structure/views/nojs/display/' . $this->view->storage->id() . '/' . $this->display['id'] . '/' . $section, array('attributes' => array('class' => 'views-ajax-link ' . $class, 'title' => $title, 'id' => drupal_html_id('views-' . $this->display['id'] . '-' . $section)), 'html' => TRUE)); + } + + /** + * Returns to tokens for arguments. + * + * This function is similar to views_handler_field::get_render_tokens() + * but without fields tokens. + */ + public function getArgumentsTokens() { + $tokens = array(); + if (!empty($this->view->build_info['substitutions'])) { + $tokens = $this->view->build_info['substitutions']; + } + $count = 0; + foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) { + $token = '%' . ++$count; + if (!isset($tokens[$token])) { + $tokens[$token] = ''; + } + + // Use strip tags as there should never be HTML in the path. + // However, we need to preserve special characters like " that + // were removed by check_plain(). + $tokens['!' . $count] = isset($this->view->args[$count - 1]) ? strip_tags(decode_entities($this->view->args[$count - 1])) : ''; + } + + return $tokens; + } + + /** + * Provide the default summary for options in the views UI. + * + * This output is returned as an array. + */ + public function optionsSummary(&$categories, &$options) { + $categories = array( + 'title' => array( + 'title' => t('Title'), + 'column' => 'first', + ), + 'format' => array( + 'title' => t('Format'), + 'column' => 'first', + ), + 'filters' => array( + 'title' => t('Filters'), + 'column' => 'first', + ), + 'fields' => array( + 'title' => t('Fields'), + 'column' => 'first', + ), + 'pager' => array( + 'title' => t('Pager'), + 'column' => 'second', + ), + 'exposed' => array( + 'title' => t('Exposed form'), + 'column' => 'third', + 'build' => array( + '#weight' => 1, + ), + ), + 'access' => array( + 'title' => '', + 'column' => 'second', + 'build' => array( + '#weight' => -5, + ), + ), + 'other' => array( + 'title' => t('Other'), + 'column' => 'third', + 'build' => array( + '#weight' => 2, + ), + ), + ); + + if ($this->display['id'] != 'default') { + $options['display_id'] = array( + 'category' => 'other', + 'title' => t('Machine Name'), + 'value' => !empty($this->display['new_id']) ? check_plain($this->display['new_id']) : check_plain($this->display['id']), + 'desc' => t('Change the machine name of this display.'), + ); + } + + $display_comment = check_plain(drupal_substr($this->getOption('display_comment'), 0, 10)); + $options['display_comment'] = array( + 'category' => 'other', + 'title' => t('Administrative comment'), + 'value' => !empty($display_comment) ? $display_comment : t('None'), + 'desc' => t('Comment or document this display.'), + ); + + $title = strip_tags($this->getOption('title')); + if (!$title) { + $title = t('None'); + } + + $options['title'] = array( + 'category' => 'title', + 'title' => t('Title'), + 'value' => $title, + 'desc' => t('Change the title that this display will use.'), + ); + + $style_plugin_instance = $this->getPlugin('style'); + $style_summary = empty($style_plugin_instance->definition['title']) ? t('Missing style plugin') : $style_plugin_instance->summaryTitle(); + $style_title = empty($style_plugin_instance->definition['title']) ? t('Missing style plugin') : $style_plugin_instance->pluginTitle(); + + $style = ''; + + $options['style'] = array( + 'category' => 'format', + 'title' => t('Format'), + 'value' => $style_title, + 'setting' => $style_summary, + 'desc' => t('Change the way content is formatted.'), + ); + + // This adds a 'Settings' link to the style_options setting if the style has options. + if ($style_plugin_instance->usesOptions()) { + $options['style']['links']['style_options'] = t('Change settings for this format'); + } + + if ($style_plugin_instance->usesRowPlugin()) { + $row_plugin_instance = $this->getPlugin('row'); + $row_summary = empty($row_plugin_instance->definition['title']) ? t('Missing style plugin') : $row_plugin_instance->summaryTitle(); + $row_title = empty($row_plugin_instance->definition['title']) ? t('Missing style plugin') : $row_plugin_instance->pluginTitle(); + + $options['row'] = array( + 'category' => 'format', + 'title' => t('Show'), + 'value' => $row_title, + 'setting' => $row_summary, + 'desc' => t('Change the way each row in the view is styled.'), + ); + // This adds a 'Settings' link to the row_options setting if the row style has options. + if ($row_plugin_instance->usesOptions()) { + $options['row']['links']['row_options'] = t('Change settings for this style'); + } + } + if ($this->usesAJAX()) { + $options['use_ajax'] = array( + 'category' => 'other', + 'title' => t('Use AJAX'), + 'value' => $this->getOption('use_ajax') ? t('Yes') : t('No'), + 'desc' => t('Change whether or not this display will use AJAX.'), + ); + } + if ($this->usesAttachments()) { + $options['hide_attachment_summary'] = array( + 'category' => 'other', + 'title' => t('Hide attachments in summary'), + 'value' => $this->getOption('hide_attachment_summary') ? t('Yes') : t('No'), + 'desc' => t('Change whether or not to display attachments when displaying a contextual filter summary.'), + ); + } + if (!isset($this->definition['contextual links locations']) || !empty($this->definition['contextual links locations'])) { + $options['show_admin_links'] = array( + 'category' => 'other', + 'title' => t('Contextual links'), + 'value' => $this->getOption('show_admin_links') ? t('Shown') : t('Hidden'), + 'desc' => t('Change whether or not to display contextual links for this view.'), + ); + } + + $pager_plugin = $this->getPlugin('pager'); + if (!$pager_plugin) { + // default to the no pager plugin. + $pager_plugin = Views::pluginManager('pager')->createInstance('none'); + } + + $pager_str = $pager_plugin->summaryTitle(); + + $options['pager'] = array( + 'category' => 'pager', + 'title' => t('Use pager'), + 'value' => $pager_plugin->pluginTitle(), + 'setting' => $pager_str, + 'desc' => t("Change this display's pager setting."), + ); + + // If pagers aren't allowed, change the text of the item: + if (!$this->usesPager()) { + $options['pager']['title'] = t('Items to display'); + } + + if ($pager_plugin->usesOptions()) { + $options['pager']['links']['pager_options'] = t('Change settings for this pager type.'); + } + + if ($this->usesMore()) { + $options['use_more'] = array( + 'category' => 'pager', + 'title' => t('More link'), + 'value' => $this->getOption('use_more') ? t('Yes') : t('No'), + 'desc' => t('Specify whether this display will provide a "more" link.'), + ); + } + + $this->view->initQuery(); + if ($this->view->query->get_aggregation_info()) { + $options['group_by'] = array( + 'category' => 'other', + 'title' => t('Use aggregation'), + 'value' => $this->getOption('group_by') ? t('Yes') : t('No'), + 'desc' => t('Allow grouping and aggregation (calculation) of fields.'), + ); + } + + $options['query'] = array( + 'category' => 'other', + 'title' => t('Query settings'), + 'value' => t('Settings'), + 'desc' => t('Allow to set some advanced settings for the query plugin'), + ); + + $languages = array( + '***CURRENT_LANGUAGE***' => t("Current user's language"), + '***DEFAULT_LANGUAGE***' => t("Default site language"), + LANGUAGE_NOT_SPECIFIED => t('Language neutral'), + ); + if (\Drupal::moduleHandler()->moduleExists('language')) { + $languages = array_merge($languages, language_list()); + } + $options['field_langcode'] = array( + 'category' => 'other', + 'title' => t('Field Language'), + 'value' => $languages[$this->getOption('field_langcode')], + 'desc' => t('All fields which support translations will be displayed in the selected language.'), + ); + + $access_plugin = $this->getPlugin('access'); + if (!$access_plugin) { + // default to the no access control plugin. + $access_plugin = Views::pluginManager('access')->createInstance('none'); + } + + $access_str = $access_plugin->summaryTitle(); + + $options['access'] = array( + 'category' => 'access', + 'title' => t('Access'), + 'value' => $access_plugin->pluginTitle(), + 'setting' => $access_str, + 'desc' => t('Specify access control type for this display.'), + ); + + if ($access_plugin->usesOptions()) { + $options['access']['links']['access_options'] = t('Change settings for this access type.'); + } + + $cache_plugin = $this->getPlugin('cache'); + if (!$cache_plugin) { + // default to the no cache control plugin. + $cache_plugin = Views::pluginManager('cache')->createInstance('none'); + } + + $cache_str = $cache_plugin->summaryTitle(); + + $options['cache'] = array( + 'category' => 'other', + 'title' => t('Caching'), + 'value' => $cache_plugin->pluginTitle(), + 'setting' => $cache_str, + 'desc' => t('Specify caching type for this display.'), + ); + + if ($cache_plugin->usesOptions()) { + $options['cache']['links']['cache_options'] = t('Change settings for this caching type.'); + } + + if ($access_plugin->usesOptions()) { + $options['access']['links']['access_options'] = t('Change settings for this access type.'); + } + + if ($this->usesLinkDisplay()) { + $display_id = $this->getLinkDisplay(); + $displays = $this->view->storage->get('display'); + $link_display = empty($displays[$display_id]) ? t('None') : check_plain($displays[$display_id]['display_title']); + $link_display = $this->getOption('link_display') == 'custom_url' ? t('Custom URL') : $link_display; + $options['link_display'] = array( + 'category' => 'other', + 'title' => t('Link display'), + 'value' => $link_display, + 'desc' => t('Specify which display or custom url this display will link to.'), + ); + } + + if ($this->usesExposedFormInBlock()) { + $options['exposed_block'] = array( + 'category' => 'exposed', + 'title' => t('Exposed form in block'), + 'value' => $this->getOption('exposed_block') ? t('Yes') : t('No'), + 'desc' => t('Allow the exposed form to appear in a block instead of the view.'), + ); + } + + $exposed_form_plugin = $this->getPlugin('exposed_form'); + if (!$exposed_form_plugin) { + // default to the no cache control plugin. + $exposed_form_plugin = Views::pluginManager('exposed_form')->createInstance('basic'); + } + + $exposed_form_str = $exposed_form_plugin->summaryTitle(); + + $options['exposed_form'] = array( + 'category' => 'exposed', + 'title' => t('Exposed form style'), + 'value' => $exposed_form_plugin->pluginTitle(), + 'setting' => $exposed_form_str, + 'desc' => t('Select the kind of exposed filter to use.'), + ); + + if ($exposed_form_plugin->usesOptions()) { + $options['exposed_form']['links']['exposed_form_options'] = t('Exposed form settings for this exposed form style.'); + } + + $css_class = check_plain(trim($this->getOption('css_class'))); + if (!$css_class) { + $css_class = t('None'); + } + + $options['css_class'] = array( + 'category' => 'other', + 'title' => t('CSS class'), + 'value' => $css_class, + 'desc' => t('Change the CSS class name(s) that will be added to this display.'), + ); + + $options['analyze-theme'] = array( + 'category' => 'other', + 'title' => t('Output'), + 'value' => t('Templates'), + 'desc' => t('Get information on how to theme this display'), + ); + + foreach ($this->extender as $extender) { + $extender->optionsSummary($categories, $options); + } + } + + /** + * Provide the default form for setting options. + */ + public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); + if ($this->defaultableSections($form_state['section'])) { + views_ui_standard_display_dropdown($form, $form_state, $form_state['section']); + } + $form['#title'] = check_plain($this->display['display_title']) . ': '; + + // Set the 'section' to hilite on the form. + // If it's the item we're looking at is pulling from the default display, + // reflect that. Don't use is_defaulted since we want it to show up even + // on the default display. + if (!empty($this->options['defaults'][$form_state['section']])) { + $form['#section'] = 'default-' . $form_state['section']; + } + else { + $form['#section'] = $this->display['id'] . '-' . $form_state['section']; + } + + switch ($form_state['section']) { + case 'display_id': + $form['#title'] .= t('The machine name of this display'); + $form['display_id'] = array( + '#type' => 'textfield', + '#title' => t('Machine name of the display'), + '#default_value' => !empty($this->display['new_id']) ? $this->display['new_id'] : $this->display['id'], + '#required' => TRUE, + '#size' => 64, + ); + break; + case 'display_title': + $form['#title'] .= t('The name and the description of this display'); + $form['display_title'] = array( + '#title' => t('Administrative name'), + '#type' => 'textfield', + '#default_value' => $this->display['display_title'], + ); + $form['display_description'] = array( + '#title' => t('Administrative description'), + '#type' => 'textfield', + '#default_value' => $this->getOption('display_description'), + ); + break; + case 'display_comment': + $form['#title'] .= t('Administrative comment'); + $form['display_comment'] = array( + '#type' => 'textarea', + '#title' => t('Administrative comment'), + '#description' => t('This description will only be seen within the administrative interface and can be used to document this display.'), + '#default_value' => $this->getOption('display_comment'), + ); + break; + case 'title': + $form['#title'] .= t('The title of this view'); + $form['title'] = array( + '#type' => 'textfield', + '#description' => t('This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc.'), + '#default_value' => $this->getOption('title'), + ); + break; + case 'css_class': + $form['#title'] .= t('CSS class'); + $form['css_class'] = array( + '#type' => 'textfield', + '#title' => t('CSS class name(s)'), + '#description' => t('Multiples classes should be separated by spaces.'), + '#default_value' => $this->getOption('css_class'), + ); + break; + case 'use_ajax': + $form['#title'] .= t('Use AJAX when available to load this view'); + $form['use_ajax'] = array( + '#description' => t('When viewing a view, things like paging, table sorting, and exposed filters will not trigger a page refresh.'), + '#type' => 'checkbox', + '#title' => t('Use AJAX'), + '#default_value' => $this->getOption('use_ajax') ? 1 : 0, + ); + break; + case 'hide_attachment_summary': + $form['#title'] .= t('Hide attachments when displaying a contextual filter summary'); + $form['hide_attachment_summary'] = array( + '#type' => 'checkbox', + '#title' => t('Hide attachments in summary'), + '#default_value' => $this->getOption('hide_attachment_summary') ? 1 : 0, + ); + break; + case 'show_admin_links': + $form['#title'] .= t('Show contextual links on this view.'); + $form['show_admin_links'] = array( + '#type' => 'checkbox', + '#title' => t('Show contextual links'), + '#default_value' => $this->getOption('show_admin_links'), + ); + break; + case 'use_more': + $form['#title'] .= t('Add a more link to the bottom of the display.'); + $form['use_more'] = array( + '#type' => 'checkbox', + '#title' => t('Create more link'), + '#description' => t("This will add a more link to the bottom of this view, which will link to the page view. If you have more than one page view, the link will point to the display specified in 'Link display' section under advanced. You can override the url at the link display setting."), + '#default_value' => $this->getOption('use_more'), + ); + $form['use_more_always'] = array( + '#type' => 'checkbox', + '#title' => t("Display 'more' link only if there is more content"), + '#description' => t("Leave this unchecked to display the 'more' link even if there are no more items to display."), + '#default_value' => !$this->getOption('use_more_always'), + '#states' => array( + 'visible' => array( + ':input[name="use_more"]' => array('checked' => TRUE), + ), + ), + ); + $form['use_more_text'] = array( + '#type' => 'textfield', + '#title' => t('More link text'), + '#description' => t("The text to display for the more link."), + '#default_value' => $this->getOption('use_more_text'), + '#states' => array( + 'visible' => array( + ':input[name="use_more"]' => array('checked' => TRUE), + ), + ), + ); + break; + case 'group_by': + $form['#title'] .= t('Allow grouping and aggregation (calculation) of fields.'); + $form['group_by'] = array( + '#type' => 'checkbox', + '#title' => t('Aggregate'), + '#description' => t('If enabled, some fields may become unavailable. All fields that are selected for grouping will be collapsed to one record per distinct value. Other fields which are selected for aggregation will have the function run on them. For example, you can group nodes on title and count the number of nids in order to get a list of duplicate titles.'), + '#default_value' => $this->getOption('group_by'), + ); + break; + case 'access': + $form['#title'] .= t('Access restrictions'); + $form['access'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#tree' => TRUE, + ); + + $access = $this->getOption('access'); + $form['access']['type'] = array( + '#type' => 'radios', + '#options' => views_fetch_plugin_names('access', $this->getType(), array($this->view->storage->get('base_table'))), + '#default_value' => $access['type'], + ); + + $access_plugin = $this->getPlugin('access'); + if ($access_plugin->usesOptions()) { + $form['markup'] = array( + '#prefix' => '
', + '#markup' => t('You may also adjust the !settings for the currently selected access restriction.', array('!settings' => $this->optionLink(t('settings'), 'access_options'))), + '#suffix' => '
', + ); + } + + break; + case 'access_options': + $plugin = $this->getPlugin('access'); + $form['#title'] .= t('Access options'); + if ($plugin) { + $form['access_options'] = array( + '#tree' => TRUE, + ); + $plugin->buildOptionsForm($form['access_options'], $form_state); + } + break; + case 'cache': + $form['#title'] .= t('Caching'); + $form['cache'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#tree' => TRUE, + ); + + $cache = $this->getOption('cache'); + $form['cache']['type'] = array( + '#type' => 'radios', + '#options' => views_fetch_plugin_names('cache', $this->getType(), array($this->view->storage->get('base_table'))), + '#default_value' => $cache['type'], + ); + + $cache_plugin = $this->getPlugin('cache'); + if ($cache_plugin->usesOptions()) { + $form['markup'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#markup' => t('You may also adjust the !settings for the currently selected cache mechanism.', array('!settings' => $this->optionLink(t('settings'), 'cache_options'))), + ); + } + break; + case 'cache_options': + $plugin = $this->getPlugin('cache'); + $form['#title'] .= t('Caching options'); + if ($plugin) { + $form['cache_options'] = array( + '#tree' => TRUE, + ); + $plugin->buildOptionsForm($form['cache_options'], $form_state); + } + break; + case 'query': + $query_options = $this->getOption('query'); + $plugin_name = $query_options['type']; + + $form['#title'] .= t('Query options'); + $this->view->initQuery(); + if ($this->view->query) { + $form['query'] = array( + '#tree' => TRUE, + 'type' => array( + '#type' => 'value', + '#value' => $plugin_name, + ), + 'options' => array( + '#tree' => TRUE, + ), + ); + + $this->view->query->buildOptionsForm($form['query']['options'], $form_state); + } + break; + case 'field_language': + $form['#title'] .= t('Field Language'); + + $entities = entity_get_info(); + $entity_tables = array(); + $has_translation_handlers = FALSE; + foreach ($entities as $type => $entity_info) { + $entity_tables[] = $entity_info['base_table']; + + if (!empty($entity_info['translation'])) { + $has_translation_handlers = TRUE; + } + } + + // Doesn't make sense to show a field setting here if we aren't querying + // an entity base table. Also, we make sure that there's at least one + // entity type with a translation handler attached. + if (in_array($this->view->storage->get('base_table'), $entity_tables) && $has_translation_handlers) { + $languages = array( + '***CURRENT_LANGUAGE***' => t("Current user's language"), + '***DEFAULT_LANGUAGE***' => t("Default site language"), + LANGUAGE_NOT_SPECIFIED => t('Language neutral'), + ); + $languages = array_merge($languages, views_language_list()); + + $form['field_langcode'] = array( + '#type' => 'select', + '#title' => t('Field Language'), + '#description' => t('All fields which support translations will be displayed in the selected language.'), + '#options' => $languages, + '#default_value' => $this->getOption('field_langcode'), + ); + $form['field_langcode_add_to_query'] = array( + '#type' => 'checkbox', + '#title' => t('When needed, add the field language condition to the query'), + '#default_value' => $this->getOption('field_langcode_add_to_query'), + ); + } + else { + $form['field_language']['#markup'] = t("You don't have translatable entity types."); + } + break; + case 'style': + $form['#title'] .= t('How should this view be styled'); + $style_plugin = $this->getPlugin('style'); + $form['style'] = array( + '#type' => 'radios', + '#options' => views_fetch_plugin_names('style', $this->getType(), array($this->view->storage->get('base_table'))), + '#default_value' => $style_plugin->definition['id'], + '#description' => t('If the style you choose has settings, be sure to click the settings button that will appear next to it in the View summary.'), + ); + + if ($style_plugin->usesOptions()) { + $form['markup'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#markup' => t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'style_options'))), + ); + } + + break; + case 'style_options': + $form['#title'] .= t('Style options'); + $style = TRUE; + $style_plugin = $this->getOption('style'); + $name = $style_plugin['type']; + + case 'row_options': + if (!isset($name)) { + $row_plugin = $this->getOption('row'); + $name = $row_plugin['type']; + } + // if row, $style will be empty. + if (empty($style)) { + $form['#title'] .= t('Row style options'); + } + $plugin = $this->getPlugin(empty($style) ? 'row' : 'style', $name); + if ($plugin) { + $form[$form_state['section']] = array( + '#tree' => TRUE, + ); + $plugin->buildOptionsForm($form[$form_state['section']], $form_state); + } + break; + case 'row': + $form['#title'] .= t('How should each row in this view be styled'); + $row_plugin_instance = $this->getPlugin('row'); + $form['row'] = array( + '#type' => 'radios', + '#options' => views_fetch_plugin_names('row', $this->getType(), array($this->view->storage->get('base_table'))), + '#default_value' => $row_plugin_instance->definition['id'], + ); + + if ($row_plugin_instance->usesOptions()) { + $form['markup'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#markup' => t('You may also adjust the !settings for the currently selected row style.', array('!settings' => $this->optionLink(t('settings'), 'row_options'))), + ); + } + + break; + case 'link_display': + $form['#title'] .= t('Which display to use for path'); + foreach ($this->view->storage->get('display') as $display_id => $display) { + if ($this->view->displayHandlers->get($display_id)->hasPath()) { + $options[$display_id] = $display['display_title']; + } + } + $options['custom_url'] = t('Custom URL'); + if (count($options)) { + $form['link_display'] = array( + '#type' => 'radios', + '#options' => $options, + '#description' => t("Which display to use to get this display's path for things like summary links, rss feed links, more links, etc."), + '#default_value' => $this->getOption('link_display'), + ); + } + + $options = array(); + $count = 0; // This lets us prepare the key as we want it printed. + foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) { + $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->adminLabel())); + $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->adminLabel())); + } + + // Default text. + // We have some options, so make a list. + $output = ''; + if (!empty($options)) { + $output = t('

The following tokens are available for this link.

'); + foreach (array_keys($options) as $type) { + if (!empty($options[$type])) { + $items = array(); + foreach ($options[$type] as $key => $value) { + $items[] = $key . ' == ' . $value; + } + $output .= theme('item_list', + array( + 'items' => $items, + 'type' => $type + )); + } + } + } + + $form['link_url'] = array( + '#type' => 'textfield', + '#title' => t('Custom URL'), + '#default_value' => $this->getOption('link_url'), + '#description' => t('A Drupal path or external URL the more link will point to. Note that this will override the link display setting above.') . $output, + '#states' => array( + 'visible' => array( + ':input[name="link_display"]' => array('value' => 'custom_url'), + ), + ), + ); + break; + case 'analyze-theme': + $form['#title'] .= t('Theming information'); + if ($theme = drupal_container()->get('request')->request->get('theme')) { + $this->theme = $theme; + } + elseif (empty($this->theme)) { + $this->theme = config('system.theme')->get('default'); + } + + if (isset($GLOBALS['theme']) && $GLOBALS['theme'] == $this->theme) { + $this->theme_registry = theme_get_registry(); + $theme_engine = $GLOBALS['theme_engine']; + } + else { + $themes = list_themes(); + $theme = $themes[$this->theme]; + + // Find all our ancestor themes and put them in an array. + $base_theme = array(); + $ancestor = $this->theme; + while ($ancestor && isset($themes[$ancestor]->base_theme)) { + $ancestor = $themes[$ancestor]->base_theme; + $base_theme[] = $themes[$ancestor]; + } + + // The base themes should be initialized in the right order. + $base_theme = array_reverse($base_theme); + + // This code is copied directly from _drupal_theme_initialize() + $theme_engine = NULL; + + // Initialize the theme. + if (isset($theme->engine)) { + // Include the engine. + include_once DRUPAL_ROOT . '/' . $theme->owner; + + $theme_engine = $theme->engine; + if (function_exists($theme_engine . '_init')) { + foreach ($base_theme as $base) { + call_user_func($theme_engine . '_init', $base); + } + call_user_func($theme_engine . '_init', $theme); + } + } + else { + // include non-engine theme files + foreach ($base_theme as $base) { + // Include the theme file or the engine. + if (!empty($base->owner)) { + include_once DRUPAL_ROOT . '/' . $base->owner; + } + } + // and our theme gets one too. + if (!empty($theme->owner)) { + include_once DRUPAL_ROOT . '/' . $theme->owner; + } + } + $this->theme_registry = _theme_load_registry($theme, $base_theme, $theme_engine); + } + + // If there's a theme engine involved, we also need to know its extension + // so we can give the proper filename. + $this->theme_extension = '.tpl.php'; + if (isset($theme_engine)) { + $extension_function = $theme_engine . '_extension'; + if (function_exists($extension_function)) { + $this->theme_extension = $extension_function(); + } + } + + $funcs = array(); + // Get theme functions for the display. Note that some displays may + // not have themes. The 'feed' display, for example, completely + // delegates to the style. + if (!empty($this->definition['theme'])) { + $funcs[] = $this->optionLink(t('Display output'), 'analyze-theme-display') . ': ' . $this->formatThemes($this->themeFunctions()); + } + + $plugin = $this->getPlugin('style'); + if ($plugin) { + $funcs[] = $this->optionLink(t('Style output'), 'analyze-theme-style') . ': ' . $this->formatThemes($plugin->themeFunctions()); + + if ($plugin->usesRowPlugin()) { + $row_plugin = $this->getPlugin('row'); + if ($row_plugin) { + $funcs[] = $this->optionLink(t('Row style output'), 'analyze-theme-row') . ': ' . $this->formatThemes($row_plugin->themeFunctions()); + } + } + + if ($plugin->usesFields()) { + foreach ($this->getHandlers('field') as $id => $handler) { + $funcs[] = $this->optionLink(t('Field @field (ID: @id)', array('@field' => $handler->adminLabel(), '@id' => $id)), 'analyze-theme-field') . ': ' . $this->formatThemes($handler->themeFunctions()); + } + } + } + + $form['important'] = array( + '#markup' => '

' . t('This section lists all possible templates for the display plugin and for the style plugins, ordered roughly from the least specific to the most specific. The active template for each plugin -- which is the most specific template found on the system -- is highlighted in bold.') . '

', + ); + + if (isset($this->view->display_handler->new_id)) { + $form['important']['new_id'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#value' => t("Important! You have changed the display's machine name. Anything that attached to this display specifically, such as theming, may stop working until it is updated. To see theme suggestions for it, you need to save the view."), + ); + } + + foreach (list_themes() as $key => $theme) { + if (!empty($theme->info['hidden'])) { + continue; + } + $options[$key] = $theme->info['name']; + } + + $form['box'] = array( + '#prefix' => '
', + '#suffix' => '
', + ); + $form['box']['theme'] = array( + '#type' => 'select', + '#options' => $options, + '#default_value' => $this->theme, + ); + + $form['box']['change'] = array( + '#type' => 'submit', + '#value' => t('Change theme'), + '#submit' => array(array($this, 'changeThemeForm')), + ); + + $form['analysis'] = array( + '#markup' => '
' . theme('item_list', array('items' => $funcs)) . '
', + ); + + $form['rescan_button'] = array( + '#prefix' => '
', + '#suffix' => '
', + ); + $form['rescan_button']['button'] = array( + '#type' => 'submit', + '#value' => t('Rescan template files'), + '#submit' => array(array($this, 'rescanThemes')), + ); + $form['rescan_button']['markup'] = array( + '#markup' => '
' . t("Important! When adding, removing, or renaming template files, it is necessary to make Drupal aware of the changes by making it rescan the files on your system. By clicking this button you clear Drupal's theme registry and thereby trigger this rescanning process. The highlighted templates above will then reflect the new state of your system.") . '
', + ); + + $form_state['ok_button'] = TRUE; + break; + case 'analyze-theme-display': + $form['#title'] .= t('Theming information (display)'); + $output = '

' . t('Back to !info.', array('!info' => $this->optionLink(t('theming information'), 'analyze-theme'))) . '

'; + + if (empty($this->definition['theme'])) { + $output .= t('This display has no theming information'); + } + else { + $output .= '

' . t('This is the default theme template used for this display.') . '

'; + $output .= '
' . check_plain(file_get_contents('./' . $this->definition['theme_path'] . '/' . strtr($this->definition['theme'], '_', '-') . '.tpl.php')) . '
'; + } + + $form['analysis'] = array( + '#markup' => '
' . $output . '
', + ); + + $form_state['ok_button'] = TRUE; + break; + case 'analyze-theme-style': + $form['#title'] .= t('Theming information (style)'); + $output = '

' . t('Back to !info.', array('!info' => $this->optionLink(t('theming information'), 'analyze-theme'))) . '

'; + + $plugin = $this->getPlugin('style'); + + if (empty($plugin->definition['theme'])) { + $output .= t('This display has no style theming information'); + } + else { + $output .= '

' . t('This is the default theme template used for this style.') . '

'; + $output .= '
' . check_plain(file_get_contents('./' . $plugin->definition['theme_path'] . '/' . strtr($plugin->definition['theme'], '_', '-') . '.tpl.php')) . '
'; + } + + $form['analysis'] = array( + '#markup' => '
' . $output . '
', + ); + + $form_state['ok_button'] = TRUE; + break; + case 'analyze-theme-row': + $form['#title'] .= t('Theming information (row style)'); + $output = '

' . t('Back to !info.', array('!info' => $this->optionLink(t('theming information'), 'analyze-theme'))) . '

'; + + $plugin = $this->getPlugin('row'); + + if (empty($plugin->definition['theme'])) { + $output .= t('This display has no row style theming information'); + } + else { + $output .= '

' . t('This is the default theme template used for this row style.') . '

'; + $output .= '
' . check_plain(file_get_contents('./' . $plugin->definition['theme_path'] . '/' . strtr($plugin->definition['theme'], '_', '-') . '.tpl.php')) . '
'; + } + + $form['analysis'] = array( + '#markup' => '
' . $output . '
', + ); + + $form_state['ok_button'] = TRUE; + break; + case 'analyze-theme-field': + $form['#title'] .= t('Theming information (row style)'); + $output = '

' . t('Back to !info.', array('!info' => $this->optionLink(t('theming information'), 'analyze-theme'))) . '

'; + + $output .= '

' . t('This is the default theme template used for this row style.') . '

'; + + // Field templates aren't registered the normal way...and they're always + // this one, anyhow. + $output .= '
' . check_plain(file_get_contents(drupal_get_path('module', 'views') . '/templates/views-view-field.tpl.php')) . '
'; + + $form['analysis'] = array( + '#markup' => '
' . $output . '
', + ); + $form_state['ok_button'] = TRUE; + break; + + case 'exposed_block': + $form['#title'] .= t('Put the exposed form in a block'); + $form['description'] = array( + '#markup' => '
' . t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '
', + ); + $form['exposed_block'] = array( + '#type' => 'radios', + '#options' => array(1 => t('Yes'), 0 => t('No')), + '#default_value' => $this->getOption('exposed_block') ? 1 : 0, + ); + break; + case 'exposed_form': + $form['#title'] .= t('Exposed Form'); + $form['exposed_form'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#tree' => TRUE, + ); + + $exposed_form = $this->getOption('exposed_form'); + $form['exposed_form']['type'] = array( + '#type' => 'radios', + '#options' => views_fetch_plugin_names('exposed_form', $this->getType(), array($this->view->storage->get('base_table'))), + '#default_value' => $exposed_form['type'], + ); + + $exposed_form_plugin = $this->getPlugin('exposed_form'); + if ($exposed_form_plugin->usesOptions()) { + $form['markup'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#markup' => t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'exposed_form_options'))), + ); + } + break; + case 'exposed_form_options': + $plugin = $this->getPlugin('exposed_form'); + $form['#title'] .= t('Exposed form options'); + if ($plugin) { + $form['exposed_form_options'] = array( + '#tree' => TRUE, + ); + $plugin->buildOptionsForm($form['exposed_form_options'], $form_state); + } + break; + case 'pager': + $form['#title'] .= t('Select which pager, if any, to use for this view'); + $form['pager'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#tree' => TRUE, + ); + + $pager = $this->getOption('pager'); + $form['pager']['type'] = array( + '#type' => 'radios', + '#options' => views_fetch_plugin_names('pager', !$this->usesPager() ? 'basic' : NULL, array($this->view->storage->get('base_table'))), + '#default_value' => $pager['type'], + ); + + $pager_plugin = $this->getPlugin('pager'); + if ($pager_plugin->usesOptions()) { + $form['markup'] = array( + '#prefix' => '
', + '#suffix' => '
', + '#markup' => t('You may also adjust the !settings for the currently selected pager.', array('!settings' => $this->optionLink(t('settings'), 'pager_options'))), + ); + } + + break; + case 'pager_options': + $plugin = $this->getPlugin('pager'); + $form['#title'] .= t('Pager options'); + if ($plugin) { + $form['pager_options'] = array( + '#tree' => TRUE, + ); + $plugin->buildOptionsForm($form['pager_options'], $form_state); + } + break; + } + + foreach ($this->extender as $extender) { + $extender->buildOptionsForm($form, $form_state); + } + } + + /** + * Submit hook to clear Drupal's theme registry (thereby triggering + * a templates rescan). + */ + public function rescanThemes($form, &$form_state) { + drupal_theme_rebuild(); + + // The 'Theme: Information' page is about to be shown again. That page + // analyzes the output of theme_get_registry(). However, this latter + // function uses an internal cache (which was initialized before we + // called drupal_theme_rebuild()) so it won't reflect the + // current state of our theme registry. The only way to clear that cache + // is to re-initialize the theme system: + unset($GLOBALS['theme']); + drupal_theme_initialize(); + + $form_state['rerender'] = TRUE; + $form_state['rebuild'] = TRUE; + } + + /** + * Displays the Change Theme form. + */ + public function changeThemeForm($form, &$form_state) { + // This is just a temporary variable. + $form_state['view']->theme = $form_state['values']['theme']; + + $form_state['view']->cacheSet(); + $form_state['rerender'] = TRUE; + $form_state['rebuild'] = TRUE; + } + + /** + * Format a list of theme templates for output by the theme info helper. + */ + protected function formatThemes($themes) { + $registry = $this->theme_registry; + $extension = $this->theme_extension; + + $output = ''; + $picked = FALSE; + foreach ($themes as $theme) { + $template = strtr($theme, '_', '-') . $extension; + if (!$picked && !empty($registry[$theme])) { + $template_path = isset($registry[$theme]['path']) ? $registry[$theme]['path'] . '/' : './'; + if (file_exists($template_path . $template)) { + $hint = t('File found in folder @template-path', array('@template-path' => $template_path)); + $template = '' . $template . ''; + } + else { + $template = '' . $template . ' ' . t('(File not found, in folder @template-path)', array('@template-path' => $template_path)) . ''; + } + $picked = TRUE; + } + $fixed[] = $template; + } + + return theme('item_list', array('items' => array_reverse($fixed))); + } + + /** + * Validate the options form. + */ + public function validateOptionsForm(&$form, &$form_state) { + switch ($form_state['section']) { + case 'display_title': + if (empty($form_state['values']['display_title'])) { + form_error($form['display_title'], t('Display title may not be empty.')); + } + break; + case 'css_class': + $css_class = $form_state['values']['css_class']; + if (preg_match('/[^a-zA-Z0-9-_ ]/', $css_class)) { + form_error($form['css_class'], t('CSS classes must be alphanumeric or dashes only.')); + } + break; + case 'display_id': + if ($form_state['values']['display_id']) { + if (preg_match('/[^a-z0-9_]/', $form_state['values']['display_id'])) { + form_error($form['display_id'], t('Display name must be letters, numbers, or underscores only.')); + } + + foreach ($this->view->display as $id => $display) { + if ($id != $this->view->current_display && ($form_state['values']['display_id'] == $id || (isset($display->new_id) && $form_state['values']['display_id'] == $display->new_id))) { + form_error($form['display_id'], t('Display id should be unique.')); + } + } + } + break; + case 'query': + if ($this->view->query) { + $this->view->query->validateOptionsForm($form['query'], $form_state); + } + break; + } + + // Validate plugin options. Every section with "_options" in it, belongs to + // a plugin type, like "style_options". + if (strpos($form_state['section'], '_options') !== FALSE) { + $plugin_type = str_replace('_options', '', $form_state['section']); + // Load the plugin and let it handle the validation. + if ($plugin = $this->getPlugin($plugin_type)) { + $plugin->validateOptionsForm($form[$form_state['section']], $form_state); + } + } + + foreach ($this->extender as $extender) { + $extender->validateOptionsForm($form, $form_state); + } + } + + /** + * Perform any necessary changes to the form values prior to storage. + * There is no need for this function to actually store the data. + */ + public function submitOptionsForm(&$form, &$form_state) { + // Not sure I like this being here, but it seems (?) like a logical place. + $cache_plugin = $this->getPlugin('cache'); + if ($cache_plugin) { + $cache_plugin->cache_flush(); + } + + $section = $form_state['section']; + switch ($section) { + case 'display_id': + if (isset($form_state['values']['display_id'])) { + $this->display['new_id'] = $form_state['values']['display_id']; + } + break; + case 'display_title': + $this->display['display_title'] = $form_state['values']['display_title']; + $this->setOption('display_description', $form_state['values']['display_description']); + break; + case 'access': + $access = $this->getOption('access'); + if ($access['type'] != $form_state['values']['access']['type']) { + $plugin = Views::pluginManager('access')->createInstance($form_state['values']['access']['type']); + if ($plugin) { + $access = array('type' => $form_state['values']['access']['type']); + $this->setOption('access', $access); + if ($plugin->usesOptions()) { + $form_state['view']->addFormToStack('display', $this->display['id'], 'access_options'); + } + } + } + + break; + case 'access_options': + $plugin = $this->getPlugin('access'); + if ($plugin) { + $access = $this->getOption('access'); + $plugin->submitOptionsForm($form['access_options'], $form_state); + $access['options'] = $form_state['values'][$section]; + $this->setOption('access', $access); + } + break; + case 'cache': + $cache = $this->getOption('cache'); + if ($cache['type'] != $form_state['values']['cache']['type']) { + $plugin = Views::pluginManager('cache')->createInstance($form_state['values']['cache']['type']); + if ($plugin) { + $cache = array('type' => $form_state['values']['cache']['type']); + $this->setOption('cache', $cache); + if ($plugin->usesOptions()) { + $form_state['view']->addFormToStack('display', $this->display['id'], 'cache_options'); + } + } + } + + break; + case 'cache_options': + $plugin = $this->getPlugin('cache'); + if ($plugin) { + $cache = $this->getOption('cache'); + $plugin->submitOptionsForm($form['cache_options'], $form_state); + $cache['options'] = $form_state['values'][$section]; + $this->setOption('cache', $cache); + } + break; + case 'query': + $plugin = $this->getPlugin('query'); + if ($plugin) { + $plugin->submitOptionsForm($form['query']['options'], $form_state); + $this->setOption('query', $form_state['values'][$section]); + } + break; + + case 'link_display': + $this->setOption('link_url', $form_state['values']['link_url']); + case 'title': + case 'css_class': + case 'display_comment': + $this->setOption($section, $form_state['values'][$section]); + break; + case 'field_language': + $this->setOption('field_langcode', $form_state['values']['field_langcode']); + $this->setOption('field_langcode_add_to_query', $form_state['values']['field_langcode_add_to_query']); + break; + case 'use_ajax': + case 'hide_attachment_summary': + case 'show_admin_links': + $this->setOption($section, (bool) $form_state['values'][$section]); + break; + case 'use_more': + $this->setOption($section, intval($form_state['values'][$section])); + $this->setOption('use_more_always', !intval($form_state['values']['use_more_always'])); + $this->setOption('use_more_text', $form_state['values']['use_more_text']); + case 'distinct': + $this->setOption($section, $form_state['values'][$section]); + break; + case 'group_by': + $this->setOption($section, $form_state['values'][$section]); + break; + case 'row': + // This if prevents resetting options to default if they don't change + // the plugin. + $row = $this->getOption('row'); + if ($row['type'] != $form_state['values'][$section]) { + $plugin = Views::pluginManager('row')->createInstance($form_state['values'][$section]); + if ($plugin) { + $row = array('type' => $form_state['values'][$section]); + $this->setOption($section, $row); + + // send ajax form to options page if we use it. + if ($plugin->usesOptions()) { + $form_state['view']->addFormToStack('display', $this->display['id'], 'row_options'); + } + } + } + break; + case 'style': + // This if prevents resetting options to default if they don't change + // the plugin. + $style = $this->getOption('style'); + if ($style['type'] != $form_state['values'][$section]) { + $plugin = views::pluginManager('style')->createInstance($form_state['values'][$section]); + if ($plugin) { + $row = array('type' => $form_state['values'][$section]); + $this->setOption($section, $row); + // send ajax form to options page if we use it. + if ($plugin->usesOptions()) { + $form_state['view']->addFormToStack('display', $this->display['id'], 'style_options'); + } + } + } + break; + case 'style_options': + $plugin = $this->getPlugin('style'); + if ($plugin) { + $style = $this->getOption('style'); + $plugin->submitOptionsForm($form['style_options'], $form_state); + $style['options'] = $form_state['values'][$section]; + $this->setOption('style', $style); + } + break; + case 'row_options': + $plugin = $this->getPlugin('row'); + if ($plugin) { + $row = $this->getOption('row'); + $plugin->submitOptionsForm($form['row_options'], $form_state); + $row['options'] = $form_state['values'][$section]; + $this->setOption('row', $row); + } + break; + case 'exposed_block': + $this->setOption($section, (bool) $form_state['values'][$section]); + break; + case 'exposed_form': + $exposed_form = $this->getOption('exposed_form'); + if ($exposed_form['type'] != $form_state['values']['exposed_form']['type']) { + $plugin = Views::pluginManager('exposed_form')->createInstance($form_state['values']['exposed_form']['type']); + if ($plugin) { + $exposed_form = array('type' => $form_state['values']['exposed_form']['type'], 'options' => array()); + $this->setOption('exposed_form', $exposed_form); + if ($plugin->usesOptions()) { + $form_state['view']->addFormToStack('display', $this->display['id'], 'exposed_form_options'); + } + } + } + + break; + case 'exposed_form_options': + $plugin = $this->getPlugin('exposed_form'); + if ($plugin) { + $exposed_form = $this->getOption('exposed_form'); + $plugin->submitOptionsForm($form['exposed_form_options'], $form_state); + $exposed_form['options'] = $form_state['values'][$section]; + $this->setOption('exposed_form', $exposed_form); + } + break; + case 'pager': + $pager = $this->getOption('pager'); + if ($pager['type'] != $form_state['values']['pager']['type']) { + $plugin = Views::pluginManager('pager')->createInstance($form_state['values']['pager']['type']); + if ($plugin) { + // Because pagers have very similar options, let's allow pagers to + // try to carry the options over. + $plugin->init($this->view, $this, $pager['options']); + + $pager = array('type' => $form_state['values']['pager']['type'], 'options' => $plugin->options); + $this->setOption('pager', $pager); + if ($plugin->usesOptions()) { + $form_state['view']->addFormToStack('display', $this->display['id'], 'pager_options'); + } + } + } + + break; + case 'pager_options': + $plugin = $this->getPlugin('pager'); + if ($plugin) { + $pager = $this->getOption('pager'); + $plugin->submitOptionsForm($form['pager_options'], $form_state); + $pager['options'] = $form_state['values'][$section]; + $this->setOption('pager', $pager); + } + break; + } + + foreach ($this->extender as $extender) { + $extender->submitOptionsForm($form, $form_state); + } + } + + /** + * If override/revert was clicked, perform the proper toggle. + */ + public function optionsOverride($form, &$form_state) { + $this->setOverride($form_state['section']); + } + + /** + * Flip the override setting for the given section. + * + * @param string $section + * Which option should be marked as overridden, for example "filters". + * @param bool $new_state + * Select the new state of the option. + * - TRUE: Revert to default. + * - FALSE: Mark it as overridden. + */ + public function setOverride($section, $new_state = NULL) { + $options = $this->defaultableSections($section); + if (!$options) { + return; + } + + if (!isset($new_state)) { + $new_state = empty($this->options['defaults'][$section]); + } + + // For each option that is part of this group, fix our settings. + foreach ($options as $option) { + if ($new_state) { + // Revert to defaults. + unset($this->options[$option]); + unset($this->display['display_options'][$option]); + } + else { + // copy existing values into our display. + $this->options[$option] = $this->getOption($option); + $this->display['display_options'][$option] = $this->options[$option]; + } + $this->options['defaults'][$option] = $new_state; + $this->display['display_options']['defaults'][$option] = $new_state; + } + } + + /** + * Inject anything into the query that the display handler needs. + */ + public function query() { + foreach ($this->extender as $extender) { + $extender->query(); + } + } + + /** + * Not all display plugins will support filtering + * + * @todo this doesn't seems to be used + */ + public function renderFilters() { } + + /** + * Not all display plugins will suppert pager rendering. + */ + public function renderPager() { + return TRUE; + } + + /** + * Render the 'more' link + */ + public function renderMoreLink() { + if ($this->usesMore() && ($this->useMoreAlways() || (!empty($this->view->pager) && $this->view->pager->has_more_records()))) { + $path = $this->getPath(); + + if ($this->getOption('link_display') == 'custom_url' && $override_path = $this->getOption('link_url')) { + $tokens = $this->getArgumentsTokens(); + $path = strtr($override_path, $tokens); + } + + if ($path) { + if (empty($override_path)) { + $path = $this->view->getUrl(NULL, $path); + } + $url_options = array(); + if (!empty($this->view->exposed_raw_input)) { + $url_options['query'] = $this->view->exposed_raw_input; + } + $theme = views_theme_functions('views_more', $this->view, $this->view->display_handler->display); + $path = check_url(url($path, $url_options)); + + return theme($theme, array('more_url' => $path, 'link_text' => check_plain($this->useMoreText()), 'view' => $this->view)); + } + } + } + + /** + * If this display creates a page with a menu item, implement it here. + * + * @param array $callbacks + * An array of already existing menu items provided by drupal. + * + * @return array + * The menu router items registers for this display. + * + * @see hook_menu() + */ + public function executeHookMenu($callbacks) { + return array(); + } + + /** + * Render this display. + */ + public function render() { + $element = array( + '#theme' => $this->themeFunctions(), + '#view' => $this->view, + ); + $element['#attached'] = &$this->view->element['#attached']; + + return $element; + } + + /** + * Render one of the available areas. + * + * @param string $area + * Identifier of the specific area to render. + * @param bool $empty + * (optional) Indicator whether or not the view result is empty. Defaults to + * FALSE + * + * @return array + * A render array for the given area. + */ + public function renderArea($area, $empty = FALSE) { + $return = array(); + foreach ($this->getHandlers($area) as $key => $area_handler) { + $return[$key] = $area_handler->render($empty); + } + return $return; + } + + + /** + * Determine if the user has access to this display of the view. + */ + public function access($account = NULL) { + if (!isset($account)) { + global $user; + $account = $user; + } + + // Full override. + if (user_access('access all views', $account)) { + return TRUE; + } + + $plugin = $this->getPlugin('access'); + if ($plugin) { + return $plugin->access($account); + } + + // fallback to all access if no plugin. + return TRUE; + } + + /** + * Set up any variables on the view prior to execution. These are separated + * from execute because they are extremely common and unlikely to be + * overridden on an individual display. + */ + public function preExecute() { + $this->view->setAjaxEnabled($this->ajaxEnabled()); + if ($this->usesMore() && !$this->useMoreAlways()) { + $this->view->get_total_rows = TRUE; + } + $this->view->initHandlers(); + if ($this->usesExposed()) { + $exposed_form = $this->getPlugin('exposed_form'); + $exposed_form->pre_execute(); + } + + foreach ($this->extender as $extender) { + $extender->pre_execute(); + } + + $this->view->setShowAdminLinks($this->getOption('show_admin_links')); + } + + /** + * When used externally, this is how a view gets run and returns + * data in the format required. + * + * The base class cannot be executed. + */ + public function execute() { } + + /** + * Fully render the display for the purposes of a live preview or + * some other AJAXy reason. + */ + function preview() { + return $this->view->render(); + } + + /** + * Returns the display type that this display requires. + * + * This can be used for filtering views plugins. E.g. if a plugin category of + * 'foo' is specified, only plugins with no 'types' declared or 'types' + * containing 'foo'. If you have a type of bar, this plugin will not be used. + * This is applicable for style, row, access, cache, and exposed_form plugins. + * + * @return string + * The required display type. Defaults to 'normal'. + * + * @see views_fetch_plugin_names() + */ + protected function getType() { + return 'normal'; + } + + /** + * Make sure the display and all associated handlers are valid. + * + * @return + * Empty array if the display is valid; an array of error strings if it is not. + */ + public function validate() { + $errors = array(); + // Make sure displays that use fields HAVE fields. + if ($this->usesFields()) { + $fields = FALSE; + foreach ($this->getHandlers('field') as $field) { + if (empty($field->options['exclude'])) { + $fields = TRUE; + } + } + + if (!$fields) { + $errors[] = t('Display "@display" uses fields but there are none defined for it or all are excluded.', array('@display' => $this->display['display_title'])); + } + } + + if ($this->hasPath() && !$this->getOption('path')) { + $errors[] = t('Display "@display" uses a path but the path is undefined.', array('@display' => $this->display['display_title'])); + } + + // Validate style plugin + $style = $this->getPlugin('style'); + if (empty($style)) { + $errors[] = t('Display "@display" has an invalid style plugin.', array('@display' => $this->display['display_title'])); + } + else { + $result = $style->validate(); + if (!empty($result) && is_array($result)) { + $errors = array_merge($errors, $result); + } + } + + // Validate query plugin. + $query = $this->getPlugin('query'); + $result = $query->validate(); + if (!empty($result) && is_array($result)) { + $errors = array_merge($errors, $result); + } + + // Validate handlers + foreach (ViewExecutable::viewsHandlerTypes() as $type => $info) { + foreach ($this->getHandlers($type) as $handler) { + $result = $handler->validate(); + if (!empty($result) && is_array($result)) { + $errors = array_merge($errors, $result); + } + } + } + + return $errors; + } + + /** + * Reacts on deleting a display. + */ + public function remove() { + } + + /** + * Check if the provided identifier is unique. + * + * @param string $id + * The id of the handler which is checked. + * @param string $identifier + * The actual get identifier configured in the exposed settings. + * + * @return bool + * Returns whether the identifier is unique on all handlers. + * + */ + public function isIdentifierUnique($id, $identifier) { + foreach (ViewExecutable::viewsHandlerTypes() as $type => $info) { + foreach ($this->getHandlers($type) as $key => $handler) { + if ($handler->canExpose() && $handler->isExposed()) { + if ($handler->isAGroup()) { + if ($id != $key && $identifier == $handler->options['group_info']['identifier']) { + return FALSE; + } + } + else { + if ($id != $key && $identifier == $handler->options['expose']['identifier']) { + return FALSE; + } + } + } + } + } + return TRUE; + } + + /** + * Provide the block system with any exposed widget blocks for this display. + */ + public function getSpecialBlocks() { + $blocks = array(); + + if ($this->usesExposedFormInBlock()) { + $delta = '-exp-' . $this->view->storage->id() . '-' . $this->display['id']; + $desc = t('Exposed form: @view-@display_id', array('@view' => $this->view->storage->id(), '@display_id' => $this->display['id'])); + + $blocks[$delta] = array( + 'info' => $desc, + 'cache' => DRUPAL_NO_CACHE, + ); + } + + return $blocks; + } + + /** + * Render the exposed form as block. + * + * @return string|NULL + * The rendered exposed form as string or NULL otherwise. + */ + public function viewExposedFormBlocks() { + // avoid interfering with the admin forms. + if (arg(0) == 'admin' && arg(1) == 'structure' && arg(2) == 'views') { + return; + } + $this->view->initHandlers(); + + if ($this->usesExposed() && $this->getOption('exposed_block')) { + $exposed_form = $this->getPlugin('exposed_form'); + return $exposed_form->render_exposed_form(TRUE); + } + } + + /** + * Provide some helpful text for the arguments. + * The result should contain of an array with + * - filter value present: The title of the fieldset in the argument + * where you can configure what should be done with a given argument. + * - filter value not present: The tiel of the fieldset in the argument + * where you can configure what should be done if the argument does not + * exist. + * - description: A description about how arguments comes to the display. + * For example blocks don't get it from url. + */ + public function getArgumentText() { + return array( + 'filter value not present' => t('When the filter value is NOT available'), + 'filter value present' => t('When the filter value IS available or a default is provided'), + 'description' => t("This display does not have a source for contextual filters, so no contextual filter value will be available unless you select 'Provide default'."), + ); + } + + /** + * Provide some helpful text for pagers. + * + * The result should contain of an array within + * - items per page title + */ + public function getPagerText() { + return array( + 'items per page title' => t('Items to display'), + 'items per page description' => t('Enter 0 for no limit.') + ); + } + + /** + * Merges default values for all plugin types. + */ + public function mergeDefaults() { + $defined_options = $this->defineOptions(); + + // Build a map of plural => singular for handler types. + $type_map = array(); + foreach (ViewExecutable::viewsHandlerTypes() as $type => $info) { + $type_map[$info['plural']] = $type; + } + + // Find all defined options, that have specified a merge_defaults callback. + foreach ($defined_options as $type => $definition) { + if (!isset($definition['merge_defaults']) || !is_callable($definition['merge_defaults'])) { + continue; + } + // Switch the type to singular, if it's a plural handler. + if (isset($type_map[$type])) { + $type = $type_map[$type]; + } + + call_user_func($definition['merge_defaults'], $type); + } + } + + /** + * Merges plugins default values. + * + * @param string $type + * The name of the plugin type option. + */ + protected function mergePlugin($type) { + if (($options = $this->getOption($type)) && isset($options['options'])) { + $plugin = $this->getPlugin($type); + $options['options'] = $options['options'] + $plugin->options; + $this->setOption($type, $options); + } + } + + /** + * Merges handlers default values. + * + * @param string $type + * The name of the handler type option. + */ + protected function mergeHandler($type) { + $types = ViewExecutable::viewsHandlerTypes(); + + $options = $this->getOption($types[$type]['plural']); + foreach ($this->getHandlers($type) as $id => $handler) { + if (isset($options[$id])) { + $options[$id] = $options[$id] + $handler->options; + } + } + + $this->setOption($types[$type]['plural'], $options); + } + +} + +/** + * @} + */ diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php index 0255179..017206d 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php @@ -118,8 +118,8 @@ public function buildOptionsForm(&$form, &$form_state) { function render_exposed_form($block = FALSE) { // Deal with any exposed filters we may have, before building. $form_state = array( - 'view' => &$this->view, - 'display' => &$this->view->display_handler->display, + 'view' => $this->view, + 'display' => $this->view->display_handler->display, 'method' => 'get', 'rerender' => TRUE, 'no_redirect' => TRUE, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php index e0dd2d5..8982063 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php @@ -417,7 +417,7 @@ function show_build_group_button(&$form, &$form_state) { * Displays the Build Group form. */ public function buildGroupForm($form, &$form_state) { - $item = &$this->options; + $item = $this->options; // flip. If the filter was a group, set back to a standard filter. $item['is_grouped'] = empty($item['is_grouped']); @@ -1088,7 +1088,7 @@ function build_group_form(&$form, &$form_state) { * Add a new group to the exposed filter groups. */ public function addGroupForm($form, &$form_state) { - $item = &$this->options; + $item = $this->options; // Add a new row. $item['group_info']['group_items'][] = array(); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php index 3c2f753..d54bddf 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php @@ -309,7 +309,7 @@ public function acceptExposedInput($input) { // rewrite the input value so that it's in the correct format so that // the parent gets the right data. if (!empty($this->options['expose']['identifier'])) { - $value = &$input[$this->options['expose']['identifier']]; + $value = $input[$this->options['expose']['identifier']]; if (!is_array($value)) { $value = array( 'value' => $value, diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php index e78516d..9118d55 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php @@ -133,7 +133,7 @@ public function getLimit() { */ function set_where_group($type = 'AND', $group = NULL, $where = 'where') { // Set an alias. - $groups = &$this->$where; + $groups = $this->$where; if (!isset($group)) { $group = empty($groups) ? 1 : max(array_keys($groups)) + 1; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php index b5c236d..05483f2 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php @@ -245,7 +245,7 @@ function left_query($options) { // Workaround until http://drupal.org/node/844910 is fixed: // Remove all fields from the SELECT except the base id. - $fields =& $subquery->getFields(); + $fields = $subquery->getFields(); foreach (array_keys($fields) as $field_name) { // The base id for this subquery is stored in our definition. if ($field_name != $this->definition['field']) { @@ -255,7 +255,7 @@ function left_query($options) { // Make every alias in the subquery safe within the outer query by // appending a namespace to it, '_inner' by default. - $tables =& $subquery->getTables(); + $tables = $subquery->getTables(); foreach (array_keys($tables) as $table_name) { $tables[$table_name]['alias'] .= $this->subquery_namespace; // Namespace the join on every table. @@ -269,13 +269,13 @@ function left_query($options) { $fields[$field_name]['alias'] .= $this->subquery_namespace; } // Namespace conditions. - $where =& $subquery->conditions(); + $where = $subquery->conditions(); $this->alter_subquery_condition($subquery, $where); // Not sure why, but our sort order clause doesn't have a table. // TODO: the call to add_item() above to add the sort handler is probably // wrong -- needs attention from someone who understands it. // In the meantime, this works, but with a leap of faith... - $orders =& $subquery->getOrderBy(); + $orders = $subquery->getOrderBy(); foreach ($orders as $order_key => $order) { // But if we're using a whole view, we don't know what we have! if ($options['subquery_view']) { @@ -310,14 +310,14 @@ function left_query($options) { * (Though why is the condition we get in a simple query 3 levels deep???) */ function alter_subquery_condition(AlterableInterface $query, &$conditions) { - foreach ($conditions as $condition_id => &$condition) { + foreach ($conditions as $condition_id => $condition) { // Skip the #conjunction element. if (is_numeric($condition_id)) { if (is_string($condition['field'])) { $condition['field'] = $this->condition_namespace($condition['field']); } elseif (is_object($condition['field'])) { - $sub_conditions =& $condition['field']->conditions(); + $sub_conditions = $condition['field']->conditions(); $this->alter_subquery_condition($query, $sub_conditions); } } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index 3945ae0..a65e2f0 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -506,7 +506,7 @@ public static function getSelected($form_state, $parents, $default_value, $eleme * The display ID (e.g. 'page' or 'block'). */ protected function build_form_style(array &$form, array &$form_state, $type) { - $style_form =& $form['displays'][$type]['options']['style']; + $style_form = &$form['displays'][$type]['options']['style']; $style = $style_form['style_plugin']['#default_value']; $style_plugin = Views::pluginManager('style')->createInstance($style); if (isset($style_plugin) && $style_plugin->usesRowPlugin()) { diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php index d7313b2..c494912 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php @@ -133,7 +133,7 @@ public function testRenderAreaToken() { $element = $this->xpath('//ul[@class="global-tokens"]'); $this->assertTrue($element, 'Token list found on the options form.'); - $empty_handler = &$view->empty['test_example']; + $empty_handler = $view->empty['test_example']; // Test the list of available tokens. $available = $empty_handler->getAvailableGlobalTokens(); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php index 43acdab..ee08f63 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php @@ -206,7 +206,7 @@ public function testAlterUrl() { // Get the expected start of the path string. $base = ($absolute ? $base_url . '/' : base_path()) . $script_path; $absolute_string = $absolute ? 'absolute' : NULL; - $alter =& $id_field->options['alter']; + $alter = $id_field->options['alter']; $alter['path'] = 'node/123'; $expected_result = url('node/123', array('absolute' => $absolute)); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/RelationshipTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/RelationshipTest.php index 1b0741c..b6b890b 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/RelationshipTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/RelationshipTest.php @@ -125,7 +125,7 @@ public function testRelationshipQuery() { $expected_result = $this->dataSet(); // Alter the expected result to contain the right uids. - foreach ($expected_result as $key => &$row) { + foreach ($expected_result as $key => $row) { // Only John has an existing author. if ($row['name'] == 'John') { $row['uid'] = 1; diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php index 8cd8880..4a4dc38 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php @@ -94,7 +94,7 @@ public function testFeedOutput() { $views = $this->container->get('plugin.manager.entity')->getStorageController('view')->load(array('test_feed_display')); $view = array_pop($views); - $display = &$view->getDisplay('feed_1'); + $display = $view->getDisplay('feed_1'); $display['display_options']['sitename_title'] = 0; $view->save(); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php index 41e5c8b..db5300d 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php @@ -385,7 +385,7 @@ public function testValidate() { $this->assertEqual(count($view->displayHandlers), $count, 'Error messages from all handlers merged.'); // Test that a deleted display is not included. - $display = &$view->storage->getDisplay('default'); + $display = $view->storage->getDisplay('default'); $display['deleted'] = TRUE; $validate_deleted = $view->validate(); diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index a8a8dd2..1098cc0 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -800,7 +800,7 @@ public function getBaseTables() { */ protected function _preQuery() { foreach ($this::viewsHandlerTypes() as $key => $info) { - $handlers = &$this->$key; + $handlers = $this->$key; $position = 0; foreach ($handlers as $id => $handler) { $handlers[$id]->position = $position; @@ -815,7 +815,7 @@ protected function _preQuery() { */ protected function _postExecute() { foreach ($this::viewsHandlerTypes() as $key => $info) { - $handlers = &$this->$key; + $handlers = $this->$key; foreach ($handlers as $id => $handler) { $handlers[$id]->postExecute($this->result); } @@ -835,7 +835,7 @@ protected function _initHandler($key, $info) { $this->$key = $this->display_handler->getHandlers($key); // This reference deals with difficult PHP indirection. - $handlers = &$this->$key; + $handlers = $this->$key; // Run through and test for accessibility. foreach ($handlers as $id => $handler) { @@ -870,7 +870,7 @@ protected function _buildArguments() { // Iterate through each argument and process. foreach ($this->argument as $id => $arg) { $position++; - $argument = &$this->argument[$id]; + $argument = $this->argument[$id]; if ($argument->broken()) { continue; @@ -1131,7 +1131,7 @@ public function build($display_id = NULL) { * build the relationship and query information. */ public function _build($key) { - $handlers = &$this->$key; + $handlers = $this->$key; foreach ($handlers as $id => $data) { if (!empty($handlers[$id]) && is_object($handlers[$id])) { @@ -2013,15 +2013,6 @@ public function getItem($display_id, $type, $id) { } /** - * Sets the build array used by the view. - * - * @param array $element - */ - public function setElement(&$element) { - $this->element =& $element; - } - - /** * Sets the configuration of a handler instance on a given display. * * @param string $display_id diff --git a/core/modules/views/search-rest b/core/modules/views/search-rest new file mode 100644 index 0000000..06ec2e6 --- /dev/null +++ b/core/modules/views/search-rest @@ -0,0 +1,373 @@ +includes/ajax.inc:function views_ajax_form_wrapper($form_id, &$form_state) { +lib/Drupal/views/Plugin/Block/ViewsBlock.php: public function form($form, &$form_state) { +lib/Drupal/views/Plugin/Block/ViewsBlock.php: protected function addContextualLinks(&$output, $block_type = 'block') { +lib/Drupal/views/Plugin/views/pager/None.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/pager/None.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/pager/None.php: function execute_count_query(&$count_query) { +lib/Drupal/views/Plugin/views/pager/None.php: public function postExecute(&$result) { +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: function execute_count_query(&$count_query) { +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: function pre_execute(&$query) { } +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: public function postExecute(&$result) { } +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: function pre_render(&$result) { } +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: function exposed_form_alter(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: function exposed_form_validate(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php: function exposed_form_submit(&$form, &$form_state, &$exclude) { } +lib/Drupal/views/Plugin/views/pager/Full.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/pager/Some.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/pager/Mini.php: public function postExecute(&$result) { +lib/Drupal/views/Plugin/views/pager/SqlBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/pager/SqlBase.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/pager/SqlBase.php: function exposed_form_alter(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/pager/SqlBase.php: function exposed_form_validate(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/row/RssFields.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/row/RowPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/row/RowPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/row/RowPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/row/Fields.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/row/Fields.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php: public function defineOptionsAlter(&$options) { } +lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php: public function optionsSummary(&$categories, &$options) { } +lib/Drupal/views/Plugin/views/display_extender/DisplayExtenderPluginBase.php: public function defaultableSections(&$sections, $section = NULL) { } +lib/Drupal/views/Plugin/views/filter/BooleanOperator.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/filter/BooleanOperator.php: function operator_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/BooleanOperator.php: function value_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/BooleanOperator.php: function value_validate($form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/String.php: function value_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/InOperator.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/filter/InOperator.php: public function buildExposeForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/InOperator.php: function value_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/InOperator.php: function value_submit($form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/Bundle.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/filter/Broken.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/filter/Broken.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/Numeric.php: function value_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/Combine.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/Equality.php: function value_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function show_operator_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function operator_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function operator_validate($form, &$form_state) { } +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function operator_submit($form, &$form_state) { } +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function show_value_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function value_form(&$form, &$form_state) { $form['value'] = array(); } +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function value_validate($form, &$form_state) { } +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function value_submit($form, &$form_state) { } +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function show_build_group_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function show_build_group_button(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function buildGroupForm($form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function showExposeButton(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function buildExposeForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function validateExposeForm($form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function build_group_validate($form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function build_group_submit($form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function group_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function buildExposedForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function build_group_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: public function addGroupForm($form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function exposed_translate(&$form, $type) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function prepare_filter_select_options(&$options) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function convert_exposed_input(&$input, $selected_group_id = NULL) { +lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php: function group_multiple_exposed_input(&$input) { +lib/Drupal/views/Plugin/views/filter/ManyToOne.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/filter/ManyToOne.php: function value_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/Date.php: function value_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/Date.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/Date.php: public function validateExposed(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/filter/Date.php: public function validateValidTime(&$form, $operator, $value) { +lib/Drupal/views/Plugin/views/filter/Date.php: function build_group_validate($form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/String.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/argument/String.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: function set_breadcrumb(&$breadcrumb) { } +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: function default_argument_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: function default_summary_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: return call_user_func_array(array(&$this, $info['method']), $info['method args']); +lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php: function process_summary_arguments(&$args) { +lib/Drupal/views/Plugin/views/argument/Broken.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/Null.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/Numeric.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/Formula.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/argument/ManyToOne.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/argument/ManyToOne.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument/Date.php: function default_argument_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/PathPluginBase.php: $access_arguments[0] = array($access_plugin_method, &$access_plugin_arguments); +lib/Drupal/views/Plugin/views/display/PathPluginBase.php: public function optionsSummary(&$categories, &$options) { +lib/Drupal/views/Plugin/views/display/PathPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/PathPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/PathPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: public function initDisplay(ViewExecutable $view, array &$display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: public function optionsSummary(&$categories, &$options) { +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: public function rescanThemes($form, &$form_state) { +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: public function changeThemeForm($form, &$form_state) { +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php: public function optionsOverride($form, &$form_state) { +lib/Drupal/views/Plugin/views/display/Page.php: public function optionsSummary(&$categories, &$options) { +lib/Drupal/views/Plugin/views/display/Page.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/Page.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/Page.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/Feed.php: public function initDisplay(ViewExecutable $view, array &$display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/display/Feed.php: public function optionsSummary(&$categories, &$options) { +lib/Drupal/views/Plugin/views/display/Feed.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/Feed.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/Attachment.php: public function optionsSummary(&$categories, &$options) { +lib/Drupal/views/Plugin/views/display/Attachment.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/display/Attachment.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public function submitOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function buildGroupByForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public function submitGroupByForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public function defineExtraOptions(&$option) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function buildExtraOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function validateExtraOptionsForm($form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function submitExtraOptionsForm($form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function buildExposedForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function validateExposed(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function submitExposed(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function buildExposeForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function validateExposeForm($form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function submitExposeForm($form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function showExposeButton(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public function showExposeForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public function postExecute(&$values) { } +lib/Drupal/views/Plugin/views/HandlerBase.php: public static function breakPhrase($str, &$handler = NULL) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public static function breakPhraseString($str, &$handler = NULL) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public function displayExposedForm($form, &$form_state) { +lib/Drupal/views/Plugin/views/HandlerBase.php: public function submitTemporaryForm($form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Counter.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Links.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: foreach ($classes as &$class) { +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: foreach ($classes as &$class) { +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: foreach ($classes as &$class) { +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: function pre_render(&$values) { } +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: function add_self_tokens(&$tokens, $item) { } +lib/Drupal/views/Plugin/views/field/FieldPluginBase.php: function document_self_tokens(&$tokens) { } +lib/Drupal/views/Plugin/views/field/Markup.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/field/Broken.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Serialized.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Serialized.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Numeric.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Url.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/TimeInterval.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Custom.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/MachineName.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/MachineName.php: function pre_render(&$values) { +lib/Drupal/views/Plugin/views/field/PrerenderList.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/FileSize.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Date.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/field/Boolean.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { + + + +lib/Drupal/views/Plugin/views/field/Boolean.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/access/AccessPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/access/AccessPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/access/AccessPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/area/Entity.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/area/Entity.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/Text.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/Text.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/Broken.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/Title.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/View.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/Result.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/AreaPluginBase.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/area/AreaPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/AreaPluginBase.php: public function tokenForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/TextCustom.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/area/TextCustom.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/PluginBase.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/PluginBase.php: protected function setOptionDefaults(array &$storage, array $options) { +lib/Drupal/views/Plugin/views/PluginBase.php: public function unpackOptions(&$storage, $options, $definition = NULL, $all = TRUE, $check = TRUE) { +lib/Drupal/views/Plugin/views/PluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/PluginBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/PluginBase.php: public function submitOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/PluginBase.php: public function globalTokenForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: function build_form(array $form, array &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function build_form_style(array &$form, array &$form_state, $type) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function build_filters(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function build_sorts(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function instantiate_view($form, &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function alter_display_options(&$display_options, $form, $form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: foreach ($display_options as &$options) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function default_display_filters_user(array $form, array &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function page_display_options(array $form, array &$form_state) { + + + +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function block_display_options(array $form, array &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function retrieve_validated_view(array $form, array &$form_state, $unset = TRUE) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: protected function set_validated_view(array $form, array &$form_state, ViewUI $view) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: public function validateView(array $form, array &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php: function create_view(array $form, array &$form_state) { +lib/Drupal/views/Plugin/views/wizard/WizardInterface.php: function build_form(array $form, array &$form_state); +lib/Drupal/views/Plugin/views/wizard/WizardInterface.php: public function validateView(array $form, array &$form_state); +lib/Drupal/views/Plugin/views/wizard/WizardInterface.php: function create_view(array $form, array &$form_state); +lib/Drupal/views/Plugin/views/sort/Random.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/Broken.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/SortPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/SortPluginBase.php: public function showExposeButton(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/SortPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/SortPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/SortPluginBase.php: function show_sort_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/SortPluginBase.php: function sort_validate(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/sort/SortPluginBase.php: function sort_submit(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/sort/SortPluginBase.php: public function buildExposeForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/sort/GroupByNumeric.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/sort/Date.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/query/QueryPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/query/QueryPluginBase.php: public function submitOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/query/QueryPluginBase.php: function load_entities(&$results) {} +lib/Drupal/views/Plugin/views/query/Sql.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/query/Sql.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/query/Sql.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/query/Sql.php: function load_entities(&$results) { +lib/Drupal/views/Plugin/views/cache/Time.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/cache/Time.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/cache/CachePluginBase.php: function post_render(&$output) { } +lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php: public function submitOptionsForm(&$form, &$form_state, &$options = array()) { } +lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php: function check_access(&$form, $option_name) { +lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php: function process_summary_arguments(&$args) { } +lib/Drupal/views/Plugin/views/argument_validator/Php.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/relationship/Broken.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php: function alter_subquery_condition(AlterableInterface $query, &$conditions) { +lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { +lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/exposed_form/InputRequired.php: public function submitOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php: function post_render(&$output) { } +lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php: function exposed_form_alter(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php: function exposed_form_validate(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php: function exposed_form_submit(&$form, &$form_state, &$exclude) { +lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php: function reset_form(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/Mapping.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/UnformattedSummary.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/HtmlList.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/Table.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/Table.php: function wizard_submit(&$form, &$form_state, WizardInterface $wizard, &$display_options, $display_type) { +lib/Drupal/views/Plugin/views/style/Table.php: foreach ($display_options['default']['fields'] as &$field) { +lib/Drupal/views/Plugin/views/style/DefaultSummary.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/Grid.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/StylePluginBase.php: public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { + +lib/Drupal/views/Plugin/views/style/StylePluginBase.php: foreach ($classes as &$class) { +lib/Drupal/views/Plugin/views/style/StylePluginBase.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/StylePluginBase.php: public function validateOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/style/StylePluginBase.php: function wizard_form(&$form, &$form_state, $type) { +lib/Drupal/views/Plugin/views/style/StylePluginBase.php: function wizard_submit(&$form, &$form_state, WizardInterface $wizard, &$display_options, $display_type) { +lib/Drupal/views/Plugin/views/style/Rss.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument_default/Php.php: public function buildOptionsForm(&$form, &$form_state) { + +lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php: public function buildOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php: public function validateOptionsForm(&$form, &$form_state) { } +lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php: public function submitOptionsForm(&$form, &$form_state, &$options = array()) { } +lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php: function check_access(&$form, $option_name) { +lib/Drupal/views/Plugin/views/argument_default/Fixed.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/views/argument_default/Raw.php: public function buildOptionsForm(&$form, &$form_state) { +lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php: public static function settingsForm(&$field, &$instance) { +lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php: public function validateAutocompleteInput($input, &$element, &$form_state, $form, $strict = TRUE) { +lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php: public function settingsFormValidate($element, &$form_state, $form) { +lib/Drupal/views/ManyToOneHelper.php: public static function defineOptions(&$options) { +lib/Drupal/views/ManyToOneHelper.php: public function buildOptionsForm(&$form, &$form_state) { + +lib/Drupal/views/Tests/ViewsDataTest.php: $expected_keys = array_walk($expected[$handler_type], function(&$item) { +lib/Drupal/views/Tests/ViewsDataTest.php: $expected_keys = array_walk($expected[$sub_type], function(&$item) { + +lib/Drupal/views/Tests/TestHelperPlugin.php: public function testSetOptionDefaults(&$storage, $options, $level = 0) { + + + +lib/Drupal/views/Tests/Handler/ArgumentStringTest.php: foreach ($view->result as &$row) { +lib/Drupal/views/ViewExecutable.php: public function executeHookMenu($display_id = NULL, &$callbacks = array()) { +lib/Drupal/views/ViewsData.php: protected function processEntityTypes(array &$data) { +lib/Drupal/views/ViewStorageController.php: protected function attachLoad(&$queried_entities, $revision_id = FALSE) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/row/RowTest.php: public function buildOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php: public function defineOptionsAlter(&$options) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php: public function optionsSummary(&$categories, &$options) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php: public function buildOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php: public function submitOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display_extender/DisplayExtenderTest.php: public function defaultableSections(&$sections, $section = NULL) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/filter/FilterTest.php: public function buildOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php: public function optionsSummary(&$categories, &$options) { + +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php: public function buildOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php: public function validateOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php: public function submitOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/field/FieldTest.php: function add_self_tokens(&$tokens, $item) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/area/TestExample.php: public function buildOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php: public function buildOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/style/MappingTest.php: protected function filterNumericFields(&$fields) { +tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/style/StyleTest.php: public function buildOptionsForm(&$form, &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Form/ViewsTestDataElementForm.php: public function buildForm(array $form, array &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Form/ViewsTestDataElementForm.php: public function validateForm(array &$form, array &$form_state) { +tests/views_test_data/lib/Drupal/views_test_data/Form/ViewsTestDataElementForm.php: public function submitForm(array &$form, array &$form_state) { +tests/views_test_data/views_test_data.views_execution.inc:function views_test_data_field_views_data_alter(&$data, $field, $module) { +tests/views_test_data/views_test_data.module:function views_test_data_preprocess_views_view_table(&$variables) { +tests/views_test_data/views_test_data.module:function template_preprocess_views_view_mapping_test(&$variables) { + +views.api.php:function hook_views_data_alter(array &$data) { +views.api.php:function hook_views_pre_view(ViewExecutable &$view, &$display_id, array &$args) { +views.api.php:function hook_views_pre_build(ViewExecutable &$view) { +views.api.php:function hook_views_post_build(ViewExecutable &$view) { +views.api.php:function hook_views_pre_execute(ViewExecutable &$view) { +views.api.php:function hook_views_post_execute(ViewExecutable &$view) { +views.api.php:function hook_views_pre_render(ViewExecutable &$view) { +views.api.php:function hook_views_post_render(ViewExecutable &$view, &$output, CacheBackendInterface &$cache) { +views.api.php:function hook_views_query_alter(ViewExecutable &$view, QueryPluginBase &$query) { +views.api.php: foreach ($query->where as &$condition_group) { +views.api.php: foreach ($condition_group['conditions'] as &$condition) { +views.api.php:function hook_views_preview_info_alter(array &$rows, ViewExecutable $view) { +views.api.php:function hook_views_ui_display_top_links_alter(array &$links, ViewExecutable $view, $display_id) { +views.module:function views_preprocess_node(&$vars) { +views.module:function views_preprocess_comment(&$vars) { +views.module:function views_menu_alter(&$callbacks) { +views.module:function views_page_alter(&$page) { +views.module:function views_preprocess_html(&$variables) { +views.module:function views_add_contextual_links(&$render_element, $location, ViewExecutable $view, $display_id) { +views.module:function views_form($form, &$form_state, ViewExecutable $view, $output) { +views.module:function views_form_views_form($form, &$form_state, ViewExecutable $view, $output) { +views.module:function views_form_views_form_validate($form, &$form_state) { +views.module:function views_form_views_form_submit($form, &$form_state) { +views.module:function views_exposed_form($form, &$form_state) { +views.module:function views_form_views_exposed_form_alter(&$form, &$form_state) { +views.module:function views_exposed_form_validate(&$form, &$form_state) { +views.module:function views_exposed_form_submit(&$form, &$form_state) { +views.module:function _views_query_tag_alter_condition(AlterableInterface $query, &$conditions, $substitutions) { +views.module:function views_process_check_options($element, &$form_state) { +views.module:function views_element_validate_tags($element, &$form_state) { +views.theme.inc:function template_preprocess_views_view(&$vars) { +views.theme.inc:function template_preprocess_views_view_fields(&$vars) { +views.theme.inc:function template_preprocess_views_view_grouping(&$vars) { +views.theme.inc:function template_preprocess_views_view_field(&$vars) { +views.theme.inc:function template_preprocess_views_view_summary(&$vars) { +views.theme.inc:function template_preprocess_views_view_summary_unformatted(&$vars) { +views.theme.inc:function template_preprocess_views_view_table(&$vars) { +views.theme.inc:function template_preprocess_views_view_grid(&$vars) { +views.theme.inc:function template_preprocess_views_view_unformatted(&$vars) { +views.theme.inc:function template_preprocess_views_view_list(&$variables) { +views.theme.inc:function template_preprocess_views_view_rss(&$vars) { +views.theme.inc:function template_preprocess_views_view_row_rss(&$vars) { +views.theme.inc:function template_preprocess_views_exposed_form(&$vars) { diff --git a/core/modules/views/templates/views-view.html.twig b/core/modules/views/templates/views-view.html.twig new file mode 100644 index 0000000..7bc73b5 --- /dev/null +++ b/core/modules/views/templates/views-view.html.twig @@ -0,0 +1,94 @@ +{# +/** + * @file + * Default theme implementation for main view template. + * + * Available variables: + * - attributes: Remaining HTML attributes for the element including: + * - class: HTML classes that can be used to style contextually + * through CSS, including: + * - view + * - view-[css_name] + * - view-id-[view_name] + * - view-display-id-[display_name] + * - view-dom-id-[dom_id] + * - css_name: A css-safe version of the view name. + * - css_class: The user-specified classes names, if any. + * - header: The optional header. + * - footer: The optional footer. + * - rows: The results of the view query, if any. + * - empty: The content to display if there are no rows. + * - pager: The optional pager next/prev links to display. + * - exposed: Exposed widget form/info to display. + * - feed_icon: An optional feed icon to display. + * - more: An optional link to the next page of results. + * - title: Title of the view, only used when displaying in the admin preview. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the view title. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the view title. + * - attachment_before: An optional attachment view to be displayed before the + * view content. + * - attachment_after: An optional attachment view to be displayed after the + * view content. + * + * @see template_preprocess() + * @see template_preprocess_views_view() + * + * @ingroup themeable + */ +#} + + {{ title_prefix }} + {% if title %} + {{ title }} + {% endif %} + {{ title_suffix }} + {% if header %} +
+ {{ header }} +
+ {% endif %} + {% if exposed %} +
+ {{ exposed }} +
+ {% endif %} + {% if attachment_before %} +
+ {{ attachment_before }} +
+ {% endif %} + + {% if rows %} +
+ {{ rows }} +
+ {% elseif empty %} +
+ {{ empty }} +
+ {% endif %} + + {% if pager %} + {{ pager }} + {% endif %} + {% if attachment_after %} +
+ {{ attachment_after }} +
+ {% endif %} + {% if more %} + {{ more }} + {% endif %} + {% if footer %} + + {% endif %} + {% if feed_icon %} +
+ {{ feed_icon }} +
+ {% endif %} + diff --git a/core/modules/views/tests/views_test_data/templates/views-view--frontpage.html.twig b/core/modules/views/tests/views_test_data/templates/views-view--frontpage.html.twig new file mode 100644 index 0000000..79a0e65 --- /dev/null +++ b/core/modules/views/tests/views_test_data/templates/views-view--frontpage.html.twig @@ -0,0 +1,89 @@ +{# +/** + * @file + * Default theme implementation for the frontpage view template. + * + * Available variables: + * - attributes: Remaining HTML attributes for the element including: + * - class: HTML classes that can be used to style contextually + * through CSS, including: + * - view + * - view-[css_name] + * - view-id-[view_name] + * - view-display-id-[display_name] + * - view-dom-id-[dom_id] + * - css_name: A css-safe version of the view name. + * - css_class: The user-specified classes names, if any. + * - header: The optional header. + * - footer: The optional footer. + * - rows: The results of the view query, if any. + * - empty: The content to display if there are no rows. + * - pager: The optional pager next/prev links to display. + * - exposed: Exposed widget form/info to display. + * - feed_icon: An optional feed icon to display. + * - more: An optional link to the next page of results. + * - title: Title of the view, only used when displaying in the admin preview. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the view title. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the view title. + * - attachment_before: An optional attachment view to be displayed before the + * view content. + * - attachment_after: An optional attachment view to be displayed after the + * view content. + * + * @see template_preprocess() + * @see template_preprocess_views_view() + * + * @ingroup themeable + */ +#} + + {% if header %} +
+ {{ header }} +
+ {% endif %} + {% if exposed %} +
+ {{ exposed }} +
+ {% endif %} + {% if attachment_before %} +
+ {{ attachment_before }} +
+ {% endif %} + + {% if rows %} +
+ {{ rows }} +
+ {% elseif empty %} +
+ {{ empty }} +
+ {% endif %} + + {% if pager %} + {{ pager }} + {% endif %} + {% if attachment_after %} +
+ {{ attachment_after }} +
+ {% endif %} + {% if more %} + {{ more }} + {% endif %} + {% if footer %} + + {% endif %} + {% if feed_icon %} +
+ {{ feed_icon }} +
+ {% endif %} + diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 09d8c6e..063a18c 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -264,7 +264,7 @@ function views_preprocess_node(&$vars) { function views_preprocess_comment(&$vars) { // The 'view' attribute of the node is added in template_preprocess_views_view_row_comment() if (!empty($vars['comment']->view) && $vars['comment']->view->storage->id()) { - $vars['view'] = &$vars['comment']->view; + $vars['view'] = $vars['comment']->view; $vars['theme_hook_suggestions'][] = 'comment__view__' . $vars['comment']->view->storage->id(); if (!empty($vars['node']->view->current_display)) { $vars['theme_hook_suggestions'][] = 'comment__view__' . $vars['comment']->view->storage->id() . '__' . $vars['comment']->view->current_display; @@ -1410,7 +1410,7 @@ function views_form_views_form_submit($form, &$form_state) { /** * Form builder for the exposed widgets form. * - * Be sure that $view and $display are references. + * Be sure that $display is a reference. */ function views_exposed_form($form, &$form_state) { // Don't show the form when batch operations are in progress. @@ -1424,7 +1424,7 @@ function views_exposed_form($form, &$form_state) { // Make sure that we validate because this form might be submitted // multiple times per page. $form_state['must_validate'] = TRUE; - $view = &$form_state['view']; + $view = $form_state['view']; $display = &$form_state['display']; $form_state['input'] = $view->getExposedInput(); @@ -1500,7 +1500,7 @@ function views_form_views_exposed_form_alter(&$form, &$form_state) { */ function views_exposed_form_validate(&$form, &$form_state) { foreach (array('field', 'filter') as $type) { - $handlers = &$form_state['view']->$type; + $handlers = $form_state['view']->$type; foreach ($handlers as $key => $handler) { $handlers[$key]->validateExposed($form, $form_state); } @@ -1514,7 +1514,7 @@ function views_exposed_form_validate(&$form, &$form_state) { */ function views_exposed_form_submit(&$form, &$form_state) { foreach (array('field', 'filter') as $type) { - $handlers = &$form_state['view']->$type; + $handlers = $form_state['view']->$type; foreach ($handlers as $key => $info) { $handlers[$key]->submitExposed($form, $form_state); } @@ -1576,8 +1576,8 @@ function views_theme_functions($hook, ViewExecutable $view, $display = NULL) { */ function views_query_views_alter(AlterableInterface $query) { $substitutions = $query->getMetaData('views_substitutions'); - $tables =& $query->getTables(); - $where =& $query->conditions(); + $tables = $query->getTables(); + $where = $query->conditions(); // Replaces substitions in tables. foreach ($tables as $table_name => $table_metadata) { @@ -1602,7 +1602,7 @@ function _views_query_tag_alter_condition(AlterableInterface $query, &$condition $condition['field'] = str_replace(array_keys($substitutions), array_values($substitutions), $condition['field']); } elseif (is_object($condition['field'])) { - $sub_conditions =& $condition['field']->conditions(); + $sub_conditions = $condition['field']->conditions(); _views_query_tag_alter_condition($query, $sub_conditions, $substitutions); } // $condition['value'] is a subquery so alter the subquery recursive. diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 82a4a1f..b86045e 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -11,11 +11,11 @@ /** * Provide a full array of possible themes to try for a given hook. * - * @param $hook + * @param string $hook * The hook to use. This is the base theme/template name. - * @param $view + * @param \Drupal\views\ViewExe cutable $view * The view being rendered. - * @param $display + * @param string|null $display * The display being rendered, if applicable. */ function _views_theme_functions($hook, ViewExecutable $view, $display = NULL) { @@ -40,14 +40,20 @@ function _views_theme_functions($hook, ViewExecutable $view, $display = NULL) { } /** - * Preprocess the primary theme implementation for a view. + * Prepares variables for view templates. + * + * Default template: views-view.html.twig. + * + * @param array $vars + * An associative array containing: + * - view: The ViewExecutable object. */ function template_preprocess_views_view(&$vars) { global $base_path; $view = $vars['view']; - $vars['rows'] = (!empty($view->result) || $view->style_plugin->even_empty()) ? $view->style_plugin->render($view->result) : ''; + $vars['rows'] = (!empty($view->result) || $view->style_plugin->even_empty()) ? $view->style_plugin->render($view->result) : array(); // Force a render array so CSS/JS can be added. if (!is_array($vars['rows'])) { $vars['rows'] = array('#markup' => $vars['rows']); @@ -57,7 +63,7 @@ function template_preprocess_views_view(&$vars) { $vars['id'] = $view->storage->id(); $vars['display_id'] = $view->current_display; - // Basic classes + // Basic classes. $vars['css_class'] = ''; $vars['attributes']['class'] = array(); @@ -110,21 +116,21 @@ function template_preprocess_views_view(&$vars) { // attached to an array (not an object) in order to process them. For our // purposes, it doesn't matter what we attach them to, since once they are // processed by contextual_preprocess() they will appear in the $title_suffix - // variable (which we will then render in views-view.tpl.php). + // variable (which we will then render in views-view.html.twig). views_add_contextual_links($vars['view_array'], 'view', $view, $view->current_display); // Attachments are always updated with the outer view, never by themselves, // so they do not have dom ids. if (empty($view->is_attachment)) { - // Our JavaScript needs to have some means to find the HTML belonging to this - // view. + // Our JavaScript needs to have some means to find the HTML belonging to + // this view. // // It is true that the DIV wrapper has classes denoting the name of the view // and its display ID, but this is not enough to unequivocally match a view // with its HTML, because one view may appear several times on the page. So - // we set up a hash with the current time, $dom_id, to issue a "unique" identifier for - // each view. This identifier is written to both Drupal.settings and the DIV - // wrapper. + // we set up a hash with the current time, $dom_id, to issue a "unique" + // identifier for each view. This identifier is written to both + // Drupal.settings and the DIV wrapper. $vars['dom_id'] = $view->dom_id; $vars['attributes']['class'][] = 'view-dom-id-' . $vars['dom_id']; } @@ -153,7 +159,7 @@ function template_preprocess_views_view(&$vars) { $view->element['#attached']['library'][] = array('views', 'views.ajax'); } - // If form fields were found in the View, reformat the View output as a form. + // If form fields were found in the view, reformat the view output as a form. if (views_view_has_form_elements($view)) { // Copy the rows so as not to modify them by reference when rendering. $rows = $vars['rows']; @@ -205,7 +211,7 @@ function template_preprocess_views_view_fields(&$vars) { $empty = $field->is_value_empty($field_output, $field->options['empty_zero']); if (empty($field->options['exclude']) && (!$empty || (empty($field->options['hide_empty']) && empty($vars['options']['hide_empty'])))) { $object = new stdClass(); - $object->handler = &$view->field[$id]; + $object->handler = $view->field[$id]; $object->inline = !empty($vars['options']['inline'][$id]); $object->element_type = $object->handler->element_type(TRUE, !$vars['options']['default_field_elements'], $object->inline); @@ -543,7 +549,7 @@ function template_preprocess_views_view_table(&$vars) { $default_row_class = isset($options['default_row_class']) ? $options['default_row_class'] : TRUE; $row_class_special = isset($options['row_class_special']) ? $options['row_class_special'] : TRUE; - $fields = &$view->field; + $fields = $view->field; $columns = $handler->sanitize_columns($options['columns'], $fields); $active = !empty($handler->active) ? $handler->active : ''; @@ -955,10 +961,11 @@ function template_preprocess_views_view_list(&$variables) { function template_preprocess_views_view_rss(&$vars) { global $base_url; - $view = $vars['view']; - $items = $vars['rows']; + $view = $vars['view']; + $options = &$vars['options']; + $items = &$vars['rows']; - $style = $view->style_plugin; + $style = $view->style_plugin; $config = config('system.site'); @@ -1023,7 +1030,9 @@ function template_preprocess_views_view_rss(&$vars) { * - row: The raw results rows. */ function template_preprocess_views_view_row_rss(&$vars) { - $item = $vars['row']; + $view = $vars['view']; + $options = &$vars['options']; + $item = &$vars['row']; $vars['title'] = check_plain($item->title); $vars['link'] = check_url($item->link); @@ -1192,7 +1201,7 @@ function theme_views_mini_pager($vars) { * or some combination thereof. * * For each view, there will be a minimum of two templates used. The first - * is used for all views: views-view.tpl.php. + * is used for all views: views-view.html.twig. * * The second template is determined by the style selected for the view. Note * that certain aspects of the view can also change which style is used; for @@ -1212,7 +1221,7 @@ function theme_views_mini_pager($vars) { * - views-view--foobar--page.tpl.php * - views-view--page.tpl.php * - views-view--foobar.tpl.php - * - views-view.tpl.php + * - views-view.html.twig * * - views-view-unformatted--foobar--page.html.twig * - views-view-unformatted--page.html.twig diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc index a723854..47a9fa1 100644 --- a/core/modules/views_ui/admin.inc +++ b/core/modules/views_ui/admin.inc @@ -333,7 +333,7 @@ function views_ui_pre_render_move_argument_options($form) { * the current display. */ function views_ui_standard_display_dropdown(&$form, &$form_state, $section) { - $view = &$form_state['view']; + $view = $form_state['view']; $display_id = $form_state['display_id']; $executable = $view->get('executable'); $displays = $executable->displayHandlers; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php index 1c8d13e..3209443 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php @@ -48,7 +48,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $display_id = $form_state['display_id']; $type = $form_state['type']; @@ -63,7 +63,7 @@ public function buildForm(array $form, array &$form_state) { if (!$executable->setDisplay($display_id)) { views_ajax_error(t('Invalid display id @display', array('@display' => $display_id))); } - $display = &$executable->displayHandlers->get($display_id); + $display = $executable->displayHandlers->get($display_id); $types = ViewExecutable::viewsHandlerTypes(); $ltitle = $types[$type]['ltitle']; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php index b8b7ac9..fbd7d13 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php @@ -34,7 +34,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $form['#title'] = t('View analysis'); $form['#section'] = 'analyze'; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php index e35cee0..8c410b7 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php @@ -51,7 +51,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $display_id = $form_state['display_id']; $type = $form_state['type']; $id = $form_state['id']; @@ -159,7 +159,7 @@ public function buildForm(array $form, array &$form_state) { // Get form from the handler. $handler->buildOptionsForm($form['options'], $form_state); - $form_state['handler'] = &$handler; + $form_state['handler'] = $handler; } $name = NULL; @@ -257,7 +257,7 @@ public function remove(&$form, &$form_state) { $executable = $form_state['view']->get('executable'); // If the display selection was changed toggle the override value. if ($was_defaulted != $is_defaulted) { - $display = &$executable->displayHandlers->get($form_state['display_id']); + $display = $executable->displayHandlers->get($form_state['display_id']); $display->optionsOverride($form, $form_state); } $executable->removeItem($form_state['display_id'], $form_state['type'], $form_state['id']); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php index 14895f8..3bcbd89 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php @@ -50,7 +50,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $display_id = $form_state['display_id']; $type = $form_state['type']; $id = $form_state['id']; @@ -83,7 +83,7 @@ public function buildForm(array $form, array &$form_state) { // Get form from the handler. $handler->buildExtraOptionsForm($form['options'], $form_state); - $form_state['handler'] = &$handler; + $form_state['handler'] = $handler; } $view->getStandardButtons($form, $form_state, 'views_ui_config_item_extra_form'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php index 8f2da46..0f1e5c0 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php @@ -50,7 +50,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $display_id = $form_state['display_id']; $type = $form_state['type']; $id = $form_state['id']; @@ -83,7 +83,7 @@ public function buildForm(array $form, array &$form_state) { $form['#title'] = t('Configure aggregation settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel())); $handler->buildGroupByForm($form['options'], $form_state); - $form_state['handler'] = &$handler; + $form_state['handler'] = $handler; } $view->getStandardButtons($form, $form_state, 'views_ui_config_item_group_form'); @@ -95,7 +95,7 @@ public function buildForm(array $form, array &$form_state) { * Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm(). */ public function submitForm(array &$form, array &$form_state) { - $item = &$form_state['handler']->options; + $item = $form_state['handler']->options; $type = $form_state['type']; $id = $form_state['id']; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php index d8c1e9a..58fd256 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php @@ -59,7 +59,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $display_id = $form_state['display_id']; $section = $form_state['section']; @@ -67,7 +67,6 @@ public function buildForm(array $form, array &$form_state) { if (!$executable->setDisplay($display_id)) { views_ajax_error(t('Invalid display id @display', array('@display' => $display_id))); } - $display = &$executable->display[$display_id]; // Get form from the handler. $form['options'] = array( diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php index 90f8c08..57600e1 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php @@ -33,7 +33,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $form['#title'] = t('View name and description'); $form['#section'] = 'details'; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php index 75c469f..1ec324e 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php @@ -48,7 +48,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $display_id = $form_state['display_id']; $type = $form_state['type']; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php index ff5db0a..75cdf5f 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php @@ -33,7 +33,7 @@ public function getFormID() { * Implements \Drupal\Core\Form\FormInterface::buildForm(). */ public function buildForm(array $form, array &$form_state) { - $view = &$form_state['view']; + $view = $form_state['view']; $display_id = $form_state['display_id']; $type = 'filter'; @@ -212,7 +212,7 @@ public function buildForm(array $form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { $types = ViewExecutable::viewsHandlerTypes(); - $display = &$form_state['view']->get('executable')->displayHandlers->get($form_state['display_id']); + $display = $form_state['view']->get('executable')->displayHandlers->get($form_state['display_id']); $remember_groups = array(); if (!empty($form_state['view']->form_cache)) { diff --git a/core/modules/views_ui/search_viewsui_log b/core/modules/views_ui/search_viewsui_log new file mode 100644 index 0000000..7382804 --- /dev/null +++ b/core/modules/views_ui/search_viewsui_log @@ -0,0 +1,125 @@ +admin.inc:function views_ui_add_ajax_trigger(&$wrapping_element, $trigger_key, $refresh_parents) { +admin.inc: $triggering_element = &$wrapping_element[$trigger_key]; +admin.inc:function views_ui_add_limited_validation($element, &$form_state) { +admin.inc: $clicked_button = &$form_state['triggering_element']; +admin.inc:function views_ui_add_ajax_wrapper($element, &$form_state) { +admin.inc: $complete_form = &$form_state['complete_form']; +admin.inc:function views_ui_nojs_submit($form, &$form_state) { +admin.inc:function views_ui_taxonomy_autocomplete_validate($element, &$form_state) { +admin.inc:function views_ui_standard_display_dropdown(&$form, &$form_state, $section) { +admin.inc:function views_ui_form_button_was_clicked($element, &$form_state) { + +lib/Drupal/views_ui/ViewEditFormController.php: public function form(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: protected function actions(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function validate(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submit(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function cancel(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: protected function actionsElement(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submitDisplayUndoDelete($form, &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submitDisplayEnable($form, &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submitDisplayDisable($form, &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submitDisplayDelete($form, &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submitDelayDestination($form, &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submitDisplayDuplicate($form, &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submitDisplayAdd($form, &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public function submitCloneDisplayAsType($form, &$form_state) { +lib/Drupal/views_ui/ViewEditFormController.php: public static function addMicroweights(&$build) { +lib/Drupal/views_ui/ViewAddFormController.php: public function init(array &$form_state) { +lib/Drupal/views_ui/ViewAddFormController.php: public function form(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewAddFormController.php: $show_form = &$form['displays']['show']; +lib/Drupal/views_ui/ViewAddFormController.php: protected function actions(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewAddFormController.php: public function validate(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewAddFormController.php: public function submit(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewAddFormController.php: public function cancel(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewUI.php: public function standardSubmit($form, &$form_state) { +lib/Drupal/views_ui/ViewUI.php: $display = &$this->executable->displayHandlers->get($form_state['display_id']); +lib/Drupal/views_ui/ViewUI.php: $display = &$this->executable->displayHandlers->get($form_state['display_id']); +lib/Drupal/views_ui/ViewUI.php: $display = &$this->executable->displayHandlers->get($form_state['display_id']); +lib/Drupal/views_ui/ViewUI.php: call_user_func_array($submit_handler, array(&$form, &$form_state)); +lib/Drupal/views_ui/ViewUI.php: public function standardCancel($form, &$form_state) { +lib/Drupal/views_ui/ViewUI.php: public function getStandardButtons(&$form, &$form_state, $form_id, $name = NULL) { +lib/Drupal/views_ui/ViewUI.php: public function submitItemAdd($form, &$form_state) { +lib/Drupal/views_ui/ViewUI.php: $display = &$this->executable->displayHandlers->get($form_state['display_id']); +lib/Drupal/views_ui/ViewUI.php: $display = &$this->executable->displayHandlers->get($form_state['display_id']); +lib/Drupal/views_ui/ViewFormControllerBase.php: public function init(array &$form_state) { +lib/Drupal/views_ui/Routing/ViewsUIController.php: foreach ($rows as &$row) { +lib/Drupal/views_ui/Form/BreakLockForm.php: public function buildForm(array $form, array &$form_state, ViewStorageInterface $view = NULL) { +lib/Drupal/views_ui/Form/BreakLockForm.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/AdvancedSettingsForm.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/AdvancedSettingsForm.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/DeleteForm.php: public function buildForm(array $form, array &$form_state, ViewStorageInterface $view = NULL) { +lib/Drupal/views_ui/Form/DeleteForm.php: public function validateForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/DeleteForm.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/BasicSettingsForm.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/BasicSettingsForm.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php: public function validateForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/EditDetails.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/EditDetails.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/Display.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/Display.php: public function validateForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/Display.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItem.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItem.php: public function validateForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItem.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItem.php: public function remove(&$form, &$form_state) { + +lib/Drupal/views_ui/Form/Ajax/ConfigItem.php: $display = &$executable->displayHandlers->get($form_state['display_id']); + + + + +lib/Drupal/views_ui/Form/Ajax/ReorderDisplays.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ReorderDisplays.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php: public function validateForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/Rearrange.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/Rearrange.php: $display = &$executable->displayHandlers->get($display_id); +lib/Drupal/views_ui/Form/Ajax/Rearrange.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/Rearrange.php: $display = &$form_state['view']->get('executable')->displayHandlers->get($form_state['display_id']); +lib/Drupal/views_ui/Form/Ajax/Analyze.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/Analyze.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php: public function submitForm(array &$form, array &$form_state) { + +lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php: $display = &$form_state['view']->get('executable')->displayHandlers->get($form_state['display_id']); + + + +lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php: foreach ($new_fields as &$new_field) { +lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php: public function buildForm(array $form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php: public function submitForm(array &$form, array &$form_state) { +lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php: $item = &$form_state['handler']->options; + + +lib/Drupal/views_ui/Form/Ajax/AddItem.php: public function buildForm(array $form, array &$form_state) { + + +lib/Drupal/views_ui/Form/Ajax/AddItem.php: $display = &$executable->displayHandlers->get($display_id); + + + +lib/Drupal/views_ui/ViewCloneFormController.php: public function init(array &$form_state) { +lib/Drupal/views_ui/ViewCloneFormController.php: public function form(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewCloneFormController.php: protected function actions(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewCloneFormController.php: public function submit(array $form, array &$form_state) { +lib/Drupal/views_ui/ParamConverter/ViewUIConverter.php: * @param array &$variables +lib/Drupal/views_ui/ParamConverter/ViewUIConverter.php: * @param array &$converted +lib/Drupal/views_ui/ParamConverter/ViewUIConverter.php: public function process(array &$variables, Route $route, array &$converted) { +lib/Drupal/views_ui/ViewListController.php: foreach ($build['#links'] as &$operation) { +lib/Drupal/views_ui/ViewPreviewFormController.php: public function form(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewPreviewFormController.php: protected function actions(array $form, array &$form_state) { +lib/Drupal/views_ui/ViewPreviewFormController.php: public function submitPreview($form, &$form_state) { +views_ui.module:function views_ui_entity_info(&$entity_info) { +views_ui.module:function views_ui_preprocess_views_view(&$vars) { +views_ui.module:function views_ui_views_plugins_display_alter(&$plugins) { +views_ui.module: foreach ($plugins as &$display) { +views_ui.module:function views_ui_contextual_links_view_alter(&$element, $items) { +views_ui.module:function views_ui_library_alter(&$libraries, $module) { +views_ui.theme.inc:function template_preprocess_views_ui_display_tab_setting(&$variables) { +views_ui.theme.inc:function template_preprocess_views_ui_display_tab_bucket(&$variables) { +views_ui.theme.inc:function template_preprocess_views_ui_view_info(&$variables) { +views_ui.theme.inc: $display = &$form[$key]; +views_ui.theme.inc:function theme_views_ui_rearrange_filter_form(&$vars) { +views_ui.theme.inc:function template_preprocess_views_ui_view_preview_section(&$vars) { diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index 0d461be..0c8bbf4 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -220,7 +220,7 @@ function views_ui_library_info() { } /** - * Theme preprocess for views-view.tpl.php. + * Implements hook_preprocess_HOOK() for views-view.html.twig. */ function views_ui_preprocess_views_view(&$vars) { $view = $vars['view']; @@ -232,11 +232,11 @@ function views_ui_preprocess_views_view(&$vars) { '#theme' => 'views_ui_view_preview_section', '#view' => $view, '#section' => $section, - '#content' => is_array($vars[$section]) ? drupal_render($vars[$section]) : $vars[$section], + '#content' => $vars[$section], '#theme_wrappers' => array('views_ui_container'), '#attributes' => array('class' => 'contextual-region'), ); - $vars[$section] = drupal_render($vars[$section]); + $vars[$section] = $vars[$section]; } } } diff --git a/views-object-reference-rerolled-2013-05-25.patch b/views-object-reference-rerolled-2013-05-25.patch new file mode 100644 index 0000000..50c816d --- /dev/null +++ b/views-object-reference-rerolled-2013-05-25.patch @@ -0,0 +1,426 @@ +diff --git a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php +index 1209901..34e7e17 100644 +--- a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php ++++ b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php +@@ -125,8 +125,8 @@ function summary_join() { + + // shortcuts + $options = $this->handler->options; +- $view = &$this->handler->view; +- $query = &$this->handler->query; ++ $view = $this->handler->view; ++ $query = $this->handler->query; + + if (!empty($options['require_value'])) { + $join->type = 'INNER'; +diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +index 3f510aa..b36eae8 100644 +--- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php ++++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +@@ -341,9 +341,7 @@ public function buildGroupByForm(&$form, &$form_state) { + * There is no need for this function to actually store the data. + */ + public function submitGroupByForm(&$form, &$form_state) { +- $item =& $form_state['handler']->options; +- +- $item['group_type'] = $form_state['values']['options']['group_type']; ++ $form_state['handler']->options['group_type'] = $form_state['values']['options']['group_type']; + } + + /** +diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +index 117ade9..6292946 100644 +--- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php ++++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +@@ -428,7 +428,7 @@ public function submitOptionsForm(&$form, &$form_state) { + } + + // Clear out the content of title if it's not enabled. +- $options =& $form_state['values']['options']; ++ $options = &$form_state['values']['options']; + if (empty($options['title_enable'])) { + $options['title'] = ''; + } +diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/Php.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/Php.php +index cf5a574..ffc1a4e 100644 +--- a/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/Php.php ++++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/Php.php +@@ -52,7 +52,7 @@ public function access() { + + function get_argument() { + // set up variables to make it easier to reference during the argument. +- $view = &$this->view; ++ $view = $this->view; + $argument = &$this->argument; + ob_start(); + $result = eval($this->options['code']); +diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Php.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Php.php +index 9b23895..34c5323 100644 +--- a/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Php.php ++++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Php.php +@@ -51,7 +51,7 @@ public function access() { + + function validate_argument($argument) { + // set up variables to make it easier to reference during the argument. +- $view = &$this->view; ++ $view = $this->view; + $handler = &$this->argument; + + ob_start(); +diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php +index b5c236d..33dbbaf 100644 +--- a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php ++++ b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php +@@ -245,7 +245,7 @@ function left_query($options) { + + // Workaround until http://drupal.org/node/844910 is fixed: + // Remove all fields from the SELECT except the base id. +- $fields =& $subquery->getFields(); ++ $fields = &$subquery->getFields(); + foreach (array_keys($fields) as $field_name) { + // The base id for this subquery is stored in our definition. + if ($field_name != $this->definition['field']) { +@@ -255,7 +255,7 @@ function left_query($options) { + + // Make every alias in the subquery safe within the outer query by + // appending a namespace to it, '_inner' by default. +- $tables =& $subquery->getTables(); ++ $tables = &$subquery->getTables(); + foreach (array_keys($tables) as $table_name) { + $tables[$table_name]['alias'] .= $this->subquery_namespace; + // Namespace the join on every table. +@@ -269,13 +269,13 @@ function left_query($options) { + $fields[$field_name]['alias'] .= $this->subquery_namespace; + } + // Namespace conditions. +- $where =& $subquery->conditions(); ++ $where = &$subquery->conditions(); + $this->alter_subquery_condition($subquery, $where); + // Not sure why, but our sort order clause doesn't have a table. + // TODO: the call to add_item() above to add the sort handler is probably + // wrong -- needs attention from someone who understands it. + // In the meantime, this works, but with a leap of faith... +- $orders =& $subquery->getOrderBy(); ++ $orders = &$subquery->getOrderBy(); + foreach ($orders as $order_key => $order) { + // But if we're using a whole view, we don't know what we have! + if ($options['subquery_view']) { +@@ -317,7 +317,7 @@ function alter_subquery_condition(AlterableInterface $query, &$conditions) { + $condition['field'] = $this->condition_namespace($condition['field']); + } + elseif (is_object($condition['field'])) { +- $sub_conditions =& $condition['field']->conditions(); ++ $sub_conditions = &$condition['field']->conditions(); + $this->alter_subquery_condition($query, $sub_conditions); + } + } +diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +index 3945ae0..a65e2f0 100644 +--- a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php ++++ b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +@@ -506,7 +506,7 @@ public static function getSelected($form_state, $parents, $default_value, $eleme + * The display ID (e.g. 'page' or 'block'). + */ + protected function build_form_style(array &$form, array &$form_state, $type) { +- $style_form =& $form['displays'][$type]['options']['style']; ++ $style_form = &$form['displays'][$type]['options']['style']; + $style = $style_form['style_plugin']['#default_value']; + $style_plugin = Views::pluginManager('style')->createInstance($style); + if (isset($style_plugin) && $style_plugin->usesRowPlugin()) { +diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php +index 43acdab..0e0cdc7 100644 +--- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php ++++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php +@@ -206,7 +206,7 @@ public function testAlterUrl() { + // Get the expected start of the path string. + $base = ($absolute ? $base_url . '/' : base_path()) . $script_path; + $absolute_string = $absolute ? 'absolute' : NULL; +- $alter =& $id_field->options['alter']; ++ $alter = &$id_field->options['alter']; + $alter['path'] = 'node/123'; + + $expected_result = url('node/123', array('absolute' => $absolute)); +diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php +index a8a8dd2..97489dc 100644 +--- a/core/modules/views/lib/Drupal/views/ViewExecutable.php ++++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php +@@ -870,7 +870,7 @@ protected function _buildArguments() { + // Iterate through each argument and process. + foreach ($this->argument as $id => $arg) { + $position++; +- $argument = &$this->argument[$id]; ++ $argument = $this->argument[$id]; + + if ($argument->broken()) { + continue; +@@ -2013,15 +2013,6 @@ public function getItem($display_id, $type, $id) { + } + + /** +- * Sets the build array used by the view. +- * +- * @param array $element +- */ +- public function setElement(&$element) { +- $this->element =& $element; +- } +- +- /** + * Sets the configuration of a handler instance on a given display. + * + * @param string $display_id +diff --git a/core/modules/views/views.module b/core/modules/views/views.module +index 09d8c6e..3143c94 100644 +--- a/core/modules/views/views.module ++++ b/core/modules/views/views.module +@@ -264,7 +264,7 @@ function views_preprocess_node(&$vars) { + function views_preprocess_comment(&$vars) { + // The 'view' attribute of the node is added in template_preprocess_views_view_row_comment() + if (!empty($vars['comment']->view) && $vars['comment']->view->storage->id()) { +- $vars['view'] = &$vars['comment']->view; ++ $vars['view'] = $vars['comment']->view; + $vars['theme_hook_suggestions'][] = 'comment__view__' . $vars['comment']->view->storage->id(); + if (!empty($vars['node']->view->current_display)) { + $vars['theme_hook_suggestions'][] = 'comment__view__' . $vars['comment']->view->storage->id() . '__' . $vars['comment']->view->current_display; +@@ -1410,7 +1410,7 @@ function views_form_views_form_submit($form, &$form_state) { + /** + * Form builder for the exposed widgets form. + * +- * Be sure that $view and $display are references. ++ * Be sure that $display is a reference. + */ + function views_exposed_form($form, &$form_state) { + // Don't show the form when batch operations are in progress. +@@ -1424,7 +1424,7 @@ function views_exposed_form($form, &$form_state) { + // Make sure that we validate because this form might be submitted + // multiple times per page. + $form_state['must_validate'] = TRUE; +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display = &$form_state['display']; + + $form_state['input'] = $view->getExposedInput(); +@@ -1576,8 +1576,8 @@ function views_theme_functions($hook, ViewExecutable $view, $display = NULL) { + */ + function views_query_views_alter(AlterableInterface $query) { + $substitutions = $query->getMetaData('views_substitutions'); +- $tables =& $query->getTables(); +- $where =& $query->conditions(); ++ $tables = &$query->getTables(); ++ $where = &$query->conditions(); + + // Replaces substitions in tables. + foreach ($tables as $table_name => $table_metadata) { +@@ -1602,7 +1602,7 @@ function _views_query_tag_alter_condition(AlterableInterface $query, &$condition + $condition['field'] = str_replace(array_keys($substitutions), array_values($substitutions), $condition['field']); + } + elseif (is_object($condition['field'])) { +- $sub_conditions =& $condition['field']->conditions(); ++ $sub_conditions = &$condition['field']->conditions(); + _views_query_tag_alter_condition($query, $sub_conditions, $substitutions); + } + // $condition['value'] is a subquery so alter the subquery recursive. +diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc +index bd9500d..323df8d 100644 +--- a/core/modules/views/views.theme.inc ++++ b/core/modules/views/views.theme.inc +@@ -211,7 +211,7 @@ function template_preprocess_views_view_fields(&$vars) { + $empty = $field->is_value_empty($field_output, $field->options['empty_zero']); + if (empty($field->options['exclude']) && (!$empty || (empty($field->options['hide_empty']) && empty($vars['options']['hide_empty'])))) { + $object = new stdClass(); +- $object->handler = &$view->field[$id]; ++ $object->handler = $view->field[$id]; + $object->inline = !empty($vars['options']['inline'][$id]); + + $object->element_type = $object->handler->element_type(TRUE, !$vars['options']['default_field_elements'], $object->inline); +@@ -961,10 +961,11 @@ function template_preprocess_views_view_list(&$variables) { + function template_preprocess_views_view_rss(&$vars) { + global $base_url; + +- $view = $vars['view']; +- $items = $vars['rows']; ++ $view = $vars['view']; ++ $options = &$vars['options']; ++ $items = &$vars['rows']; + +- $style = $view->style_plugin; ++ $style = $view->style_plugin; + + $config = config('system.site'); + +@@ -1029,7 +1030,9 @@ function template_preprocess_views_view_rss(&$vars) { + * - row: The raw results rows. + */ + function template_preprocess_views_view_row_rss(&$vars) { +- $item = $vars['row']; ++ $view = $vars['view']; ++ $options = &$vars['options']; ++ $item = &$vars['row']; + + $vars['title'] = check_plain($item->title); + $vars['link'] = check_url($item->link); +diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc +index a723854..47a9fa1 100644 +--- a/core/modules/views_ui/admin.inc ++++ b/core/modules/views_ui/admin.inc +@@ -333,7 +333,7 @@ function views_ui_pre_render_move_argument_options($form) { + * the current display. + */ + function views_ui_standard_display_dropdown(&$form, &$form_state, $section) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display_id = $form_state['display_id']; + $executable = $view->get('executable'); + $displays = $executable->displayHandlers; +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php +index 1c8d13e..63e9a72 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php +@@ -48,7 +48,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display_id = $form_state['display_id']; + $type = $form_state['type']; + +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php +index b8b7ac9..fbd7d13 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php +@@ -34,7 +34,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + + $form['#title'] = t('View analysis'); + $form['#section'] = 'analyze'; +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php +index e35cee0..43da0b8 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php +@@ -51,7 +51,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display_id = $form_state['display_id']; + $type = $form_state['type']; + $id = $form_state['id']; +@@ -159,7 +159,7 @@ public function buildForm(array $form, array &$form_state) { + + // Get form from the handler. + $handler->buildOptionsForm($form['options'], $form_state); +- $form_state['handler'] = &$handler; ++ $form_state['handler'] = $handler; + } + + $name = NULL; +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php +index 14895f8..3bcbd89 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php +@@ -50,7 +50,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display_id = $form_state['display_id']; + $type = $form_state['type']; + $id = $form_state['id']; +@@ -83,7 +83,7 @@ public function buildForm(array $form, array &$form_state) { + + // Get form from the handler. + $handler->buildExtraOptionsForm($form['options'], $form_state); +- $form_state['handler'] = &$handler; ++ $form_state['handler'] = $handler; + } + + $view->getStandardButtons($form, $form_state, 'views_ui_config_item_extra_form'); +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php +index 8f2da46..d8ad554 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php +@@ -50,7 +50,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display_id = $form_state['display_id']; + $type = $form_state['type']; + $id = $form_state['id']; +@@ -83,7 +83,7 @@ public function buildForm(array $form, array &$form_state) { + $form['#title'] = t('Configure aggregation settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->adminLabel())); + + $handler->buildGroupByForm($form['options'], $form_state); +- $form_state['handler'] = &$handler; ++ $form_state['handler'] = $handler; + } + + $view->getStandardButtons($form, $form_state, 'views_ui_config_item_group_form'); +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php +index d8c1e9a..58fd256 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php +@@ -59,7 +59,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display_id = $form_state['display_id']; + $section = $form_state['section']; + +@@ -67,7 +67,6 @@ public function buildForm(array $form, array &$form_state) { + if (!$executable->setDisplay($display_id)) { + views_ajax_error(t('Invalid display id @display', array('@display' => $display_id))); + } +- $display = &$executable->display[$display_id]; + + // Get form from the handler. + $form['options'] = array( +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php +index 90f8c08..57600e1 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php +@@ -33,7 +33,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + + $form['#title'] = t('View name and description'); + $form['#section'] = 'details'; +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php +index 75c469f..1ec324e 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php +@@ -48,7 +48,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display_id = $form_state['display_id']; + $type = $form_state['type']; + +diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php +index ff5db0a..1a6e61e 100644 +--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php ++++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php +@@ -33,7 +33,7 @@ public function getFormID() { + * Implements \Drupal\Core\Form\FormInterface::buildForm(). + */ + public function buildForm(array $form, array &$form_state) { +- $view = &$form_state['view']; ++ $view = $form_state['view']; + $display_id = $form_state['display_id']; + $type = 'filter'; + diff --git a/views-remove-php4-style-references-for-objects-1959338.patch b/views-remove-php4-style-references-for-objects-1959338.patch new file mode 100644 index 0000000..e69de29