2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Added IS_INTERVIEWER token so can check if the questionnaire is administered by an interviewer by the following Lime Expression Manager code: {if(IS_INTERVIEWER,'This is an interviewer','THIS IS NOT AN INTERVIEWER')}

This commit is contained in:
Adam Zammit
2013-06-07 10:40:15 +10:00
parent e0ee24a492
commit f69d62dec6

View File

@@ -50,11 +50,6 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
$_templateurl = sGetTemplateURL($_templatename) . '/'; $_templateurl = sGetTemplateURL($_templatename) . '/';
$templatedir = sgetTemplatePath($_templatename); $templatedir = sgetTemplatePath($_templatename);
if (stripos($line, "</head>"))
{
//queXS Addition
$textfocus = "";
$interviewer=returnglobal('interviewer'); $interviewer=returnglobal('interviewer');
if (!empty($interviewer) || (isset($_SESSION['interviewer']) && $_SESSION['interviewer'] == true)) if (!empty($interviewer) || (isset($_SESSION['interviewer']) && $_SESSION['interviewer'] == true))
{ {
@@ -66,6 +61,11 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
$interviewer = false; $interviewer = false;
} }
if (stripos($line, "</head>"))
{
//queXS Addition
$textfocus = "";
if ($interviewer) if ($interviewer)
{ {
$textfocus = $textfocus =
@@ -770,6 +770,7 @@ EOD;
//queXS Addition //queXS Addition
include_once("quexs.php"); include_once("quexs.php");
$coreReplacements['IS_INTERVIEWER'] = $interviewer;
$coreReplacements = array_merge($coreReplacements,quexs_core_replace()); $coreReplacements = array_merge($coreReplacements,quexs_core_replace());
if (!is_null($replacements) && is_array($replacements)) if (!is_null($replacements) && is_array($replacements))