本文整理汇总了PHP中LimeExpressionManager::SetEMLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP LimeExpressionManager::SetEMLanguage方法的具体用法?PHP LimeExpressionManager::SetEMLanguage怎么用?PHP LimeExpressionManager::SetEMLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LimeExpressionManager
的用法示例。
在下文中一共展示了LimeExpressionManager::SetEMLanguage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetSurveyLanguage
/**
* Set the public survey language
* Control if language exist in this survey, else set to survey default language
* if $surveyid <= 0 : set the language to default site language
* @param int $surveyid
* @param string $language
*/
function SetSurveyLanguage($surveyid, $language)
{
$surveyid = sanitize_int($surveyid);
$default_language = Yii::app()->getConfig('defaultlang');
if (isset($surveyid) && $surveyid > 0) {
$default_survey_language = Survey::model()->findByPk($surveyid)->language;
$additional_survey_languages = Survey::model()->findByPk($surveyid)->getAdditionalLanguages();
if (!isset($language) || $language == '' || !(in_array($language, $additional_survey_languages) || $language == $default_survey_language)) {
// Language not supported, fall back to survey's default language
$_SESSION['survey_' . $surveyid]['s_lang'] = $default_survey_language;
} else {
$_SESSION['survey_' . $surveyid]['s_lang'] = $language;
}
Yii::import('application.libraries.Limesurvey_lang', true);
$clang = new limesurvey_lang($_SESSION['survey_' . $surveyid]['s_lang']);
$thissurvey = getSurveyInfo($surveyid, @$_SESSION['survey_' . $surveyid]['s_lang']);
Yii::app()->loadHelper('surveytranslator');
LimeExpressionManager::SetEMLanguage($_SESSION['survey_' . $surveyid]['s_lang']);
} else {
if (!$language) {
$language = $default_language;
}
$_SESSION['survey_' . $surveyid]['s_lang'] = $language;
Yii::import('application.libraries.Limesurvey_lang', true);
$clang = new Limesurvey_lang($language);
}
$oApplication = Yii::app();
$oApplication->lang = $clang;
return $clang;
}
示例2: view
/**
* Load complete view of survey properties and actions specified by $iSurveyID
*
* @access public
* @param mixed $iSurveyID
* @param mixed $gid
* @param mixed $qid
* @return void
*/
public function view($iSurveyID, $gid = null, $qid = null)
{
$iSurveyID = sanitize_int($iSurveyID);
if (isset($gid)) {
$gid = sanitize_int($gid);
}
if (isset($qid)) {
$qid = sanitize_int($qid);
}
// Reinit LEMlang and LEMsid: ensure LEMlang are set to default lang, surveyid are set to this survey id
// Ensure Last GetLastPrettyPrintExpression get info from this sid and default lang
LimeExpressionManager::SetEMLanguage(Survey::model()->findByPk($iSurveyID)->language);
LimeExpressionManager::SetSurveyId($iSurveyID);
LimeExpressionManager::StartProcessingPage(false, true);
$aData['surveyid'] = $iSurveyID;
$aData['gid'] = $gid;
$aData['qid'] = $qid;
$aData['display']['menu_bars']['surveysummary'] = true;
$this->_renderWrappedTemplate('survey', array(), $aData);
}
示例3: SetSurveyLanguage
/**
* Set the public survey language
* Control if language exist in this survey, else set to survey default language
* if $surveyid <= 0 : set the language to default site language
* @param int $surveyid
* @param string $language
*/
function SetSurveyLanguage($surveyid, $sLanguage)
{
$surveyid = sanitize_int($surveyid);
$default_language = Yii::app()->getConfig('defaultlang');
if (isset($surveyid) && $surveyid > 0) {
$default_survey_language = Survey::model()->findByPk($surveyid)->language;
$additional_survey_languages = Survey::model()->findByPk($surveyid)->getAdditionalLanguages();
if (!isset($sLanguage) || $sLanguage == '' || !(in_array($sLanguage, $additional_survey_languages) || $sLanguage == $default_survey_language)) {
// Language not supported, fall back to survey's default language
$_SESSION['survey_' . $surveyid]['s_lang'] = $default_survey_language;
} else {
$_SESSION['survey_' . $surveyid]['s_lang'] = $sLanguage;
}
App()->setLanguage($_SESSION['survey_' . $surveyid]['s_lang']);
$thissurvey = getSurveyInfo($surveyid, @$_SESSION['survey_' . $surveyid]['s_lang']);
Yii::app()->loadHelper('surveytranslator');
LimeExpressionManager::SetEMLanguage($_SESSION['survey_' . $surveyid]['s_lang']);
} else {
if (!$sLanguage) {
$sLanguage = $default_language;
}
$_SESSION['survey_' . $surveyid]['s_lang'] = $sLanguage;
App()->setLanguage($_SESSION['survey_' . $surveyid]['s_lang']);
}
}
示例4: SetSurveyLanguage
function SetSurveyLanguage($surveyid, $language)
{
global $rootdir, $defaultlang, $clang;
$surveyid = sanitize_int($surveyid);
require_once $rootdir . '/classes/core/language.php';
if (isset($surveyid) && $surveyid > 0) {
// see if language actually is present in survey
# $query = "SELECT language, additional_languages FROM ".db_table_name('surveys')." WHERE sid=$surveyid";
# $result = db_execute_assoc($query); //Checked
# while ($result && ($row=$result->FetchRow())) {
# $additional_languages = $row['additional_languages'];
# $default_language = $row['language'];
# }
$default_language = GetBaseLanguageFromSurveyID($surveyid);
$additional_languages = GetAdditionalLanguagesFromSurveyID($surveyid);
if (!isset($language) || $language == '' || !(in_array($language, $additional_languages) || $language == $default_language)) {
// Language not supported, fall back to survey's default language
$_SESSION['s_lang'] = $default_language;
} else {
$_SESSION['s_lang'] = $language;
}
$clang = new limesurvey_lang($_SESSION['s_lang']);
} else {
$clang = new limesurvey_lang($defaultlang);
}
$thissurvey = getSurveyInfo($surveyid, $_SESSION['s_lang']);
$_SESSION['dateformats'] = getDateFormatData($thissurvey['surveyls_dateformat']);
LimeExpressionManager::SetEMLanguage($_SESSION['s_lang']);
return $clang;
}
示例5: listquestions
/**
* Load list questions view for a specified survey by $iSurveyID
*
* @access public
* @param mixed $iSurveyID
* @param mixed $gid
* @param mixed $qid
* @return void
*/
public function listquestions($surveyid)
{
$iSurveyID = sanitize_int($surveyid);
// Reinit LEMlang and LEMsid: ensure LEMlang are set to default lang, surveyid are set to this survey id
// Ensure Last GetLastPrettyPrintExpression get info from this sid and default lang
LimeExpressionManager::SetEMLanguage(Survey::model()->findByPk($iSurveyID)->language);
LimeExpressionManager::SetSurveyId($iSurveyID);
LimeExpressionManager::StartProcessingPage(false, true);
$survey = Survey::model()->findByPk($iSurveyID);
$aData['surveyid'] = $iSurveyID;
$aData['display']['menu_bars']['listquestions'] = true;
$aData['sidemenu']['listquestions'] = true;
$aData['surveybar']['returnbutton']['url'] = $this->getController()->createUrl("admin/survey/sa/listsurveys");
$aData['surveybar']['returnbutton']['text'] = gT('Return to survey list');
$aData['surveybar']['buttons']['newquestion'] = true;
$surveyinfo = $survey->surveyinfo;
$aData["surveyinfo"] = $surveyinfo;
$aData["surveyHasGroup"] = $survey->groups;
$aData['title_bar']['title'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
$this->_renderWrappedTemplate('survey', array(), $aData);
}
示例6: SetSurveyLanguage
function SetSurveyLanguage($surveyid, $language)
{
global $rootdir, $defaultlang, $clang;
$surveyid = sanitize_int($surveyid);
require_once $rootdir . '/classes/core/language.php';
if (isset($surveyid) && $surveyid > 0) {
// see if language actually is present in survey
$query = "SELECT language, additional_languages FROM " . db_table_name('surveys') . " WHERE sid={$surveyid}";
$result = db_execute_assoc($query);
//Checked
while ($result && ($row = $result->FetchRow())) {
$additional_languages = $row['additional_languages'];
$default_language = $row['language'];
}
if (!isset($language) || $language == '' || isset($additional_languages) && strpos($additional_languages, $language) === false or isset($default_language) && $default_language == $language) {
// Language not supported, or default language for survey, fall back to survey's default language
$_SESSION['s_lang'] = $default_language;
//echo "Language not supported, resorting to ".$_SESSION['s_lang']."<br />";
} else {
$_SESSION['s_lang'] = $language;
//echo "Language will be set to ".$_SESSION['s_lang']."<br />";
}
$clang = new limesurvey_lang($_SESSION['s_lang']);
} else {
$clang = new limesurvey_lang($defaultlang);
}
$thissurvey = getSurveyInfo($surveyid, $_SESSION['s_lang']);
$_SESSION['dateformats'] = getDateFormatData($thissurvey['surveyls_dateformat']);
LimeExpressionManager::SetEMLanguage($_SESSION['s_lang']);
return $clang;
}
示例7: returnglobal
//Desired subaction
if (!isset($editedaction)) {
$editedaction = returnglobal('editedaction');
}
// for html editor integration
if (isset($_SERVER['HTTP_REFERER'])) {
$refurl = $_SERVER['HTTP_REFERER'];
//store referer. Can be used for other screens and not just GlobalSettings
} else {
$refurl = "";
}
LimeExpressionManager::SetSurveyId($surveyid);
// must be called early - it clears internal cache if a new survey is being used
if (!is_null($surveyid)) {
$sinfo = getSurveyInfo($surveyid);
LimeExpressionManager::SetEMLanguage($sinfo['surveyls_language']);
}
if ($action != 'showprintablesurvey' && substr($action, 0, 4) != 'ajax') {
$adminoutput = "<div id='wrapper'>";
} else {
$adminoutput = '';
}
if ($casEnabled == true) {
include_once "login_check_cas.php";
} else {
include_once 'login_check.php';
}
if ($action == 'CSRFwarn') {
include 'access_denied.php';
}
if ($action == 'FakeGET') {