Skip to content

Commit

Permalink
Dev: moved classes, id and attribute to core for bootstrap_alert_moda…
Browse files Browse the repository at this point in the history
…l.twig
  • Loading branch information
LouisGac committed Aug 18, 2017
1 parent ed9c2bd commit 0003b86
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
19 changes: 19 additions & 0 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1786,6 +1786,25 @@ private function setClassAndIds()
$this->aSurveyInfo['class']['formcontrol'] = ' form-control ';
$this->aSurveyInfo['class']['aLCDWithForm'] = ' btn btn-default ls-js-hidden ';

// Bootstrap Modal Alert
$this->aSurveyInfo['id']['alertmodal'] = 'bootstrap-alert-box-modal';
$this->aSurveyInfo['class']['alertmodal'] = ' modal fade ';
$this->aSurveyInfo['class']['modaldialog'] = ' modal-dialog ';
$this->aSurveyInfo['class']['modalcontent'] = ' modal-content ';
$this->aSurveyInfo['class']['modalheader'] = ' modal-header ';
$this->aSurveyInfo['class']['modalclosebutton'] = ' close ';
$this->aSurveyInfo['class']['modaltitle'] = ' modal-title h4 ';
$this->aSurveyInfo['class']['modalbody'] = ' modal-body ';
$this->aSurveyInfo['class']['modalfooter'] = ' modal-footer ';
$this->aSurveyInfo['class']['modalfooterlink'] = ' btn btn-default ';


$this->aSurveyInfo['attr']['modalheader'] = ' style="min-height:40px;" '; // Todo: move to CSS
$this->aSurveyInfo['attr']['modalclosebutton'] = ' type="button" data-dismiss="modal" aria-hidden="true" ';
$this->aSurveyInfo['attr']['modalfooterlink'] = ' href="#" data-dismiss="modal" ';

$this->aSurveyInfo['attr']['alertmodal'] = $this->aSurveyInfo['attr']['modaldialog'] = $this->aSurveyInfo['attr']['modalcontent'] = $this->aSurveyInfo['attr']['modaltitle'] = $this->aSurveyInfo['attr']['modalbody'] = $this->aSurveyInfo['attr']['modalfooter'] = '';

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

Expand Down
20 changes: 11 additions & 9 deletions templates/default/views/subviews/bootstrap_alert_modal.twig
Expand Up @@ -26,16 +26,18 @@
{% endif %}

<!-- Bootstrap Modal Alert -->
<div id="bootstrap-alert-box-modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="min-height:40px;">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<div class="modal-title h4">&nbsp;</div>
<div id="{{ aSurveyInfo.id.alertmodal }}" class="{{ aSurveyInfo.class.alertmodal }}" {{ aSurveyInfo.attr.alertmodal }}>
<div class="{{ aSurveyInfo.class.modaldialog }}" {{ aSurveyInfo.attr.modaldialog }}>
<div class="{{ aSurveyInfo.class.modalcontent }}" {{ aSurveyInfo.attr.modalcontent }} >
<div class="{{ aSurveyInfo.class.modalheader }}" {{ aSurveyInfo.attr.modalheader }} >
<button {{ aSurveyInfo.attr.modalclosebutton }} class="{{ aSurveyInfo.class.modalclosebutton }}" >&times;</button>
<div class="{{ aSurveyInfo.class.modaltitle }}" {{ aSurveyInfo.attr.modaltitle }}>&nbsp;</div>
</div>
<div class="modal-body"><p></p></div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn btn-default">{{ "close" | t }}</a>
<div class="{{ aSurveyInfo.class.modalbody }}" {{ aSurveyInfo.attr.modalbody }}>
<p></p>
</div>
<div class="{{ aSurveyInfo.class.modalfooter }}" {{ aSurveyInfo.attr.modalfooter }}>
<a {{ aSurveyInfo.attr.modalfooterlink }} class="{{ aSurveyInfo.class.modalfooterlink }}">{{ "close" | t }}</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 0003b86

Please sign in to comment.