本文整理汇总了PHP中templatereplace函数的典型用法代码示例。如果您正苦于以下问题:PHP templatereplace函数的具体用法?PHP templatereplace怎么用?PHP templatereplace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了templatereplace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showsaveform
function showsaveform()
{
//Show 'SAVE FORM' only when click the 'Save so far' button the first time, or when duplicate is found on SAVE FORM.
global $errormsg, $thissurvey, $surveyid, $clang, $clienttoken, $thisstep;
$redata = compact(array_keys(get_defined_vars()));
$sTemplatePath = $_SESSION['survey_' . $surveyid]['templatepath'];
sendCacheHeaders();
doHeader();
echo templatereplace(file_get_contents($sTemplatePath . "startpage.pstpl"), array(), $redata);
echo "\n\n<!-- JAVASCRIPT FOR CONDITIONAL QUESTIONS -->\n" . "\t<script type='text/javascript'>\n" . "\t<!--\n" . "function checkconditions(value, name, type, evt_type)\n" . "\t{\n" . "\t}\n" . "\t//-->\n" . "\t</script>\n\n";
echo CHtml::form(array("/survey/index"), 'post') . "\n";
//PRESENT OPTIONS SCREEN
if (isset($errormsg) && $errormsg != "") {
$errormsg .= "<p>" . $clang->gT("Please try again.") . "</p>";
}
echo templatereplace(file_get_contents($sTemplatePath . "save.pstpl"), array(), $redata);
//END
echo "<input type='hidden' name='sid' value='{$surveyid}' />\n";
echo "<input type='hidden' name='thisstep' value='{$thisstep}' />\n";
echo CHtml::hiddenField('token', $clienttoken) . "\n";
echo "<input type='hidden' name='saveprompt' value='Y' />\n";
echo "</form>";
echo templatereplace(file_get_contents($sTemplatePath . "endpage.pstpl"), array(), $redata);
echo "</html>\n";
exit;
}
示例2: showsaveform
function showsaveform()
{
//Show 'SAVE FORM' only when click the 'Save so far' button the first time, or when duplicate is found on SAVE FORM.
global $thistpl, $errormsg, $thissurvey, $surveyid, $clang, $clienttoken, $relativeurl, $thisstep;
sendcacheheaders();
doHeader();
foreach (file("{$thistpl}/startpage.pstpl") as $op) {
echo templatereplace($op);
}
echo "\n\n<!-- JAVASCRIPT FOR CONDITIONAL QUESTIONS -->\n" . "\t<script type='text/javascript'>\n" . "\t<!--\n" . "function checkconditions(value, name, type, evt_type)\n" . "\t{\n" . "\t}\n" . "\t//-->\n" . "\t</script>\n\n";
echo "<form method='post' action='{$relativeurl}/index.php'>\n";
//PRESENT OPTIONS SCREEN
if (isset($errormsg) && $errormsg != "") {
$errormsg .= "<p>" . $clang->gT("Please try again.") . "</p>";
}
foreach (file("{$thistpl}/save.pstpl") as $op) {
echo templatereplace($op);
}
//END
echo "<input type='hidden' name='sid' value='{$surveyid}' />\n";
echo "<input type='hidden' name='thisstep' value='", $thisstep, "' />\n";
echo "<input type='hidden' name='token' value='", $clienttoken, "' />\n";
echo "<input type='hidden' name='saveprompt' value='Y' />\n";
echo "</form>";
foreach (file("{$thistpl}/endpage.pstpl") as $op) {
echo templatereplace($op);
}
echo "</html>\n";
exit;
}
示例3: doreplacement
function doreplacement($file, $data)
{
//Produce sample page from template file
/**
$output=array();
foreach(file($file) as $op) {
$output[]=templatereplace($op);
}
return $output;
*/
return (array) templatereplace(file_get_contents($file), array(), $data);
}
示例4: run
function run($args)
{
extract($args);
$redata = compact(array_keys(get_defined_vars()));
$sTemplatePath = $_SESSION['survey_' . $surveyid]['templatepath'];
sendCacheHeaders();
doHeader();
echo templatereplace(file_get_contents($sTemplatePath . "startpage.pstpl"), array(), $redata);
echo "\n\n<!-- JAVASCRIPT FOR CONDITIONAL QUESTIONS -->\n" . "\t<script type='text/javascript'>\n" . "function checkconditions(value, name, type, evt_type)\n" . "\t{\n" . "\t}\n" . "\t</script>\n\n";
echo CHtml::form(array("/survey/index", "sid" => $surveyid), 'post') . "\n";
echo templatereplace(file_get_contents($sTemplatePath . "load.pstpl"), array(), $redata);
//PRESENT OPTIONS SCREEN (Replace with Template Later)
//END
echo "<input type='hidden' name='loadall' value='reload' />\n";
if (isset($clienttoken) && $clienttoken != "") {
echo "<input type='hidden' name='token' value='{$clienttoken}' />\n";
}
echo "</form>";
echo templatereplace(file_get_contents($sTemplatePath . "endpage.pstpl"), array(), $redata);
doFooter();
exit;
}
示例5: display_first_page
/**
* Shows the welcome page, used in group by group and question by question mode
*/
function display_first_page()
{
global $token, $surveyid, $thissurvey, $navigator;
$totalquestions = $_SESSION['survey_' . $surveyid]['totalquestions'];
$clang = Yii::app()->lang;
// Fill some necessary var for template
$navigator = surveymover();
$sitename = Yii::app()->getConfig('sitename');
$languagechanger = makeLanguageChangerSurvey($clang->langcode);
sendCacheHeaders();
doHeader();
LimeExpressionManager::StartProcessingPage();
LimeExpressionManager::StartProcessingGroup(-1, false, $surveyid);
// start on welcome page
$redata = compact(array_keys(get_defined_vars()));
$sTemplatePath = $_SESSION['survey_' . $surveyid]['templatepath'];
echo templatereplace(file_get_contents($sTemplatePath . "startpage.pstpl"), array(), $redata, 'frontend_helper[2757]');
echo CHtml::form(array("/survey/index"), 'post', array('id' => 'limesurvey', 'name' => 'limesurvey', 'autocomplete' => 'off'));
echo "\n\n<!-- START THE SURVEY -->\n";
echo templatereplace(file_get_contents($sTemplatePath . "welcome.pstpl"), array(), $redata, 'frontend_helper[2762]') . "\n";
if ($thissurvey['anonymized'] == "Y") {
echo templatereplace(file_get_contents($sTemplatePath . "/privacy.pstpl"), array(), $redata, 'frontend_helper[2765]') . "\n";
}
echo templatereplace(file_get_contents($sTemplatePath . "navigator.pstpl"), array(), $redata, 'frontend_helper[2767]');
if ($thissurvey['active'] != "Y") {
echo "<p style='text-align:center' class='error'>" . $clang->gT("This survey is currently not active. You will not be able to save your responses.") . "</p>\n";
}
echo "\n<input type='hidden' name='sid' value='{$surveyid}' id='sid' />\n";
if (isset($token) && !empty($token)) {
echo "\n<input type='hidden' name='token' value='{$token}' id='token' />\n";
}
echo "\n<input type='hidden' name='lastgroupname' value='_WELCOME_SCREEN_' id='lastgroupname' />\n";
//This is to ensure consistency with mandatory checks, and new group test
$loadsecurity = returnGlobal('loadsecurity', true);
if (isset($loadsecurity)) {
echo "\n<input type='hidden' name='loadsecurity' value='{$loadsecurity}' id='loadsecurity' />\n";
}
$_SESSION['survey_' . $surveyid]['LEMpostKey'] = mt_rand();
echo "<input type='hidden' name='LEMpostKey' value='{$_SESSION['survey_' . $surveyid]['LEMpostKey']}' id='LEMpostKey' />\n";
echo "<input type='hidden' name='thisstep' id='thisstep' value='0' />\n";
echo "\n</form>\n";
echo templatereplace(file_get_contents($sTemplatePath . "endpage.pstpl"), array(), $redata, 'frontend_helper[2782]');
echo LimeExpressionManager::GetRelevanceAndTailoringJavaScript();
LimeExpressionManager::FinishProcessingPage();
doFooter();
}
示例6: templatereplace
$clang->eT("Question:");
?>
</strong></td><td>
<?php
templatereplace($qrrow['question'], array(), $aReplacementData, 'Unspecified', false, $qid);
echo FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), true);
?>
</td></tr>
<tr><td><strong>
<?php
$clang->eT("Help:");
?>
</strong></td><td>
<?php
if (trim($qrrow['help']) != '') {
templatereplace($qrrow['help'], array(), $aReplacementData, 'Unspecified', false, $qid);
echo FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), true);
}
?>
</td></tr>
<?php
if ($qrrow['preg']) {
?>
<tr ><td><strong>
<?php
$clang->eT("Validation:");
?>
</strong></td><td><?php
echo htmlspecialchars($qrrow['preg']);
?>
</td></tr>
示例7: preview
//.........这里部分代码省略.........
\$('#answer'+name).val(displayVal);
if (typeof evt_type === 'undefined')
{
evt_type = 'onchange';
}
checkconditions(newval, name, type, evt_type);
}
function checkconditions(value, name, type, evt_type)
{
if (typeof evt_type === 'undefined')
{
evt_type = 'onchange';
}
if (type == 'radio' || type == 'select-one')
{
var hiddenformname='java'+name;
document.getElementById(hiddenformname).value=value;
}
else if (type == 'checkbox')
{
if (document.getElementById('answer'+name).checked)
{
\$('#java'+name).val('Y');
} else
{
\$('#java'+name).val('');
}
}
else if (type == 'text' && name.match(/other\$/) && typeof document.getElementById('java'+name) !== 'undefined' && document.getElementById('java'+name) != null)
{
\$('#java'+name).val(value);
}
ExprMgr_process_relevance_and_tailoring(evt_type,name,type);
{$showQuestion}
}
\$(document).ready(function() {
{$showQuestion}
});
\$(document).change(function() {
{$showQuestion}
});
\$(document).bind('keydown',function(e) {
if (e.keyCode == 9) {
{$showQuestion}
return true;
}
return true;
});
// -->
</script>
EOD;
$answer = $answers[0][1];
// $help = $answers[0][2];
$qinfo = LimeExpressionManager::GetQuestionStatus($qid);
$help = $qinfo['info']['help'];
$question = $answers[0][0];
$question['code'] = $answers[0][5];
$question['class'] = getQuestionClass($qrows['type']);
$question['essentials'] = 'id="question' . $qrows['qid'] . '"';
$question['sgq'] = $ia[1];
$question['aid'] = 'unknown';
$question['sqid'] = 'unknown';
if ($qrows['mandatory'] == 'Y') {
$question['man_class'] = ' mandatory';
} else {
$question['man_class'] = '';
}
$redata = compact(array_keys(get_defined_vars()));
$content = templatereplace(file_get_contents("{$thistpl}/startpage.pstpl"), array(), $redata);
$content .= CHtml::form('index.php', 'post', array('id' => "limesurvey", 'name' => "limesurvey", 'autocomplete' => 'off'));
$content .= templatereplace(file_get_contents("{$thistpl}/startgroup.pstpl"), array(), $redata);
$question_template = file_get_contents("{$thistpl}/question.pstpl");
// the following has been added for backwards compatiblity.
if (substr_count($question_template, '{QUESTION_ESSENTIALS}') > 0) {
// LS 1.87 and newer templates
$content .= "\n" . templatereplace($question_template, array(), $redata, 'Unspecified', false, $qid) . "\n";
} else {
// LS 1.86 and older templates
$content .= '<div ' . $question['essentials'] . ' class="' . $question['class'] . $question['man_class'] . '">';
$content .= "\n" . templatereplace($question_template, array(), $redata, 'Unspecified', false, $qid) . "\n";
$content .= "\n\t</div>\n";
}
$content .= templatereplace(file_get_contents("{$thistpl}/endgroup.pstpl"), array(), $redata) . $dummy_js;
LimeExpressionManager::FinishProcessingGroup();
$content .= LimeExpressionManager::GetRelevanceAndTailoringJavaScript();
$content .= '<p> </form>';
$content .= templatereplace(file_get_contents("{$thistpl}/endpage.pstpl"), array(), $redata);
LimeExpressionManager::FinishProcessingPage();
echo $content;
if ($LEMdebugLevel >= 1) {
echo LimeExpressionManager::GetDebugTimingMessage();
}
if ($LEMdebugLevel >= 2) {
echo "<table><tr><td align='left'><b>Group/Question Validation Results:</b>" . $moveResult['message'] . "</td></tr></table>\n";
}
echo "</html>\n";
exit;
}
示例8: templatereplace
<?php
templatereplace(flattenText($surveyinfo['surveyls_welcometext']));
echo LimeExpressionManager::GetLastPrettyPrintExpression();
?>
</td>
</tr>
<tr>
<td>
<strong><?php
$clang->eT("End message:");
?>
</strong>
</td>
<td>
<?php
templatereplace(flattenText($surveyinfo['surveyls_endtext']));
echo LimeExpressionManager::GetLastPrettyPrintExpression();
?>
</td>
</tr>
<tr>
<td>
<strong><?php
$clang->eT("Administrator:");
?>
</strong>
</td>
<td>
<?php
echo flattenText("{$surveyinfo['admin']} ({$surveyinfo['adminemail']})");
?>
示例9: _renderHtml
private function _renderHtml($html, $thistpl, $aSurveyInfo)
{
sendCacheHeaders();
doHeader();
$aSupportData = array('thissurvey' => $aSurveyInfo);
echo templatereplace(file_get_contents($thistpl . DIRECTORY_SEPARATOR . 'startpage.pstpl'), array(), $aSupportData);
$aData['html'] = $html;
$aData['thistpl'] = $thistpl;
$this->render('/opt_view', $aData);
echo templatereplace(file_get_contents($thistpl . DIRECTORY_SEPARATOR . 'endpage.pstpl'), array(), $aSupportData);
doFooter();
}
示例10: array
echo $assess['minimum'];
?>
</td>
<td><?php
echo $assess['maximum'];
?>
</td>
<td><?php
$aReplacementData = array();
templatereplace($assess['name'], array(), $aReplacementData, 'Unspecified', false, $assess['sid']);
echo FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), true);
?>
</td>
<td><?php
$aReplacementData = array();
templatereplace($assess['message'], array(), $aReplacementData, 'Unspecified', false, $assess['sid']);
echo FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), true);
?>
</td>
</tr>
<?php
}
?>
</tbody></table>
<?php
if (Permission::model()->hasSurveyPermission($surveyid, 'assessments', 'update') && $actionvalue == "assessmentupdate" || Permission::model()->hasSurveyPermission($surveyid, 'assessments', 'create') && $actionvalue == "assessmentadd") {
?>
<br />
<?php
示例11: _initialise
//.........这里部分代码省略.........
}
$myoutput[] = $this->getController()->render('/admin/templates/templateeditor_question_meta_view', array('clang' => $clang), true);
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/startpage.pstpl", $aData));
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/survey.pstpl", $aData));
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/startgroup.pstpl", $aData));
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/groupdescription.pstpl", $aData));
$question = array('all' => $clang->gT("How many roads must a man walk down?"), 'text' => $clang->gT("How many roads must a man walk down?"), 'code' => '1a', 'help' => 'helpful text', 'mandatory' => $clang->gT("*"), 'man_class' => ' mandatory', 'man_message' => '', 'valid_message' => '', 'file_valid_message' => '', 'essentials' => 'id="question1"', 'class' => 'list-radio', 'input_error_class' => '', 'number' => '1', 'type' => 'L');
$aData['question'] = $question;
$answer = $this->getController()->render('/admin/templates/templateeditor_question_answer_view', array('clang' => $clang), true);
$aData['answer'] = $answer;
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/question.pstpl", $aData));
$answer = $this->getController()->render('/admin/templates/templateeditor_question_answer_view', array('alt' => true, 'clang' => $clang), true);
$aData['answer'] = $answer;
$question = array('all' => $clang->gT("Please explain something in detail:"), 'text' => $clang->gT('Please explain something in detail:'), 'code' => '2a', 'help' => '', 'mandatory' => '', 'man_message' => '', 'valid_message' => '', 'file_valid_message' => '', 'essentials' => 'id="question2"', 'class' => 'text-long', 'man_class' => 'mandatory', 'input_error_class' => '', 'number' => '2', 'type' => 'T');
$aData['question'] = $question;
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/question.pstpl", $aData));
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/endgroup.pstpl", $aData));
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/navigator.pstpl", $aData));
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/endpage.pstpl", $aData));
break;
case 'welcome':
unset($files);
$myoutput[] = "";
foreach ($Welcome as $qs) {
$files[] = array("name" => $qs);
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/{$qs}", $aData));
}
break;
case 'register':
unset($files);
foreach ($Register as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/survey.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/register.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData);
$myoutput[] = "\n";
break;
case 'save':
unset($files);
foreach ($Save as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/save.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData);
$myoutput[] = "\n";
break;
case 'load':
unset($files);
foreach ($Load as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/load.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData);
$myoutput[] = "\n";
break;
case 'clearall':
unset($files);
foreach ($Clearall as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/clearall.pstpl"), array(), $aData);
示例12: getHtmlExpression
/**
* Get the complete HTML from a string
* @param string $sExpression : the string to parse
* @param array $aReplacement : optionnal array of replacemement
* @param string $sDebugSource : optionnal debug source (for templatereplace)
* @uses ExpressionValidate::$iSurveyId
* @uses ExpressionValidate::$sLang
*
* @author Denis Chenu
* @version 1.0
*/
private function getHtmlExpression($sExpression, $aReplacement = array(), $sDebugSource = __CLASS__)
{
$LEM = LimeExpressionManager::singleton();
$LEM::SetDirtyFlag();
// Not sure it's needed
$LEM::SetPreviewMode('logic');
$aReData = array();
if ($this->iSurveyId) {
$LEM::StartSurvey($this->iSurveyId, 'survey', array('hyperlinkSyntaxHighlighting' => true));
// replace QCODE
$aReData['thissurvey'] = getSurveyInfo($this->iSurveyId, $this->sLang);
}
// TODO : Find error in class name, style etc ....
// need: templatereplace without any filter and find if there are error but $bHaveError=$LEM->em->HasErrors() is Private
$oFilter = new CHtmlPurifier();
templatereplace($oFilter->purify(viewHelper::filterScript($sExpression)), $aReplacement, $aReData, $sDebugSource, false, null, array(), true);
return $LEM::GetLastPrettyPrintExpression();
}
示例13: doHeader
<?php
doHeader();
echo templatereplace(file_get_contents(getTemplatePath(validateTemplateDir($sTemplatePath))."/startpage.pstpl"));
?>
<script type='text/javascript'>
var graphUrl="<?php echo Yii::app()->getController()->createUrl("admin/statistics/graph"); ?>";
</script>
<div id='statsContainer'>
<div id='statsHeader'>
<div class='statsSurveyTitle'><?php echo $thisSurveyTitle; ?></div>
<div class='statsNumRecords'><?php echo $clang->gT("Total records in survey")." : $totalrecords"; ?></div>
</div>
<?php if (isset($statisticsoutput) && $statisticsoutput) { echo $statisticsoutput; } ?><br />
</div>
<?php
echo templatereplace(file_get_contents(getTemplatePath(validateTemplateDir($sTemplatePath))."/endpage.pstpl"));
?>
示例14: templatereplace
?>
</td>
</tr>
<?php
if (trim($grow['grelevance']) != '') {
?>
<tr>
<td><strong>
<?php
$clang->eT("Relevance:");
?>
</strong>
</td>
<td>
<?php
templatereplace('{' . $grow['grelevance'] . '}');
echo LimeExpressionManager::GetLastPrettyPrintExpression();
?>
</td>
</tr>
<?php
}
if (trim($grow['randomization_group']) != '') {
?>
<tr>
<td><?php
$clang->eT("Randomization group:");
?>
</td><td><?php
echo $grow['randomization_group'];
?>
示例15: ShowSurveyLogicFile
/**
* Create HTML view of the survey, showing everything that uses EM
* @param <type> $sid
* @param <type> $gid
* @param <type> $qid
*/
public static function ShowSurveyLogicFile($sid, $gid = NULL, $qid = NULL, $LEMdebugLevel = 0, $assessments = false)
{
// Title
// Welcome
// G1, name, relevance, text
// *Q1, name [type], relevance [validation], text, help, default, help_msg
// SQ1, name [scale], relevance [validation], text
// A1, code, assessment_value, text
// End Message
$LEM =& LimeExpressionManager::singleton();
$LEM->sPreviewMode = 'logic';
$aSurveyInfo = getSurveyInfo($sid, $_SESSION['LEMlang']);
$allErrors = array();
$warnings = 0;
$surveyOptions = array('assessments' => $aSurveyInfo['assessments'] == 'Y', 'hyperlinkSyntaxHighlighting' => true);
$varNamesUsed = array();
// keeps track of whether variables have been declared
if (!is_null($qid)) {
$surveyMode = 'question';
LimeExpressionManager::StartSurvey($sid, 'question', $surveyOptions, false, $LEMdebugLevel);
$qseq = LimeExpressionManager::GetQuestionSeq($qid);
$moveResult = LimeExpressionManager::JumpTo($qseq + 1, true, false, true);
} else {
if (!is_null($gid)) {
$surveyMode = 'group';
LimeExpressionManager::StartSurvey($sid, 'group', $surveyOptions, false, $LEMdebugLevel);
$gseq = LimeExpressionManager::GetGroupSeq($gid);
$moveResult = LimeExpressionManager::JumpTo($gseq + 1, true, false, true);
} else {
$surveyMode = 'survey';
LimeExpressionManager::StartSurvey($sid, 'survey', $surveyOptions, false, $LEMdebugLevel);
$moveResult = LimeExpressionManager::NavigateForwards();
}
}
$qtypes = getQuestionTypeList('', 'array');
if (is_null($moveResult) || is_null($LEM->currentQset) || count($LEM->currentQset) == 0) {
return array('errors' => 1, 'html' => sprintf($LEM->gT('Invalid question - probably missing sub-questions or language-specific settings for language %s'), $_SESSION['LEMlang']));
}
$surveyname = templatereplace('{SURVEYNAME}', array('SURVEYNAME' => $aSurveyInfo['surveyls_title']));
$out = '<div id="showlogicfilediv" ><H3>' . $LEM->gT('Logic File for Survey # ') . '[' . $LEM->sid . "]: {$surveyname}</H3>\n";
$out .= "<table class='table' id='logicfiletable'>";
if (is_null($gid) && is_null($qid)) {
if ($aSurveyInfo['surveyls_description'] != '') {
$LEM->ProcessString($aSurveyInfo['surveyls_description'], 0);
$sPrint = $LEM->GetLastPrettyPrintExpression();
$errClass = $LEM->em->HasErrors() ? 'LEMerror' : '';
$out .= "<tr class='LEMgroup {$errClass}'><td colspan=2>" . $LEM->gT("Description:") . "</td><td colspan=2>" . $sPrint . "</td></tr>";
}
if ($aSurveyInfo['surveyls_welcometext'] != '') {
$LEM->ProcessString($aSurveyInfo['surveyls_welcometext'], 0);
$sPrint = $LEM->GetLastPrettyPrintExpression();
$errClass = $LEM->em->HasErrors() ? 'LEMerror' : '';
$out .= "<tr class='LEMgroup {$errClass}'><td colspan=2>" . $LEM->gT("Welcome:") . "</td><td colspan=2>" . $sPrint . "</td></tr>";
}
if ($aSurveyInfo['surveyls_endtext'] != '') {
$LEM->ProcessString($aSurveyInfo['surveyls_endtext']);
$sPrint = $LEM->GetLastPrettyPrintExpression();
$errClass = $LEM->em->HasErrors() ? 'LEMerror' : '';
$out .= "<tr class='LEMgroup {$errClass}'><td colspan=2>" . $LEM->gT("End message:") . "</td><td colspan=2>" . $sPrint . "</td></tr>";
}
if ($aSurveyInfo['surveyls_url'] != '') {
$LEM->ProcessString($aSurveyInfo['surveyls_urldescription'] . " - " . $aSurveyInfo['surveyls_url']);
$sPrint = $LEM->GetLastPrettyPrintExpression();
$errClass = $LEM->em->HasErrors() ? 'LEMerror' : '';
$out .= "<tr class='LEMgroup {$errClass}'><td colspan=2>" . $LEM->gT("End URL:") . "</td><td colspan=2>" . $sPrint . "</td></tr>";
}
}
$out .= "<tr><th>#</th><th>" . $LEM->gT('Name [ID]') . "</th><th>" . $LEM->gT('Relevance [Validation] (Default value)') . "</th><th>" . $LEM->gT('Text [Help] (Tip)') . "</th></tr>\n";
$_gseq = -1;
foreach ($LEM->currentQset as $q) {
$gseq = $q['info']['gseq'];
$gid = $q['info']['gid'];
$qid = $q['info']['qid'];
$qseq = $q['info']['qseq'];
$errorCount = 0;
//////
// SHOW GROUP-LEVEL INFO
//////
if ($gseq != $_gseq) {
$LEM->ParseResultCache = array();
// reset for each group so get proper color coding?
$_gseq = $gseq;
$ginfo = $LEM->gseq2info[$gseq];
$grelevance = '{' . ($ginfo['grelevance'] == '' ? 1 : $ginfo['grelevance']) . '}';
$gtext = trim($ginfo['description']) == '' ? ' ' : $ginfo['description'];
$editlink = Yii::app()->getController()->createUrl('admin/questiongroups/sa/view/surveyid/' . $LEM->sid . '/gid/' . $gid);
$groupRow = "<tr class='LEMgroup'>" . "<td>G-{$gseq}</td>" . "<td><b>" . $ginfo['group_name'] . "</b><br />[<a target='_blank' href='{$editlink}'>GID " . $gid . "</a>]</td>" . "<td>" . $grelevance . "</td>" . "<td>" . $gtext . "</td>" . "</tr>\n";
$LEM->ProcessString($groupRow, $qid, NULL, false, 1, 1, false, false);
$out .= $LEM->GetLastPrettyPrintExpression();
if ($LEM->em->HasErrors()) {
++$errorCount;
}
}
//////
//.........这里部分代码省略.........