Commit 394442e2 authored by webchick's avatar webchick
Browse files

Issue #2152231 by rteijeiro, steveoliver, joelpittet, hussainweb, shanethehat,...

Issue #2152231 by rteijeiro, steveoliver, joelpittet, hussainweb, shanethehat, jenlampton, kpa, AnythonyR, EVIIILJ, kgoel, Cottser, dsdeiz, hanpersand: Convert theme_vertical_tabs() to Twig
parent e9a240b4
...@@ -2108,18 +2108,19 @@ function form_pre_render_vertical_tabs($element) { ...@@ -2108,18 +2108,19 @@ function form_pre_render_vertical_tabs($element) {
} }
/** /**
* Returns HTML for an element's children details as vertical tabs. * Prepares variables for vertical tabs templates.
* *
* @param $variables * Default template: vertical-tabs.html.twig.
*
* @param array $variables
* An associative array containing: * An associative array containing:
* - element: An associative array containing the properties and children of * - element: An associative array containing the properties and children of
* the details element. Properties used: #children. * the details element. Properties used: #children.
* *
* @ingroup themeable
*/ */
function theme_vertical_tabs($variables) { function template_preprocess_vertical_tabs(&$variables) {
$element = $variables['element']; $element = $variables['element'];
return '<div data-vertical-tabs-panes ' . new Attribute($element['#attributes']) . '>' . $element['#children'] . '</div>'; $variables['children'] = (!empty($element['#children'])) ? $element['#children'] : '';
} }
/** /**
......
...@@ -2733,6 +2733,7 @@ function drupal_common_theme() { ...@@ -2733,6 +2733,7 @@ function drupal_common_theme() {
), ),
'vertical_tabs' => array( 'vertical_tabs' => array(
'render element' => 'element', 'render element' => 'element',
'template' => 'vertical-tabs',
), ),
'container' => array( 'container' => array(
'render element' => 'element', 'render element' => 'element',
......
{#
/**
* @file
* Default theme implementation for vertical tabs.
*
* Available variables
* - attributes: A list of HTML attributes for the wrapper element.
* - children: The rendered checkboxes.
*
* @see template_preprocess_vertical_tabs()
*
* @ingroup themeable
*/
#}
<div data-vertical-tabs-panes {{ attributes }}>{{ children }}</div>
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