Skip to content

Commit

Permalink
Dev: moved classes, id and attribute to core for language_changer.twig
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Aug 18, 2017
1 parent 93810bf commit a123641
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
8 changes: 8 additions & 0 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1779,6 +1779,14 @@ private function setClassAndIds()
$this->aSurveyInfo['attr']['navbartoggle'] = ' data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar" ';
$this->aSurveyInfo['attr']['navbar'] = $this->aSurveyInfo['attr']['navbarheader'] = $this->aSurveyInfo['attr']['navbarbrand'] = $this->aSurveyInfo['attr']['navbarcollapse'] = $this->aSurveyInfo['attr']['navbarlink'] = '';

// Language changer
$this->aSurveyInfo['class']['languagechanger'] = ' form-inline form-change-lang ';
$this->aSurveyInfo['class']['formgroup'] = ' form-group ';
$this->aSurveyInfo['class']['controllabel'] = ' control-label ';
$this->aSurveyInfo['class']['formcontrol'] = ' form-control ';
$this->aSurveyInfo['class']['aLCDWithForm'] = ' btn btn-default ls-js-hidden ';



// Maybe add a plugin event here?
Expand Down
34 changes: 17 additions & 17 deletions templates/default/views/subviews/language_changer.twig
Expand Up @@ -30,15 +30,15 @@
#}
{% set htmlOptions = {
'id' : false,
'class' : 'form-control',
'class' : aSurveyInfo.class.formcontrol,
'data-targeturl' : aLCD.targetUrl,
}
%}

<!-- Language Changer -->
<div class="form-inline form-change-lang {{ aSurveyInfo.alanguageChanger.sClass }} " >
<label class="form-group">
<span class="control-label">{{ "Language:" | t }}</span>
<div class=" {{ aSurveyInfo.class.languagechanger }} " >
<label class="{{ aSurveyInfo.class.formgroup }}">
<span class="{{ aSurveyInfo.class.controllabel }}">{{ "Language:" | t }}</span>
{{
C.Html.dropDownList(
'lang',
Expand All @@ -50,22 +50,22 @@

</label>

{% if aLCD.withForm == true %}
<!-- for no js functionality (need form) -->
{% set buttonhtmlOptions = {
'type' : 'submit',
'value': 'changelang',
'name' : 'move',
'class': 'btn btn-default ls-js-hidden',
}
%}
{% if aLCD.withForm == true %}
<!-- for no js functionality (need form) -->
{% set buttonhtmlOptions = {
'type' : 'submit',
'value': 'changelang',
'name' : 'move',
'class': aSurveyInfo.class.aLCDWithForm,
}
%}

{{
C.Html.htmlButton(
{{
C.Html.htmlButton(
("Change the language" | gT ),
htmlOptions
)
}}
)
}}
{% endif %}
</div>
{% endif %}
Expand Down

0 comments on commit a123641

Please sign in to comment.