Skip to content

Commit

Permalink
Dev:Dev: moved classes, id and attribute to core for navigator.twig
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Aug 24, 2017
1 parent 14bd2b3 commit 5c310c5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
27 changes: 25 additions & 2 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1863,13 +1863,36 @@ private function setClassAndIds()
$this->aSurveyInfo['class']['lctdropdownli'] = ' index-item ';
$this->aSurveyInfo['class']['lctdropdownlia'] = ' ls-language-link ';



$this->aSurveyInfo['attr']['lctla'] = ' data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" ';
$this->aSurveyInfo['attr']['lctdropdown'] = ' style="overflow: scroll" ';

$this->aSurveyInfo['attr']['lctli'] = $this->aSurveyInfo['attr']['lctspan'] = $this->aSurveyInfo['attr']['lctdropdownli'] = $this->aSurveyInfo['attr']['lctdropdownlia'] = ' ';


// Navigator
$this->aSurveyInfo['id']['navigatorcontainer'] = 'navigator-container';

$this->aSurveyInfo['class']['navigatorcontainer'] = ' navigator row ';
$this->aSurveyInfo['class']['navigatorbuttonl'] = ' col-xs-6 text-left ';
$this->aSurveyInfo['class']['navigatorbuttonprev'] = ' ls-move-btn ls-move-previous-btn btn btn-lg btn-default ';
$this->aSurveyInfo['class']['navigatorbuttonr'] = ' col-xs-6 text-right ';
$this->aSurveyInfo['class']['navigatorbuttonsumbit'] = ' ls-move-btn ls-move-submit-btn btn btn-lg btn-primary ';
$this->aSurveyInfo['class']['navigatorbuttonnext'] = ' ls-move-btn ls-move-next-btn ls-move-submit-btn btn btn-lg btn-primary ';
$this->aSurveyInfo['class']['loadsavecontainer'] = ' navigator row ';
$this->aSurveyInfo['class']['loadsavecol'] = ' col-sm-6 save-clearall-wrapper ';
$this->aSurveyInfo['class']['loadbutton'] = ' ls-saveaction ls-loadall btn btn-default ';
$this->aSurveyInfo['class']['savebutton'] = ' ls-saveaction ls-loadall btn btn-default ';



$this->aSurveyInfo['attr']['navigatorbuttonprev'] = ' type="submit" value="moveprev" name="move" accesskey="p" accesskey="n"';
$this->aSurveyInfo['attr']['navigatorbuttonsumbit'] = ' type="submit" value="movesubmit" name="move" accesskey="l" ';
$this->aSurveyInfo['attr']['navigatorbuttonnext'] = ' type="submit" value="movenext" name="move" ';
$this->aSurveyInfo['attr']['loadbutton'] = ' type="submit" value="loadall" name="loadall" accesskey="L"';
$this->aSurveyInfo['attr']['savebutton'] = ' type="submit" value="saveall" name="saveall" accesskey="s" ';
$this->aSurveyInfo['attr']['navigatorcontainer'] = $this->aSurveyInfo['attr']['navigatorbuttonl'] = $this->aSurveyInfo['attr']['loadsavecontainer'] = $this->aSurveyInfo['attr']['loadsavecol'] = '';


// Here you can add metas from core
$this->aSurveyInfo['metas'] = ' ';

Expand Down
20 changes: 10 additions & 10 deletions templates/default/views/subviews/navigation/navigator.twig
Expand Up @@ -23,33 +23,33 @@
{% set aNavigator = aSurveyInfo.aNavigator %}

<!-- PRESENT THE NAVIGATOR -->
<div class="navigator row" id="navigator-container">
<div class="{{ aSurveyInfo.class.navigatorcontainer }}" id="{{ aSurveyInfo.id.navigatorcontainer }}" {{ aSurveyInfo.attr.navigatorcontainer }}>

<!-- Previous button container -->
<div class="col-xs-6 text-left">
<div class="{{ aSurveyInfo.class.navigatorbuttonl }}" {{ aSurveyInfo.attr.navigatorbuttonl }}>

{# Previous button must be set to ON in survey settings (and it's not shown in first page, in All in One survey mode, etc) #}
{% if aNavigator.aMovePrev.show %}
<!-- Button previous -->
<button type="submit" value="moveprev" name="move" class=" {{ aNavigator.disabled }} ls-move-btn ls-move-previous-btn btn btn-lg btn-default" accesskey="p">
<button {{ aSurveyInfo.attr.navigatorbuttonprev }} class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonprev }} " >
{{ "Previous" | t }}
</button>
{% endif %}
</div>
<div class="col-xs-6 text-right">
<div class="{{ aSurveyInfo.class.navigatorbuttonr }}">

{# Next button is not always shown (last page, all in one mode, etc) #}
{% if aNavigator.aMoveNext.show %}

{# On last page, Next button become submit button. #}
{% if aNavigator.aMoveNext.value == "movesubmit" %}
<!-- Button submit -->
<button type="submit" value="movesubmit" name="move" class=" {{ aNavigator.disabled }} ls-move-btn ls-move-submit-btn btn btn-lg btn-primary" accesskey="l">
<button {{ aSurveyInfo.attr.navigatorbuttonsubmit }} class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonsubmit }}">
{{ "Submit" | t }}
</button>
{% else %}
<!-- Button Next -->
<button type="submit" value="movenext" name="move" class=" {{ aNavigator.disabled }} ls-move-btn ls-move-next-btn ls-move-submit-btn btn btn-lg btn-primary" accesskey="n">
<button {{ aSurveyInfo.attr.navigatorbuttonnext }} class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonnext }} " >
{{ "Next" | t }}
</button>
{% endif %}
Expand All @@ -58,21 +58,21 @@
</div>

<!-- Save and load buttons-->
<div class="navigator row">
<div class="col-sm-6 save-clearall-wrapper">
<div class="{{ aSurveyInfo.class.loadsavecontainer }}" {{ aSurveyInfo.attr.loadsavecontainer }}>
<div class="{{ aSurveyInfo.class.loadsaveccol }} " {{ aSurveyInfo.attr.loadsaveccol }} >

{# Loading survey must be allowed in survey settings, and it must not be shown once survey is completed #}
{% if aNavigator.load.show == "Y" %}
<!-- Button load unfinished survey -->
<button type="submit" value="loadall" name="loadall" class="ls-saveaction ls-loadall btn btn-default" accesskey="L">
<button {{ aSurveyInfo.attr.loadbutton }} class="{{ aSurveyInfo.class.loadbutton }}" >
{{ "Load unfinished survey" | t }}
</button>
{% endif %}

{# Saving survey must be allowed in survey settings, and it must not be shown on welcome page or once survey is completed #}
{% if aNavigator.save.show == "Y" %}
<!-- Button resume later -->
<button type="submit" value="saveall" name="saveall" class="ls-saveaction ls-loadall btn btn-default" accesskey="s">
<button {{ aSurveyInfo.attr.savebutton }} class="{{ aSurveyInfo.class.savebutton }}" >
{{ "Resume later" | t }}
</button>
{% endif %}
Expand Down

0 comments on commit 5c310c5

Please sign in to comment.