本文整理汇总了PHP中viewHelper::filterScript方法的典型用法代码示例。如果您正苦于以下问题:PHP viewHelper::filterScript方法的具体用法?PHP viewHelper::filterScript怎么用?PHP viewHelper::filterScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类viewHelper
的用法示例。
在下文中一共展示了viewHelper::filterScript方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: ShowSurveyLogicFile
//.........这里部分代码省略.........
$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;
}
}
//////
// SHOW QUESTION-LEVEL INFO
//////
$mandatory = $q['info']['mandatory'] == 'Y' ? "<span class='mandatory'>*</span>" : '';
$type = $q['info']['type'];
$typedesc = $qtypes[$type]['description'];
$sgqas = explode('|', $q['sgqa']);
if (count($sgqas) == 1 && !is_null($q['info']['default'])) {
$LEM->ProcessString($q['info']['default'], $qid, NULL, false, 1, 1, false, false);
// Default value is Y or answer code or go to input/textarea, then we can filter it
$_default = $LEM->GetLastPrettyPrintExpression();
if ($LEM->em->HasErrors()) {
++$errorCount;
}
$default = '<br />(' . $LEM->gT('Default:') . ' ' . viewHelper::filterScript($_default) . ')';
} else {
$default = '';
}
$qtext = $q['info']['qtext'] != '' ? $q['info']['qtext'] : ' ';
$help = $q['info']['help'] != '' ? '<hr/>[' . $LEM->gT("Help:") . ' ' . $q['info']['help'] . ']' : '';
$prettyValidTip = $q['prettyValidTip'] == '' ? '' : '<hr/>(' . $LEM->gT("Tip:") . ' ' . $q['prettyValidTip'] . ')';
//////
// SHOW QUESTION ATTRIBUTES THAT ARE PROCESSED BY EM
//////
$attrTable = '';
$attrs = isset($LEM->qattr[$qid]) ? $LEM->qattr[$qid] : array();
if (isset($LEM->q2subqInfo[$qid]['preg'])) {
$attrs['regex_validation'] = $LEM->q2subqInfo[$qid]['preg'];
}
if (isset($LEM->questionSeq2relevance[$qseq]['other'])) {
$attrs['other'] = $LEM->questionSeq2relevance[$qseq]['other'];
}
if (count($attrs) > 0) {
$attrTable = "<table class='table' id='logicfileattributetable'><tr><th>" . $LEM->gT("Question attribute") . "</th><th>" . $LEM->gT("Value") . "</th></tr>\n";
$count = 0;
foreach ($attrs as $key => $value) {
if (is_null($value) || trim($value) == '') {
continue;
}
switch ($key) {
// @todo: Rather compares the current attribute value to the defaults in the question attributes array to decide which ones should show (only the ones that are non-standard)
default:
case 'exclude_all_others':
case 'exclude_all_others_auto':
case 'hidden':
if ($value == false || $value == '0') {
$value = NULL;