Skip to content

Commit

Permalink
Fixed issue #13994: Question validation equation along with "Hide tip"
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikvitt committed Sep 3, 2018
1 parent dff62fe commit 8287185
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -6731,13 +6731,19 @@ public function _ValidateQuestion($questionSeq,$force=false)
// Only add non-empty tip
if (trim($vtip) != "")
{
// set hideTip from question atrribute
$qattr = isset($LEM->qattr[$qid]) ? $LEM->qattr[$qid] : array();
$hideTip = array_key_exists('hide_tip', $qattr)?$qattr['hide_tip']:0;

$tipsDatas = array(
'qid' =>$qid,
'coreId' =>"vmsg_{$qid}_{$vclass}", // If it's not this id : EM is broken
'coreClass' =>"ls-em-tip em_{$vclass}",
'vclass' =>$vclass,
'vtip' =>$vtip,
'hideTip' =>($vclass == 'default' && $hideTip == 1)?true:false // hide default tip if attribute hide_tip is set to 1
);

$stringToParse .= Yii::app()->getController()->renderPartial('//survey/questions/question_help/em-tip', $tipsDatas, true);
}
}
Expand Down
2 changes: 2 additions & 0 deletions application/views/survey/questions/question_help/em-tip.php
Expand Up @@ -8,7 +8,9 @@
* @var $vtip
*/
?>
<?php if ($hideTip === false){ ?>
<div id='<?php echo $coreId; ?>' class='ls-question-message <?php echo $coreClass; ?>'>
<span class='fa fa-exclamation-circle' aria-hidden="true"></span>
<?php echo $vtip; ?>
</div>
<?php } ?>

0 comments on commit 8287185

Please sign in to comment.