本文整理汇总了PHP中Survey::getDefaultLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::getDefaultLanguage方法的具体用法?PHP Survey::getDefaultLanguage怎么用?PHP Survey::getDefaultLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Survey
的用法示例。
在下文中一共展示了Survey::getDefaultLanguage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showOutputDocumentation
function showOutputDocumentation()
{
$survey = new Survey(getSurvey());
$user = new User($_SESSION['URID']);
$utype = $user->getUserType();
$ut = "";
switch ($utype) {
case USER_SYSADMIN:
$ut = "sysadmin";
$headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output'), Language::headerOutput()), 'label' => Language::headerOutput());
$headers[] = array('link' => '', 'label' => Language::headerOutputDocumentation());
break;
case USER_ADMIN:
$ut = "admin";
break;
case USER_TRANSLATOR:
$ut = "translator";
$headers[] = array('link' => setSessionParamsHref(array('page' => 'translator.output'), Language::headerOutput()), 'label' => Language::headerOutput());
$headers[] = array('link' => '', 'label' => Language::headerOutputDocumentation());
break;
case USER_RESEARCHER:
$ut = "researcher";
$headers[] = array('link' => '', 'label' => Language::headerOutputDocumentation());
break;
case USER_INTERVIEWER:
$ut = "interviewer";
break;
}
$returnStr = $this->showOutputHeader($headers);
$returnStr .= '<form id=modeform method="post">';
$returnStr .= '<input type=hidden name=r value="' . setSessionsParamString(getSessionParams()) . '">';
$returnStr .= $this->displayComboBox();
$returnStr .= '<span class="label label-default">' . Language::labelOutputDocumentation() . '</span>';
$returnStr .= '<div class="well well-sm">';
$returnStr .= '<table>';
$returnStr .= '<tr><td>' . Language::labelOutputDocumentationSurvey() . '</td><td>' . $this->displaySurveys("survey", "survey", $_SESSION['SUID'], '') . '</tr>';
$returnStr .= '<tr><td>' . Language::labelOutputDocumentationMode() . '</td><td>' . $this->displayModesAdmin("surveymode", "surveymode", getSurveyMode(), "", implode("~", $user->getModes(getSurvey()))) . '</tr>';
/* language dropdown */
$langs = explode("~", $user->getLanguages(getSurvey(), getSurveyMode()));
$default = $survey->getDefaultLanguage();
if (!inArray($default, $langs)) {
//$langs[] = $default;
}
$returnStr .= '<tr><td>' . Language::labelOutputDocumentationLanguage() . '</td><td>' . $this->displayLanguagesAdmin("surveylanguage", "surveylanguage", getSurveyLanguage(), true, false, true, "", implode("~", $langs)) . '</tr>';
$returnStr .= '</table><br/>';
$returnStr .= '<script type=text/javascript>
$(document).ready(function(){
$("#survey").on("change", function(event) {
var values = $("#modeform").serialize();
values += "&' . POST_PARAM_AJAX_LOAD . '=' . AJAX_LOAD . '";
// Send the data using post
var posting = $.post( $("#modeform").attr("action"), values );
posting.done(function( data ) {
$("#content").html( $( data ).html());
$("[data-hover=\'dropdown\']").dropdownHover();
});
});
$("#surveymode").on("change", function(event) {
var values = $("#modeform").serialize();
values += "&' . POST_PARAM_AJAX_LOAD . '=' . AJAX_LOAD . '";
// Send the data using post
var posting = $.post( $("#modeform").attr("action"), values );
posting.done(function( data ) {
$("#content").html( $( data ).html());
$("[data-hover=\'dropdown\']").dropdownHover();
});
});';
//if ($ut != "sysadmin" && $ut != "translator") {
$returnStr .= '$("#surveylanguage").on("change", function(event) {
var values = $("#modeform").serialize();
values += "&' . POST_PARAM_AJAX_LOAD . '=' . AJAX_LOAD . '";
// Send the data using post
var posting = $.post( $("#languageform").attr("action"), values );
posting.done(function( data ) {
$("#content").html( $( data ).html());
$("[data-hover=\'dropdown\']").dropdownHover();
});
});';
//}
$returnStr .= '
});
</script>';
$returnStr .= "</form>";
$returnStr .= '<div class="list-group">';
$user = new User($_SESSION['URID']);
$utype = $user->getUserType();
if (inArray($utype, array(USER_SYSADMIN, USER_RESEARCHER))) {
$returnStr .= '<a target="_blank" href="index.php?r=' . setSessionsParamString(array('page' => $ut . '.output.documentation.dictionary')) . '" class="list-group-item">' . Language::labelOutputDocumentationDictionary() . '</a>';
$returnStr .= '<a target="_blank" href="index.php?r=' . setSessionsParamString(array('page' => $ut . '.output.documentation.routing')) . '" class="list-group-item">' . Language::labelOutputDocumentationRouting() . '</a>';
if (inArray($utype, array(USER_SYSADMIN))) {
$returnStr .= '<a target="_blank" href="index.php?r=' . setSessionsParamString(array('page' => $ut . '.output.documentation.routing.dash')) . '" class="list-group-item">' . Language::labelOutputDocumentationRouting() . ' (text only)</a>';
}
}
//.........这里部分代码省略.........
示例2: showTest
function showTest($content = "")
{
$returnStr = $this->showToolsHeader(Language::headerToolsTester());
$returnStr .= $content;
$surveys = new Surveys();
$surveys = $surveys->getSurveys();
if (sizeof($surveys) > 0) {
$returnStr .= "<form id=refreshform method=post>";
$returnStr .= '<input type=hidden name=page value="translator.tools.test">';
$returnStr .= '<input type=hidden name="' . SMS_POST_SURVEY . '" id="' . SMS_POST_SURVEY . '_hidden" value="' . getSurvey() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_MODE . '" id="' . SMS_POST_MODE . '_hidden" value="' . getSurveyMode() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_LANGUAGE . '" id="' . SMS_POST_LANGUAGE . '_hidden" value="' . getSurveyLanguage() . '">';
$returnStr .= "</form>";
$returnStr .= "<form method=post>";
$returnStr .= '<input type=hidden name=' . POST_PARAM_SE . ' value="' . addslashes(USCIC_SURVEY) . '">';
$returnStr .= '<input type=hidden name=' . POST_PARAM_PRIMKEY . ' value="' . addslashes(encryptC(generateRandomPrimkey(8), Config::directLoginKey())) . '">';
$returnStr .= '<input type=hidden name=' . POST_PARAM_NEW_PRIMKEY . ' value="1">';
$returnStr .= '<input type=hidden name=' . POST_PARAM_SURVEY_EXECUTION_MODE . ' value="' . SURVEY_EXECUTION_MODE_TEST . '">';
$returnStr .= '<span class="label label-default">' . Language::labelToolsTestSettings() . '</span>';
$returnStr .= '<div class="well well-sm">';
$returnStr .= $this->displayComboBox();
$returnStr .= '<table>';
$returnStr .= '<tr><td>' . Language::labelTestSurvey() . "</td><td><select onchange='document.getElementById(\"" . SMS_POST_SURVEY . "_hidden\").value=this.value; document.getElementById(\"refreshform\").submit();' name=" . POST_PARAM_SUID . " class='selectpicker show-tick'>";
$current = new Survey(getSurvey());
foreach ($surveys as $survey) {
$selected = "";
if ($survey->getSuid() == $current->getSuid()) {
$selected = "SELECTED";
}
$returnStr .= "<option {$selected} value=" . $survey->getSuid() . '>' . $survey->getName() . '</option>';
}
$returnStr .= "</select></td></tr>";
$user = new User($_SESSION['URID']);
$cm = getSurveyMode();
$cl = getSurveyLanguage();
$modes = $user->getModes(getSurvey());
$langs = explode("~", $user->getLanguages(getSurvey(), getSurveyMode()));
$default = $current->getDefaultLanguage();
if (!inArray($default, $langs)) {
$langs[] = $default;
}
$returnStr .= "<tr><td>" . Language::labelTestModeInput() . "</td><td>" . $this->displayModesAdmin(POST_PARAM_MODE, POST_PARAM_MODE, getSurveyMode(), "", implode("~", $modes), "onchange='document.getElementById(\"" . SMS_POST_MODE . "_hidden\").value=this.value; document.getElementById(\"refreshform\").submit();'") . "</td></tr>";
$returnStr .= "<tr><td>" . Language::labelTestLanguage() . "</td><td>" . $this->displayLanguagesAdmin(POST_PARAM_LANGUAGE, POST_PARAM_LANGUAGE, getSurveyLanguage(), true, true, false, "", implode("~", $langs)) . "</td></tr>";
$returnStr .= '</table>';
$returnStr .= '</div>';
$returnStr .= '<button type="submit" class="btn btn-default navbar-btn">' . Language::buttonTest() . '</button>';
$returnStr .= "</form>";
} else {
$returnStr .= $this->displayInfo(Language::messageNoSurveysAvailable());
}
$returnStr .= '</p></div></div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}
示例3: showCheck
function showCheck($content)
{
$returnStr = $this->showToolsHeader(Language::headerToolsChecker());
$returnStr .= $content;
$survey = new Survey($_SESSION['SUID']);
$user = new User($_SESSION['URID']);
$returnStr .= "<form id=refreshform method=post>";
$returnStr .= '<input type=hidden name=page value="sysadmin.tools.check">';
$returnStr .= '<input type=hidden name="' . SMS_POST_SURVEY . '" id="' . SMS_POST_SURVEY . '_hidden" value="' . getSurvey() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_MODE . '" id="' . SMS_POST_MODE . '_hidden" value="' . getSurveyMode() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_LANGUAGE . '" id="' . SMS_POST_LANGUAGE . '_hidden" value="' . getSurveyLanguage() . '">';
$returnStr .= "</form>";
$returnStr .= '<form method="post">';
$returnStr .= setSessionParamsPost(array('page' => 'sysadmin.tools.checkres'));
$returnStr .= '<div class="well well-sm">';
$returnStr .= '<table>';
$returnStr .= '<tr><td>' . Language::labelOutputDocumentationSurvey() . '</td><td>' . $this->displaySurveys("survey", "survey", $_SESSION['SUID'], '', "onchange='document.getElementById(\"" . SMS_POST_SURVEY . "_hidden\").value=this.value; document.getElementById(\"refreshform\").submit();'") . '</tr>';
$returnStr .= '<tr><td>' . Language::labelOutputDocumentationMode() . '</td><td>' . $this->displayModesAdmin("surveymode", "surveymode", getSurveyMode(), "", implode("~", $user->getModes()), "onchange='document.getElementById(\"" . SMS_POST_MODE . "_hidden\").value=this.value; document.getElementById(\"refreshform\").submit();'") . '</tr>';
/* language dropdown */
$langs = explode("~", $user->getLanguages($_SESSION['SUID'], getSurveyMode()));
$default = $survey->getDefaultLanguage();
if (!inArray($default, $langs)) {
$langs[] = $default;
}
$returnStr .= '<tr><td>' . Language::labelOutputDocumentationLanguage() . '</td><td>' . $this->displayLanguagesAdmin("surveylanguage", "surveylanguage", getSurveyLanguage(), true, false, true, "", implode("~", $langs)) . '</tr>';
$returnStr .= '</table>';
$returnStr .= '</div>';
$returnStr .= '<div class="well well-sm">';
$returnStr .= '<table>';
$returnStr .= '<tr><td><label><input name=components[] value="' . SURVEY_COMPONENT_ROUTING . '" type="checkbox">' . Language::labelToolsCheckRouting() . '</label></td></tr>';
$returnStr .= '<tr><td><label><input name=components[] value="' . SURVEY_COMPONENT_SECTION . '" type="checkbox">' . Language::labelToolsCompileSections() . '</label></td></tr>';
$returnStr .= '<tr><td><label><input name=components[] value="' . SURVEY_COMPONENT_TYPE . '" type="checkbox">' . Language::labelToolsCompileTypes() . '</label></td></tr>';
$returnStr .= '<tr><td><label><input name=components[] value="' . SURVEY_COMPONENT_VARIABLE . '" type="checkbox">' . Language::labelToolsCompileVariables() . '</label></td></tr>';
$returnStr .= '<tr><td><label><input name=components[] value="' . SURVEY_COMPONENT_GROUP . '" type="checkbox">' . Language::labelToolsCompileGroup() . '</label></td></tr>';
$returnStr .= '</table>';
$returnStr .= '</div>';
$returnStr .= '<input type="submit" class="btn btn-default" value="' . Language::buttonCheck() . '"/>';
$returnStr .= '</form>';
$returnStr .= '</div>';
//END CONTENT
$returnStr .= '</p></div> </div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}