Issue #1963986 by chrisjlee, designesse, joelpittet, waynethayer: Convert theme_views_ui_view_info() to Twig.
parent
4fc16f8ea1
commit
3bc754a644
|
@ -0,0 +1,16 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* 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">{{ title }}</h3>
|
||||
<div class="views-ui-view-displays">{{ displays }}</div>
|
|
@ -137,6 +137,7 @@ function views_ui_theme() {
|
|||
'views_ui_view_info' => array(
|
||||
'variables' => array('view' => NULL, 'displays' => NULL),
|
||||
'file' => 'views_ui.theme.inc',
|
||||
'template' => 'views-ui-view-info',
|
||||
),
|
||||
|
||||
// Group of filters.
|
||||
|
|
|
@ -89,23 +89,19 @@ function template_preprocess_views_ui_display_tab_bucket(&$variables) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements hook_preprocess_HOOK() for theme_views_ui_view_info().
|
||||
* 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();
|
||||
$variables['displays'] = empty($variables['displays']) ? t('None') : format_plural(count($variables['displays']), 'Display', 'Displays') . ': ' . '<em>' . implode(', ', $variables['displays']) . '</em>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns basic administrative information about a view.
|
||||
*/
|
||||
function theme_views_ui_view_info($variables) {
|
||||
$output = '';
|
||||
$output .= '<h3 class="views-ui-view-title">' . $variables['title'] . "</h3>\n";
|
||||
$output .= '<div class="views-ui-view-displays">' . $variables['displays'] . "</div>\n";
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Theme the expose filter form.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue