Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev: twig file to show language changer inside the form (not in top m…
…enu)
- Loading branch information
LouisGac
committed
Jan 9, 2017
1 parent
e933cfc
commit 54f6de1
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{# Show a language changer inside the form #} | ||
|
||
{% if aSurveyInfo.alanguageChangerDatas != false %} | ||
{% set aLCD = aSurveyInfo.alanguageChangerDatas %} | ||
|
||
{# | ||
array of attributes of the Drop Down list. | ||
To add a new attribute, just add an entry: | ||
'attribute' : 'value', | ||
#} | ||
{% set htmlOptions = { | ||
'id' : false, | ||
'class' : 'form-control', | ||
'data-targeturl' : aLCD.targetUrl, | ||
} | ||
%} | ||
|
||
{% if aSurveyInfo.withForm == true %} | ||
<form method="get" class="ls-languagechanger-form"> | ||
{% endif %} | ||
|
||
{# Must be included only one time (else : multiple id) #} | ||
<div class="form-inline form-change-lang <?php echo $sClass ?>" > | ||
<label class="form-group"> | ||
<span class="control-label">{{ "Language:" | t }}</span> | ||
{{ | ||
C.Html.dropDownList( | ||
'lang', | ||
aLCD.sSelected, | ||
aLCD.aListLang, | ||
htmlOptions | ||
) | ||
| raw | ||
}} | ||
|
||
</label> | ||
|
||
{% if aSurveyInfo.withForm == true %} | ||
<!-- for no js functionality (need form) --> | ||
{% set buttonhtmlOptions = { | ||
'type' : 'submit', | ||
'value': 'changelang', | ||
'name' : 'move', | ||
'class': 'btn btn-default ls-js-hidden', | ||
} | ||
%} | ||
|
||
{{ | ||
C.Html.htmlButton( | ||
("Change the language" | gT ), | ||
htmlOptions | ||
) | ||
| raw | ||
}} | ||
{% endif %} | ||
</div> | ||
|
||
{% if aSurveyInfo.withForm == true %} | ||
</form> | ||
{% endif %} | ||
{% endif %} |