Issue #1963986 by chrisjlee, designesse, joelpittet, waynethayer: Convert theme_views_ui_view_info() to Twig.

8.0.x
Alex Pott 2013-07-20 01:23:33 +01:00
parent 4fc16f8ea1
commit 3bc754a644
3 changed files with 24 additions and 11 deletions

View File

@ -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>

View File

@ -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.

View File

@ -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.
*/