Commit 691697f3 authored by xjm's avatar xjm

Issue #2502095 by joelpittet, cwells: Remove SafeMarkup::set in...

Issue #2502095 by joelpittet, cwells: Remove SafeMarkup::set in template_preprocess_views_ui_view_info()
parent f8b8f3bc
......@@ -4,17 +4,25 @@
* Default theme implementation for basic administrative info about a View.
*
* Available variables:
* - title: View title.
* - displays: List of displays.
*
* @see template_preprocess_views_ui_view_info()
*
* @ingroup themeable
*/
#}
<h3 class="views-ui-view-title views-table-filter-text-source">{{ title }}</h3>
<div class="views-ui-view-displays">{{ displays }}</div>
<h3 class="views-ui-view-title views-table-filter-text-source">{{ view.label }}</h3>
<div class="views-ui-view-displays">
{% if displays %}
{% trans %}
Display
{% plural displays %}
Displays
{% endtrans %}:
<em>{{ displays|safe_join(', ') }}</em>
{% else %}
{{ 'None'|t }}
{% endif %}
</div>
<div class="views-ui-view-machine-name">
{% trans 'Machine name:' %}
<span class="views-table-filter-text-source">{{ view.id }}</span>
{{ 'Machine name:'|t }}
<span class="views-table-filter-text-source">{{ view.id }}</span>
</div>
......@@ -64,32 +64,6 @@ function template_preprocess_views_ui_display_tab_bucket(&$variables) {
$variables['actions'] = !empty($element['#actions']) ? $element['#actions'] : array();
}
/**
* Prepares variables for Views UI View info templates.
*
* Default template: views-ui-view-info.html.twig.
*
* @param array $variables
* An associative array containing:
* - view: The View object.
*/
function template_preprocess_views_ui_view_info(&$variables) {
$variables['title'] = $variables['view']->label();
if (empty($variables['displays'])) {
$displays = t('None');
}
else {
$displays = \Drupal::translation()->formatPlural(count($variables['displays']), 'Display', 'Displays') . ': <em>';
$separator = '';
foreach ($variables['displays'] as $displays_item) {
$displays .= $separator . SafeMarkup::escape($displays_item);
$separator = ', ';
}
$displays = SafeMarkup::set($displays . '</em>');
}
$variables['displays'] = $displays;
}
/**
* Theme the build group filter form.
*
......
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