Commit 7e209672 authored by catch's avatar catch
Browse files

Issue #1939086 by chrisjlee, joelpittet, tim.plunkett: Convert theme_dropbutton_wrapper() to Twig.

parent 423f1d65
......@@ -1744,20 +1744,6 @@ function theme_links($variables) {
return $output;
}
/**
* Returns HTML for wrapping a dropbutton menu.
*
* @param array $variables
* An associative array containing:
* - element: An associative array containing the properties and children of
* the dropbutton menu. Properties used: #children.
*/
function theme_dropbutton_wrapper($variables) {
if (!empty($variables['element']['#children'])) {
return '<div class="dropbutton-wrapper"><div class="dropbutton-widget">' . $variables['element']['#children'] . '</div></div>';
}
}
/**
* Returns HTML for an image.
*
......@@ -3012,7 +2998,8 @@ function drupal_common_theme() {
'variables' => array('links' => array(), 'attributes' => array('class' => array('links')), 'heading' => array()),
),
'dropbutton_wrapper' => array(
'render element' => 'element',
'variables' => array('children' => NULL),
'template' => 'dropbutton-wrapper',
),
'image' => array(
// HTML 4 and XHTML 1.0 always require an alt attribute. The HTML 5 draft
......
{#
/**
* @file
* Default theme implementation for a dropbutton wrapper.
*
* Available variables:
* - children: Contains the child elements of the dropbutton menu.
*
* @see template_preprocess()
* @see template_preprocess_dropbutton_wrapper()
*
* @ingroup themeable
*/
#}
{% if children %}
{% spaceless %}
<div class="dropbutton-wrapper">
<div class="dropbutton-widget">
{{ children }}
</div>
</div>
{% endspaceless %}
{% endif %}
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