本文整理汇总了PHP中makeLanguageChangerSurvey函数的典型用法代码示例。如果您正苦于以下问题:PHP makeLanguageChangerSurvey函数的具体用法?PHP makeLanguageChangerSurvey怎么用?PHP makeLanguageChangerSurvey使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makeLanguageChangerSurvey函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
//.........这里部分代码省略.........
}
$qanda[] = $plus_qanda;
}
if ($plus_inputnames) {
$inputnames = addtoarray_single($inputnames, $plus_inputnames);
}
//Display the "mandatory" popup if necessary
// TMSW - get question-level error messages - don't call **_popup() directly
if ($okToShowErrors && $stepInfo['mandViolation']) {
list($mandatorypopup, $popup) = mandatory_popup($ia, $notanswered);
}
//Display the "validation" popup if necessary
if ($okToShowErrors && !$stepInfo['valid']) {
list($validationpopup, $vpopup) = validation_popup($ia, $notvalidated);
}
// Display the "file validation" popup if necessary
if ($okToShowErrors && isset($filenotvalidated)) {
list($filevalidationpopup, $fpopup) = file_validation_popup($ia, $filenotvalidated);
}
}
if ($ia[4] == "|") {
$upload_file = TRUE;
}
}
//end iteration
}
if ($surveyMode != 'survey' && isset($thissurvey['showprogress']) && $thissurvey['showprogress'] == 'Y') {
if ($show_empty_group) {
$percentcomplete = makegraph($_SESSION[$LEMsessid]['totalsteps'] + 1, $_SESSION[$LEMsessid]['totalsteps']);
} else {
$percentcomplete = makegraph($_SESSION[$LEMsessid]['step'], $_SESSION[$LEMsessid]['totalsteps']);
}
}
if (!(isset($languagechanger) && strlen($languagechanger) > 0) && function_exists('makeLanguageChangerSurvey')) {
$languagechanger = makeLanguageChangerSurvey($_SESSION[$LEMsessid]['s_lang']);
}
//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
sendCacheHeaders();
doHeader();
/**
* Question Index
*/
$aQuestionindexbuttons = null;
$aQuestionindexbuttonsmenu = null;
if (!$previewgrp && !$previewquestion) {
if ($surveyMode != 'survey' && $thissurvey['questionindex'] == 1) {
//$aQuestionindex = $this->createIncrementalQuestionIndex($LEMsessid, $surveyMode);
$aQuestionindexmenu = $this->createIncrementalQuestionIndexMenu($LEMsessid, $surveyMode);
} elseif ($surveyMode != 'survey' && $thissurvey['questionindex'] == 2) {
//$aQuestionindex = $this->createFullQuestionIndex($LEMsessid, $surveyMode);
$aQuestionindexmenu = $this->createFullQuestionIndexMenu($LEMsessid, $surveyMode);
}
//$questionindex = (isset($aQuestionindex['menulist']))?$aQuestionindex['menulist']:'';
$questionindexmenu = isset($aQuestionindexmenu['menulist']) ? $aQuestionindexmenu['menulist'] : '';
//$aQuestionindexbuttons = (isset($aQuestionindex['buttons']))?$aQuestionindex['buttons']:'';
$aQuestionindexbuttonsmenu = isset($aQuestionindexmenu['buttons']) ? $aQuestionindexmenu['buttons'] : '';
}
/////////////////////////////////
// First call to templatereplace
echo "<!-- SurveyRunTimeHelper -->";
$redata = compact(array_keys(get_defined_vars()));
echo templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata);
$aPopup = array();
// We can move this part where we want now
if (isset($backpopup)) {
$aPopup[] = $backpopup;
示例2: display_first_page
/**
* Shows the welcome page, used in group by group and question by question mode
*/
function display_first_page()
{
global $token, $surveyid, $thissurvey, $navigator;
$totalquestions = $_SESSION['survey_' . $surveyid]['totalquestions'];
$clang = Yii::app()->lang;
// Fill some necessary var for template
$navigator = surveymover();
$sitename = Yii::app()->getConfig('sitename');
$languagechanger = makeLanguageChangerSurvey($clang->langcode);
sendCacheHeaders();
doHeader();
LimeExpressionManager::StartProcessingPage();
LimeExpressionManager::StartProcessingGroup(-1, false, $surveyid);
// start on welcome page
$redata = compact(array_keys(get_defined_vars()));
$sTemplatePath = $_SESSION['survey_' . $surveyid]['templatepath'];
echo templatereplace(file_get_contents($sTemplatePath . "startpage.pstpl"), array(), $redata, 'frontend_helper[2757]');
echo CHtml::form(array("/survey/index"), 'post', array('id' => 'limesurvey', 'name' => 'limesurvey', 'autocomplete' => 'off'));
echo "\n\n<!-- START THE SURVEY -->\n";
echo templatereplace(file_get_contents($sTemplatePath . "welcome.pstpl"), array(), $redata, 'frontend_helper[2762]') . "\n";
if ($thissurvey['anonymized'] == "Y") {
echo templatereplace(file_get_contents($sTemplatePath . "/privacy.pstpl"), array(), $redata, 'frontend_helper[2765]') . "\n";
}
echo templatereplace(file_get_contents($sTemplatePath . "navigator.pstpl"), array(), $redata, 'frontend_helper[2767]');
if ($thissurvey['active'] != "Y") {
echo "<p style='text-align:center' class='error'>" . $clang->gT("This survey is currently not active. You will not be able to save your responses.") . "</p>\n";
}
echo "\n<input type='hidden' name='sid' value='{$surveyid}' id='sid' />\n";
if (isset($token) && !empty($token)) {
echo "\n<input type='hidden' name='token' value='{$token}' id='token' />\n";
}
echo "\n<input type='hidden' name='lastgroupname' value='_WELCOME_SCREEN_' id='lastgroupname' />\n";
//This is to ensure consistency with mandatory checks, and new group test
$loadsecurity = returnGlobal('loadsecurity', true);
if (isset($loadsecurity)) {
echo "\n<input type='hidden' name='loadsecurity' value='{$loadsecurity}' id='loadsecurity' />\n";
}
$_SESSION['survey_' . $surveyid]['LEMpostKey'] = mt_rand();
echo "<input type='hidden' name='LEMpostKey' value='{$_SESSION['survey_' . $surveyid]['LEMpostKey']}' id='LEMpostKey' />\n";
echo "<input type='hidden' name='thisstep' id='thisstep' value='0' />\n";
echo "\n</form>\n";
echo templatereplace(file_get_contents($sTemplatePath . "endpage.pstpl"), array(), $redata, 'frontend_helper[2782]');
echo LimeExpressionManager::GetRelevanceAndTailoringJavaScript();
LimeExpressionManager::FinishProcessingPage();
doFooter();
}
示例3: display_first_page
/**
* Shows the welcome page, used in group by group and question by question mode
*/
function display_first_page()
{
global $token, $surveyid, $thissurvey, $navigator;
$totalquestions = $_SESSION['survey_' . $surveyid]['totalquestions'];
// Fill some necessary var for template
$aNavigator = surveymover();
$moveprevbutton = $aNavigator['sMovePrevButton'];
$movenextbutton = $aNavigator['sMoveNextButton'];
$navigator = $moveprevbutton . ' ' . $movenextbutton;
$sitename = Yii::app()->getConfig('sitename');
$languagechanger = makeLanguageChangerSurvey(App()->language);
sendCacheHeaders();
doHeader();
LimeExpressionManager::StartProcessingPage();
LimeExpressionManager::StartProcessingGroup(-1, false, $surveyid);
// start on welcome page
$redata = compact(array_keys(get_defined_vars()));
$oTemplate = Template::model()->getInstance('', $surveyid);
$sTemplatePath = $oTemplate->path;
$sTemplateViewPath = $oTemplate->viewPath;
echo templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata, 'frontend_helper[2757]');
echo CHtml::form(array("/survey/index", "sid" => $surveyid), 'post', array('id' => 'limesurvey', 'name' => 'limesurvey', 'autocomplete' => 'off', 'class' => 'frontend_helper'));
echo templatereplace(file_get_contents($sTemplateViewPath . "welcome.pstpl"), array(), $redata, 'frontend_helper[2762]') . "\n";
if ($thissurvey['anonymized'] == "Y") {
echo templatereplace(file_get_contents($sTemplateViewPath . "/privacy.pstpl"), array(), $redata, 'frontend_helper[2765]') . "\n";
}
echo templatereplace(file_get_contents($sTemplateViewPath . "navigator.pstpl"), array(), $redata, 'frontend_helper[2767]');
echo "\n<input type='hidden' name='sid' value='{$surveyid}' id='sid' />\n";
if (isset($token) && !empty($token)) {
echo "\n<input type='hidden' name='token' value='{$token}' id='token' />\n";
}
echo "\n<input type='hidden' name='lastgroupname' value='_WELCOME_SCREEN_' id='lastgroupname' />\n";
//This is to ensure consistency with mandatory checks, and new group test
$loadsecurity = returnGlobal('loadsecurity', true);
if (isset($loadsecurity)) {
echo "\n<input type='hidden' name='loadsecurity' value='{$loadsecurity}' id='loadsecurity' />\n";
}
$_SESSION['survey_' . $surveyid]['LEMpostKey'] = mt_rand();
echo "<input type='hidden' name='LEMpostKey' value='{$_SESSION['survey_' . $surveyid]['LEMpostKey']}' id='LEMpostKey' />\n";
echo "<input type='hidden' name='thisstep' id='thisstep' value='0' />\n";
echo "<!--frontendhelper --></form>";
echo templatereplace(file_get_contents($sTemplateViewPath . "endpage.pstpl"), array(), $redata, 'frontend_helper[2782]');
echo LimeExpressionManager::GetRelevanceAndTailoringJavaScript();
LimeExpressionManager::FinishProcessingPage();
doFooter();
echo "<!-- end of frontend_helper / display_first_page -->";
}
示例4: run
//.........这里部分代码省略.........
// adds madatory identifyer for adding mandatory class to question wrapping div
$qanda[] = $plus_qanda;
}
if ($plus_inputnames) {
$inputnames = addtoarray_single($inputnames, $plus_inputnames);
}
//Display the "mandatory" popup if necessary
// TMSW - get question-level error messages - don't call **_popup() directly
if ($okToShowErrors && $stepInfo['mandViolation']) {
list($mandatorypopup, $popup) = mandatory_popup($ia, $notanswered);
}
//Display the "validation" popup if necessary
if ($okToShowErrors && !$stepInfo['valid']) {
list($validationpopup, $vpopup) = validation_popup($ia, $notvalidated);
}
// Display the "file validation" popup if necessary
if ($okToShowErrors && isset($filenotvalidated)) {
list($filevalidationpopup, $fpopup) = file_validation_popup($ia, $filenotvalidated);
}
}
if ($ia[4] == "|") {
$upload_file = TRUE;
}
}
//end iteration
}
if ($surveyMode != 'survey' && isset($thissurvey['showprogress']) && $thissurvey['showprogress'] == 'Y') {
if ($show_empty_group) {
$percentcomplete = makegraph($_SESSION[$LEMsessid]['totalsteps'] + 1, $_SESSION[$LEMsessid]['totalsteps']);
} else {
$percentcomplete = makegraph($_SESSION[$LEMsessid]['step'], $_SESSION[$LEMsessid]['totalsteps']);
}
}
if (!(isset($languagechanger) && strlen($languagechanger) > 0) && function_exists('makeLanguageChangerSurvey')) {
$languagechanger = makeLanguageChangerSurvey($_SESSION[$LEMsessid]['s_lang']);
}
//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
sendCacheHeaders();
doHeader();
$redata = compact(array_keys(get_defined_vars()));
echo templatereplace(file_get_contents($sTemplatePath . "startpage.pstpl"), array(), $redata);
//popup need jquery
if (isset($popup)) {
echo $popup;
}
if (isset($vpopup)) {
echo $vpopup;
}
if (isset($fpopup)) {
echo $fpopup;
}
//ALTER PAGE CLASS TO PROVIDE WHOLE-PAGE ALTERNATION
if ($surveyMode != 'survey' && $_SESSION[$LEMsessid]['step'] != $_SESSION[$LEMsessid]['prevstep'] || isset($_SESSION[$LEMsessid]['stepno']) && $_SESSION[$LEMsessid]['stepno'] % 2) {
if (!isset($_SESSION[$LEMsessid]['stepno'])) {
$_SESSION[$LEMsessid]['stepno'] = 0;
}
if ($_SESSION[$LEMsessid]['step'] != $_SESSION[$LEMsessid]['prevstep']) {
++$_SESSION[$LEMsessid]['stepno'];
}
if ($_SESSION[$LEMsessid]['stepno'] % 2) {
echo "<script type=\"text/javascript\">\n" . " \$(\"body\").addClass(\"page-odd\");\n" . "</script>\n";
}
}
$hiddenfieldnames = implode("|", $inputnames);
if (isset($upload_file) && $upload_file) {
echo CHtml::form(array("survey/index"), 'post', array('enctype' => 'multipart/form-data', 'id' => 'limesurvey', 'name' => 'limesurvey', 'autocomplete' => 'off')) . "\n\n <!-- INPUT NAMES -->\n <input type='hidden' name='fieldnames' value='{$hiddenfieldnames}' id='fieldnames' />\n";
示例5: beforeSurveyPage
//.........这里部分代码省略.........
// TLR change to put date into sent
$today = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig('timeadjust'));
$oToken->sent=$today;
$oToken->save();
$sReturnHtml="<div id='wrapper' class='message tokenmessage'>"
. "<p>".gT("Thank you for registering to participate in this survey.")."</p>\n"
. "<p>".$aMail['information']."</p>\n"
. "<p>".gT("Survey administrator")." {ADMINNAME} ({ADMINEMAIL})</p>"
. "</div>\n";
}
else
{
$sReturnHtml="<div id='wrapper' class='message tokenmessage'>"
. "<p>".gT("Thank you for registering to participate in this survey.")."</p>\n"
. "<p>"."We can not sent you an email actually, please contact the survey administrator"."</p>\n"
. "<p>".gT("Survey administrator")." {ADMINNAME} ({ADMINEMAIL})</p>"
. "</div>\n";
}
$sReturnHtml=ReplaceFields($sReturnHtml, $aReplacementFields);
$sTemplatePath=$aData['templatedir'] = getTemplatePath($aSurveyInfo['template']);
ob_start(function($buffer, $phase) {
App()->getClientScript()->render($buffer);
App()->getClientScript()->reset();
return $buffer;
});
ob_implicit_flush(false);
sendCacheHeaders();
doHeader();
$aData['thissurvey'] = $aSurveyInfo;
$aData['thissurvey'] = $aSurveyInfo;
echo templatereplace(file_get_contents($sTemplatePath.'/startpage.pstpl'),array(), $aData);
echo templatereplace(file_get_contents($sTemplatePath.'/survey.pstpl'),array(), $aData);
echo $sReturnHtml;
echo templatereplace(file_get_contents($sTemplatePath.'/endpage.pstpl'),array(), $aData);
doFooter();
ob_flush();
App()->end();
}
if($bShowForm || count($aRegisterError))
{
// Language ?
if(count($aRegisterError)==1){
$sHtmlRegistererror="<p class='error error-register'><strong>{$aRegisterError[0]}</strong></p>";
}elseif(count($aRegisterError)>1){
$sHtmlRegistererror="<ul class='error error-register error-list'>";
foreach ($aRegisterError as $sRegisterError)
$sHtmlRegistererror.="<li><strong>{$sRegisterError}</strong></li>";
$sHtmlRegistererror.="</ul>";
}
$aExtraParams['action']='register';
$aExtraParams['lang']=$sLanguage;
$sHtmlRegisterform = CHtml::form(Yii::app()->createUrl("/survey/index/sid/{$iSurveyId}",$aExtraParams), 'post');
$sHtmlRegisterform.="<table class='register'><tbody>\n";
$sHtmlRegisterform.= "<tr><th><label for='register_firstname'>".gT("First name") . "</label></th><td>".CHtml::textField('register_firstname',htmlentities($sR_firstname, ENT_QUOTES, 'UTF-8'),array('class'=>'text'))."</td></tr>\n";
$sHtmlRegisterform.= "<tr><th><label for='register_lastname'>".gT("Last name") . "</label></th><td>".CHtml::textField('register_lastname',htmlentities($sR_lastname, ENT_QUOTES, 'UTF-8'),array('class'=>'text'))."</td></tr>\n";
$sHtmlRegisterform.= "<tr class='mandatory'><th><label for='register_email'>".gT("Email address") . "</label></th><td>".CHtml::textField('register_email',htmlentities($sR_email, ENT_QUOTES, 'UTF-8'),array('class'=>'text'))."</td></tr>\n";
// Extra attribute
foreach ($aSurveyInfo['attributedescriptions'] as $field => $aAttribute)
{
if (!empty($aAttribute['show_register']) && $aAttribute['show_register'] == 'Y')
{
$sHtmlRegisterform.= "<tr".($aAttribute['mandatory'] == 'Y' ? " class='mandatory'" : '')."><th><label for='register_{$field}'>".$aSurveyInfo['attributecaptions'][$field].($aAttribute['mandatory'] == 'Y' ? ' *' : '')."</label></th><td>".CHtml::textField('register_'.$field,htmlentities($aR_attribute[$field], ENT_QUOTES, 'UTF-8'),array('class'=>'text'))."</td></tr>\n";
}
}
if (function_exists("ImageCreate") && isCaptchaEnabled('registrationscreen', $aSurveyInfo['usecaptcha']))
$sHtmlRegisterform.= "<tr><th><label for='loadsecurity'>" . gT("Security question") . "</label></th><td><img src='".Yii::app()->getController()->createUrl("/verification/image/sid/{$iSurveyId}")."' alt='' /><input type='text' size='5' maxlength='3' name='loadsecurity' id='loadsecurity' value='' /></td></tr>\n";
$sHtmlRegisterform.= "<tr><td></td><td>".CHtml::submitButton(gT("Continue"))."</td></tr>";
$sHtmlRegisterform.= "</tbody></table>\n";
$sHtmlRegisterform.= makeLanguageChangerSurvey($sLanguage);// Need to be inside the form
$sHtmlRegisterform.= CHtml::endForm();
}
$sTemplatePath=$aData['templatedir'] = getTemplatePath($aSurveyInfo['template']);
ob_start(function($buffer, $phase) {
App()->getClientScript()->render($buffer);
App()->getClientScript()->reset();
return $buffer;
});
ob_implicit_flush(false);
sendCacheHeaders();
doHeader();
// Get the register.pstpl file content, but remplace default by own string
$sHtmlRegister=file_get_contents($sTemplatePath.'/register.pstpl');
$sHtmlRegister= str_replace("{REGISTERERROR}",$sHtmlRegistererror,$sHtmlRegister);
$sHtmlRegister= str_replace("{REGISTERMESSAGE1}",$sHtmlRegistermessage1,$sHtmlRegister);
$sHtmlRegister= str_replace("{REGISTERMESSAGE2}",$sHtmlRegistermessage2,$sHtmlRegister);
$sHtmlRegister= str_replace("{REGISTERFORM}",$sHtmlRegisterform,$sHtmlRegister);
$aData['thissurvey'] = $aSurveyInfo;
echo templatereplace(file_get_contents($sTemplatePath.'/startpage.pstpl'),array(), $aData);
echo templatereplace(file_get_contents($sTemplatePath.'/survey.pstpl'),array(), $aData);
echo templatereplace($sHtmlRegister);
echo templatereplace(file_get_contents($sTemplatePath.'/endpage.pstpl'),array(), $aData);
doFooter();
ob_flush();
App()->end();
}
}
}
示例6: display
/**
* Display needed public page
* @param $iSurveyId
*/
private function display($iSurveyId)
{
$sLanguage = Yii::app()->language;
$aData['surveyid'] = $surveyid = $iSurveyId;
$aData['thissurvey'] = getSurveyInfo($iSurveyId, $sLanguage);
$sTemplate = getTemplatePath($aData['thissurvey']['template']);
Yii::app()->setConfig('surveyID', $iSurveyId);
//Needed for languagechanger
$aData['sitename'] = Yii::app()->getConfig('sitename');
$aData['aRegisterErrors'] = $this->aRegisterErrors;
$aData['sMessage'] = $this->sMessage;
sendCacheHeaders();
doHeader();
$aViewData['sTemplate'] = $sTemplate;
if (!$this->sMessage) {
$aData['languagechanger'] = makeLanguageChangerSurvey($sLanguage);
// Only show language changer shown the form is shown, not after submission
$aViewData['content'] = self::getRegisterForm($iSurveyId);
} else {
$aViewData['content'] = templatereplace($this->sMessage);
}
$aViewData['aData'] = $aData;
// Test if we come from index or from register
if (empty(App()->clientScript->scripts)) {
App()->getClientScript()->registerPackage('jqueryui');
App()->getClientScript()->registerPackage('jquery-touch-punch');
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts') . "survey_runtime.js");
useFirebug();
$this->render('/register/display', $aViewData);
} else {
// urvey/index need renderPartial
$this->renderPartial('/register/display', $aViewData);
}
doFooter();
}