Skip to content

Commit

Permalink
Dev: user css classes should always be the last classes in the elemen…
Browse files Browse the repository at this point in the history
…t "class" attribute
  • Loading branch information
LouisGac committed Jul 9, 2018
1 parent 153f834 commit 6b364c6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -89,11 +89,11 @@ public function run($surveyid, $args)
{
// Survey settings
$this->setSurveySettings($surveyid, $args);

// Start rendering
$this->makeLanguageChanger(); // language changer can be used on any entry screen, so it must be set first
extract($args);

///////////////////////////////////////////////////////////
// 1: We check if token and/or captcha form shouls be shown
if (!isset($_SESSION[$this->LEMsessid]['step'])) {
Expand Down Expand Up @@ -1011,7 +1011,7 @@ private function saveAllIfNeeded()
"
, LSYii_ClientScript::POS_POSTSCRIPT
);

}
}
}
Expand Down Expand Up @@ -1182,7 +1182,7 @@ private function moveSubmitIfNeeded()


if (isset($this->aSurveyInfo['autoredirect']) && $this->aSurveyInfo['autoredirect'] == "Y" && $this->aSurveyInfo['surveyls_url']) {
//Automatically redirect the page to the "url" setting for the survey
//Automatically redirect the page to the "url" setting for the survey
$headToSurveyUrl = $this->aSurveyInfo['surveyls_url'];
$actualRedirect = $headToSurveyUrl;
header("Access-Control-Allow-Origin: *");
Expand Down Expand Up @@ -1713,6 +1713,16 @@ public function getCurrentQuestionClasses($iQid)
$aQuestionClass .= ' ls-hidden';
}

if ($lemQuestionInfo['info']['mandatory'] == 'Y') {
$aQuestionClass .= ' mandatory';
}

if ($lemQuestionInfo['anyUnanswered'] && $_SESSION[$this->LEMsessid]['maxstep'] != $_SESSION[$this->LEMsessid]['step']) {
$aQuestionClass .= ' missing';
}



$aQuestionAttributes = QuestionAttribute::model()->getQuestionAttributes($iQid);

//add additional classes
Expand All @@ -1724,13 +1734,6 @@ public function getCurrentQuestionClasses($iQid)
}
}

if ($lemQuestionInfo['info']['mandatory'] == 'Y') {
$aQuestionClass .= ' mandatory';
}

if ($lemQuestionInfo['anyUnanswered'] && $_SESSION[$this->LEMsessid]['maxstep'] != $_SESSION[$this->LEMsessid]['step']) {
$aQuestionClass .= ' missing';
}
return $aQuestionClass;
}
}

1 comment on commit 6b364c6

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.