commit 4f32e43c1855f501dda2f5600396b53836a719d7 Author: Thomas Lattimore Date: Thu Apr 18 11:05:42 2013 -0400 Moving vars to variables. Also simple doc update. diff --git a/core/modules/views/templates/views-view-fields.html.twig b/core/modules/views/templates/views-view-fields.html.twig index fbe1fdd..a62bd7a 100644 --- a/core/modules/views/templates/views-view-fields.html.twig +++ b/core/modules/views/templates/views-view-fields.html.twig @@ -5,7 +5,7 @@ * * Available variables: * - view: The view in use. - * - fields: an array of field objects. Each one contains: + * - fields: A list of fields, each one contains: * - field.content: The output of the field. * - field.raw: The raw data for the field, if it exists. This is NOT output safe. * - field.class: The safe class id to use. diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index f214da1..c48418a 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -179,7 +179,7 @@ function template_preprocess_views_view(&$vars) { * * Default template: views-view-fields.html.twig. * - * @param array $variables + * @param array $vars * An associative array containing: * - view: The view object. * - options: An array of options. Each option contains: @@ -193,21 +193,21 @@ function template_preprocess_views_view(&$vars) { * them from squishing up next to each other. * - row: An array containg information about the current row. */ -function template_preprocess_views_view_fields(&$variables) { - $view = $variables['view']; +function template_preprocess_views_view_fields(&$vars) { + $view = $vars['view']; // Loop through the fields for this view. $previous_inline = FALSE; - $variables['fields'] = array(); // ensure it's at least an empty array. + $vars['fields'] = array(); // ensure it's at least an empty array. foreach ($view->field as $id => $field) { // render this even if set to exclude so it can be used elsewhere. $field_output = $view->style_plugin->get_field($view->row_index, $id); $empty = $field->is_value_empty($field_output, $field->options['empty_zero']); - if (empty($field->options['exclude']) && (!$empty || (empty($field->options['hide_empty']) && empty($variables['options']['hide_empty'])))) { + 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->inline = !empty($variables['options']['inline'][$id]); + $object->inline = !empty($vars['options']['inline'][$id]); - $object->element_type = $object->handler->element_type(TRUE, !$variables['options']['default_field_elements'], $object->inline); + $object->element_type = $object->handler->element_type(TRUE, !$vars['options']['default_field_elements'], $object->inline); if ($object->element_type) { $attributes = array(); if ($object->handler->options['element_default_classes']) { @@ -231,22 +231,22 @@ function template_preprocess_views_view_fields(&$variables) { } $object->content = $field_output; - if (isset($view->field[$id]->field_alias) && isset($variables['row']->{$view->field[$id]->field_alias})) { - $object->raw = $variables['row']->{$view->field[$id]->field_alias}; + if (isset($view->field[$id]->field_alias) && isset($vars['row']->{$view->field[$id]->field_alias})) { + $object->raw = $vars['row']->{$view->field[$id]->field_alias}; } else { $object->raw = NULL; // make sure it exists to reduce NOTICE } - if (!empty($variables['options']['separator']) && $previous_inline && $object->inline && $object->content) { - $object->separator = filter_xss_admin($variables['options']['separator']); + if (!empty($vars['options']['separator']) && $previous_inline && $object->inline && $object->content) { + $object->separator = filter_xss_admin($vars['options']['separator']); } $object->class = drupal_clean_css_identifier($id); $previous_inline = $object->inline; $object->inline_html = $object->handler->element_wrapper_type(TRUE, TRUE); - if ($object->inline_html === '' && $variables['options']['default_field_elements']) { + if ($object->inline_html === '' && $vars['options']['default_field_elements']) { $object->inline_html = $object->inline ? 'span' : 'div'; } @@ -282,7 +282,7 @@ function template_preprocess_views_view_fields(&$variables) { $object->label_html .= ': '; } - $object->element_label_type = $object->handler->element_label_type(TRUE, !$variables['options']['default_field_elements']); + $object->element_label_type = $object->handler->element_label_type(TRUE, !$vars['options']['default_field_elements']); if ($object->element_label_type) { $attributes = array(); if ($object->handler->options['element_default_classes']) { @@ -304,7 +304,7 @@ function template_preprocess_views_view_fields(&$variables) { } } - $variables['fields'][$id] = $object; + $vars['fields'][$id] = $object; } }