addfolder

This commit is contained in:
2018-04-23 21:14:46 +02:00
parent cec9a0314b
commit a7cb972085
192 changed files with 16037 additions and 24 deletions
@@ -0,0 +1,39 @@
{#
/**
* @file
* Default theme implementation for a fieldgroup accordion item.
*
* Available variables:
* - title: Title of the group.
* - children: The children of the group.
* - label_attributes: A list of HTML attributes for the label.
* - attributes: A list of HTML attributes for the group wrapper.
*
* @see template_preprocess_field_group_accordion()
*
* @ingroup themeable
*/
#}
{%
set label_classes = [
'field-group-format-toggler',
'accordion-item',
open ? 'field-group-accordion-active',
]
%}
{%
set classes = [
'field-group-format-wrapper',
]
%}
<h3 {{ label_attributes.addClass(label_classes) }}>
<a href="#">{{ title }}</a>
</h3>
<div {{ attributes.addClass(classes) }}>
{% if description %}<div class="description"></div>{% endif %}
{{children}}
</div>
@@ -0,0 +1,21 @@
{#
/**
* @file
* Default theme implementation for a fieldgroup accordion item.
*
* Available variables:
* - children: The children of the group.
* - attributes: A list of HTML attributes for the group wrapper.
*
* @see template_preprocess_field_group_accordion()
*
* @ingroup themeable
*/
#}
{%
set classes = [
'field-group-accordion-wrapper',
]
%}
<div {{ attributes.addClass(classes) }}>{{ children }}</div>
@@ -0,0 +1,30 @@
{#
/**
* @file
* Default theme implementation for a fieldgroup html element.
*
* Available variables:
* - title: Title of the group.
* - title_element: Element to wrap the title.
* - children: The children of the group.
* - wrapper_element: The html element to use
* - attributes: A list of HTML attributes for the group wrapper.
*
* @see template_preprocess_field_group_html_element()
*
* @ingroup themeable
*/
#}
<{{ wrapper_element }} {{ attributes }}>
{% if title %}
<{{ title_element }}{% if collapsible %} class="field-group-toggler"{% endif %}>{{ title }}</{{ title_element }}>
{% endif %}
{% if collapsible %}
<div class="field-group-wrapper">
{% endif %}
{{children}}
{% if collapsible %}
</div>
{% endif %}
</{{ wrapper_element }}>
@@ -0,0 +1,15 @@
{#
/**
* @file
* Default theme implementation for horizontal tabs.
*
* Available variables
* - attributes: A list of HTML attributes for the wrapper element.
* - children: The rendered children.
*
* @see template_preprocess_horizontal_tabs()
*
* @ingroup themeable
*/
#}
<div data-horizontal-tabs-panes{{ attributes }}>{{ children }}</div>
+94
View File
@@ -0,0 +1,94 @@
<?php
/**
* @file
* Preprocessors for fieldgroup elements.
*/
/**
* Prepares variables for horizontal tabs templates.
*
* Default template: horizontal-tabs.html.twig.
*
* @param array $variables
* An associative array containing:
* - element: An associative array containing the properties and children of
* the details element. Properties used: #children.
*
*/
function template_preprocess_horizontal_tabs(&$variables) {
$element = $variables['element'];
$variables['children'] = (!empty($element['#children'])) ? $element['#children'] : '';
}
/**
* Prepares variables for fieldgroup accordion templates.
*
* Default template: field-group-accordion.html.twig.
*
* @param array $variables
* An associative array containing:
* - element: An associative array containing the properties and children of
* the accordion element. Properties used: #children.
*
*/
function template_preprocess_field_group_accordion(&$variables) {
$element = $variables['element'];
$variables['children'] = (!empty($element['#children'])) ? $element['#children'] : '';
}
/**
* Prepares variables for fieldgroup accordion item templates.
*
* Default template: field-group-accordion-item.html.twig.
*
* @param array $variables
* An associative array containing:
* - element: An associative array containing the properties and children of
* the accordion item element.
*
*/
function template_preprocess_field_group_accordion_item(&$variables) {
$element = $variables['element'];
if (!empty($element['#title'])) {
$variables['title'] = $element['#title'];
}
if (!empty($element['#description'])) {
$variables['description'] = $element['#description'];
}
$variables['open'] = $element['#open'];
$variables['label_attributes'] = new \Drupal\Core\Template\Attribute();
$variables['children'] = (!empty($element['#children'])) ? $element['#children'] : '';
}
/**
* Prepares variables for fieldgroup html element templates.
*
* Default template: field-group-html-element.html.twig.
*
* @param array $variables
* An associative array containing:
* - element: An associative array containing the properties and children of
* the html element.
*
*/
function template_preprocess_field_group_html_element(&$variables) {
$element = $variables['element'];
if (!empty($element['#title']) && !empty($element['#title_element'])) {
$variables['title_element'] = $element['#title_element'];
$variables['title'] = $element['#title'];
}
$variables['collapsible'] = (!empty($element['#effect']) && $element['#effect'] !== 'none');
$variables['wrapper_element'] = $element['#wrapper_element'];
$variables['attributes'] = $element['#attributes'];
$variables['children'] = (!empty($element['#children'])) ? $element['#children'] : '';
}