本文整理汇总了PHP中templatereplace函数的典型用法代码示例。如果您正苦于以下问题:PHP templatereplace函数的具体用法?PHP templatereplace怎么用?PHP templatereplace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了templatereplace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:26,代码来源:Save.php
示例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;
}
开发者ID:ddrmoscow,项目名称:queXS,代码行数:30,代码来源:save.php
示例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);
}
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:12,代码来源:template_helper.php
示例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;
}
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:22,代码来源:Load_answers.php
示例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();
}
开发者ID:elcharlygraf,项目名称:Encuesta-YiiFramework,代码行数:49,代码来源:frontend_helper.php
示例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>
开发者ID:pmaonline,项目名称:limesurvey-quickstart,代码行数:31,代码来源:questionbar_view.php
示例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;
}
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:101,代码来源:question.php
示例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']})");
?>
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:31,代码来源:surveySummary_view.php
示例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();
}
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:12,代码来源:OptinController.php
示例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
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:31,代码来源:assessments_view.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);
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:67,代码来源:templates.php
示例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();
}
开发者ID:withhope,项目名称:HIT-Survey,代码行数:29,代码来源:ExpressionValidate.php
示例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"));
?>
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:17,代码来源:statistics_user_view.php
示例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'];
?>
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:31,代码来源:questiongroupbar_view.php
示例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;
}
}
//////
//.........这里部分代码省略.........
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:101,代码来源:em_manager_helper.php
示例16: getTemplateURL
$data['templateurl'] = getTemplateURL(Yii::app()->getConfig("defaulttemplate")) . "/";
$data['templatename'] = Yii::app()->getConfig("defaulttemplate");
$data['sitename'] = Yii::app()->getConfig("sitename");
$data['languagechanger'] = makeLanguageChanger(App()->lang->langcode);
//A nice exit
sendCacheHeaders();
doHeader();
// Javascript Var
$aLSJavascriptVar = array();
$aLSJavascriptVar['bFixNumAuto'] = (int) (bool) Yii::app()->getConfig('bFixNumAuto', 1);
$aLSJavascriptVar['bNumRealValue'] = (int) (bool) Yii::app()->getConfig('bNumRealValue', 0);
if (isset($thissurvey['surveyls_numberformat'])) {
$radix = getRadixPointData($thissurvey['surveyls_numberformat']);
} else {
$aLangData = getLanguageData();
$radix = getRadixPointData($aLangData[Yii::app()->getConfig('defaultlang')]['radixpoint']);
// or $clang->langcode . defaultlang ensure it's same for each language ?
}
$aLSJavascriptVar['sLEMradix'] = $radix['separator'];
$sLSJavascriptVar = "LSvar=" . json_encode($aLSJavascriptVar);
App()->clientScript->registerScript('sLSJavascriptVar', $sLSJavascriptVar, CClientScript::POS_HEAD);
App()->clientScript->registerScript('setJsVar', "setJsVar();", CClientScript::POS_BEGIN);
// Ensure all js var is set before rendering the page (User can click before $.ready)
App()->getClientScript()->registerPackage('jqueryui');
App()->getClientScript()->registerPackage('jquery-touch-punch');
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts') . "survey_runtime.js");
useFirebug();
echo templatereplace(file_get_contents(getTemplatePath(Yii::app()->getConfig("defaulttemplate")) . "/startpage.pstpl"), array(), $data, 'survey[' . __LINE__ . ']');
echo templatereplace(file_get_contents(getTemplatePath(Yii::app()->getConfig("defaulttemplate")) . "/surveylist.pstpl"), array(), $data, 'survey[' . __LINE__ . ']');
echo templatereplace(file_get_contents(getTemplatePath(Yii::app()->getConfig("defaulttemplate")) . "/endpage.pstpl"), array(), $data, 'survey[' . __LINE__ . ']');
doFooter();
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:31,代码来源:publicSurveyList.php
示例17: _renderHtml
private function _renderHtml($html, $thistpl, $aSurveyInfo)
{
sendCacheHeaders();
doHeader();
$aSupportData = array('thissurvey' => $aSurveyInfo);
// $oTemplate is a global variable defined in controller/survey/index
global $oTemplate;
$sTemplatePath = $oTemplate->path;
$thistpl = $oTemplate->viewPath;
echo templatereplace(file_get_contents($thistpl . 'startpage.pstpl'), array(), $aSupportData);
$aData['html'] = $html;
$aData['thistpl'] = $thistpl;
$this->render('/opt_view', $aData);
echo templatereplace(file_get_contents($thistpl . 'endpage.pstpl'), array(), $aSupportData);
doFooter();
}
开发者ID:BertHankes,项目名称:LimeSurvey,代码行数:16,代码来源:OptoutController.php
示例18: sanitize_html_string
</em>
</span>
</div>
<!-- Other questions -->
<?php else: ?>
<a href="<?php echo $this->createUrl("/admin/questions/sa/view/surveyid/$iSurveyId/gid/".$aGroup->gid."/qid/".$question->qid); ?>" class="question-link" >
<span class="question-collapse-title">
<span class="glyphicon glyphicon-list"></span>
<strong>
<?php echo sanitize_html_string(strip_tags($question->title));?>
</strong>
<br/>
<em>
<?php
templatereplace($question->question, array(),$aReplacementData,'Unspecified', false ,$question->qid);
echo viewHelper::stripTagsEM(LimeExpressionManager::GetLastPrettyPrintExpression());
?>
</em>
</span>
</a>
<?php endif; ?>
<?php endif; ?>
<?php endforeach;?>
<?php else:?>
<a href="" onclick="event.preventDefault();" style="cursor: default;">
<?php eT('There are no questions in this group.');?>
</a>
<?php endif;?>
</div>
</div>
开发者ID:CSCI-462-01-2016,项目名称:LimeSurvey,代码行数:31,代码来源:_question_explorer.php
示例19: templatereplace
<?php
global $oTemplate;
echo templatereplace(file_get_contents($oTemplate->viewPath . "startpage.pstpl"), array(), $aData);
echo templatereplace(file_get_contents($oTemplate->viewPath . "survey.pstpl"), array(), $aData);
echo $content;
echo templatereplace(file_get_contents($oTemplate->viewPath . "endpage.pstpl"), array(), $aData);
开发者ID:BertHankes,项目名称:LimeSurvey |
请发表评论