本文整理汇总了PHP中HTMLEscape函数的典型用法代码示例。如果您正苦于以下问题:PHP HTMLEscape函数的具体用法?PHP HTMLEscape怎么用?PHP HTMLEscape使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HTMLEscape函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: templateoptions
function templateoptions($optionarray, $selectedvalue)
{
$return = '';
foreach ($optionarray as $arkey => $arvalue) {
$return .= "<option value='" . HTMLEscape($arkey) . "'";
if ($arkey == $selectedvalue) {
$return .= " selected='selected'";
}
$return .= '>' . HTMLEscape($arkey) . "</option>\n";
}
return $return;
}
示例2: quoteText
/**
* Quotes a translation according to purpose
* if sEscapeMode is null, we use HTML method because probably we had to specify null as sEscapeMode upstream
*
* @param mixed $sText Text to quote
* @param string $sEscapeMode Optional - One of the values 'html','js' or 'unescaped' - defaults to 'html'
*/
function quoteText($sText, $sEscapeMode = 'html')
{
if ($sEscapeMode === null) {
$sEscapeMode = 'html';
}
switch ($sEscapeMode) {
case 'html':
return HTMLEscape($sText);
break;
case 'js':
return javascriptEscape($sText);
break;
case 'unescaped':
return $sText;
break;
default:
return "Unsupported EscapeMode in gT method";
break;
}
}
示例3: do_array_multiflexi
//.........这里部分代码省略.........
}
$myfname = $ia[1] . $ansrow['title'];
$answertext = $ansrow['question'];
$answertextsave = $answertext;
/* Check if this item has not been answered: the 'notanswered' variable must be an array,
containing a list of unanswered questions, the current question must be in the array,
and there must be no answer available for the item in this session. */
if ($ia[6] == 'Y' && is_array($notanswered)) {
//Go through each labelcode and check for a missing answer! If any are found, highlight this line
$emptyresult = 0;
foreach ($labelcode as $ld) {
$myfname2 = $myfname . '_' . $ld;
if (array_search($myfname2, $notanswered) !== FALSE && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2] == "") {
$emptyresult = 1;
}
}
if ($emptyresult == 1) {
$answertext = '<span class="errormandatory">' . $answertext . '</span>';
}
}
// Get array_filter stuff
$trbc = alternation($trbc, 'row');
list($htmltbody2, $hiddenfield) = return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname, "tr", "{$trbc} subquestions-list questions-list {$answertypeclass}-list");
$answer .= $htmltbody2;
if (strpos($answertext, '|')) {
$answertext = substr($answertext, 0, strpos($answertext, '|'));
}
$answer .= "\t<th class=\"answertext\" width=\"{$answerwidth}%\">\n" . "{$answertext}\n" . $hiddenfield . "<input type=\"hidden\" name=\"java{$myfname}\" id=\"java{$myfname}\" value=\"";
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname])) {
$answer .= $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname];
}
$answer .= "\" />\n\t</th>\n";
$first_hidden_field = '';
$thiskey = 0;
foreach ($labelcode as $ld) {
if ($checkboxlayout == false) {
$myfname2 = $myfname . "_{$ld}";
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2])) {
$myfname2_java_value = " value=\"{$_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2]}\" ";
} else {
$myfname2_java_value = "";
}
$answer .= "\t<td class=\"answer_cell_00{$ld} question-item answer-item {$answertypeclass}-item {$extraclass}\">\n" . "\t<input type=\"hidden\" name=\"java{$myfname2}\" id=\"java{$myfname2}\" {$myfname2_java_value} />\n" . "<label class=\"hide read\" for=\"answer{$myfname2}\">{$labelans[$thiskey]}</label>\n";
$sSeparator = getRadixPointData($thissurvey['surveyls_numberformat']);
$sSeparator = $sSeparator['separator'];
if ($inputboxlayout == false) {
$answer .= "\t<select class=\"multiflexiselect\" name=\"{$myfname2}\" id=\"answer{$myfname2}\" title=\"" . HTMLEscape($labelans[$thiskey]) . '"' . " onchange=\"{$checkconditionFunction}(this.value, this.name, this.type)\">\n" . "<option value=\"\">" . $clang->gT('...') . "</option>\n";
for ($ii = $minvalue; $reverse ? $ii >= $maxvalue : $ii <= $maxvalue; $ii += $stepvalue) {
$answer .= '<option value="' . str_replace('.', $sSeparator, $ii) . '"';
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2] == $ii) {
$answer .= SELECTED;
}
$answer .= ">" . str_replace('.', $sSeparator, $ii) . "</option>\n";
}
$answer .= "\t</select>\n";
} elseif ($inputboxlayout == true) {
$answer .= "\t<input type='text' class=\"multiflexitext text {$kpclass}\" name=\"{$myfname2}\" id=\"answer{$myfname2}\" {$maxlength} size=5 title=\"" . HTMLEscape($labelans[$thiskey]) . '"' . " onkeyup=\"{$checkconditionFunction}(this.value, this.name, this.type)\"" . " value=\"";
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2]) && is_numeric($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2])) {
$answer .= str_replace('.', $sSeparator, $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2]);
}
$answer .= "\" />\n";
}
$answer .= "\t</td>\n";
$inputnames[] = $myfname2;
$thiskey++;
} else {
$myfname2 = $myfname . "_{$ld}";
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname2] == '1') {
$myvalue = '1';
$setmyvalue = CHECKED;
} else {
$myvalue = '';
$setmyvalue = '';
}
$answer .= "\t<td class=\"answer_cell_00{$ld} question-item answer-item {$answertypeclass}-item\">\n" . "\t<input type=\"hidden\" name=\"java{$myfname2}\" id=\"java{$myfname2}\" value=\"{$myvalue}\"/>\n" . "\t<input type=\"hidden\" name=\"{$myfname2}\" id=\"answer{$myfname2}\" value=\"{$myvalue}\" />\n";
$answer .= "\t<input type=\"checkbox\" class=\"checkbox {$extraclass}\" name=\"cbox_{$myfname2}\" id=\"cbox_{$myfname2}\" {$setmyvalue} " . " onclick=\"cancelBubbleThis(event); " . " aelt=document.getElementById('answer{$myfname2}');" . " jelt=document.getElementById('java{$myfname2}');" . " if(this.checked) {" . " aelt.value=1;jelt.value=1;{$checkconditionFunction}(1,'{$myfname2}',aelt.type);" . " } else {" . " aelt.value='';jelt.value='';{$checkconditionFunction}('','{$myfname2}',aelt.type);" . " }; return true;\" " . " />\n";
$answer .= "<label class=\"hide read\" for=\"cbox_{$myfname2}\">{$labelans[$thiskey]}</label>\n";
$inputnames[] = $myfname2;
// $answer .= "</label>\n"
$answer .= "" . "\t</td>\n";
$thiskey++;
}
}
if (strpos($answertextsave, '|')) {
$answertext = substr($answertextsave, strpos($answertextsave, '|') + 1);
$answer .= "\t<td class=\"answertextright\" style='text-align:left;' width=\"{$answerwidth}%\">{$answertext}</td>\n";
} elseif ($right_exists) {
$answer .= "\t<td class=\"answertextright\" style='text-align:left;' width=\"{$answerwidth}%\"> </td>\n";
}
$answer .= "</tr>\n";
//IF a MULTIPLE of flexi-redisplay figure, repeat the headings
$fn++;
}
$answer .= "\t</tbody>\n</table>\n";
} else {
$answer = "\n<p class=\"error\">" . $clang->gT("Error: There are no answer options for this question and/or they don't exist in this language.") . "</p>\n";
$inputnames = '';
}
return array($answer, $inputnames);
}
示例4: index
//.........这里部分代码省略.........
$aConditionsMerged[] = $arow;
}
foreach ($aConditionsMerged as $rows) {
if ($rows['method'] == "") {
$rows['method'] = "==";
}
//Fill in the empty method from previous versions
$markcidstyle = "oddrow";
if (array_search($rows['cid'], $markcidarray) !== FALSE) {
// This is the style used when the condition editor is called
// in order to check which conditions prevent a question deletion
$markcidstyle = "markedrow";
}
if ($subaction == "editthiscondition" && isset($p_cid) && $rows['cid'] === $p_cid) {
// Style used when editing a condition
$markcidstyle = "editedrow";
}
if (isset($currentfield) && $currentfield != $rows['cfieldname']) {
$aViewUrls['output'] .= "<tr class='evenrow'>\n" . "\t<td colspan='2'>\n" . "<span><strong>" . $clang->gT("and") . "</strong></span></td></tr>";
} elseif (isset($currentfield)) {
$aViewUrls['output'] .= "<tr class='evenrow'>\n" . "\t<td colspan='2'>\n" . "<span><strong>" . $clang->gT("or") . "</strong></span></td></tr>";
}
$aViewUrls['output'] .= "\t<tr class='{$markcidstyle}'>\n" . "\t<td colspan='2'>" . CHtml::form(array("/admin/conditions/sa/index/subaction/{$subaction}/surveyid/{$iSurveyID}/gid/{$gid}/qid/{$qid}/"), 'post', array('id' => "conditionaction{$rows['cid']}", 'name' => "conditionaction{$rows['cid']}")) . "<table>\n" . "\t<tr>\n";
if ($subaction == "copyconditionsform" || $subaction == "copyconditions") {
$aViewUrls['output'] .= "<td> </td>" . "<td>\n" . "\t<input type='checkbox' name='aConditionFromScenario{$scenarionr['scenario']}' id='cbox{$rows['cid']}' value='{$rows['cid']}' checked='checked'/>\n" . "</td>\n";
}
$aViewUrls['output'] .= "" . "<td>\n" . "\t<span>\n";
$leftOperandType = 'unknown';
// prevquestion, tokenattr
if ($thissurvey['anonymized'] != 'Y' && preg_match('/^{TOKEN:([^}]*)}$/', $rows['cfieldname'], $extractedTokenAttr) > 0) {
$leftOperandType = 'tokenattr';
$aTokenAttrNames = getTokenFieldsAndNames($iSurveyID);
if (count($aTokenAttrNames) != 0) {
$thisAttrName = HTMLEscape($aTokenAttrNames[strtolower($extractedTokenAttr[1])]['description']) . " [" . $clang->gT("From token table") . "]";
} else {
$thisAttrName = HTMLEscape($extractedTokenAttr[1]) . " [" . $clang->gT("Inexistant token table") . "]";
}
$aViewUrls['output'] .= "\t{$thisAttrName}\n";
// TIBO not sure this is used anymore !!
$conditionsList[] = array("cid" => $rows['cid'], "text" => $thisAttrName);
} else {
$leftOperandType = 'prevquestion';
foreach ($cquestions as $cqn) {
if ($cqn[3] == $rows['cfieldname']) {
$aViewUrls['output'] .= "\t{$cqn['0']} (qid{$rows['cqid']})\n";
$conditionsList[] = array("cid" => $rows['cid'], "text" => $cqn[0] . " ({$rows['value']})");
} else {
//$aViewUrls['output'] .= "\t<font color='red'>ERROR: Delete this condition. It is out of order.</font>\n";
}
}
}
$aViewUrls['output'] .= "\t</span></td>\n" . "\t<td>\n" . "<span>\n" . $method[trim($rows['method'])] . "</span>\n" . "\t</td>\n" . "\n" . "\t<td>\n" . "<span>\n";
// let's read the condition's right operand
// determine its type and display it
$rightOperandType = 'unknown';
// predefinedAnsw,constantVal, prevQsgqa, tokenAttr, regexp
if ($rows['method'] == 'RX') {
$rightOperandType = 'regexp';
$aViewUrls['output'] .= "" . HTMLEscape($rows['value']) . "\n";
} elseif (preg_match('/^@([0-9]+X[0-9]+X[^@]*)@$/', $rows['value'], $matchedSGQA) > 0) {
// SGQA
$rightOperandType = 'prevQsgqa';
$textfound = false;
foreach ($cquestions as $cqn) {
if ($cqn[3] == $matchedSGQA[1]) {
$matchedSGQAText = $cqn[0];
示例5: HTMLEscape
?>
' class='btn btn-default'
<?php
if (!is_template_editable($templatename)) {
?>
disabled='disabled'
<?php
}
?>
/>
<input type='hidden' name='editfile' value='<?php
echo $editfile;
?>
' />
<input type='hidden' name='screenname' value='<?php
echo HTMLEscape($screenname);
?>
' />
<input type='hidden' name='templatename' value='<?php
echo $templatename;
?>
' />
<input type='hidden' name='action' value='templateuploadfile' />
<?php
if (isset($_GET['editfile'])) {
?>
<input type='hidden' name='editfileindex' value='<?php
echo $_GET['editfile'];
?>
' />
<?php
示例6: eT
</div>
<!-- Right Menu -->
<div class="col-md-7 text-right form-inline">
<div class="form-group">
<label for='templatedir'><?php eT("Template:"); ?></label>
<select class="listboxtemplates form-control" id='templatedir' name='templatedir' onchange="javascript: window.open('<?php echo $this->createUrl("admin/templates/sa/view/editfile/".$editfile."/screenname/".$screenname); ?>/templatename/'+escape(this.value), '_top')">
<?php echo templateoptions($templates, $templatename); ?>
</select>
</div>
<div class="form-group">
<label for='listboxtemplates'><?php eT("Screen:"); ?></label>
<select class="listboxtemplates form-control" id='listboxtemplates' name='screenname' onchange="javascript: window.open('<?php echo $this->createUrl("admin/templates/sa/screenredirect/editfile/".$editfile."/templatename/".$templatename); ?>/screenname/'+escape(this.value), '_top')">
<?php echo makeoptions($screens, "id", "name", HTMLEscape($screenname) ); ?>
</select>
</div>
<?php if(isset($fullpagebar['savebutton']['form'])):?>
<a class="btn btn-success" href="#" role="button" id="save-form-button" data-form-id="<?php echo $fullpagebar['savebutton']['form']; ?>">
<span class="glyphicon glyphicon-ok" ></span>
<?php eT("Save");?>
</a>
<?php endif;?>
<!-- Close -->
<?php if(isset($fullpagebar['closebutton']['url'])):?>
<a class="btn btn-danger" href="<?php echo $fullpagebar['closebutton']['url']; ?>" role="button">
<span class="glyphicon glyphicon-close" ></span>
<?php eT("Close");?>
示例7: HTMLEscape
{
?>
<td><img class='handle' src='<?php echo $sImageURL; ?>handle.png' alt=''/></td>
<td>
<input type='hidden' class='hiddencode' value='<?php echo $row['code'] ?>' />
<input type='text' class='codeval' id='code_<?php echo $row['sortorder'] ?>' name='code_<?php echo $row['sortorder'] ?>' maxlength='5' size='6' value='<?php echo $row['code'] ?>'/>
</td>
<td>
<input type='text' class='assessmentval' id='assessmentvalue_<?php echo $row['sortorder'] ?>' style='text-align: right;' name='assessmentvalue_<?php echo $row['sortorder'] ?>' maxlength='5' size='6' value='<?php echo $row['assessment_value'] ?>' />
</td>
<?php
}
?>
<td>
<input type='text' name='title_<?php echo $row['language'] ?>_<?php echo $row['sortorder'] ?>' maxlength='3000' size='80' value="<?php echo HTMLEscape($row['title']) ?>" />
<?php
echo getEditor("editlabel", "title_{$row['language']}_{$row['sortorder']}", "[" . gT("Label:", "js") . "](" . $row['language'] . ")", '', '', '', $action);
?>
</td>
<td style='text-align:center;'>
<?php
if ($first)
{
?>
<img src='<?php echo $sImageURL; ?>addanswer.png' class='btnaddanswer' alt='<?php eT("Insert a new label after this one") ?>' />
<img src='<?php echo $sImageURL; ?>deleteanswer.png' class='btndelanswer' alt='<?php eT("Delete this label") ?>' />
<?php
}
?>
</td>
示例8: array
?>
<?php
echo CHtml::dropDownList('completionstate', $sCompletionStateValue, array('all' => $clang->gT("All responses"), 'complete' => $clang->gT("Completed responses only"), 'incomplete' => $clang->gT("Incomplete responses only")));
?>
<input type='hidden' name='sid' value='<?php
echo $surveyid;
?>
' />
<input type='hidden' name='action' value='browse' />
<input type='hidden' name='subaction' value='all' />
<?php
if (isset($_POST['sql'])) {
?>
<input type='hidden' name='sql' value='<?php
echo HTMLEscape($_POST['sql']);
?>
' />
<?php
}
?>
</form></div>
</div>
</div>
<?php
echo CHtml::form(array("admin/responses/sa/browse/surveyid/{$surveyid}/"), 'post', array('id' => 'resulttableform'));
?>
<!-- DATA TABLE -->
<?php
if ($fncount < 10) {
示例9: templatereplace
//.........这里部分代码省略.........
if (isset($surveyid)) {
$restart_extra = "";
$restart_token = returnGlobal('token');
if (!empty($restart_token)) {
$restart_extra .= "/token/" . urlencode($restart_token);
} else {
$restart_extra = "/newtest/Y";
}
if (!empty($_GET['lang'])) {
$restart_extra .= "/lang/" . returnGlobal('lang');
}
$_restart = "<a href='" . Yii::app()->getController()->createUrl("survey/index/sid/{$surveyid}{$restart_extra}") . "'>" . $clang->gT("Restart this Survey") . "</a>";
} else {
$_restart = "";
}
}
if (isset($thissurvey['anonymized']) && $thissurvey['anonymized'] == 'Y') {
$_savealert = $clang->gT("To remain anonymous please use a pseudonym as your username, also an email address is not required.");
} else {
$_savealert = "";
}
if (isset($surveyid)) {
$_return_to_survey = "<a href=" . Yii::app()->getController()->createUrl("survey/index/sid/{$surveyid}");
if (returnGlobal('token')) {
$_return_to_survey .= "?amp;token=" . urlencode(trim(sanitize_xss_string(strip_tags(returnGlobal('token')))));
}
$_return_to_survey .= "'>" . $clang->gT("Return to survey") . "</a>";
} else {
$_return_to_survey = "";
}
// Save Form
$_saveform = "<table><tr><td align='right'>" . $clang->gT("Name") . ":</td><td><input type='text' name='savename' value='";
if (isset($_POST['savename'])) {
$_saveform .= HTMLEscape(autoUnescape($_POST['savename']));
}
$_saveform .= "' /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Password") . ":</td><td><input type='password' name='savepass' value='";
if (isset($_POST['savepass'])) {
$_saveform .= HTMLEscape(autoUnescape($_POST['savepass']));
}
$_saveform .= "' /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Repeat password") . ":</td><td><input type='password' name='savepass2' value='";
if (isset($_POST['savepass2'])) {
$_saveform .= HTMLEscape(autoUnescape($_POST['savepass2']));
}
$_saveform .= "' /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Your email address") . ":</td><td><input type='text' name='saveemail' value='";
if (isset($_POST['saveemail'])) {
$_saveform .= HTMLEscape(autoUnescape($_POST['saveemail']));
}
$_saveform .= "' /></td></tr>\n";
if (isset($thissurvey['usecaptcha']) && function_exists("ImageCreate") && isCaptchaEnabled('saveandloadscreen', $thissurvey['usecaptcha'])) {
$_saveform .= "<tr><td align='right'>" . $clang->gT("Security question") . ":</td><td><table><tr><td valign='middle'><img src='" . Yii::app()->getController()->createUrl('/verification/image/sid/' . (isset($surveyid) ? $surveyid : '')) . "' alt6='' /></td><td valign='middle' style='text-align:left'><input type='text' size='5' maxlength='3' name='loadsecurity' value='' /></td></tr></table></td></tr>\n";
}
$_saveform .= "<tr><td align='right'></td><td></td></tr>\n" . "<tr><td></td><td><input type='submit' id='savebutton' name='savesubmit' value='" . $clang->gT("Save Now") . "' /></td></tr>\n" . "</table>";
// Load Form
$_loadform = "<table><tr><td align='right'>" . $clang->gT("Saved name") . ":</td><td><input type='text' name='loadname' value='";
if (isset($loadname)) {
$_loadform .= HTMLEscape(autoUnescape($loadname));
}
$_loadform .= "' /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Password") . ":</td><td><input type='password' name='loadpass' value='";
if (isset($loadpass)) {
$_loadform .= HTMLEscape(autoUnescape($loadpass));
}
$_loadform .= "' /></td></tr>\n";
if (isset($thissurvey['usecaptcha']) && function_exists("ImageCreate") && isCaptchaEnabled('saveandloadscreen', $thissurvey['usecaptcha'])) {
$_loadform .= "<tr><td align='right'>" . $clang->gT("Security question") . ":</td><td><table><tr><td valign='middle'><img src='" . Yii::app()->getController()->createUrl('/verification/image/sid/' . $surveyid) . "' alt='' /></td><td valign='middle'><input type='text' size='5' maxlength='3' name='loadsecurity' value='' alt=''/></td></tr></table></td></tr>\n";
}
$_loadform .= "<tr><td align='right'></td><td></td></tr>\n" . "<tr><td></td><td><input type='submit' id='loadbutton' value='" . $clang->gT("Load now") . "' /></td></tr></table>\n";
示例10: do_array_dual
//.........这里部分代码省略.........
//$answer .= $answer_head1;
$answer .= "\n<tr class=\"repeat headings\">\n" . $answer_head_line . "</tr>\n";
}
}
$trbc = alternation($trbc, 'row');
$answertext = dTexts__run($ansrow['question']);
$answertextsave = $answertext;
$dualgroup = 0;
$myfname0 = $ia[1] . $ansrow['title'];
$myfname = $ia[1] . $ansrow['title'] . '#0';
$myfname1 = $ia[1] . $ansrow['title'] . '#1';
// new multi-scale-answer
/* Check if this item has not been answered: the 'notanswered' variable must be an array,
containing a list of unanswered questions, the current question must be in the array,
and there must be no answer available for the item in this session. */
if ($ia[6] == 'Y' && is_array($notanswered) && (array_search($myfname, $notanswered) !== FALSE || array_search($myfname1, $notanswered) !== FALSE) && ($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == '' || $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1] == '')) {
$answertext = "<span class='errormandatory'>{$answertext}</span>";
}
// Get array_filter stuff
list($htmltbody2, $hiddenfield) = return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname0, $trbc, $myfname, "tr", "{$trbc} answers-list radio-list");
$answer .= $htmltbody2;
if (strpos($answertext, '|')) {
$answertext = substr($answertext, 0, strpos($answertext, '|'));
}
array_push($inputnames, $myfname);
$answer .= "\t<th class=\"answertext\">\n" . $hiddenfield . "{$answertext}\n" . "<input type=\"hidden\" name=\"java{$myfname}\" id=\"java{$myfname}\" value=\"";
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname])) {
$answer .= $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname];
}
$answer .= "\" />\n\t</th>\n";
$hiddenanswers = '';
$thiskey = 0;
foreach ($labelcode as $ld) {
$answer .= "\t<td class=\"answer_cell_1_00{$ld} answer-item {$answertypeclass}-item\">\n" . "<label for=\"answer{$myfname}-{$ld}\">\n" . "\t<input class=\"radio\" type=\"radio\" name=\"{$myfname}\" value=\"{$ld}\" id=\"answer{$myfname}-{$ld}\" title=\"" . HTMLEscape(strip_tags($labelans[$thiskey])) . '"';
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname] == $ld) {
$answer .= CHECKED;
}
// --> START NEW FEATURE - SAVE
$answer .= " onclick=\"{$checkconditionFunction}(this.value, this.name, this.type)\" />\n</label>\n";
// --> END NEW FEATURE - SAVE
$answer .= "\n\t</td>\n";
$thiskey++;
}
if (count($labelans1) > 0) {
$dualgroup++;
$hiddenanswers = '';
$answer .= "\t<td class=\"dual_scale_separator information-item\"> </td>\n";
// separator
array_push($inputnames, $myfname1);
$hiddenanswers .= "<input type=\"hidden\" name=\"java{$myfname1}\" id=\"java{$myfname1}\" value=\"";
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1])) {
$hiddenanswers .= $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1];
}
$hiddenanswers .= "\" />\n";
$thiskey = 0;
foreach ($labelcode1 as $ld) {
$answer .= "\t<td class=\"answer_cell_2_00{$ld} answer-item radio-item\">\n";
if ($hiddenanswers != '') {
$answer .= $hiddenanswers;
$hiddenanswers = '';
}
$answer .= "<label for=\"answer{$myfname1}-{$ld}\">\n" . "\t<input class=\"radio\" type=\"radio\" name=\"{$myfname1}\" value=\"{$ld}\" id=\"answer{$myfname1}-{$ld}\" title=\"" . HTMLEscape(strip_tags($labelans1[$thiskey])) . '"';
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1] == $ld) {
$answer .= CHECKED;
}
// --> START NEW FEATURE - SAVE
示例11: HTMLEscape
$clang->eT("Starting from:");
?>
<input type='text' size='4' value='<?php
echo $start;
?>
' name='start' id='start' />
<input type='submit' value='<?php
$clang->eT("Show");
?>
' />
</font>
<?php
if (Yii::app()->request->getPost('sql')) {
?>
<input type='hidden' name='sql' value='<?php
echo HTMLEscape(Yii::app()->request->getPost('sql'));
?>
' />
<?php
}
?>
</form>
</div>
</div>
<?php
echo CHtml::form(array("admin/responses/sa/time/surveyid/{$surveyid}/"), 'post', array('id' => 'resulttableform'));
?>
<!-- DATA TABLE -->
<?php
示例12: foreach
}
?>
<?php
if (!empty($tids)) {
?>
<input type='hidden' name='tokenids' value="<?php
echo $tids;
?>
" />
<?php
}
?>
<?php
foreach ($aSurveyLangs as $language) {
$message = HTMLEscape($_POST['message_' . $language]);
$subject = HTMLEscape($_POST['subject_' . $language]);
?>
<input type='hidden' name='from_<?php
echo $language;
?>
' value="<?php
echo $_POST['from_' . $language];
?>
" />
<input type='hidden' name='subject_<?php
echo $language;
?>
' value="<?php
echo $_POST['subject_' . $language];
?>
" />
示例13: HTMLEscape
<?php
echo HTMLEscape($row['title']);
?>
</h2>
<div>
<?php
echo convertSqlDate($row['created_at']);
?>
<?php
echo "<br>" . countCommentsForPost($row['id']) . " comments.";
?>
</div>
<p>
<?php
echo HTMLEscape($row['body']);
?>
</p>
<p>
<a href="view-post.php?post_id=<?php
echo $row['id'];
?>
">Read more....</a>
</p>
<?php
}
?>
</body>
</html>
示例14: do_array_dual
//.........这里部分代码省略.........
$myfname0 = $ia[1] . $ansrow['title'] . '#0';
$myfid0 = $ia[1] . $ansrow['title'] . '_0';
$myfname1 = $ia[1] . $ansrow['title'] . '#1';
// new multi-scale-answer
$myfid1 = $ia[1] . $ansrow['title'] . '_1';
/* Check if this item has not been answered: the 'notanswered' variable must be an array,
containing a list of unanswered questions, the current question must be in the array,
and there must be no answer available for the item in this session. */
if ($ia[6] == 'Y' && is_array($notanswered) && (array_search($myfname0, $notanswered) !== FALSE || array_search($myfname1, $notanswered) !== FALSE) && ($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname0] == '' || $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1] == '')) {
$answertext = "<span class='errormandatory'>{$answertext}</span>";
}
// Get array_filter stuff
list($htmltbody2, $hiddenfield) = return_array_filter_strings($ia, $aQuestionAttributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname, "tr", "{$trbc} answers-list radio-list");
$answer .= $htmltbody2;
array_push($inputnames, $myfname0);
$answer .= "\t<th class=\"answertext\">\n" . $hiddenfield . "{$answertext}\n";
// Hidden answers used by EM: sure can be added in javascript
$answer .= "<input type=\"hidden\" disabled=\"disabled\" name=\"java{$myfid0}\" id=\"java{$myfid0}\" value=\"";
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname0])) {
$answer .= $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname0];
}
$answer .= "\" />\n";
if (count($labelans1) > 0) {
$answer .= "<input type=\"hidden\" disabled=\"disabled\" name=\"java{$myfid1}\" id=\"java{$myfid1}\" value=\"";
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1])) {
$answer .= $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1];
}
$answer .= "\" />\n";
}
$answer .= "\t</th>\n";
$hiddenanswers = '';
$thiskey = 0;
foreach ($labelcode0 as $ld) {
$answer .= "\t<td class=\"answer_cell_1_00{$ld} answer-item {$answertypeclass}-item\">\n" . "<label for=\"answer{$myfname}-{$ld}\">\n" . "\t<input class=\"radio\" type=\"radio\" name=\"{$myfname0}\" value=\"{$ld}\" id=\"answer{$myfid0}-{$ld}\" title=\"" . HTMLEscape(strip_tags($labelans0[$thiskey])) . '"';
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname0]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname0] == $ld) {
$answer .= CHECKED;
}
$answer .= " />\n</label>\n";
$answer .= "\n\t</td>\n";
$thiskey++;
}
if (count($labelans1) > 0) {
$answer .= "\t<td class=\"dual_scale_separator information-item\">";
if ($shownoanswer) {
$answer .= "<label for='answer{$myfid0}-' class= \"jshide\">\n" . "\t<input class='radio' type='radio' name='{$myfname0}' value='' id='answer{$myfid0}-' title='" . $clang->gT("No answer") . "'";
if (!isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname0]) || $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname0] == "") {
$answer .= CHECKED;
}
$answer .= " />\n" . "</label>\n";
}
$answer .= "{$answertextcenter}</td>\n";
// separator
array_push($inputnames, $myfname1);
$thiskey = 0;
foreach ($labelcode1 as $ld) {
$answer .= "\t<td class=\"answer_cell_2_00{$ld} answer-item radio-item\">\n";
$answer .= "<label for=\"answer{$myfname1}-{$ld}\">\n" . "\t<input class=\"radio\" type=\"radio\" name=\"{$myfname1}\" value=\"{$ld}\" id=\"answer{$myfid1}-{$ld}\" title=\"" . HTMLEscape(strip_tags($labelans1[$thiskey])) . '"';
if (isset($_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1]) && $_SESSION['survey_' . Yii::app()->getConfig('surveyID')][$myfname1] == $ld) {
$answer .= CHECKED;
}
$answer .= " />\n</label>\n";
$answer .= "\t</td>\n";
$thiskey++;
}
}
if ($shownoanswer || $rightexists) {
示例15: if
<form action='<?php echo $this->createUrl("admin/responses/browse/surveyid/$surveyid/"); ?>' id='browseresults' method='post'>
<img src='<?php echo $sImageURL; ?>blank.gif' width='31' height='20' alt='' />
<?php $clang->eT("Records displayed:"); ?><input type='text' size='4' value='<?php echo $dtcount2; ?>' name='limit' id='limit' />
<?php $clang->eT("Starting from:"); ?><input type='text' size='4' value='<?php echo $start; ?>' name='start' id='start' />
<input type='submit' value='<?php $clang->eT("Show"); ?>' />
<?php $clang->eT("Display:"); ?>
<?php echo CHtml::dropDownList('completionstate',$sCompletionStateValue,array('all'=> $clang->gT("All responses"),
'complete'=> $clang->gT("Completed responses only"),
'incomplete'=> $clang->gT("Incomplete responses only")),array('onchange'=>'javascript:submit();')); ?>
<input type='hidden' name='sid' value='<?php echo $surveyid; ?>' />
<input type='hidden' name='action' value='browse' />
<input type='hidden' name='subaction' value='all' />
<?php if (isset($_POST['sql']))
{ ?>
<input type='hidden' name='sql' value='<?php echo HTMLEscape($_POST['sql']); ?>' />
<?php } ?>
</form></div>
</div>
</div>
<form action='<?php echo $this->createUrl("admin/responses/browse/surveyid/$surveyid"); ?>' id='resulttableform' method='post'>
<!-- DATA TABLE -->
<?php if ($fncount < 10) { ?>
<table class='browsetable' style='width:100%'>
<?php } else { ?>
<table class='browsetable'>
<?php } ?>
<thead>