Skip to content

Commit

Permalink
Merge branch '6.13' into 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Jan 17, 2018
2 parents d2d77a0 + 3f09fdf commit 7207697
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
->arrayNode('content')
->info('Content related configuration')
->children()
->booleanNode('view_cache')->defaultValue(true)->end()
->booleanNode('ttl_cache')->defaultValue(true)->end()
->scalarNode('default_ttl')->info('Default value for TTL cache, in seconds')->defaultValue(60)->end()
->booleanNode('view_cache')->end()
->booleanNode('ttl_cache')->end()
->scalarNode('default_ttl')->info('Default value for TTL cache, in seconds')->end()
->arrayNode('tree_root')
->canBeUnset()
->children()
Expand All @@ -52,9 +52,17 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
{
if (!empty($scopeSettings['content'])) {
$contextualizer->setContextualParameter('content.view_cache', $currentScope, $scopeSettings['content']['view_cache']);
$contextualizer->setContextualParameter('content.ttl_cache', $currentScope, $scopeSettings['content']['ttl_cache']);
$contextualizer->setContextualParameter('content.default_ttl', $currentScope, $scopeSettings['content']['default_ttl']);
if (isset($scopeSettings['content']['view_cache'])) {
$contextualizer->setContextualParameter('content.view_cache', $currentScope, $scopeSettings['content']['view_cache']);
}

if (isset($scopeSettings['content']['ttl_cache'])) {
$contextualizer->setContextualParameter('content.ttl_cache', $currentScope, $scopeSettings['content']['ttl_cache']);
}

if (isset($scopeSettings['content']['default_ttl'])) {
$contextualizer->setContextualParameter('content.default_ttl', $currentScope, $scopeSettings['content']['default_ttl']);
}

if (isset($scopeSettings['content']['tree_root'])) {
$contextualizer->setContextualParameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,14 @@

{% block ezselection_field %}
{% spaceless %}
{% if fieldSettings.isMultiple and field.value.selection|length() > 0 %}
{% if field.value.selection|length() <= 0 %}
{% elseif fieldSettings.isMultiple %}
<ul {{ block( 'field_attributes' ) }}>
{% for selectedIndex in field.value.selection %}
<li>{{ fieldSettings.options[selectedIndex] }}</li>
{% endfor %}
</ul>
{% elseif not fieldSettings.isMultiple %}
{% else %}
{% set field_value = fieldSettings.options[field.value.selection.0] %}
{{ block( 'simple_block_field' ) }}
{% endif %}
Expand Down

0 comments on commit 7207697

Please sign in to comment.