Skip to content

Commit

Permalink
Fixed issue 5547 : Show groupname, groupdescription, showXquestion...…
Browse files Browse the repository at this point in the history
… according to cofiguration

Dev: use of $CI->config->config['XXXXXX'];

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11307 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Shnoulle committed Nov 1, 2011
1 parent 54a88c2 commit 98dfe5d
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions application/helpers/replacements_helper.php
Expand Up @@ -62,8 +62,9 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
'totalBoilerplatequestions',
'totalquestions',
);

$varsPassed = array();

foreach($allowedvars as $var)
{
if(isset($redata[$var])) {
Expand All @@ -72,17 +73,16 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
}
}
if (count($varsPassed) > 0) {
// log_message('debug', 'templatereplace() called from ' . $debugSrc . ' contains: ' . implode(', ', $varsPassed));
//log_message('debug', 'templatereplace() called from ' . $debugSrc . ' contains: ' . implode(', ', $varsPassed));
}
// extract($redata); // creates variables for each of the keys in the array

// Local over-rides in case not set above
if (!isset($showgroupinfo)) { $showgroupinfo = 'Y'; }
if (!isset($showqnumcode)) { $showqnumcode = ''; }
if (!isset($showgroupinfo)) { $showgroupinfo = $CI->config->config['showgroupinfo']; }
if (!isset($showqnumcode)) { $showqnumcode = $CI->config->config['showqnumcode']; }
$_surveyid = (isset($surveyid) ? $surveyid : 0);

if (!isset($totalBoilerplatequestions)) { $totalBoilerplatequestions = 0; }
if (!isset($showXquestions)) { $showXquestions = 'choose'; }
if (!isset($showXquestions)) { $showXquestions = $CI->config->config['showXquestions']; }
if (!isset($relativeurl)) { $relativeurl = $CI->config->item("relativeurl"); }
if (!isset($s_lang)) { $s_lang = (isset($_SESSION['s_lang']) ? $_SESSION['s_lang'] : 'en'); }
if (!isset($captchapath)) { $captchapath = ''; }
Expand Down Expand Up @@ -211,6 +211,8 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$_question_class = $question['class'];
$_question_man_class = $question['man_class'];
$_question_input_error_class = $question['input_error_class'];
$_question_number = $question['number'];
$_question_code = $question['code'];
}
else
{
Expand All @@ -226,33 +228,27 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
$_question_class = '';
$_question_man_class = '';
$_question_input_error_class = '';
$_question_number = '';
$_question_code = '';
};

if (
if (!(
$showqnumcode == 'both' ||
$showqnumcode == 'number' ||
($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N')
)
{
$_question_number = $question['number'];
}
else
))
{
$_question_number = '';
};
if (
if (!(
$showqnumcode == 'both' ||
$showqnumcode == 'code' ||
($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C')
)
{
$_question_code = $question['code'];
}
else
))
{
$_question_code = '';
}
Expand Down

0 comments on commit 98dfe5d

Please sign in to comment.