reverted:
--- b/core/modules/views_ui/templates/views-ui-build-group-filter-form.html.twig
+++ /dev/null
@@ -1,57 +0,0 @@
-{#
-/**
- * @file
- * Default theme implementation for build group filter form.
- *
- * Available variables:
- * - form: A render element representing the form.
- * - form_description: The exposed filter's description.
- * - expose_button: The button to toggle the expose filter form.
- * - group_button: Toggle options between single and grouped filters.
- * - label: A filter label input field.
- * - description: A filter description field.
- * - value: The filters available values.
- * - optional: A checkbox to require this filter or not.
- * - remember: A checkbox to remember selected filter value(s) (per user).
- * - widget: Radio Buttons to select the filter widget.
- * - add_group: A button to add another row to the table.
- * - more: A details element for additional field exposed filter fields.
- * - table: A rendered table element of the group filter form.
- *
- * @see template_preprocess_views_ui_build_group_filter_form()
- *
- * @ingroup themeable
- */
-#}
-{{ form.form_description }}
-{{ form.expose_button }}
-{{ form.group_button }}
-
- {{ form.optional }}
- {{ form.remember }}
-
-
- {{ form.widget }}
- {{ form.label }}
- {{ form.description }}
-
-{#
- Render the rest of the form elements excluding elements that are rendered
- elsewhere.
-#}
-{{ form|without(
- 'form_description',
- 'expose_button',
- 'group_button',
- 'optional',
- 'remember',
- 'widget',
- 'label',
- 'description',
- 'add_group',
- 'more'
- )
-}}
-{{ table }}
-{{ form.add_group }}
-{{ form.more }}
diff -u b/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module
--- b/core/modules/views_ui/views_ui.module
+++ b/core/modules/views_ui/views_ui.module
@@ -8,12 +8,8 @@
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
-use Drupal\views\Views;
use Drupal\views\ViewExecutable;
-use Drupal\views_ui\ViewUI;
use Drupal\views\Analyzer;
-use Drupal\Core\Ajax\AjaxResponse;
-use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Component\Utility\Xss;
/**
@@ -24,15 +20,15 @@
case 'help.page.views_ui':
$output = '';
$output .= '' . t('About') . '
';
- $output .= '' . t('The Views UI module provides an interface for managing views for the Views module. For more information, see the online documentation for the Views UI module.', array('@views' => \Drupal::url('help.page', array('name' => 'views')), '@handbook' => 'https://www.drupal.org/documentation/modules/views_ui')) . '
';
+ $output .= '' . t('The Views UI module provides an interface for managing views for the Views module. For more information, see the online documentation for the Views UI module.', ['@views' => \Drupal::url('help.page', ['name' => 'views']), '@handbook' => 'https://www.drupal.org/documentation/modules/views_ui']) . '
';
$output .= '' . t('Uses') . '
';
$output .= '';
$output .= '- ' . t('Creating and managing views.') . '
';
- $output .= '- ' . t('Views can be created from the Views list page by using the "Add new view" action. Existing views can be managed from the Views list page by locating the view in the "Enabled" or "Disabled" list and selecting the desired operation action, for example "Edit".', array('@list' => \Drupal::url('entity.view.collection', array('name' => 'views_ui')))) . '
';
+ $output .= '- ' . t('Views can be created from the Views list page by using the "Add new view" action. Existing views can be managed from the Views list page by locating the view in the "Enabled" or "Disabled" list and selecting the desired operation action, for example "Edit".', ['@list' => \Drupal::url('entity.view.collection', ['name' => 'views_ui'])]) . '
';
$output .= '- ' . t('Enabling and disabling views.') . '
- ';
- $output .= '
- ' . t('Views can be enabled or disabled from the Views list page. To enable a view, find the view within the "Disabled" list and select the "Enable" operation. To disable a view find the view within the "Enabled" list and select the "Disable" operation.', array('@list' => \Drupal::url('entity.view.collection', array('name' => 'views_ui')))) . '
';
+ $output .= '- ' . t('Views can be enabled or disabled from the Views list page. To enable a view, find the view within the "Disabled" list and select the "Enable" operation. To disable a view find the view within the "Enabled" list and select the "Disable" operation.', ['@list' => \Drupal::url('entity.view.collection', ['name' => 'views_ui'])]) . '
';
$output .= '- ' . t('Exporting and importing views.') . '
';
- $output .= '- ' . t('Views can be exported and imported as configuration files by using the Configuration Manager module.', array('@config' => (\Drupal::moduleHandler()->moduleExists('config')) ? \Drupal::url('help.page', array('name' => 'config')) : '#')) . '
';
+ $output .= '- ' . t('Views can be exported and imported as configuration files by using the Configuration Manager module.', ['@config' => (\Drupal::moduleHandler()->moduleExists('config')) ? \Drupal::url('help.page', ['name' => 'config']) : '#']) . '
';
$output .= '- ' . t('Theming views.') . '
';
$output .= '- ' . t('The template files used by views can be overridden from a custom theme. When editing a view, you can see the templates that are used and alternatives for overriding them by clicking on the "Templates" link, found in the Advanced > Other section under "Output".') . '
';
$output .= '
';
@@ -68,56 +64,56 @@
* Implements hook_theme().
*/
function views_ui_theme() {
- return array(
+ return [
// edit a view
- 'views_ui_display_tab_setting' => array(
- 'variables' => array('description' => '', 'link' => '', 'settings_links' => array(), 'overridden' => FALSE, 'defaulted' => FALSE, 'description_separator' => TRUE, 'class' => array()),
+ 'views_ui_display_tab_setting' => [
+ 'variables' => ['description' => '', 'link' => '', 'settings_links' => [], 'overridden' => FALSE, 'defaulted' => FALSE, 'description_separator' => TRUE, 'class' => []],
'file' => 'views_ui.theme.inc',
- ),
- 'views_ui_display_tab_bucket' => array(
+ ],
+ 'views_ui_display_tab_bucket' => [
'render element' => 'element',
'file' => 'views_ui.theme.inc',
- ),
- 'views_ui_rearrange_filter_form' => array(
+ ],
+ 'views_ui_rearrange_filter_form' => [
'render element' => 'form',
'file' => 'views_ui.theme.inc',
- ),
- 'views_ui_expose_filter_form' => array(
+ ],
+ 'views_ui_expose_filter_form' => [
'render element' => 'form',
'file' => 'views_ui.theme.inc',
- ),
+ ],
// list views
- 'views_ui_view_info' => array(
- 'variables' => array('view' => NULL, 'displays' => NULL),
+ 'views_ui_view_info' => [
+ 'variables' => ['view' => NULL, 'displays' => NULL],
'file' => 'views_ui.theme.inc',
- ),
+ ],
// Group of filters.
- 'views_ui_build_group_filter_form' => array(
+ 'views_ui_build_group_filter_form' => [
'render element' => 'form',
'file' => 'views_ui.theme.inc',
- ),
+ ],
// On behalf of a plugin
- 'views_ui_style_plugin_table' => array(
+ 'views_ui_style_plugin_table' => [
'render element' => 'form',
'file' => 'views_ui.theme.inc',
- ),
+ ],
// When previewing a view.
- 'views_ui_view_preview_section' => array(
- 'variables' => array('view' => NULL, 'section' => NULL, 'content' => NULL, 'links' => ''),
+ 'views_ui_view_preview_section' => [
+ 'variables' => ['view' => NULL, 'section' => NULL, 'content' => NULL, 'links' => ''],
'file' => 'views_ui.theme.inc',
- ),
+ ],
// Generic container wrapper, to use instead of theme_container when an id
// is not desired.
- 'views_ui_container' => array(
- 'variables' => array('children' => NULL, 'attributes' => array()),
+ 'views_ui_container' => [
+ 'variables' => ['children' => NULL, 'attributes' => []],
'file' => 'views_ui.theme.inc',
- ),
- );
+ ],
+ ];
}
/**
@@ -133,21 +129,22 @@
if (!empty($view->live_preview) && \Drupal::moduleHandler()->moduleExists('contextual')) {
$view->setShowAdminLinks(FALSE);
- foreach (array('title', 'header', 'exposed', 'rows', 'pager', 'more', 'footer', 'empty', 'attachment_after', 'attachment_before') as $section) {
+ foreach (['title', 'header', 'exposed', 'rows', 'pager', 'more', 'footer', 'empty', 'attachment_after', 'attachment_before'] as $section) {
if (!empty($variables[$section])) {
- $variables[$section] = array(
+ $variables[$section] = [
'#theme' => 'views_ui_view_preview_section',
'#view' => $view,
'#section' => $section,
'#content' => $variables[$section],
- '#theme_wrappers' => array('views_ui_container'),
- '#attributes' => array('class' => array('contextual-region')),
- );
+ '#theme_wrappers' => ['views_ui_container'],
+ '#attributes' => ['class' => ['contextual-region']],
+ ];
}
}
}
}
+
/**
* Returns contextual links for each handler of a certain section.
*
@@ -155,34 +152,40 @@
* Bring in relationships
* Refactor this function to use much stuff of views_ui_edit_form_get_bucket.
*
+ * @param ViewExecutable $view
+ *
+ * @param $type
+ *
* @param $title
* Add a bolded title of this section.
+ *
+ * @return array
*/
function views_ui_view_preview_section_handler_links(ViewExecutable $view, $type, $title = FALSE) {
$display = $view->display_handler->display;
$handlers = $view->display_handler->getHandlers($type);
- $links = array();
+ $links = [];
$types = ViewExecutable::getHandlerTypes();
if ($title) {
- $links[$type . '-title'] = array(
+ $links[$type . '-title'] = [
'title' => $types[$type]['title'],
- );
+ ];
}
foreach ($handlers as $id => $handler) {
$field_name = $handler->adminLabel(TRUE);
- $links[$type . '-edit-' . $id] = array(
- 'title' => t('Edit @section', array('@section' => $field_name)),
+ $links[$type . '-edit-' . $id] = [
+ 'title' => t('Edit @section', ['@section' => $field_name]),
'url' => Url::fromRoute('views_ui.form_handler', ['js' => 'nojs', 'view' => $view->storage->id(), 'display_id' => $display['id'], 'type' => $type, 'id' => $id]),
- 'attributes' => array('class' => array('views-ajax-link')),
- );
+ 'attributes' => ['class' => ['views-ajax-link']],
+ ];
}
- $links[$type . '-add'] = array(
+ $links[$type . '-add'] = [
'title' => t('Add new'),
'url' => Url::fromRoute('views_ui.form_add_handler', ['js' => 'nojs', 'view' => $view->storage->id(), 'display_id' => $display['id'], 'type' => $type]),
- 'attributes' => array('class' => array('views-ajax-link')),
- );
+ 'attributes' => ['class' => ['views-ajax-link']],
+ ];
return $links;
}
@@ -192,13 +195,13 @@
*/
function views_ui_view_preview_section_display_category_links(ViewExecutable $view, $type, $title) {
$display = $view->display_handler->display;
- $links = array(
- $type . '-edit' => array(
- 'title' => t('Edit @section', array('@section' => $title)),
+ $links = [
+ $type . '-edit' => [
+ 'title' => t('Edit @section', ['@section' => $title]),
'url' => Url::fromRoute('views_ui.form_display', ['js' => 'nojs', 'view' => $view->storage->id(), 'display_id' => $display['id'], 'type' => $type]),
- 'attributes' => array('class' => array('views-ajax-link')),
- ),
- );
+ 'attributes' => ['class' => ['views-ajax-link']],
+ ],
+ ];
return $links;
}
@@ -207,7 +210,7 @@
* Returns all contextual links for the main content part of the view.
*/
function views_ui_view_preview_section_rows_links(ViewExecutable $view) {
- $links = array();
+ $links = [];
$links = array_merge($links, views_ui_view_preview_section_handler_links($view, 'filter', TRUE));
$links = array_merge($links, views_ui_view_preview_section_handler_links($view, 'field', TRUE));
$links = array_merge($links, views_ui_view_preview_section_handler_links($view, 'sort', TRUE));
@@ -225,10 +228,10 @@
// paths underneath "admin/structure/views/view/{$view->id()}" (i.e., paths
// for editing and performing other contextual actions on the view).
foreach ($plugins as &$display) {
- $display['contextual links']['entity.view.edit_form'] = array(
+ $display['contextual links']['entity.view.edit_form'] = [
'route_name' => 'entity.view.edit_form',
- 'route_parameters_names' => array('view' => 'id'),
- );
+ 'route_parameters_names' => ['view' => 'id'],
+ ];
}
}
@@ -239,7 +242,7 @@
// Remove contextual links from being rendered, when so desired, such as
// within a View preview.
if (views_ui_contextual_links_suppress()) {
- $element['#links'] = array();
+ $element['#links'] = [];
}
// Append the display ID to the Views UI edit links, so that clicking on the
// contextual link takes you directly to the correct display tab on the edit
@@ -297,7 +300,7 @@
* node.views.inc as well.
*/
function views_ui_views_analyze(ViewExecutable $view) {
- $ret = array();
+ $ret = [];
// Check for something other than the default display:
if (count($view->displayHandlers) < 2) {
$ret[] = Analyzer::formatMessage(t('This view has only a default display and therefore will not be placed anywhere on your site; perhaps you want to add a page or a block display.'), 'warning');
@@ -312,7 +315,7 @@
if ($display->hasPath() && $path = $display->getOption('path')) {
$normal_path = \Drupal::service('path.alias_manager')->getPathByAlias($path);
if ($path != $normal_path) {
- $ret[] = Analyzer::formatMessage(t('You have configured display %display with a path which is an path alias as well. This might lead to unwanted effects so better use an internal path.', array('%display' => $display->display['display_title'])), 'warning');
+ $ret[] = Analyzer::formatMessage(t('You have configured display %display with a path which is an path alias as well. This might lead to unwanted effects so better use an internal path.', ['%display' => $display->display['display_title']]), 'warning');
}
}
}
diff -u b/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc
--- b/core/modules/views_ui/views_ui.theme.inc
+++ b/core/modules/views_ui/views_ui.theme.inc
@@ -61,7 +61,7 @@
$variables['overridden'] = isset($element['#overridden']) ? $element['#overridden'] : NULL;
$variables['content'] = $element['#children'];
$variables['title'] = $element['#title'];
- $variables['actions'] = !empty($element['#actions']) ? $element['#actions'] : array();
+ $variables['actions'] = !empty($element['#actions']) ? $element['#actions'] : [];
}
/**
@@ -77,14 +77,14 @@
$form = $variables['form'];
// Prepare table of options.
- $header = array(
+ $header = [
t('Default'),
t('Weight'),
t('Label'),
t('Operator'),
t('Value'),
t('Operations'),
- );
+ ];
// Prepare default selectors.
$form_state = new FormState();
@@ -92,15 +92,15 @@
$form['default_group_multiple'] = Element\Checkboxes::processCheckboxes($form['default_group_multiple'], $form_state, $form);
$form['default_group']['All']['#title'] = '';
- $rows[] = array(
+ $rows[] = [
['data' => $form['default_group']['All']],
'',
- array(
+ [
'data' => \Drupal::config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? t('<Any>') : t('- Any -'),
'colspan' => 4,
- 'class' => array('class' => 'any-default-radios-row'),
- ),
- );
+ 'class' => ['class' => 'any-default-radios-row'],
+ ],
+ ];
// Remove the 'All' default_group form element because it's added to the
// table row.
unset($variables['form']['default_group']['All']);
@@ -133,32 +133,32 @@
'#title' => SafeMarkup::format('@text', ['@text' => t('Remove')]),
];
$remove = [$form['group_items'][$group_id]['remove'], $link];
- $data = array(
+ $data = [
'default' => ['data' => $default],
'weight' => ['data' => $form['group_items'][$group_id]['weight']],
'title' => ['data' => $form['group_items'][$group_id]['title']],
'operator' => ['data' => $form['group_items'][$group_id]['operator']],
'value' => ['data' => $form['group_items'][$group_id]['value']],
'remove' => ['data' => $remove],
- );
- $rows[] = array('data' => $data, 'id' => 'views-row-' . $group_id, 'class' => array('draggable'));
+ ];
+ $rows[] = ['data' => $data, 'id' => 'views-row-' . $group_id, 'class' => ['draggable']];
}
- $variables['table'] = array(
+ $variables['table'] = [
'#type' => 'table',
'#header' => $header,
'#rows' => $rows,
- '#attributes' => array(
- 'class' => array('views-filter-groups'),
+ '#attributes' => [
+ 'class' => ['views-filter-groups'],
'id' => 'views-filter-groups',
- ),
- '#tabledrag' => array(
- array(
+ ],
+ '#tabledrag' => [
+ [
'action' => 'order',
'relationship' => 'sibling',
'group' => 'weight',
- )
- ),
- );
+ ]
+ ],
+ ];
// Hide fields used in table.
unset($variables['form']['group_items']);
@@ -175,7 +175,7 @@
*/
function template_preprocess_views_ui_rearrange_filter_form(&$variables) {
$form = &$variables['form'];
- $rows = $ungroupable_rows = array();
+ $rows = $ungroupable_rows = [];
// Enable grouping only if > 1 group.
$variables['grouping'] = count(array_keys($form['#group_options'])) > 1;
@@ -184,41 +184,41 @@
if ($group_id !== 'ungroupable') {
// Set up tabledrag so that it changes the group dropdown when rows are
// dragged between groups.
- $options = array(
+ $options = [
'table_id' => 'views-rearrange-filters',
'action' => 'match',
'relationship' => 'sibling',
'group' => 'views-group-select',
'subgroup' => 'views-group-select-' . $group_id,
- );
+ ];
drupal_attach_tabledrag($form['override'], $options);
// Title row, spanning all columns.
- $row = array();
+ $row = [];
// Add a cell to the first row, containing the group operator.
- $row[] = array(
- 'class' => array('group', 'group-operator', 'container-inline'),
+ $row[] = [
+ 'class' => ['group', 'group-operator', 'container-inline'],
'data' => $form['filter_groups']['groups'][$group_id],
- 'rowspan' => max(array(2, count($contents) + 1)),
- );
+ 'rowspan' => max([2, count($contents) + 1]),
+ ];
// Title.
- $row[] = array(
- 'class' => array('group', 'group-title'),
- 'data' => array(
+ $row[] = [
+ 'class' => ['group', 'group-title'],
+ 'data' => [
'#prefix' => '',
'#markup' => $form['#group_options'][$group_id],
'#suffix' => '',
- ),
+ ],
'colspan' => 4,
- );
- $rows[] = array(
- 'class' => array('views-group-title'),
+ ];
+ $rows[] = [
+ 'class' => ['views-group-title'],
'data' => $row,
'id' => 'views-group-title-' . $group_id,
- );
+ ];
// Row which will only appear if the group has nothing in it.
- $row = array();
+ $row = [];
$class = 'group-' . (count($contents) ? 'populated' : 'empty');
$instructions = '' . t('No filters have been added.') . ' ' . t('Drag to add filters.') . '';
// When JavaScript is enabled, the button for removing the group (if it's
@@ -227,63 +227,63 @@
if (!empty($form['remove_groups'][$group_id]['#type']) && $form['remove_groups'][$group_id]['#type'] == 'submit') {
$form['remove_groups'][$group_id]['#attributes']['class'][] = 'js-hide';
}
- $row[] = array(
+ $row[] = [
'colspan' => 5,
- 'data' => array(
- array('#markup' => $instructions),
+ 'data' => [
+ ['#markup' => $instructions],
$form['remove_groups'][$group_id],
- ),
- );
- $rows[] = array(
- 'class' => array(
+ ],
+ ];
+ $rows[] = [
+ 'class' => [
'group-message',
'group-' . $group_id . '-message',
$class,
- ),
+ ],
'data' => $row,
'id' => 'views-group-' . $group_id,
- );
+ ];
}
foreach ($contents as $id) {
if (isset($form['filters'][$id]['name'])) {
- $row = array();
+ $row = [];
$row[]['data'] = $form['filters'][$id]['name'];
- $form['filters'][$id]['weight']['#attributes']['class'] = array('weight');
+ $form['filters'][$id]['weight']['#attributes']['class'] = ['weight'];
$row[]['data'] = $form['filters'][$id]['weight'];
- $form['filters'][$id]['group']['#attributes']['class'] = array('views-group-select views-group-select-' . $group_id);
+ $form['filters'][$id]['group']['#attributes']['class'] = ['views-group-select views-group-select-' . $group_id];
$row[]['data'] = $form['filters'][$id]['group'];
$form['filters'][$id]['removed']['#attributes']['class'][] = 'js-hide';
- $remove_link = array(
+ $remove_link = [
'#type' => 'link',
'#url' => Url::fromRoute(''),
- '#title' => SafeMarkup::format('@text', array('@text' => t('Remove'))),
+ '#title' => SafeMarkup::format('@text', ['@text' => t('Remove')]),
'#weight' => '1',
- '#options' => array(
- 'attributes' => array(
+ '#options' => [
+ 'attributes' => [
'id' => 'views-remove-link-' . $id,
- 'class' => array(
+ 'class' => [
'views-hidden',
'views-button-remove',
'views-groups-remove-link',
'views-remove-link',
- ),
+ ],
'alt' => t('Remove this item'),
'title' => t('Remove this item'),
- ),
- ),
- );
- $row[]['data'] = array(
+ ],
+ ],
+ ];
+ $row[]['data'] = [
$form['filters'][$id]['removed'],
$remove_link,
- );
+ ];
- $row = array(
+ $row = [
'data' => $row,
- 'class' => array('draggable'),
+ 'class' => ['draggable'],
'id' => 'views-row-' . $id,
- );
+ ];
if ($group_id !== 'ungroupable') {
$rows[] = $row;
@@ -300,56 +300,56 @@
}
if (!empty($ungroupable_rows)) {
- $header = array(
+ $header = [
t('Ungroupable filters'),
t('Weight'),
- array(
+ [
'data' => t('Group'),
- 'class' => array('views-hide-label'),
- ),
- array(
+ 'class' => ['views-hide-label'],
+ ],
+ [
'data' => t('Remove'),
- 'class' => array('views-hide-label'),
- ),
- );
- $variables['ungroupable_table'] = array(
+ 'class' => ['views-hide-label'],
+ ],
+ ];
+ $variables['ungroupable_table'] = [
'#type' => 'table',
'#header' => $header,
'#rows' => $ungroupable_rows,
- '#attributes' => array(
+ '#attributes' => [
'id' => 'views-rearrange-filters-ungroupable',
- 'class' => array('arrange'),
- ),
- '#tabledrag' => array(
- array(
+ 'class' => ['arrange'],
+ ],
+ '#tabledrag' => [
+ [
'action' => 'order',
'relationship' => 'sibling',
'group' => 'weight',
- )
- ),
- );
+ ]
+ ],
+ ];
}
if (empty($rows)) {
- $rows[] = array(array('data' => t('No fields available.'), 'colspan' => '2'));
+ $rows[] = [['data' => t('No fields available.'), 'colspan' => '2']];
}
// Set up tabledrag so that the weights are changed when rows are dragged.
- $variables['table'] = array(
+ $variables['table'] = [
'#type' => 'table',
'#rows' => $rows,
- '#attributes' => array(
+ '#attributes' => [
'id' => 'views-rearrange-filters',
- 'class' => array('arrange'),
- ),
- '#tabledrag' => array(
- array(
+ 'class' => ['arrange'],
+ ],
+ '#tabledrag' => [
+ [
'action' => 'order',
'relationship' => 'sibling',
'group' => 'weight',
- ),
- ),
- );
+ ],
+ ],
+ ];
// When JavaScript is enabled, the button for adding a new group should be
// hidden, since it will be replaced by a link on the client side.
@@ -369,72 +369,72 @@
function template_preprocess_views_ui_style_plugin_table(&$variables) {
$form = $variables['form'];
- $header = array(
+ $header = [
t('Field'),
t('Column'),
t('Align'),
t('Separator'),
- array(
+ [
'data' => t('Sortable'),
'align' => 'center',
- ),
- array(
+ ],
+ [
'data' => t('Default order'),
'align' => 'center',
- ),
- array(
+ ],
+ [
'data' => t('Default sort'),
'align' => 'center',
- ),
- array(
+ ],
+ [
'data' => t('Hide empty column'),
'align' => 'center',
- ),
- array(
+ ],
+ [
'data' => t('Responsive'),
'align' => 'center',
- ),
- );
- $rows = array();
+ ],
+ ];
+ $rows = [];
foreach (Element::children($form['columns']) as $id) {
- $row = array();
+ $row = [];
$row[]['data'] = $form['info'][$id]['name'];
$row[]['data'] = $form['columns'][$id];
$row[]['data'] = $form['info'][$id]['align'];
$row[]['data'] = $form['info'][$id]['separator'];
if (!empty($form['info'][$id]['sortable'])) {
- $row[] = array(
+ $row[] = [
'data' => $form['info'][$id]['sortable'],
'align' => 'center',
- );
- $row[] = array(
+ ];
+ $row[] = [
'data' => $form['info'][$id]['default_sort_order'],
'align' => 'center',
- );
- $row[] = array(
+ ];
+ $row[] = [
'data' => $form['default'][$id],
'align' => 'center',
- );
+ ];
}
else {
$row[] = '';
$row[] = '';
$row[] = '';
}
- $row[] = array(
+ $row[] = [
'data' => $form['info'][$id]['empty_column'],
'align' => 'center',
- );
- $row[] = array(
+ ];
+ $row[] = [
'data' => $form['info'][$id]['responsive'],
'align' => 'center',
- );
+ ];
$rows[] = $row;
}
// Add the special 'None' row.
- $rows[] = array(array('data' => t('None'), 'colspan' => 6), array('align' => 'center', 'data' => $form['default'][-1]), array('colspan' => 2));
+ $rows[] = [['data' => t('None'), 'colspan' => 6], ['align' => 'center', 'data' => $form['default'][-1]], ['colspan' => 2]];
// Unset elements from the form array that are used to build the table so that
// they are not rendered twice.
@@ -442,12 +442,12 @@
unset($form['info']);
unset($form['columns']);
- $variables['table'] = array(
+ $variables['table'] = [
'#type' => 'table',
'#theme' => 'table__views_ui_style_plugin_table',
'#header' => $header,
'#rows' => $rows,
- );
+ ];
$variables['form'] = $form;
}
@@ -508,14 +508,14 @@
}
if (isset($links)) {
- $build = array(
+ $build = [
'#theme' => 'links__contextual',
'#links' => $links,
- '#attributes' => array('class' => array('contextual-links')),
- '#attached' => array(
- 'library' => array('contextual/drupal.contextual-links'),
- ),
- );
+ '#attributes' => ['class' => ['contextual-links']],
+ '#attached' => [
+ 'library' => ['contextual/drupal.contextual-links'],
+ ],
+ ];
$variables['links'] = $build;
}
}
@@ -526,3 +526,3 @@
function views_ui_theme_suggestions_views_ui_view_preview_section(array $variables) {
- return array('views_ui_view_preview_section__' . $variables['section']);
+ return ['views_ui_view_preview_section__' . $variables['section']];
}
only in patch2:
unchanged:
--- a/core/modules/views_ui/templates/views-ui-build-group-filter-form.html.twig
+++ b/core/modules/views_ui/templates/views-ui-build-group-filter-form.html.twig
@@ -0,0 +1,57 @@
+{#
+/**
+ * @file
+ * Default theme implementation for build group filter form.
+ *
+ * Available variables:
+ * - form: A render element representing the form.
+ * - form_description: The exposed filter's description.
+ * - expose_button: The button to toggle the expose filter form.
+ * - group_button: Toggle options between single and grouped filters.
+ * - label: A filter label input field.
+ * - description: A filter description field.
+ * - value: The filters available values.
+ * - optional: A checkbox to require this filter or not.
+ * - remember: A checkbox to remember selected filter value(s) (per user).
+ * - widget: Radio Buttons to select the filter widget.
+ * - add_group: A button to add another row to the table.
+ * - more: A details element for additional field exposed filter fields.
+ * - table: A rendered table element of the group filter form.
+ *
+ * @see template_preprocess_views_ui_build_group_filter_form()
+ *
+ * @ingroup themeable
+ */
+#}
+{{ form.form_description }}
+{{ form.expose_button }}
+{{ form.group_button }}
+
+ {{ form.optional }}
+ {{ form.remember }}
+
+
+ {{ form.widget }}
+ {{ form.label }}
+ {{ form.description }}
+
+{#
+ Render the rest of the form elements excluding elements that are rendered
+ elsewhere.
+#}
+{{ form|without(
+ 'form_description',
+ 'expose_button',
+ 'group_button',
+ 'optional',
+ 'remember',
+ 'widget',
+ 'label',
+ 'description',
+ 'add_group',
+ 'more'
+ )
+}}
+{{ table }}
+{{ form.add_group }}
+{{ form.more }}