本文整理汇总了PHP中viewHelper::purified方法的典型用法代码示例。如果您正苦于以下问题:PHP viewHelper::purified方法的具体用法?PHP viewHelper::purified怎么用?PHP viewHelper::purified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类viewHelper
的用法示例。
在下文中一共展示了viewHelper::purified方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 = viewHelper::stripTagsEM(templatereplace('{SURVEYNAME}', array('SURVEYNAME' => $aSurveyInfo['surveyls_title'])));
$out = '<div id="showlogicfilediv" class="table-responsive"><h3>' . $LEM->gT('Logic File for Survey # ') . '[' . $LEM->sid . "]: {$surveyname}</h3>\n";
$out .= "<table id='logicfiletable' class='table table-bordered'>";
if (is_null($gid) && is_null($qid)) {
if ($aSurveyInfo['surveyls_description'] != '') {
$LEM->ProcessString($aSurveyInfo['surveyls_description'], 0);
$sPrint = viewHelper::purified(viewHelper::filterScript($LEM->GetLastPrettyPrintExpression()));
$errClass = $LEM->em->HasErrors() ? 'danger' : '';
$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 = viewHelper::purified(viewHelper::filterScript($LEM->GetLastPrettyPrintExpression()));
$errClass = $LEM->em->HasErrors() ? 'danger' : '';
$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 = viewHelper::purified(viewHelper::filterScript($LEM->GetLastPrettyPrintExpression()));
$errClass = $LEM->em->HasErrors() ? 'danger' : '';
$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 = viewHelper::purified($LEM->GetLastPrettyPrintExpression());
$errClass = $LEM->em->HasErrors() ? 'danger' : '';
$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) {
$bGroupHaveError = false;
$errClass = '';
$LEM->ParseResultCache = array();
// reset for each group so get proper color coding?
$_gseq = $gseq;
$ginfo = $LEM->gseq2info[$gseq];
$sGroupRelevance = '{' . ($ginfo['grelevance'] == '' ? 1 : $ginfo['grelevance']) . '}';
$LEM->ProcessString($sGroupRelevance, $qid, NULL, false, 1, 1, false, false);
$bGroupHaveError = $bGroupHaveError || $LEM->em->HasErrors();
$sGroupRelevance = viewHelper::stripTagsEM($LEM->GetLastPrettyPrintExpression());
$sGroupText = trim($ginfo['description']) == '' ? ' ' : $ginfo['description'];
$LEM->ProcessString($sGroupText, $qid, NULL, false, 1, 1, false, false);
$bGroupHaveError = $bGroupHaveError || $LEM->em->HasErrors();
$sGroupText = viewHelper::purified(viewHelper::filterScript($LEM->GetLastPrettyPrintExpression()));
$editlink = Yii::app()->getController()->createUrl('admin/survey/sa/view/surveyid/' . $LEM->sid . '/gid/' . $gid);
//.........这里部分代码省略.........