Commit 298d1fd0 authored by alexpott's avatar alexpott

Issue #1843772 by joelpittet, steveoliver, 2ndmile, Cottser | tostinni:...

Issue #1843772 by joelpittet, steveoliver, 2ndmile, Cottser | tostinni: [READY] Convert views/views_ui()/templates/views-ui-display-tab-bucket.tpl.php to Twig.
parent bd5769d9
{#
/**
* @file
* Default theme implementation for each "box" on the display query edit screen.
*
* Available variables:
* - attributes: HTML attributes to apply to the container element.
* - actions: Action links such as "Add", "And/Or, Rearrange" for the content.
* - title: The title of the bucket, e.g. "Fields", "Filter Criteria", etc.
* - content: Content items such as fields or settings in this container.
*
* @see template_preprocess()
* @see template_preprocess_views_ui_display_tab_bucket()
*
* @ingroup themeable
*/
#}
<div{{ attributes }}>
{% if title -%}
<h3>{{ title }}</h3>
{%- endif %}
{{ content }}
{% if actions -%}
{{ actions }}
{%- endif %}
</div>
<?php
/**
* @file
* Template for each "box" on the display query edit screen.
*/
?>
<div <?php print $attributes; ?>>
<?php if (!empty($title)) : ?>
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php print $content; ?>
<?php if (!empty($actions)) : ?>
<?php print $actions; ?>
<?php endif; ?>
</div>
......@@ -40,6 +40,16 @@ function template_preprocess_views_ui_display_tab_setting(&$variables) {
}
}
/**
* Prepares variables for Views UI display tab bucket templates.
*
* Default template: views-ui-display-tab-bucket.html.twig.
*
* @param array $variables
* An associative array containing:
* - element: An associative array containing the properties of the element.
* Properties used: #name, #overridden, #children, #title, #actions.
*/
function template_preprocess_views_ui_display_tab_bucket(&$variables) {
$element = $variables['element'];
......@@ -50,12 +60,12 @@ function template_preprocess_views_ui_display_tab_bucket(&$variables) {
}
if (!empty($element['#overridden'])) {
$variables['attributes']['class'][] = 'overridden';
$variables['attributes_array']['title'][] = t('Overridden');
$variables['attributes']['title'][] = t('Overridden');
}
$variables['content'] = $element['#children'];
$variables['title'] = $element['#title'];
$variables['actions'] = !empty($element['#actions']) ? render($element['#actions']) : '';
$variables['actions'] = !empty($element['#actions']) ? $element['#actions'] : array();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment