本文整理汇总了PHP中Survey::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::getType方法的具体用法?PHP Survey::getType怎么用?PHP Survey::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Survey
的用法示例。
在下文中一共展示了Survey::getType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkVariable
//.........这里部分代码省略.........
$text[] = $var->getInlineStyle();
$text[] = $var->getPageStyle();
$text[] = $var->getPageJavascript();
$text[] = $var->getInlineJavascript();
$text[] = $var->getScripts();
$text[] = $var->getOnBack();
$text[] = $var->getOnNext();
$text[] = $var->getOnDK();
$text[] = $var->getOnRF();
$text[] = $var->getOnNA();
$text[] = $var->getOnUpdate();
$text[] = $var->getOnLanguageChange();
$text[] = $var->getOnModeChange();
$text[] = $var->getOnVersionChange();
}
// navigation
if ($_SESSION['VRFILTERMODE_VARIABLE'] == 7 || $all == true) {
$text[] = $var->getKeyboardBindingBack();
$text[] = $var->getKeyboardBindingNext();
$text[] = $var->getKeyboardBindingUpdate();
$text[] = $var->getKeyboardBindingClose();
$text[] = $var->getKeyboardBindingDK();
$text[] = $var->getKeyboardBindingRF();
$text[] = $var->getKeyboardBindingNA();
$text[] = $var->getKeyboardBindingRemark();
}
// check for references
$fills = getReferences(implode(" ", $text), INDICATOR_FILL);
$fills1 = getReferences(implode(" ", $text), INDICATOR_FILL_NOVALUE);
$fills2 = getReferences(implode(" ", $text), INDICATOR_INLINEFIELD_ANSWER);
$fills3 = getReferences(implode(" ", $text), INDICATOR_INLINEFIELD_TEXT);
$fills = array_unique(array_merge($fills, $fills1, $fills2, $fills3));
$messages = $this->checkReferences($fills);
// options text format check
if ($_SESSION['VRFILTERMODE_VARIABLE'] == 0 || $all == true) {
if (inArray($t, array(ANSWER_TYPE_ENUMERATED, ANSWER_TYPE_DROPDOWN, ANSWER_TYPE_SETOFENUMERATED, ANSWER_TYPE_MULTIDROPDOWN))) {
if ($var->getOptionsText() == "") {
$messages[] = Language::messageCheckerVariableNoOptionCodes();
} else {
if ($var->getOptionsText() != SETTING_FOLLOW_TYPE) {
$options = explode("\r\n", $var->getOptionsText());
foreach ($options as $option) {
$t = splitString("/ /", $option, PREG_SPLIT_NO_EMPTY, 2);
$code = trim($t[0]);
if (!is_numeric($code)) {
$messages[] = Language::messageCheckerVariableNumericOptionCodes($option);
break;
}
$labeltext = trim($t[1]);
}
}
}
}
}
// function reference check
if ($_SESSION['VRFILTERMODE_VARIABLE'] == 6 || $all == true) {
$functions[] = $var->getOnBack();
$functions[] = $var->getOnNext();
$functions[] = $var->getOnDK();
$functions[] = $var->getOnRF();
$functions[] = $var->getOnNA();
$functions[] = $var->getOnUpdate();
$functions[] = $var->getOnLanguageChange();
$functions[] = $var->getOnModeChange();
$functions[] = $var->getOnVersionChange();
foreach ($functions as $f) {
if (stripos($f, '(') !== false) {
$f = substr($f, 0, stripos($f, '('));
}
if (!inArray(trim($f), array("", SETTING_FOLLOW_GENERIC, SETTING_FOLLOW_TYPE))) {
if (function_exists($f) == false) {
$messages[] = Language::messageCheckerFunctionNotExists($f);
}
}
}
}
if ($_SESSION['VRFILTERMODE_VARIABLE'] == 0 || $all == true) {
if ($t == ANSWER_TYPE_CUSTOM) {
$functions[] = $var->getAnswerTypeCustom();
foreach ($functions as $f) {
if (stripos($f, '(') !== false) {
$f = substr($f, 0, stripos($f, '('));
}
if (!inArray(trim($f), array("", SETTING_FOLLOW_GENERIC, SETTING_FOLLOW_TYPE))) {
if (function_exists($f) == false) {
$messages[] = Language::messageCheckerFunctionNotExists($f);
}
}
}
}
}
if ($var->hasType()) {
$tempsurv = new Survey($var->getSuid());
$temptype = $tempsurv->getType($var->getTyd());
if ($temptype->getTyd() == "") {
$messages[] = Language::messageCheckerTypeNotExists($var->getName());
}
}
return $messages;
}
示例2: showTranslateVariableAssistance
function showTranslateVariableAssistance($variable)
{
$returnStr = '<form id="editform" method="post">';
$returnStr .= setSessionParamsPost(array('page' => 'translator.survey.translatevariableassistanceres', 'vsid' => $variable->getVsid()));
$returnStr .= $this->getVariableTopTab(3);
$helpstart = '<div class="input-group">';
$helpstart2 = "";
$helpend2 = "";
$message = Language::helpFollowSurvey();
$answertype = $variable->getAnswerType();
if ($answertype == SETTING_FOLLOW_TYPE) {
$survey = new Survey($_SESSION['SUID']);
$type = $survey->getType($variable->getTyd());
$answertype = $type->getAnswerType();
} else {
if ($variable->getTyd() > 0) {
$survey = new Survey($_SESSION['SUID']);
$type = $survey->getType($variable->getTyd());
$message = Language::helpFollowType($type->getName());
$helpstart2 = '<div class="input-group">';
$message2 = Language::helpFollowTypeOnly($type->getName());
$helpend2 = '<span class="input-group-addon"><i>' . $message2 . '</i></span></div>';
}
}
$helpend = '<span class="input-group-addon"><i>' . $message . '</i></span></div>';
$returnStr .= '<div class="well" style="background-color:white;">';
$survey = new Survey($_SESSION['SUID']);
$language = getSurveyLanguage();
$returnStr .= "<div id='accordion' class='panel-group' role='tablist' aria-expanded='true'>";
$l = $survey->getDefaultLanguage(getSurveyMode());
$arr = Language::getLanguagesArray();
$helpend = '<span class="input-group-addon"><i>' . $message . '</i></span></div>';
if ($l != $language) {
switchSurveyLanguageTranslator($l);
$langlabel = $arr[str_replace("_", "", getSurveyLanguagePostFix($l))]['name'];
$returnStr .= "<div class='panel panel-default'>";
$returnStr .= "<div class='panel panel-heading' role='tab' id='headingOne'>";
$returnStr .= '<a role="button" data-toggle="collapse" aria-expanded="true" aria-controls="collapseOne" href="#collapseOne">' . $langlabel . '</a>';
$returnStr .= "</div>";
$returnStr .= '<div class="panel-collapse collapse in" id="collapseOne" role="tabpanel" labelledby="headingOne">';
$returnStr .= "<div class='panel-body'>";
$returnStr .= '<table width=100%>';
if (inArray($answertype, array(ANSWER_TYPE_STRING, ANSWER_TYPE_INTEGER, ANSWER_TYPE_RANGE, ANSWER_TYPE_DOUBLE, ANSWER_TYPE_DROPDOWN, ANSWER_TYPE_MULTIDROPDOWN))) {
$returnStr .= '<tr><td>' . Language::labelTypeEditAssistancePreText() . '</td><td>' . $helpstart2 . '<input type="text" class="form-control" readonly value="' . $this->displayTextSettingValue(convertHTLMEntities($variable->getPreText(), ENT_QUOTES)) . '">' . $helpend2 . '</td></tr>';
$returnStr .= '<tr><td>' . Language::labelTypeEditAssistancePostText() . '</td><td>' . $helpstart2 . '<input type="text" class="form-control" readonly value="' . $this->displayTextSettingValue(convertHTLMEntities($variable->getPostText(), ENT_QUOTES)) . '">' . $helpend2 . '</td></tr>';
}
$returnStr .= '<tr><td>' . Language::labelTypeEditAssistanceHoverText() . '</td><td>' . $helpstart2 . '<input type="text" class="form-control" readonly value="' . $this->displayTextSettingValue(convertHTLMEntities($variable->getHoverText(), ENT_QUOTES)) . '">' . $helpend2 . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelTypeEditAssistanceEmptyMessage() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" rows=2 readonly class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getEmptyMessage()), ENT_QUOTES) . '</textarea>' . $helpend . '</td></tr>';
switch ($answertype) {
case ANSWER_TYPE_DOUBLE:
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageDouble() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageDouble(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
break;
case ANSWER_TYPE_INTEGER:
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInteger() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInteger(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
break;
case ANSWER_TYPE_STRING:
/* fall through */
/* fall through */
case ANSWER_TYPE_OPEN:
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessagePattern() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessagePattern(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageMinLength() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageMinimumLength(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageMaxLength() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageMaximumLength(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageMinWords() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageMinimumWords(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageMaxWords() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageMaximumWords(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
break;
case ANSWER_TYPE_ENUMERATED:
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineAnswered() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineAnswered(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineExclusive() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineExclusive(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineInclusive() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineInclusive(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineMinRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineMinimumRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineMaxRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineMaximumRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineExactRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineExactRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
break;
case ANSWER_TYPE_SETOFENUMERATED:
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineAnswered() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineAnswered(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineExclusive() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineExclusive(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineInclusive() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineInclusive(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineMinRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineMinimumRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineMaxRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineMaximumRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInlineExactRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageInlineExactRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
/* fall through */
/* fall through */
case ANSWER_TYPE_MULTIDROPDOWN:
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageMinSelect() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageSelectMinimum(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageMaxSelect() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageSelectMaximum(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageExactSelect() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageSelectExact(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInvalidSubSelect() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageSelectInvalidSubset(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageInvalidSelect() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageSelectInvalidSet(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
break;
case ANSWER_TYPE_RANGE:
/* fall through */
/* fall through */
case ANSWER_TYPE_SLIDER:
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageRange() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($variable->getErrorMessageRange(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
break;
case ANSWER_TYPE_CALENDAR:
$returnStr .= '<tr><td valign=top style="width: 20%;">' . Language::labelTypeEditAssistanceErrorMessageMaxCalendar() . '</td><td><textarea style="width: 100%;" readonly rows=2 class="form-control">' . convertHTLMEntities($variable->getErrorMessageMaximumCalendar(), ENT_QUOTES) . '</textarea></td></tr>';
break;
}
$returnStr .= '</table></div></div></div>';
//.........这里部分代码省略.........
示例3: showOutputTranslation
function showOutputTranslation()
{
$_SESSION['PARAMETER_RETRIEVAL'] = PARAMETER_SURVEY_RETRIEVAL;
$survey = new Survey($_SESSION['SUID']);
$user = new User($_SESSION['URID']);
$utype = $user->getUserType();
$ut = "";
switch ($utype) {
case USER_SYSADMIN:
$ut = "sysadmin";
break;
case USER_ADMIN:
$ut = "admin";
break;
case USER_TRANSLATOR:
$ut = "translator";
break;
case USER_INTERVIEWER:
$ut = "interviewer";
break;
}
$headers[] = array('link' => setSessionParamsHref(array('page' => $ut . '.output'), Language::headerOutput()), 'label' => Language::headerOutput());
$headers[] = array('link' => setSessionParamsHref(array('page' => $ut . '.output.documentation'), Language::headerOutputDocumentation()), 'label' => Language::headerOutputDocumentation());
$headers[] = array('link' => '', 'label' => Language::headerOutputDictionary());
$returnStr = $this->showOutputHeader($headers, false);
/* display survey texts */
$returnStr .= "<div class='uscic-dictionary-messages'>Generic messages</div>";
$returnStr .= "<table class='table table-bordered'";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceEmptyMessage() . "</td><td class='uscic-dictionary-message'>" . $survey->getEmptyMessage() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageDouble() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageDouble() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelGroupEditAssistanceExactRequired() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageExactRequired() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelGroupEditAssistanceExclusive() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageExclusive() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelGroupEditAssistanceInclusive() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageInclusive() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInlineAnswered() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageInlineAnswered() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInlineExactRequired() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageInlineExactRequired() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInlineExclusive() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageInlineExclusive() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInlineInclusive() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageInlineInclusive() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInlineMaxRequired() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageInlineMaximumRequired() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInlineMinRequired() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageInlineMinimumRequired() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInteger() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageInteger() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageMaxCalendar() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageMaximumCalendar() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageMaxLength() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageMaximumLength() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelGroupEditAssistanceMaximumRequired() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageMaximumRequired() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageMaxWords() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageMaximumWords() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageMinLength() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageMinimumLength() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelGroupEditAssistanceMinimumRequired() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageMinimumRequired() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageMinWords() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageMinimumWords() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessagePattern() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessagePattern() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageRange() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageRange() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageExactSelect() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageSelectExact() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInvalidSelect() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageSelectInvalidSet() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageInvalidSubSelect() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageSelectInvalidSubset() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageMaxSelect() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageSelectMaximum() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditAssistanceErrorMessageMinSelect() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageSelectMinimum() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelGroupEditAssistanceUniqueRequired() . "</td><td class='uscic-dictionary-message'>" . $survey->getErrorMessageUniqueRequired() . "</td></tr>";
$returnStr .= "</table>";
$backbutton = strtoupper($survey->getLabelBackButton());
$nextbutton = strtoupper($survey->getLabelNextButton());
$dkbutton = strtoupper($survey->getLabelDKButton());
$rfbutton = strtoupper($survey->getLabelRFButton());
$nabutton = strtoupper($survey->getLabelNAButton());
$updatebutton = strtoupper($survey->getLabelUpdateButton());
/* display survey texts */
$returnStr .= "<div class='uscic-dictionary-messages'>Button labels</div>";
$returnStr .= "<table class='table table-bordered'";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditBackButton() . "</td><td class='uscic-dictionary-message'>" . $survey->getLabelBackButton() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditNextButton() . "</td><td class='uscic-dictionary-message'>" . $survey->getLabelNextButton() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditDKButton() . "</td><td class='uscic-dictionary-message'>" . $survey->getLabelDKButton() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditRFButton() . "</td><td class='uscic-dictionary-message'>" . $survey->getLabelRFButton() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditNAButton() . "</td><td class='uscic-dictionary-message'>" . $survey->getLabelNAButton() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditUpdateButton() . "</td><td class='uscic-dictionary-message'>" . $survey->getLabelUpdateButton() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditRemarkButton() . "</td><td class='uscic-dictionary-message'>" . $survey->getLabelRemarkButton() . "</td></tr>";
$returnStr .= "<tr><td width='200px'>" . Language::labelTypeEditCloseButton() . "</td><td class='uscic-dictionary-message'>" . $survey->getLabelCloseButton() . "</td></tr>";
$returnStr .= "</table>";
$returnStr .= "<hr>";
/* loop through sections */
$sections = $survey->getSections();
foreach ($sections as $section) {
$returnStr .= "<div class='uscic-dictionary-section'>Section: " . $section->getName() . "</div>";
$vars = $survey->getVariableDescriptives($section->getSeid());
foreach ($vars as $var) {
if ($var->isHiddenTranslation() == false) {
$answertype = $var->getAnswerType();
if ($answertype == SETTING_FOLLOW_TYPE) {
$type = $survey->getType($var->getTyd());
$answertype = $type->getAnswerType();
}
$table = "";
//if ($var->getDescription() != "") {
// $table .= "<tr><td width='200px'>Description</td>";
// $table .= "<td class='uscic-dictionary-description'>" . $var->getDescription() . "</td></tr>";
//}
if (trim($var->getQuestion()) != "") {
$table .= "<tr><td width='200px'>Text</td>";
$table .= "<td class='uscic-dictionary-text'>" . convertHTLMEntities($this->replaceFills($var->getQuestion())) . "</td></tr>";
}
if (inArray($answertype, array(ANSWER_TYPE_ENUMERATED, ANSWER_TYPE_SETOFENUMERATED, ANSWER_TYPE_DROPDOWN, ANSWER_TYPE_MULTIDROPDOWN))) {
$table .= "<tr><td width='200px'>Answer options</td>";
$table .= "<td class='uscic-dictionary-categories'>" . str_replace("\r\n", "<br/>", convertHTLMEntities($this->replaceFills($var->getOptionsText()))) . "</td></tr>";
}
//.........这里部分代码省略.........
示例4: handleTypeAction
function handleTypeAction($selected, $action, &$typecookievalue)
{
$surveys = array();
$displaySysAdmin = new DisplaySysAdmin();
switch ($action) {
case 'edit':
$settings = $this->getBatchEditorVariableProperties();
$tosave = array();
$tocompile = array();
$changed = array();
foreach ($settings as $set) {
if (loadvar($set . "_checkbox") == 1) {
$val = loadvarAllowHTML($set);
if ($val != "") {
foreach ($selected as $sel) {
$s = explode("~", $sel);
if (isset($surveys[$s[0]])) {
$survey = $surveys[$s[0]];
} else {
$survey = new Survey($s[0]);
$surveys[$s[0]] = $survey;
$tocompile[] = $s[0];
}
if (isset($tosave[$sel])) {
$type = $tosave[$sel];
} else {
$type = $survey->getType($s[1]);
$tosave[$sel] = $type;
}
if (isset($changed[$s[0]])) {
$arr = $changed[$s[0]];
if (isset($arr[$sel]) == false) {
$arr[$sel] = $type;
$changed[$s[0]] = $arr;
}
} else {
$arr = array();
$arr[$sel] = $type;
$changed[$s[0]] = $arr;
}
$type->setSettingValue($set, $val);
if ($set == SETTING_INPUT_MASK && $val == INPUTMASK_CUSTOM) {
$type->setSettingValue(SETTING_INPUT_MASK_CUSTOM, loadvarAllowHTML(SETTING_INPUT_MASK_CUSTOM));
} else {
if ($set == SETTING_ENUMERATED_TEXTBOX && $val == TEXTBOX_YES) {
$type->setSettingValue(SETTING_ENUMERATED_TEXTBOX_LABEL, loadvarAllowHTML(SETTING_ENUMERATED_TEXTBOX_LABEL));
}
}
}
}
}
}
/* save */
foreach ($tosave as $to) {
$to->save();
}
/* compile */
foreach ($tocompile as $comp) {
if (isset($surveys[$comp])) {
$survey = $surveys[$comp];
} else {
$survey = new Survey($comp);
$surveys[$comp] = $survey;
}
$compiler = new Compiler($comp, getSurveyVersion($surveys[$comp]));
$mess = $compiler->generateTypes($changed[$comp]);
$newtypes = $changed[$comp];
foreach ($newtypes as $newtype) {
$newvars = $survey->getVariableDescriptivesOfType($newtype->getTyd());
$mess = $compiler->generateVariableDescriptives($newvars);
$mess = $compiler->generateGetFills($newvars);
$mess = $compiler->generateInlineFields($newvars);
}
}
if ($changed) {
$content = $displaySysAdmin->displaySuccess(Language::messageToolsBatchEditorEdited(Language::labelTypesLower()));
} else {
$content = $displaySysAdmin->displayWarning(Language::messageToolsBatchEditorNotEdited());
}
break;
break;
case 'copy':
// determine survey
$suid = loadvar('suid');
foreach ($selected as $sel) {
$s = explode("~", $sel);
if (isset($surveys[$s[0]])) {
$survey = $surveys[$s[0]];
} else {
$survey = new Survey($s[0]);
$surveys[$s[0]] = $survey;
}
$type = $survey->getType($s[1]);
$oldtype = $type;
$type->copy($suid);
$newtypes[] = $type;
}
/* compile new */
$compiler = new Compiler($suid, getSurveyVersion($survey));
$mess = $compiler->generateTypes($newtypes);
//.........这里部分代码省略.........
示例5: showToolsBatchEditorTypes
function showToolsBatchEditorTypes($variablecookievalue, $sectioncookievalue, $groupcookievalue, $typecookievalue)
{
$returnStr = $this->getToolsBatchEditorTopTab(1, $variablecookievalue != "", $sectioncookievalue != "", $groupcookievalue != "", $typecookievalue != "");
$returnStr .= "<form method='post' id='reload' name='reload'>";
$returnStr .= setSessionParamsPost(array('page' => 'sysadmin.tools.batcheditor'));
$returnStr .= "</form>";
$returnStr .= '<form id=actionform name=actionform method="post">';
$returnStr .= setSessionParamsPost(array('page' => 'sysadmin.tools.batcheditorres'));
$returnStr .= "<input type=hidden name=batchaction id=batchaction />";
$returnStr .= "<input type=hidden name=vrfiltermode_batch id=vrfiltermode_batch value=1 />";
$returnStr .= '<div class="well">';
$types = explode("-", $typecookievalue);
$returnStr1 = '';
foreach ($types as $typ) {
$varsplit = explode("~", $typ);
$survey = new Survey($varsplit[0]);
$v = $survey->getType($varsplit[1]);
if ($v->getName() != "") {
$returnStr1 .= '<tr>';
$returnStr1 .= '<td>';
$returnStr1 .= "<input class='selectedboxtype' name=selected[] type='checkbox' value='" . $typ . "'>";
$returnStr1 .= '</td>';
$returnStr1 .= '<td>' . $v->getName() . '</td>';
$returnStr1 .= '<tr>';
}
}
if ($returnStr1 == "") {
$returnStr .= $this->displayInfo(Language::messageToolsBatchEditorNoTypesFound());
} else {
$returnStr .= $this->displayComboBox();
$returnStr .= '<div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-6 col-md-3">';
$returnStr .= '<span class="label label-default">' . Language::labelToolsBatchEditorTypes() . '</span>';
$returnStr .= '<div style="background-color: white;" class="well">';
$returnStr .= '<table class="table table-bordered table-striped">';
$returnStr .= '<tr>';
$returnStr .= "<th><nobr/></th>";
$returnStr .= "<th>" . Language::labelTypeEditGeneralName() . "</th>";
$returnStr .= '</tr>';
$returnStr .= $returnStr1;
$returnStr .= '</table>';
$returnStr .= $this->displayCookieScripts();
// TODO: ADD PAGE RELOAD HERE
$returnStr .= "<script type=text/javascript>\n function selectAllTypes() {\n \$('.selectedboxtype').prop('checked', true);\n };\n function unselectAllTypes() {\n \$('.selectedboxtype').prop('checked', false);\n };\n </script>";
$returnStr .= "<input class='btn btn-default' type=button onclick='selectAllTypes();' value='Select all'/>";
$returnStr .= "<input class='btn btn-default' type=button onclick='unselectAllTypes();' value='Unselect all'/>";
$returnStr .= "<input class='btn btn-default' type=button onclick='clearCookie(\"uscictypecookie\"); \$(\"#reload\").submit();' value='" . Language::buttonClear() . "'/>";
$returnStr .= "</div>";
$returnStr .= '</div>';
// actions
$returnStr .= '<div class="col-xs-12 col-md-9">';
$returnStr .= '<span class="label label-default">' . Language::labelToolsBatchEditorActions() . '</span>';
$returnStr .= '<div style="background-color: white;" class="well">';
$returnStr .= '<span class="label label-default">' . Language::labelEdit() . '</span>';
$returnStr .= '<div class="well">';
$returnStr .= '<ul class="nav nav-pills nav-justified" role="tablist">';
$returnStr .= '<li class="active"><a href="#general" role="tab" data-toggle="tab">' . Language::labelGeneral() . '</a></li>';
$returnStr .= '<li><a href="#access" role="tab" data-toggle="tab">' . Language::labelAccess() . '</a></li>';
$returnStr .= '<li><a href="#verification" role="tab" data-toggle="tab">' . Language::labelVerification() . '</a></li>';
$returnStr .= '<li><a href="#display" role="tab" data-toggle="tab">' . Language::labelLayout() . '</a></li>';
$returnStr .= '<li><a href="#assistance" role="tab" data-toggle="tab">' . Language::labelAssistance() . '</a></li>';
$returnStr .= '<li><a href="#interactive" role="tab" data-toggle="tab">' . Language::labelInteractive() . '</a></li>';
$returnStr .= '<li><a href="#output" role="tab" data-toggle="tab">' . Language::labelOutput() . '</a></li>';
$returnStr .= '<li><a href="#navigation" role="tab" data-toggle="tab">' . Language::labelNavigation() . '</a></li>';
$returnStr .= '</ul>';
$returnStr .= $this->showToolsBatchEditorVariableTabs(1);
$returnStr .= '</div>';
$returnStr .= '<span class="label label-default">' . Language::labelCopy() . '</span>';
$returnStr .= '<div class="well">';
$returnStr .= '<table width=100%>';
$surveys = new Surveys();
$suid = loadvar("suid");
if ($suid == "") {
$suid = $_SESSION['SUID'];
if ($suid == "") {
$suid = $surveys->getFirstSurvey(false);
}
}
if ($surveys->getNumberOfSurveys() > 1) {
$returnStr .= '<tr><td>' . Language::labelTypeCopySurvey() . '</td><td>' . $this->displaySurveys("suid", "suid", $suid) . '</tr>';
}
$returnStr .= '</table>';
$returnStr .= '<input onclick="$(\'#batchaction\').val(\'copy\'); $(\'#actionform\').submit(); " type="button" class="btn btn-default" value="' . Language::buttonCopy() . '"/>';
$returnStr .= '</div>';
if ($surveys->getNumberOfSurveys() > 1) {
$returnStr .= '<span class="label label-default">' . Language::labelMove() . '</span>';
$returnStr .= '<div class="well">';
$returnStr .= '<table width=100%>';
$returnStr .= '<tr><td>' . Language::labelTypeMoveSurvey() . '</td><td>' . $this->displaySurveys("suid", "suid", $_SESSION['SUID']) . '</tr>';
$returnStr .= '</table>';
$returnStr .= '<input onclick="$(\'#batchaction\').val(\'move\'); $(\'#actionform\').submit(); " type="button" class="btn btn-default" value="' . Language::buttonMove() . '"/>';
$returnStr .= '</div>';
}
$returnStr .= '<span class="label label-default">' . Language::labelRemove() . '</span>';
$returnStr .= '<div class="well">';
$returnStr .= '<input onclick="$(\'#batchaction\').val(\'remove\'); $(\'#actionform\').submit(); " type="button" class="btn btn-default" value="' . Language::buttonRemove() . '"/>';
$returnStr .= '</div>';
$returnStr .= '</div>';
// close
$returnStr .= '</div>';
//.........这里部分代码省略.........
示例6: showTranslateTypeAssistanceRes
function showTranslateTypeAssistanceRes()
{
$displayTranslator = new DisplayTranslator();
$survey = new Survey($_SESSION['SUID']);
$tyd = getFromSessionParams('tyd');
$type = $survey->getType($tyd);
$_SESSION['TYD'] = $tyd;
$type->setPreText(loadvarAllowHTML(SETTING_PRETEXT));
$type->setPostText(loadvarAllowHTML(SETTING_POSTTEXT));
$type->setHoverText(loadvarAllowHTML(SETTING_HOVERTEXT));
if (loadvar(SETTING_EMPTY_MESSAGE) != "") {
$type->setEmptyMessage(loadvarAllowHTML(SETTING_EMPTY_MESSAGE));
}
$t = $type->getAnswerType();
switch ($t) {
case ANSWER_TYPE_STRING:
/* fall through */
/* fall through */
case ANSWER_TYPE_OPEN:
$type->setErrorMessageMinimumLength(loadvarAllowHTML(SETTING_ERROR_MESSAGE_MINIMUM_LENGTH));
$type->setErrorMessageMaximumLength(loadvarAllowHTML(SETTING_ERROR_MESSAGE_MAXIMUM_LENGTH));
$type->setErrorMessageMinimumWords(loadvarAllowHTML(SETTING_ERROR_MESSAGE_MINIMUM_WORDS));
$type->setErrorMessageMaximumWords(loadvarAllowHTML(SETTING_ERROR_MESSAGE_MAXIMUM_WORDS));
$type->setErrorMessagePattern(loadvarAllowHTML(SETTING_ERROR_MESSAGE_PATTERN));
break;
case ANSWER_TYPE_DOUBLE:
$type->setErrorMessageDouble(loadvarAllowHTML(SETTING_ERROR_MESSAGE_DOUBLE));
break;
case ANSWER_TYPE_INTEGER:
$type->setErrorMessageInteger(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INTEGER));
break;
case ANSWER_TYPE_ENUMERATED:
$type->setErrorMessageInlineAnswered(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_ANSWERED));
$type->setErrorMessageInlineExactRequired(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_EXACT_REQUIRED));
$type->setErrorMessageInlineExclusive(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_EXCLUSIVE));
$type->setErrorMessageInlineInclusive(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_INCLUSIVE));
$type->setErrorMessageInlineMinimumRequired(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_MINIMUM_REQUIRED));
$type->setErrorMessageInlineMaximumRequired(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_MAXIMUM_REQUIRED));
break;
case ANSWER_TYPE_SETOFENUMERATED:
$type->setErrorMessageInlineAnswered(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_ANSWERED));
$type->setErrorMessageInlineExactRequired(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_EXACT_REQUIRED));
$type->setErrorMessageInlineExclusive(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_EXCLUSIVE));
$type->setErrorMessageInlineInclusive(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_INCLUSIVE));
$type->setErrorMessageInlineMinimumRequired(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_MINIMUM_REQUIRED));
$type->setErrorMessageInlineMaximumRequired(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INLINE_MAXIMUM_REQUIRED));
/* fall through */
/* fall through */
case ANSWER_TYPE_MULTIDROPDOWN:
$type->setErrorMessageSelectMinimum(loadvarAllowHTML(SETTING_ERROR_MESSAGE_MINIMUM_SELECT));
$type->setErrorMessageSelectMaximum(loadvarAllowHTML(SETTING_ERROR_MESSAGE_MAXIMUM_SELECT));
$type->setErrorMessageSelectExact(loadvarAllowHTML(SETTING_ERROR_MESSAGE_EXACT_SELECT));
$type->setErrorMessageSelectInvalidSubset(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INVALID_SUB_SELECT));
$type->setErrorMessageSelectInvalidSet(loadvarAllowHTML(SETTING_ERROR_MESSAGE_INVALID_SELECT));
break;
case ANSWER_TYPE_RANGE:
/* fall through */
/* fall through */
case ANSWER_TYPE_SLIDER:
$type->setErrorMessageRange(loadvarAllowHTML(SETTING_ERROR_MESSAGE_RANGE));
break;
case ANSWER_TYPE_CALENDAR:
$type->setErrorMessageMaximumCalendar(loadvarAllowHTML(SETTING_ERROR_MESSAGE_MAXIMUM_CALENDAR));
break;
}
$content = $displayTranslator->displaySuccess(Language::messageTypeChanged($type->getName()));
$type->save();
/* compile */
$compiler = new Compiler($_SESSION['SUID'], getSurveyVersion($survey));
$mess = $compiler->generateTypes(array($type));
$vars = $survey->getVariableDescriptivesOfType($tyd);
$mess = $compiler->generateVariableDescriptives($vars);
$mess = $compiler->generateGetFills($vars);
$mess = $compiler->generateInlineFields($vars);
/* update last page */
$_SESSION['LASTPAGE'] = substr($_SESSION['LASTPAGE'], 0, strripos($_SESSION['LASTPAGE'], "res"));
/* return result */
return $displayTranslator->showTranslateType($_SESSION['TYD'], $content);
}