本文整理汇总了PHP中Language::getLanguagesArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::getLanguagesArray方法的具体用法?PHP Language::getLanguagesArray怎么用?PHP Language::getLanguagesArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::getLanguagesArray方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showLanguage
function showLanguage()
{
global $survey;
$allowed = explode("~", $survey->getAllowedLanguages(getSurveyMode()));
if (sizeof($allowed) == 1) {
return "";
}
$rgid = $this->engine->getRgid();
$variablenames = $this->getRealVariables(explode("~", $this->engine->getDisplayed()));
$template = $this->engine->getTemplate();
$click = "";
if ($template != "") {
$group = $this->engine->getGroup($template);
$click = $this->engine->replaceFills($group->getClickLanguageChange());
} else {
$vars = explode("~", $variablenames);
$var = $this->engine->getVariableDescriptive($vars[0]);
$click = $this->engine->replaceFills($var->getClickLanguageChange());
}
$click = str_replace("'", "", $click);
$current = getSurveyLanguage();
$langs = Language::getLanguagesArray();
foreach ($langs as $key => $lang) {
if (inArray($lang["value"], $allowed)) {
$check = '';
if ($lang["value"] == getSurveyLanguage()) {
// $check = ' <span class="glyphicon glyphicon-ok"></span>';
} else {
$returnStr .= '<button type="button" class="btn btn-sm btn-warning" onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_LASTACTION => $this->engine->getLastSurveyAction(), SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->primkey, SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => getSurveyMode(), SESSION_PARAM_TEMPLATE => getSurveyTemplate(), SESSION_PARAM_VERSION => getSurveyVersion(), SESSION_PARAM_LANGUAGE => $current, SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWLANGUAGE => $lang["value"]))) . '"; document.getElementById("navigation").value="' . NAVIGATION_LANGUAGE_CHANGE . '"; ' . $click . ' document.getElementById("form").submit(); \'>' . $lang["name"] . $check . '</button>';
}
}
}
return $returnStr;
}
示例2: watch
function watch()
{
$returnStr = $this->showHeader(Language::messageSMSTitle());
$returnStr .= $this->displayComboBox();
$returnStr .= "<form method='post'>";
$params = getSessionParams();
//$params['reportpage'] = 'reportRes';
$returnStr .= setSessionParamsPost($params);
$returnStr .= '<div id="wrap">';
$returnStr .= '<div class="container"><p>';
$returnStr .= '<div class="panel panel-default">
<div class="panel-heading">';
$returnStr .= '<h4>' . Language::linkWatch() . '</h4>';
$returnStr .= ' </div>
<div class="panel-body">';
require_once 'data.php';
require_once 'display.php';
$data = new Data();
$values = $data->getRespondentData(getFromSessionParams('watchsuid'), getFromSessionParams('watchprimkey'));
$returnStr .= '</div>
<div role="panel" class="panel">';
if (sizeof($values) == 0) {
$returnStr .= "<br/>" . '<div class="alert alert-warning">' . Language::labelWatchNoData() . '</div>';
} else {
$returnStr .= $this->displayDataTablesScripts(array("colvis", "rowreorder"));
$returnStr .= "<script type='text/javascript'>\n \$(document).ready(function(){\n \$('#issuetable').dataTable(\n {\n \"iDisplayLength\": 5,\n dom: 'C<\"clear\">lfrtip',\n searching: false,\n paging: true\n } \n );\n \n });</script>\n\n ";
//
$returnStr .= "<br/><table id='issuetable' class='table table-bordered table-striped'><thead>";
$returnStr .= "<th>" . Language::labelWatchVariable() . "</th><th>" . Language::labelWatchValue() . "</th><th>" . Language::labelWatchClean() . "</th><th>" . Language::labelWatchMode() . "</th><th>" . Language::labelWatchLanguage() . "</th><th>" . Language::labelWatchTime() . "</th></tr>";
$returnStr .= "</thead><tbody>";
$modes = Common::surveyModes();
$languages = Language::getLanguagesArray();
$sesid = session_id();
require_once 'object.php';
require_once 'component.php';
require_once 'setting.php';
require_once 'type.php';
require_once 'variabledescriptive.php';
$survey = new Survey(getFromSessionParams('watchsuid'));
foreach ($values as $is) {
$returnStr .= "<tr>";
$returnStr .= "<td>" . $is["variablename"] . "</td>";
$returnStr .= "<td>" . $this->getDisplayValue($survey->getVariableDescriptiveByName($is["variablename"]), $is["answer_dec"]) . "</td>";
$returnStr .= "<td>" . $this->displayDirty([$is["dirty"]]) . "</td>";
$returnStr .= "<td>" . $modes[$is["mode"]] . "</td>";
$returnStr .= "<td>" . $languages[str_replace("_", "", getSurveyLanguagePostFix($is["language"]))]['name'] . "</td>";
$returnStr .= "<td>" . $is["ts"] . "</td>";
$returnStr .= "</tr>";
}
$returnStr .= "</tbody></table>";
}
$returnStr .= '</div>
</div>
</div>';
$returnStr .= ' </div></div>';
$returnStr .= '</p></div> </div>';
//container and wrap
$returnStr .= $this->showFooter(false);
echo $returnStr;
}
示例3: showNavBar
public function showNavBar()
{
$returnStr = $this->showCalculator();
//language
$rgid = $this->engine->getRgid();
$variablenames = $this->engine->getDisplayed();
// begin language
global $survey;
if (getSurveyLanguageAllowChange() == LANGUAGE_CHANGE_RESPONDENT_ALLOWED) {
$allowed = explode("~", $survey->getAllowedLanguages(getSurveyMode()));
if (sizeof($allowed) > 1) {
$returnStr .= '<li class="dropdown">';
$returnStr .= ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Language <b class="caret"></b></a><ul class="dropdown-menu">';
$langs = Language::getLanguagesArray();
//getSurveyLanguages($this->engine->survey);
foreach ($langs as $lang) {
if (inArray($lang["value"], $allowed)) {
$check = '';
if ($lang["value"] == getSurveyLanguage()) {
$check = ' <span class="glyphicon glyphicon-ok"></span>';
}
$returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_PRIMKEY => $this->engine->primkey, SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWLANGUAGE => $lang["value"]))) . '"; document.getElementById("navigation").value="' . addslashes(Language::buttonUpdate()) . '"; document.getElementById("form").submit(); \'>' . $lang["name"] . $check . '</a></li>';
}
}
$returnStr .= '</ul></li>';
}
//end language
}
$user = new User($_SESSION['URID']);
$returnStr .= '<li class="dropdown">
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">' . $user->getName() . ' <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">' . $this->engine->primkey . '</li>
<li class="dropdown-header">' . $variablenames . '</li>';
//$returnStr .= '<li><a href=# data-toggle="modal" data-target="#calculator">Calculator</a></li>';
$returnStr .= '<li><a href="#" data-toggle="modal" data-target="#calculator"><span class="glyphicon glyphicon-th"></span> Calculator</a></li>';
$returnStr .= '<li><a href="' . setSessionParams(array('page' => 'nurse.backfromsms', 'primkey' => $this->engine->primkey, 'suid' => $this->engine->getSuid())) . '&se=' . addslashes(USCIC_SMS) . '"><span class="glyphicon glyphicon-home"></span> ' . Language::linkBackToSMS() . '</a></li>
<li class="divider"></li>
<li><a href="index.php?rs=1&se=2"><span class="glyphicon glyphicon-log-out"></span> ' . Language::linkLogout() . '</a></li>
</ul>
</li>
</ul>
';
$returnStr .= '</div><!--/.nav-collapse --> </div> </div>';
return $returnStr;
}
示例4: showTranslateGroupAssistance
function showTranslateGroupAssistance($group)
{
$returnStr = '<form id="editform" method="post">';
$returnStr .= setSessionParamsPost(array('page' => 'translator.survey.translategroupassistanceres', 'gid' => $group->getGid()));
$returnStr .= $this->getGroupTopTab(3);
$returnStr .= '<div class="well" style="background-color:white;">';
$helpstart = '<div class="input-group">';
$message = Language::helpFollowSurvey();
$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%>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceExclusive() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageExclusive(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceInclusive() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageInclusive(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceMinimumRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageMinimumRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceMaximumRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageMaximumRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceExactRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageExactRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceUniqueRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" readonly rows=2 class="form-control">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageUniqueRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '</table></div></div></div>';
switchSurveyLanguageTranslator($language);
}
$langlabel = $arr[str_replace("_", "", getSurveyLanguagePostFix($language))]['name'];
$returnStr .= "<div class='panel panel-default'>";
$returnStr .= "<div class='panel panel-heading' role='tab' id='headingTwo'>";
$returnStr .= '<a role="button" data-toggle="collapse" aria-expanded="true" aria-controls="collapseTwo" href="#collapseTwo">' . $langlabel . '</a>';
$returnStr .= "</div>";
$returnStr .= '<div class="panel-collapse collapse in" id="collapseTwo" role="tabpanel" labelledby="headingTwo">';
$returnStr .= "<div class='panel-body'>";
$returnStr .= '<table width=100%>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceExclusive() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" rows=2 class="form-control" name="' . SETTING_ERROR_MESSAGE_EXCLUSIVE . '">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageExclusive(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceInclusive() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" rows=2 class="form-control" name="' . SETTING_ERROR_MESSAGE_INCLUSIVE . '">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageInclusive(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceMinimumRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" rows=2 class="form-control" name="' . SETTING_ERROR_MESSAGE_MINIMUM_REQUIRED . '">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageMinimumRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceMaximumRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" rows=2 class="form-control" name="' . SETTING_ERROR_MESSAGE_MAXIMUM_REQUIRED . '">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageMaximumRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceExactRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" rows=2 class="form-control" name="' . SETTING_ERROR_MESSAGE_EXACT_REQUIRED . '">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageExactRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '<tr><td valign=top style="width: 15%;">' . Language::labelGroupEditAssistanceUniqueRequired() . '</td><td>' . $helpstart . '<textarea style="width: 100%;" rows=2 class="form-control" name="' . SETTING_ERROR_MESSAGE_UNIQUE_REQUIRED . '">' . $this->displayTextSettingValue(convertHTLMEntities($group->getErrorMessageUniqueRequired(), ENT_QUOTES)) . '</textarea>' . $helpend . '</td></tr>';
$returnStr .= '</table></div></div></div></div></div>';
$survey = new Survey($_SESSION['SUID']);
$user = new User($_SESSION['URID']);
$langs = explode("~", $user->getLanguages(getSurvey(), getSurveyMode()));
if (getSurveyLanguage() != $survey->getDefaultLanguage(getSurveyMode())) {
$returnStr .= '<input type="submit" class="btn btn-default" value="' . Language::buttonTranslate() . '"/>';
} else {
if (inArray(getSurveyLanguage(), $langs)) {
$returnStr .= '<input type="submit" class="btn btn-default" value="' . Language::buttonEdit() . '"/>';
}
}
$returnStr .= '</form>';
return $returnStr;
}
示例5: showNavBar
public function showNavBar()
{
$returnStr = $this->showCalculator();
//language
$rgid = $this->engine->getRgid();
$variablenames = $this->getRealVariables(explode("~", $this->engine->getDisplayed()));
$variablenamesfull = $this->engine->getDisplayed();
$template = $this->engine->getTemplate();
$click = "";
if ($template != "") {
$group = $this->engine->getGroup($template);
$click = $this->engine->replaceFills($group->getClickLanguageChange());
} else {
$vars = explode("~", $variablenames);
$var = $this->engine->getVariableDescriptive($vars[0]);
$click = $this->engine->replaceFills($var->getClickLanguageChange());
}
$click = str_replace("'", "", $click);
// begin language
global $survey;
if (getSurveyLanguageAllowChange() == LANGUAGE_CHANGE_RESPONDENT_ALLOWED) {
$allowed = explode("~", $survey->getAllowedLanguages(getSurveyMode()));
if (sizeof($allowed) > 1) {
$returnStr .= '<li class="dropdown">';
$returnStr .= ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Language <b class="caret"></b></a><ul class="dropdown-menu">';
$langs = Language::getLanguagesArray();
//getSurveyLanguages($this->engine->survey);
foreach ($langs as $lang) {
if (inArray($lang["value"], $allowed)) {
$check = '';
if ($lang["value"] == getSurveyLanguage()) {
$check = ' <span class="glyphicon glyphicon-ok"></span>';
}
$returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->engine->getPrimaryKey(), SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => getSurveyMode(), SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TEMPLATE => getSurveyTemplate(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWLANGUAGE => $lang["value"]))) . '"; document.getElementById("navigation").value="' . addslashes(Language::buttonUpdate()) . '"; ' . $click . ' document.getElementById("form").submit(); \'>' . $lang["name"] . $check . '</a></li>';
}
}
$returnStr .= '</ul></li>';
}
//end language
}
$user = new User($_SESSION['URID']);
$returnStr .= '<li class="dropdown">
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">' . $user->getName() . ' <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">' . $this->engine->primkey . '</li>
<li class="dropdown-header">' . $variablenamesfull . '</li>';
//$returnStr .= '<li><a href=# data-toggle="modal" data-target="#calculator">Calculator</a></li>';
$returnStr .= '<li><a href="#" data-toggle="modal" data-target="#calculator"><span class="glyphicon glyphicon-th"></span> ' . Language::linkCalculator() . '</a></li>';
$windowopen = 'window.open(\'tester/' . setSessionParams(array('type' => "2", 'testpage' => 'watch', 'watchurid' => $_SESSION['URID'], 'watchsuid' => $this->engine->getSuid(), 'watchseid' => $this->engine->getSeid(), 'watchmainseid' => $this->engine->getMainSeid(), 'watchrgid' => $rgid, 'watchdisplayed' => $variablenames, 'watchlanguage' => getSurveyLanguage(), 'watchmode' => getSurveyMode(), 'watchversion' => getSurveyVersion(), 'watchprimkey' => $this->engine->getPrimarykey())) . '\', \'popupWindow\', \'width=770,height=650,scrollbars=yes,top=100,left=100\'); return false;';
$javascript = ' onclick="' . $windowopen . '"';
$returnStr .= '<li><a style="cursor: pointer;" ' . $javascript . '><span class="glyphicon glyphicon-zoom-in"></span> ' . Language::linkWatch() . '</a></li>';
$windowopen = 'window.open(\'tester/' . setSessionParams(array('type' => "2", 'testpage' => 'update', 'watchurid' => $_SESSION['URID'], 'watchsuid' => $this->engine->getSuid(), 'watchseid' => $this->engine->getSeid(), 'watchmainseid' => $this->engine->getMainSeid(), 'watchrgid' => $rgid, 'watchdisplayed' => $variablenames, 'watchlanguage' => getSurveyLanguage(), 'watchmode' => getSurveyMode(), 'watchversion' => getSurveyVersion(), 'watchprimkey' => $this->engine->getPrimarykey())) . '\', \'popupWindow\', \'width=1200,height=650,scrollbars=yes,top=100,left=100\'); return false;';
$javascript = ' onclick="' . $windowopen . '"';
$returnStr .= '<li><a style="cursor: pointer;" ' . $javascript . '><span class="glyphicon glyphicon-zoom-in"></span> ' . Language::linkUpdate() . '</a></li>';
$first = $this->engine->isFirstState();
if ($first == false || $first == true && $this->engine->getForward() == true) {
if ($this->engine->getForward() == true) {
$stateid = $this->engine->getStateId() + 1;
} else {
$stateid = $this->engine->getStateId();
}
$windowopen = 'window.open(\'tester/' . setSessionParams(array('type' => "2", 'testpage' => 'jumpback', 'jumpurid' => $_SESSION['URID'], 'jumpsuid' => $this->engine->getSuid(), 'jumpstateid' => $stateid, 'jumpprimkey' => $this->engine->getPrimaryKey())) . '\', \'popupWindow\', \'width=770,height=300,scrollbars=yes,top=100,left=100\'); return false;';
$javascript = ' onclick="' . $windowopen . '"';
$returnStr .= '<li><a style="cursor: pointer;" ' . $javascript . '><span class="glyphicon glyphicon-arrow-left"></span> ' . Language::linkJumpBack() . '</a></li>';
}
$returnStr .= '<li><a href="' . setSessionParams(array('page' => 'interviewer.backfromsms', 'primkey' => $this->engine->primkey, 'suid' => $this->engine->getSuid())) . '&se=' . addslashes(USCIC_SMS) . '"><span class="glyphicon glyphicon-home"></span> ' . Language::linkBackToSMS() . '</a></li>
<li class="divider"></li>
<li><a href="index.php?rs=1&se=2"><span class="glyphicon glyphicon-log-out"></span> ' . Language::linkLogout() . '</a></li>
</ul>
</li>
</ul>
';
$returnStr .= '</div><!--/.nav-collapse --> </div> </div>';
return $returnStr;
}
示例6: showNavBar
public function showNavBar()
{
$returnStr = $this->getHeader();
//language
$rgid = $this->engine->getRgid();
$variablenames = $this->getRealVariables(explode("~", $this->engine->getDisplayed()));
$variablenamesfull = $this->engine->getDisplayed();
$template = $this->engine->getTemplate();
$click = "";
if ($template != "") {
$group = $this->engine->getGroup($template);
$click = $this->engine->replaceFills($group->getClickLanguageChange());
} else {
$vars = explode("~", $variablenames);
$var = $this->engine->getVariableDescriptive($vars[0]);
$click = $this->engine->replaceFills($var->getClickLanguageChange());
}
$click = str_replace("'", "", $click);
$clickmode = "";
if ($template != "") {
$group = $this->engine->getGroup($template);
$clickmode = $this->engine->replaceFills($group->getClickModeChange());
} else {
$vars = explode("~", $variablenames);
$var = $this->engine->getVariableDescriptive($vars[0]);
$clickmode = $this->engine->replaceFills($var->getClickModeChange());
}
$clickmode = str_replace("'", "", $clickmode);
// begin language
global $survey;
$user = new User($_SESSION['URID']);
$allowedmodes = $user->getModes();
$allowedlanguages = explode("~", $user->getLanguages(getSurvey(), getSurveyMode()));
$default = $survey->getDefaultLanguage();
$ut = "sysadmin";
if ($user->getUserType() == USER_TRANSLATOR) {
$ut = "translator";
if (!inArray($default, $allowedlanguages)) {
$allowedlanguages[] = $default;
}
} else {
if ($user->GetUserType() == USER_TESTER) {
$ut = "tester";
}
}
if (getSurveyModeAllowChange() == MODE_CHANGE_RESPONDENT_ALLOWED) {
//$allowed = explode("~", $survey->getAllowedModes());
if (sizeof($allowedmodes) > 1) {
$template = $this->engine->getTemplate();
$returnStr .= '<li class="dropdown">';
$returnStr .= ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mode <b class="caret"></b></a>';
$returnStr .= '<ul class="dropdown-menu" role="menu">';
$current = getSurveyMode();
$modes = Common::surveyModes();
foreach ($modes as $key => $mode) {
if (inArray($key, $allowedmodes)) {
$check = '';
if ($key == $current) {
$check = ' <span class="glyphicon glyphicon-ok"></span>';
}
//$returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_LASTACTION => $this->engine->getLastSurveyAction(), SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->primkey, SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => $current, SESSION_PARAM_VERSION => getSurveyVersion(), SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWMODE => $key))) . '"; document.getElementById("navigation").value="' . NAVIGATION_MODE_CHANGE . '"; $("#form").submit(); \'>' . $mode . $check . '</a></li>';
$returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->engine->getPrimaryKey(), SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => getSurveyMode(), SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TEMPLATE => getSurveyTemplate(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWMODE => $key))) . '"; document.getElementById("navigation").value="' . addslashes(Language::buttonUpdate()) . '"; ' . $clickmode . ' document.getElementById("form").submit(); \'>' . $mode . $check . '</a></li>';
}
}
$returnStr .= '</ul></li>';
}
}
if (getSurveyLanguageAllowChange() == LANGUAGE_CHANGE_RESPONDENT_ALLOWED) {
//$allowed = explode("~", $survey->getAllowedLanguages(getSurveyMode()));
if (sizeof($allowedlanguages) > 1) {
$returnStr .= '<li class="dropdown">';
$returnStr .= ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">Language <b class="caret"></b></a><ul class="dropdown-menu">';
$langs = Language::getLanguagesArray();
//getSurveyLanguages($this->engine->survey);
foreach ($langs as $lang) {
if (inArray($lang["value"], $allowedlanguages)) {
$check = '';
if ($lang["value"] == getSurveyLanguage()) {
$check = ' <span class="glyphicon glyphicon-ok"></span>';
}
$returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->engine->getPrimaryKey(), SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => getSurveyMode(), SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TEMPLATE => getSurveyTemplate(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWLANGUAGE => $lang["value"]))) . '"; document.getElementById("navigation").value="' . addslashes(Language::buttonUpdate()) . '"; ' . $click . ' document.getElementById("form").submit(); \'>' . $lang["name"] . $check . '</a></li>';
}
}
$returnStr .= '</ul></li>';
}
//end language
}
$user = new User($_SESSION['URID']);
$returnStr .= '<li class="dropdown">
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">' . $user->getName() . ' <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">' . $this->engine->getPrimaryKey() . '</li>
<li class="dropdown-header">' . $variablenamesfull . '</li>';
$windowopen = 'window.open(\'tester/' . setSessionParams(array('reporturid' => $_SESSION['URID'], 'testpage' => 'report', 'reportsuid' => $this->engine->getSuid(), 'reportseid' => $this->engine->getSeid(), 'reportmainseid' => $this->engine->getMainSeid(), 'reportrgid' => $rgid, 'reportdisplayed' => $variablenames, 'reportlanguage' => getSurveyLanguage(), 'reportmode' => getSurveyMode(), 'reportversion' => getSurveyVersion(), 'reportprimkey' => $this->engine->getPrimarykey())) . '\', \'popupWindow\', \'width=770,height=500,scrollbars=yes,top=100,left=100\'); return false;';
$javascript = ' onclick="' . $windowopen . '"';
$returnStr .= '<li><a style="cursor: pointer;" ' . $javascript . '><span class="glyphicon glyphicon-remove-sign"></span> ' . Language::linkReportProblem() . '</a></li>';
$windowopen = 'window.open(\'tester/' . setSessionParams(array('testpage' => 'watch', 'watchurid' => $_SESSION['URID'], 'watchsuid' => $this->engine->getSuid(), 'watchseid' => $this->engine->getSeid(), 'watchmainseid' => $this->engine->getMainSeid(), 'watchrgid' => $rgid, 'watchdisplayed' => $variablenames, 'watchlanguage' => getSurveyLanguage(), 'watchmode' => getSurveyMode(), 'watchversion' => getSurveyVersion(), 'watchprimkey' => $this->engine->getPrimarykey())) . '\', \'popupWindow\', \'width=770,height=650,scrollbars=yes,top=100,left=100\'); return false;';
$javascript = ' onclick="' . $windowopen . '"';
$returnStr .= '<li><a style="cursor: pointer;" ' . $javascript . '><span class="glyphicon glyphicon-zoom-in"></span> ' . Language::linkWatch() . '</a></li>';
$first = $this->engine->isFirstState();
//.........这里部分代码省略.........
示例7: reportSub
function reportSub($message = '')
{
$returnStr = $this->displayComboBox();
$returnStr .= '<div class="panel panel-default">
<div class="panel-heading">';
$returnStr .= '<h4>' . Language::reportProblem() . '</h4>';
$returnStr .= ' </div>
<div class="panel-body">';
$returnStr .= $message;
global $survey;
$issues = $survey->getReportedIssues();
$returnStr .= '<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#newissue" aria-controls="home" role="tab" data-toggle="tab">New problem</a></li>
<li role="presentation"><a href="#reportedissues" aria-controls="home" role="tab" data-toggle="tab">Reported problems (' . sizeof($issues) . ')</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="newissue">';
$returnStr .= "<br/><table>";
$returnStr .= "<tr><td>" . Language::reportProblemCategory() . "</td><td>";
$returnStr .= "<select class='selectpicker show-tick' name='reportcategory'>";
$options = Language::reportProblemCategories();
foreach ($options as $k => $option) {
$returnStr .= "<option value=" . $k . ">" . $option . "</option>";
}
$returnStr .= "</select></td></tr>";
$returnStr .= "<tr><td valign=top>" . Language::reportProblemDescription() . "</td><td>";
$returnStr .= "<textarea name='reportcomment' class='form-control' style='min-width: 400px;' rows=6></textarea>";
$returnStr .= "</td></tr>";
$returnStr .= '</table><br/>';
$returnStr .= '<button type="submit" class="btn btn-success" style="min-width:100px">' . Language::buttonReport() . '</button>';
$returnStr .= '<button onclick="window.close();" type="cancel" class="btn btn-default" style="min-width:100px">' . Language::buttonClose() . '</button>';
$returnStr .= "</form>";
$returnStr .= '</div>
<div role="tabpanel" class="tab-pane" id="reportedissues">';
if (sizeof($issues) == 0) {
$returnStr .= "<br/>" . '<div class="alert alert-warning">' . Language::labelNoProblemsReported() . '</div>';
} else {
$returnStr .= $this->displayDataTablesScripts(array("colvis", "rowreorder"));
$returnStr .= "<script type='text/javascript'>\n \$(document).ready(function(){\n \$('#issuetable').dataTable(\n {\n \"iDisplayLength\": " . sizeof($issues) . ",\n dom: 'C<\"clear\">lfrtip',\n searching: false,\n paging: false\n } \n );\n \n });</script>\n\n ";
//
$returnStr .= "<br/><table id='issuetable' class='table table-bordered table-striped'><thead>";
$returnStr .= "<th>Reported by</th><th>" . Language::labelReportedOn() . "</th><th>" . Language::labelReportedCategory() . "</th><th>" . Language::labelReportedDescription() . "</th><th>" . Language::labelReportedMode() . "</th><th>" . Language::labelReportedLanguage() . "</th>";
$returnStr .= "</thead><tbody>";
$modes = Common::surveyModes();
$languages = Language::getLanguagesArray();
$cats = Language::reportProblemCategories();
foreach ($issues as $is) {
$us = new User($is['urid']);
$returnStr .= "<tr>";
$returnStr .= "<td>" . $us->getUsername() . "</td>";
$returnStr .= "<td>" . $is["ts"] . "</td>";
$returnStr .= "<td>" . $cats[$is["category"]] . "</td>";
$returnStr .= "<td>" . $is["comment"] . "</td>";
$returnStr .= "<td>" . $modes[$is["mode"]] . "</td>";
$returnStr .= "<td>" . $languages[str_replace("_", "", getSurveyLanguagePostFix($is["language"]))]['name'] . "</td>";
$returnStr .= "</tr>";
}
$returnStr .= "</tbody></table>";
}
$returnStr .= '</div>
</div>
</div>';
return $returnStr;
}
示例8: showIssues
function showIssues($content = "")
{
$returnStr = $this->showToolsHeader(Language::linkReported());
$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="sysadmin.tools.issues">';
$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>";
// get reported issues for survey
global $survey;
$issues = $survey->getReportedIssues();
// no problems reported
if (sizeof($issues) == 0) {
$returnStr .= "<br/>" . '<div class="alert alert-warning">' . 'No reported problems found' . '</div>';
} else {
$returnStr .= $this->displayComboBox();
$returnStr .= '<span class="label label-default">Filter by</span>';
$returnStr .= '<div class="well well-sm">';
$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></table></div>";
$returnStr .= $this->displayDataTablesScripts(array("colvis", "rowreorder"));
$returnStr .= "<script type='text/javascript'>\n \$(document).ready(function(){\n \$('#issuetable').dataTable(\n {\n \"iDisplayLength\": " . sizeof($issues) . ",\n dom: 'C<\"clear\">lfrtip',\n searching: false,\n paging: false\n } \n );\n \n });</script>\n\n ";
//
$returnStr .= "<br/><table id='issuetable' class='table table-bordered table-striped'><thead>";
$returnStr .= "<th>Reported by</th><th>Reported on</th><th>Category</th><th>Description</th><th>Primary key</th><th>Interview mode</th><th>Language</th>";
$returnStr .= "</thead><tbody>";
$modes = Common::surveyModes();
$languages = Language::getLanguagesArray();
$cats = Language::reportProblemCategories();
foreach ($issues as $is) {
$us = new User($is['urid']);
$returnStr .= "<tr>";
$returnStr .= "<td>" . $us->getUsername() . "</td>";
$returnStr .= "<td>" . $is["ts"] . "</td>";
$returnStr .= "<td>" . $cats[$is["category"]] . "</td>";
$returnStr .= "<td>" . $is["comment"] . "</td>";
$returnStr .= "<td>" . $is["primkey"] . "</td>";
$returnStr .= "<td>" . $modes[$is["mode"]] . "</td>";
$returnStr .= "<td>" . $languages[str_replace("_", "", getSurveyLanguagePostFix($is["language"]))]['name'] . "</td>";
$returnStr .= "</tr>";
}
$returnStr .= "</tbody></table>";
}
} else {
$returnStr .= $this->displayInfo(Language::messageNoSurveysAvailable());
}
$returnStr .= '</p></div></div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}
示例9: update
function update()
{
$returnStr = $this->showHeader(Language::messageSMSTitle());
$returnStr .= $this->displayComboBox();
$returnStr .= '<div id="wrap">';
$returnStr .= '<div class="container"><p>';
$returnStr .= '<div class="panel panel-default">
<div class="panel-heading">';
$returnStr .= '<h4>' . Language::linkUpdate() . '</h4>';
$returnStr .= ' </div>
<div class="panel-body">';
require_once 'data.php';
require_once 'display.php';
$data = new Data();
$values = $data->getRespondentData(getFromSessionParams('watchsuid'), getFromSessionParams('watchprimkey'));
$returnStr .= '</div>
<div role="panel" class="panel">';
if (sizeof($values) == 0) {
$returnStr .= "<br/>" . '<div class="alert alert-warning">' . Language::labelWatchNoData() . '</div>';
} else {
$display = $this->engine->getDisplayObject();
$returnStr .= $display->displayDataTablesScripts(array("colvis", "rowreorder"));
$returnStr .= "<script type='text/javascript'>\n \$(document).ready(function(){\n \$('#issuetable').dataTable(\n {\n \"iDisplayLength\": 4,\n dom: 'C<\"clear\">lfrtip',\n searching: false,\n paging: true\n } \n );\n \n });</script>\n\n ";
//
$returnStr .= "<br/><table id='issuetable' class='table table-bordered table-striped'><thead>";
$returnStr .= "<th>" . Language::labelUpdateVariable() . "</th><th>" . Language::labelUpdateQuestion() . "</th><th>" . Language::labelUpdateCurrent() . "</th><th>" . Language::labelUpdateChangeTo() . "</th></tr>";
$returnStr .= "</thead><tbody>";
$modes = Common::surveyModes();
$languages = Language::getLanguagesArray();
$sesid = session_id();
require_once 'object.php';
require_once 'component.php';
require_once 'setting.php';
require_once 'type.php';
require_once 'variabledescriptive.php';
global $survey;
$survey = new Survey(getFromSessionParams('watchsuid'));
$cnt = 1;
$params = getSessionParams();
$params[SESSION_PARAM_SURVEY] = getFromSessionParams('watchsuid');
// add for getSurvey
$params['testpage'] = 'updateRes';
$paramstring = setSessionParamsPost($params);
foreach ($values as $is) {
$var = $survey->getVariableDescriptiveByName($is["variablename"]);
$returnStr .= "<tr>";
$returnStr .= "<td>" . $is["variablename"] . "</td>";
$returnStr .= "<td>" . $var->getQuestion() . "</td>";
$returnStr .= "<td>" . $this->getDisplayValue($var, $is["answer_dec"]) . "</td>";
$returnStr .= "<td>" . $this->displayInput($paramstring, $is["variablename"], $var, $is["answer_dec"], $cnt) . "</td>";
$returnStr .= "</tr>";
$cnt++;
}
$returnStr .= "</tbody></table>";
}
$returnStr .= '</div>
</div>
</div>';
$returnStr .= ' </div></div>';
$returnStr .= '</p></div> </div>';
//container and wrap
$returnStr .= $this->showFooter(false);
echo $returnStr;
}
示例10: displayLanguagesAdmin
function displayLanguagesAdmin($name, $id, $value, $flags = true, $country = true, $showdefault = true, $multiple = "", $list = "")
{
$languages = Language::getLanguagesArray();
$returnStr = $this->displayComboBox();
$values = explode("~", $value);
$tag = "";
if ($multiple != "") {
$tag = "[]";
}
$returnStr .= '<select ' . $multiple . ' id="' . $id . '" name="' . $name . $tag . '" class="form-control selectpicker show-tick">';
$languagelist = explode("~", $list);
foreach ($languages as $lang) {
if (trim($list) == "" || inArray($lang["value"], $languagelist)) {
$text = $lang["name"];
if ($country) {
if ($lang["countryfull"] != "") {
$text .= "(" . $lang["countryfull"] . ")";
}
}
$flagtext = "";
if ($flags) {
$flagtext = 'data-icon="bfh-flag-' . $lang["country"] . '"';
}
$selected = "";
if (inArray($lang["value"], $values)) {
$selected = "SELECTED";
}
$default = "";
if ($showdefault == true && $lang["value"] == getDefaultSurveyLanguage()) {
$default = " (default)";
}
$returnStr .= '<option ' . $selected . ' value="' . $lang["value"] . '" ' . $flagtext . '>' . $text . $default . '</option>';
}
}
$returnStr .= '</select>';
return $returnStr;
}