diff --git a/application/config/internal.php b/application/config/internal.php
index b95cd659929..dfd44bf5d17 100644
--- a/application/config/internal.php
+++ b/application/config/internal.php
@@ -3,7 +3,7 @@
/**
* This file contains configuration parameters for the Yii framework.
* Do not change these unless you know what you are doing.
- *
+ *
*/
@date_default_timezone_set(@date_default_timezone_get());
$internalConfig = array(
@@ -28,7 +28,7 @@
'rules' => require('routes.php'),
'showScriptName' => true,
),
-
+
'clientScript' => array(
'packages' => require('third_party.php')
),
@@ -60,9 +60,9 @@
'schemaCachingDuration' => 3600,
),
'messages' => array(
- 'class' => 'GettextMessageSource',
+ 'class' => 'CGettextMessageSource',
'useMoFile' => true,
- 'basePath' => __DIR__ . '/../../locale'
+ 'basePath' => __DIR__ . DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'locale'
)
)
diff --git a/application/controllers/AdminController.php b/application/controllers/AdminController.php
index 0e6f3a192d8..5eae44e9a07 100644
--- a/application/controllers/AdminController.php
+++ b/application/controllers/AdminController.php
@@ -14,7 +14,6 @@
class AdminController extends LSYii_Controller
{
- public $lang = null;
public $layout = false;
protected $user_id = 0;
@@ -59,15 +58,14 @@ protected function _init()
*/
public function error($message, $sURL = array())
{
- $clang = $this->lang;
$this->_getAdminHeader();
$sOutput = "
"
."\n"
- .$clang->gT("Database has been created.")." \n"
- .$clang->gT("Please continue with populating the database.")." \n";
+ .gT("Database has been created.")." \n"
+ .gT("Please continue with populating the database.")." \n";
$aData['next'] = array(
'action' => 'installer/populatedb',
- 'label' => $clang->gT("Populate database"),
+ 'label' => gT("Populate database"),
'name' => 'createdbstep2',
);
}
@@ -513,10 +513,10 @@ function stepCreateDb()
$oModel->dbuser=$aDbConfig['sDatabaseUser'];
//$oModel->dbpwd$aDbConfig['sDatabasePwd']; Don't set password for security issue
$oModel->dbprefix=$aDbConfig['sDatabasePrefix'];
- $oModel->addError('dbname', $clang->gT('Try again! Creation of database failed.'));
+ $oModel->addError('dbname', gT('Try again! Creation of database failed.'));
- $aData['title'] = $clang->gT('Database configuration');
- $aData['descp'] = $clang->gT('Please enter the database settings you want to use for LimeSurvey:');
+ $aData['title'] = gT('Database configuration');
+ $aData['descp'] = gT('Please enter the database settings you want to use for LimeSurvey:');
$aData['classesForStep'] = array('off','off','off','on','off','off');
$aData['progressValue'] = 40;
$aData['model'] = $oModel;
@@ -524,8 +524,8 @@ function stepCreateDb()
$this->render('/installer/dbconfig_view',$aData);
}
- $aData['title'] = $clang->gT("Database settings");
- $aData['descp'] = $clang->gT("Database settings");
+ $aData['title'] = gT("Database settings");
+ $aData['descp'] = gT("Database settings");
$aData['classesForStep'] = array('off','off','off','off','on','off');
$aData['progressValue'] = 60;
$this->render('/installer/dbsettings_view',$aData);
@@ -545,8 +545,8 @@ function stepPopulateDb()
$aData['clang'] = $clang = $this->lang;
$aData['model'] = $model = new InstallerConfigForm;
- $aData['title'] = $clang->gT("Database configuration");
- $aData['descp'] = $clang->gT("Please enter the database settings you want to use for LimeSurvey:");
+ $aData['title'] = gT("Database configuration");
+ $aData['descp'] = gT("Please enter the database settings you want to use for LimeSurvey:");
$aData['classesForStep'] = array('off','off','off','on','off','off');
$aData['progressValue'] = 40;
@@ -578,7 +578,7 @@ function stepPopulateDb()
$aErrors = self::_setup_tables(dirname(APPPATH).'/installer/sql/create-'.$sql_file.'.sql');
if ($aErrors === false)
{
- $model->addError('dblocation', $clang->gT('Try again! Connection with database failed. Reason: ').implode(', ', $aErrors));
+ $model->addError('dblocation', gT('Try again! Connection with database failed. Reason: ').implode(', ', $aErrors));
$this->render('/installer/dbconfig_view', $aData);
}
elseif (count($aErrors)==0)
@@ -586,11 +586,11 @@ function stepPopulateDb()
//$data1['adminoutput'] = '';
//$data1['adminoutput'] .= sprintf("Database `%s` has been successfully populated.",$dbname)." \n";
//$data1['adminoutput'] .= " ";
- $sConfirmation = sprintf($clang->gT("Database %s has been successfully populated."), sprintf('%s ', Yii::app()->session['dbname']));
+ $sConfirmation = sprintf(gT("Database %s has been successfully populated."), sprintf('%s ', Yii::app()->session['dbname']));
}
else
{
- $sConfirmation = $clang->gT('Database was populated but there were errors:').'
';
+ $sConfirmation = gT('Database was populated but there were errors:').'
';
foreach ($aErrors as $sError)
{
$sConfirmation.=''.htmlspecialchars($sError).' ';
@@ -613,8 +613,8 @@ private function stepOptionalConfiguration()
{
$aData['clang'] = $clang = $this->lang;
$aData['confirmation'] = Yii::app()->session['optconfig_message'];
- $aData['title'] = $clang->gT("Optional settings");
- $aData['descp'] = $clang->gT("Optional settings to give you a head start");
+ $aData['title'] = gT("Optional settings");
+ $aData['descp'] = gT("Optional settings to give you a head start");
$aData['classesForStep'] = array('off','off','off','off','off','on');
$aData['progressValue'] = 80;
$this->loadHelper('surveytranslator');
@@ -639,8 +639,8 @@ private function stepOptionalConfiguration()
$sSiteLanguage = $model->surveylang;
$sAdminEmail = $model->adminEmail;
- $aData['title'] = $clang->gT("Database configuration");
- $aData['descp'] = $clang->gT("Please enter the database settings you want to use for LimeSurvey:");
+ $aData['title'] = gT("Database configuration");
+ $aData['descp'] = gT("Please enter the database settings you want to use for LimeSurvey:");
$aData['classesForStep'] = array('off','off','off','on','off','off');
$aData['progressValue'] = 40;
@@ -682,15 +682,15 @@ private function stepOptionalConfiguration()
Yii::app()->session['deletedirectories'] = true;
- $aData['title'] = $clang->gT("Success!");
- $aData['descp'] = $clang->gT("LimeSurvey has been installed successfully.");
+ $aData['title'] = gT("Success!");
+ $aData['descp'] = gT("LimeSurvey has been installed successfully.");
$aData['classesForStep'] = array('off','off','off','off','off','off');
$aData['progressValue'] = 100;
$aData['user'] = $sAdminUserName;
if($sDefaultAdminPassword==$sAdminPassword){
$aData['pwd'] = $sAdminPassword;
}else{
- $aData['pwd'] = $clang->gT("The password you have chosen at the optional settings step.");
+ $aData['pwd'] = gT("The password you have chosen at the optional settings step.");
}
$this->render('/installer/success_view', $aData);
@@ -698,7 +698,7 @@ private function stepOptionalConfiguration()
}
} else {
// if passwords don't match, redirect to proper link.
- Yii::app()->session['optconfig_message'] = sprintf('%s ', $clang->gT("Passwords don't match."));
+ Yii::app()->session['optconfig_message'] = sprintf('%s ', gT("Passwords don't match."));
$this->redirect(array('installer/optional'));
}
} elseif(empty(Yii::app()->session['configFileWritten'])) {
@@ -1122,8 +1122,8 @@ function _writeConfigFile()
$oUrlManager->setUrlFormat($sURLFormat);
} else {
header('refresh:5;url='.$this->createUrl("installer/welcome"));
- echo "".$clang->gT("Configuration directory is not writable")." ";
- printf($clang->gT('You will be redirected in about 5 secs. If not, click here .' ,'unescaped'), $this->createUrl('installer/welcome'));
+ echo "".gT("Configuration directory is not writable")." ";
+ printf(gT('You will be redirected in about 5 secs. If not, click here .' ,'unescaped'), $this->createUrl('installer/welcome'));
exit;
}
}
diff --git a/application/controllers/OptinController.php b/application/controllers/OptinController.php
index febbc8a0998..a126f2b8766 100644
--- a/application/controllers/OptinController.php
+++ b/application/controllers/OptinController.php
@@ -63,7 +63,7 @@ function actiontokens($surveyid, $token, $langcode = '')
if ($aSurveyInfo == false || !tableExists("{{tokens_{$iSurveyID}}}"))
{
- $sMessage = $clang->gT('This survey does not seem to exist.');
+ $sMessage = gT('This survey does not seem to exist.');
}
else
{
@@ -71,7 +71,7 @@ function actiontokens($surveyid, $token, $langcode = '')
if (!isset($oToken))
{
- $sMessage = $clang->gT('You are not a participant in this survey.');
+ $sMessage = gT('You are not a participant in this survey.');
}
else
{
@@ -79,15 +79,15 @@ function actiontokens($surveyid, $token, $langcode = '')
{
$oToken->emailstatus = 'OK';
$oToken->save();
- $sMessage = $clang->gT('You have been successfully added back to this survey.');
+ $sMessage = gT('You have been successfully added back to this survey.');
}
elseif ($oToken->emailstatus == 'OK')
{
- $sMessage = $clang->gT('You are already a part of this survey.');
+ $sMessage = gT('You are already a part of this survey.');
}
else
{
- $sMessage = $clang->gT('You have been already removed from this survey.');
+ $sMessage = gT('You have been already removed from this survey.');
}
}
}
diff --git a/application/controllers/OptoutController.php b/application/controllers/OptoutController.php
index d528f862022..4376588de6a 100644
--- a/application/controllers/OptoutController.php
+++ b/application/controllers/OptoutController.php
@@ -61,7 +61,7 @@ function actiontokens()
$aSurveyInfo=getSurveyInfo($iSurveyID,$sBaseLanguage);
if ($aSurveyInfo==false || !tableExists("{{tokens_{$iSurveyID}}}")){
- $sMessage = $clang->gT('This survey does not seem to exist.');
+ $sMessage = gT('This survey does not seem to exist.');
}
else
{
@@ -69,7 +69,7 @@ function actiontokens()
if (!isset($oToken))
{
- $sMessage = $clang->gT('You are not a participant in this survey.');
+ $sMessage = gT('You are not a participant in this survey.');
}
else
{
@@ -77,11 +77,11 @@ function actiontokens()
{
$oToken->emailstatus = 'OptOut';
$oToken->save();
- $sMessage = $clang->gT('You have been successfully removed from this survey.');
+ $sMessage = gT('You have been successfully removed from this survey.');
}
else
{
- $sMessage = $clang->gT('You have been already removed from this survey.');
+ $sMessage = gT('You have been already removed from this survey.');
}
}
}
@@ -137,14 +137,14 @@ function actionparticipants()
$aSurveyInfo=getSurveyInfo($iSurveyID,$sBaseLanguage);
if ($aSurveyInfo==false || !tableExists("{{tokens_{$iSurveyID}}}")){
- $sMessage = $clang->gT('This survey does not seem to exist.');
+ $sMessage = gT('This survey does not seem to exist.');
}
else
{
$oToken = Token::model($iSurveyID)->findByAttributes(array('token' => $sToken));
if (!isset($oToken))
{
- $sMessage = $clang->gT('You are not a participant in this survey.');
+ $sMessage = gT('You are not a participant in this survey.');
}
else
{
@@ -152,11 +152,11 @@ function actionparticipants()
{
$oToken->emailstatus = 'OptOut';
$oToken->save();
- $sMessage = $clang->gT('You have been successfully removed from this survey.');
+ $sMessage = gT('You have been successfully removed from this survey.');
}
else
{
- $sMessage = $clang->gT('You have been already removed from this survey.');
+ $sMessage = gT('You have been already removed from this survey.');
}
if(!empty($oToken->participant_id))
{
@@ -165,13 +165,13 @@ function actionparticipants()
if($oParticipant->blacklisted=="Y")
{
$sMessage .= " ";
- $sMessage .= $clang->gT("You have already been removed from the central participants list for this site");
+ $sMessage .= gT("You have already been removed from the central participants list for this site");
} else
{
$oParticipant->blacklisted='Y';
$oParticipant->save();
$sMessage .= " ";
- $sMessage .= $clang->gT("You have been removed from the central participants list for this site");
+ $sMessage .= gT("You have been removed from the central participants list for this site");
}
}
}
diff --git a/application/controllers/PrintanswersController.php b/application/controllers/PrintanswersController.php
index 37afc4bd558..65a3096d0a8 100644
--- a/application/controllers/PrintanswersController.php
+++ b/application/controllers/PrintanswersController.php
@@ -79,9 +79,9 @@ function actionView($surveyid,$printableexport=FALSE)
doHeader();
echo templatereplace(file_get_contents(getTemplatePath($sTemplate).'/startpage.pstpl'),array());
echo " \n"
- ."\t".$clang->gT("Error")." \n"
- ."\t".$clang->gT("We are sorry but your session has expired.")." ".$clang->gT("Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.")." \n"
- ."\t".sprintf($clang->gT("Please contact %s ( %s ) for further assistance."), Yii::app()->getConfig("siteadminname"), Yii::app()->getConfig("siteadminemail"))."\n"
+ ."\t".gT("Error")." \n"
+ ."\t".gT("We are sorry but your session has expired.")." ".gT("Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.")." \n"
+ ."\t".sprintf(gT("Please contact %s ( %s ) for further assistance."), Yii::app()->getConfig("siteadminname"), Yii::app()->getConfig("siteadminemail"))."\n"
." \n";
echo templatereplace(file_get_contents(getTemplatePath($sTemplate).'/endpage.pstpl'),array());
doFooter();
@@ -101,7 +101,7 @@ function actionView($surveyid,$printableexport=FALSE)
//OK. IF WE GOT THIS FAR, THEN THE SURVEY EXISTS AND IT IS ACTIVE, SO LETS GET TO WORK.
//SHOW HEADER
$sOutput = CHtml::form(array("printanswers/view/surveyid/{$iSurveyID}/printableexport/pdf"), 'post')
- ." ";
+ ." ";
if($sExportType == 'pdf')
{
//require (Yii::app()->getConfig('rootdir').'/application/config/tcpdf.php');
@@ -109,7 +109,7 @@ function actionView($surveyid,$printableexport=FALSE)
Yii::import('application.helpers.pdfHelper');
$aPdfLanguageSettings=pdfHelper::getPdfLanguageSettings($clang->langcode);
$oPDF = new pdf();
- $oPDF->SetTitle($clang->gT("Survey name (ID)",'unescaped').": {$sSurveyName} ({$iSurveyID})");
+ $oPDF->SetTitle(gT("Survey name (ID)",'unescaped').": {$sSurveyName} ({$iSurveyID})");
$oPDF->SetSubject($sSurveyName);
$oPDF->SetDisplayMode('fullpage', 'two');
$oPDF->setLanguageArray($aPdfLanguageSettings['lg']);
@@ -117,9 +117,9 @@ function actionView($surveyid,$printableexport=FALSE)
$oPDF->setFooterFont(Array($aPdfLanguageSettings['pdffont'], '', PDF_FONT_SIZE_DATA));
$oPDF->SetFont($aPdfLanguageSettings['pdffont'], '', $aPdfLanguageSettings['pdffontsize']);
$oPDF->AddPage();
- $oPDF->titleintopdf($clang->gT("Survey name (ID)",'unescaped').": {$sSurveyName} ({$iSurveyID})");
+ $oPDF->titleintopdf(gT("Survey name (ID)",'unescaped').": {$sSurveyName} ({$iSurveyID})");
}
- $sOutput .= "\t".$clang->gT("Survey name (ID):")." $sSurveyName ($iSurveyID)
\n";
+ $sOutput .= "\t
".gT("Survey name (ID):")." $sSurveyName ($iSurveyID)
\n";
LimeExpressionManager::StartProcessingPage(true); // means that all variables are on the same page
// Since all data are loaded, and don't need JavaScript, pretend all from Group 1
LimeExpressionManager::StartProcessingGroup(1,($aSurveyInfo['anonymized']!="N"),$iSurveyID);
diff --git a/application/controllers/RegisterController.php b/application/controllers/RegisterController.php
index d71d594f622..ced32509c88 100644
--- a/application/controllers/RegisterController.php
+++ b/application/controllers/RegisterController.php
@@ -134,7 +134,7 @@ public function getRegisterErrors($iSurveyId){
$sSecAnswer=(isset($_SESSION['survey_'.$iSurveyId]['secanswer']))?$_SESSION['survey_'.$iSurveyId]['secanswer']:"";
if ($sLoadsecurity!=$sSecAnswer)
{
- $this->aRegisterErrors[] = $clang->gT("The answer to the security question is incorrect.");
+ $this->aRegisterErrors[] = gT("The answer to the security question is incorrect.");
}
}
@@ -143,16 +143,16 @@ public function getRegisterErrors($iSurveyId){
//Check that the email is a valid style address
if($aFieldValue['sEmail']==""){
- $this->aRegisterErrors[]= $clang->gT("You must enter a valid email. Please try again.");
+ $this->aRegisterErrors[]= gT("You must enter a valid email. Please try again.");
}elseif (!validateEmailAddress($aFieldValue['sEmail'])){
- $this->aRegisterErrors[]= $clang->gT("The email you used is not valid. Please try again.");
+ $this->aRegisterErrors[]= gT("The email you used is not valid. Please try again.");
}
//Check and validate attribute
foreach ($aRegisterAttributes as $key => $aAttribute)
{
if ($aAttribute['show_register'] == 'Y' && $aAttribute['mandatory'] == 'Y' && empty($aFieldValue['aAttribute'][$key]))
{
- $this->aRegisterErrors[]= sprintf($clang->gT("%s cannot be left empty").".", $aAttribute['caption']);
+ $this->aRegisterErrors[]= sprintf(gT("%s cannot be left empty").".", $aAttribute['caption']);
}
}
}
@@ -191,11 +191,11 @@ public function getRegisterForm($iSurveyId){
$sRegisterError='';
$aReplacement['REGISTERERROR'] = $sRegisterError;
- $aReplacement['REGISTERMESSAGE1'] = $clang->gT("You must be registered to complete this survey");
+ $aReplacement['REGISTERMESSAGE1'] = gT("You must be registered to complete this survey");
if($sStartDate=$this->getStartDate($iSurveyId))
- $aReplacement['REGISTERMESSAGE2'] = sprintf($clang->gT("You may register for this survey but you have to wait for the %s before starting the survey."),$sStartDate)." \n".$clang->gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately.");
+ $aReplacement['REGISTERMESSAGE2'] = sprintf(gT("You may register for this survey but you have to wait for the %s before starting the survey."),$sStartDate)." \n".gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately.");
else
- $aReplacement['REGISTERMESSAGE2'] = $clang->gT("You may register for this survey if you wish to take part.")." \n".$clang->gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately.");
+ $aReplacement['REGISTERMESSAGE2'] = gT("You may register for this survey if you wish to take part.")." \n".gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately.");
$aData['thissurvey'] = $aSurveyInfo;
Yii::app()->setConfig('surveyID',$iSurveyId);//Needed for languagechanger
@@ -276,17 +276,17 @@ public function sendRegistrationEmail($iSurveyId,$iTokenId){
$oToken->sent=$today;
$oToken->save();
$this->sMessage="
"
- . "
".$clang->gT("Thank you for registering to participate in this survey.")."
\n"
+ . "
".gT("Thank you for registering to participate in this survey.")."
\n"
. "
{$this->sMailMessage}
\n"
- . "
".sprintf($clang->gT("Survey administrator %s (%s)"),$aSurveyInfo['adminname'],$aSurveyInfo['adminemail'])."
"
+ . "
".sprintf(gT("Survey administrator %s (%s)"),$aSurveyInfo['adminname'],$aSurveyInfo['adminemail'])."
"
. "
\n";
}
else
{
$this->sMessage=""
- . "
".$clang->gT("Thank you for registering to participate in this survey.")."
\n"
- . "
".$clang->gT("You are registred but an error happen when trying to send the email, please contact the survey administrator.")."
\n"
- . "
".sprintf($clang->gT("Survey administrator %s (%s)"),$aSurveyInfo['adminname'],$aSurveyInfo['adminemail'])."
"
+ . "
".gT("Thank you for registering to participate in this survey.")."
\n"
+ . "
".gT("You are registred but an error happen when trying to send the email, please contact the survey administrator.")."
\n"
+ . "
".sprintf(gT("Survey administrator %s (%s)"),$aSurveyInfo['adminname'],$aSurveyInfo['adminemail'])."
"
. "
\n";
}
// Allways return true : if we come here, we allways trye to send an email
@@ -311,19 +311,19 @@ public function getTokenId($iSurveyId)
{
if($oToken->usesleft<1 && $aSurveyInfo['alloweditaftercompletion']!='Y')
{
- $this->aRegisterErrors[]=$clang->gt("The mail address you have entered is already registered an the survey has been completed.");
+ $this->aRegisterErrors[]=gT("The mail address you have entered is already registered an the survey has been completed.");
}
elseif(strtolower(substr(trim($oToken->emailstatus),0,6))==="optout")// And global blacklisting ?
{
- $this->aRegisterErrors[]=$clang->gt("This email address is already registered but someone ask to not receive new email again.");
+ $this->aRegisterErrors[]=gT("This email address is already registered but someone ask to not receive new email again.");
}
elseif(!$oToken->emailstatus && $oToken->emailstatus!="OK")
{
- $this->aRegisterErrors[]=$clang->gt("This email address is already registered but the email adress was bounced.");
+ $this->aRegisterErrors[]=gT("This email address is already registered but the email adress was bounced.");
}
else
{
- $this->sMailMessage=$clang->gt("The address you have entered is already registered. An email has been sent to this address with a link that gives you access to the survey.");
+ $this->sMailMessage=gT("The address you have entered is already registered. An email has been sent to this address with a link that gives you access to the survey.");
return $oToken->tid;
}
}
@@ -348,7 +348,7 @@ public function getTokenId($iSurveyId)
}
$oToken->save();
TokenDynamic::model($iSurveyId)->createToken($oToken->tid);// Review if really create a token
- $this->sMailMessage=$clang->gT("An email has been sent to the address you provided with access details for this survey. Please follow the link in that email to proceed.");
+ $this->sMailMessage=gT("An email has been sent to the address you provided with access details for this survey. Please follow the link in that email to proceed.");
return $oToken->tid;
}
}
diff --git a/application/controllers/Statistics_userController.php b/application/controllers/Statistics_userController.php
index 492d8e6d4f7..7991567bf26 100644
--- a/application/controllers/Statistics_userController.php
+++ b/application/controllers/Statistics_userController.php
@@ -265,7 +265,7 @@ function actionAction($surveyid,$language)
break;
case "A": // ARRAY OF 5 POINT CHOICE QUESTIONS
case "B": // ARRAY OF 10 POINT CHOICE QUESTIONS
- case "C": // ARRAY OF YES\No\$clang->gT("Uncertain") QUESTIONS
+ case "C": // ARRAY OF YES\No\gT("Uncertain") QUESTIONS
case "E": // ARRAY OF Increase/Same/Decrease QUESTIONS
case "F": // FlEXIBLE ARRAY
case "H": // ARRAY (By Column)
@@ -385,9 +385,9 @@ function actionAction($surveyid,$language)
$prb->setFrame(); // set ProgressBar Frame
$prb->frame['left'] = 50; // Frame position from left
$prb->frame['top'] = 80; // Frame position from top
- $prb->addLabel('text','txt1',$clang->gT("Please wait ...")); // add Text as Label 'txt1' and value 'Please wait'
+ $prb->addLabel('text','txt1',gT("Please wait ...")); // add Text as Label 'txt1' and value 'Please wait'
$prb->addLabel('percent','pct1'); // add Percent as Label 'pct1'
- $prb->addButton('btn1',$clang->gT('Go back'),'?action=statistics&sid='.$iSurveyID); // add Button as Label 'btn1' and action '?restart=1'
+ $prb->addButton('btn1',gT('Go back'),'?action=statistics&sid='.$iSurveyID); // add Button as Label 'btn1' and action '?restart=1'
//progress bar starts with 35%
$process_status = 35;
@@ -396,7 +396,7 @@ function actionAction($surveyid,$language)
// 1: Get list of questions with answers chosen
//"Getting Questions and Answer ..." is shown above the bar
- $prb->setLabelValue('txt1',$clang->gT('Getting questions and answers ...'));
+ $prb->setLabelValue('txt1',gT('Getting questions and answers ...'));
$prb->moveStep(5);
// creates array of post variable names
@@ -418,7 +418,7 @@ function actionAction($surveyid,$language)
if (isset($summary) && $summary)
{
//"Generating Summaries ..." is shown above the progress bar
- $prb->setLabelValue('txt1',$clang->gT('Generating summaries ...'));
+ $prb->setLabelValue('txt1',gT('Generating summaries ...'));
$prb->moveStep($process_status);
//let's run through the survey // Fixed bug 3053 with array_unique
@@ -443,7 +443,7 @@ function actionAction($surveyid,$language)
//done! set progress bar to 100%
if (isset($prb))
{
- $prb->setLabelValue('txt1',$clang->gT('Completed'));
+ $prb->setLabelValue('txt1',gT('Completed'));
$prb->moveStep(100);
$prb->hide();
}
diff --git a/application/controllers/UploaderController.php b/application/controllers/UploaderController.php
index 367052ccc68..d49b1251aaa 100644
--- a/application/controllers/UploaderController.php
+++ b/application/controllers/UploaderController.php
@@ -116,10 +116,10 @@ function run($actionID)
// Return some json to do a beautiful text
if (@unlink($sFileDir.$sFileName))
{
- echo sprintf($clang->gT('File %s deleted'), $sOriginalFileName);
+ echo sprintf(gT('File %s deleted'), $sOriginalFileName);
}
else
- echo $clang->gT('Oops, There was an error deleting the file');
+ echo gT('Oops, There was an error deleting the file');
Yii::app()->end();
}
@@ -161,7 +161,7 @@ function run($actionID)
{
$return = array(
"success" => false,
- "msg" => sprintf($clang->gT("Sorry, this file extension (%s) is not allowed!"),$ext)
+ "msg" => sprintf(gT("Sorry, this file extension (%s) is not allowed!"),$ext)
);
//header('Content-Type: application/json');
echo ls_json_encode($return);
@@ -175,7 +175,7 @@ function run($actionID)
{
$return = array(
"success" => false,
- "msg" => sprintf($clang->gT("Sorry, this file is too large. Only files upto %s KB are allowed."), $maxfilesize)
+ "msg" => sprintf(gT("Sorry, this file is too large. Only files upto %s KB are allowed."), $maxfilesize)
);
//header('Content-Type: application/json');
echo ls_json_encode($return);
@@ -192,7 +192,7 @@ function run($actionID)
"name" => rawurlencode(basename($filename)),
"ext" => $ext,
"filename" => $randfilename,
- "msg" => $clang->gT("The file has been successfuly uploaded.")
+ "msg" => gT("The file has been successfuly uploaded.")
);
// TODO : unlink this file since this is just a preview. But we can do it only if it's not needed, and still needed to have the file content
// Maybe use a javascript 'onunload' on preview question/group
@@ -210,7 +210,7 @@ function run($actionID)
{
$return = array(
"success" => false,
- "msg" => sprintf($clang->gT("Sorry, this file is too large. Only files up to %s KB are allowed.",'unescaped'), $maxfilesize)
+ "msg" => sprintf(gT("Sorry, this file is too large. Only files up to %s KB are allowed.",'unescaped'), $maxfilesize)
);
//header('Content-Type: application/json');
echo ls_json_encode($return);
@@ -220,7 +220,7 @@ function run($actionID)
{
$return = array(
"success" => false,
- "msg" => $clang->gT("We are sorry but there was a system error and your file was not saved. An email has been dispatched to notify the survey administrator.",'unescaped')
+ "msg" => gT("We are sorry but there was a system error and your file was not saved. An email has been dispatched to notify the survey administrator.",'unescaped')
);
//header('Content-Type: application/json');
echo ls_json_encode($return);
@@ -234,7 +234,7 @@ function run($actionID)
"name" => rawurlencode(basename($filename)),
"ext" => $ext,
"filename" => $randfilename,
- "msg" => $clang->gT("The file has been successfuly uploaded.")
+ "msg" => gT("The file has been successfuly uploaded.")
);
//header('Content-Type: application/json');
echo ls_json_encode($return);
@@ -248,7 +248,7 @@ function run($actionID)
{
$return = array(
"success" => false,
- "msg" => $clang->gT("Sorry, there was an error uploading your file")
+ "msg" => gT("Sorry, there was an error uploading your file")
);
//header('Content-Type: application/json');
echo ls_json_encode($return);
@@ -259,7 +259,7 @@ function run($actionID)
{
$return = array(
"success" => false,
- "msg" => sprintf($clang->gT("Sorry, this file is too large. Only files upto %s KB are allowed."), $maxfilesize)
+ "msg" => sprintf(gT("Sorry, this file is too large. Only files upto %s KB are allowed."), $maxfilesize)
);
//header('Content-Type: application/json');
echo ls_json_encode($return);
@@ -269,7 +269,7 @@ function run($actionID)
{
$return = array(
"success" => false,
- "msg" => $clang->gT("Unknown error")
+ "msg" => gT("Unknown error")
);
//header('Content-Type: application/json');
echo ls_json_encode($return);
@@ -294,17 +294,17 @@ function run($actionID)
';
$sLangScriptVar="
translt = {
- titleFld: '" . $clang->gT('Title','js') . "',
- commentFld: '" . $clang->gT('Comment','js') . "',
- errorNoMoreFiles: '" . $clang->gT('Sorry, no more files can be uploaded!','js') . "',
- errorOnlyAllowed: '" . $clang->gT('Sorry, only %s files can be uploaded for this question!','js') . "',
- uploading: '" . $clang->gT('Uploading','js') . "',
- selectfile: '" . $clang->gT('Select file','js') . "',
- errorNeedMore: '" . $clang->gT('Please upload %s more file(s).','js') . "',
- errorMoreAllowed: '" . $clang->gT('If you wish, you may upload %s more file(s); else you may return back to survey.','js') . "',
- errorMaxReached: '" . $clang->gT('The maximum number of files has been uploaded. You may return back to survey.','js') . "',
- errorTooMuch: '" . $clang->gT('The maximum number of files has been uploaded. You may return back to survey.','js') . "',
- errorNeedMoreConfirm: '" . $clang->gT("You need to upload %s more files for this question.\nAre you sure you want to exit?",'js') . "'
+ titleFld: '" . gT('Title','js') . "',
+ commentFld: '" . gT('Comment','js') . "',
+ errorNoMoreFiles: '" . gT('Sorry, no more files can be uploaded!','js') . "',
+ errorOnlyAllowed: '" . gT('Sorry, only %s files can be uploaded for this question!','js') . "',
+ uploading: '" . gT('Uploading','js') . "',
+ selectfile: '" . gT('Select file','js') . "',
+ errorNeedMore: '" . gT('Please upload %s more file(s).','js') . "',
+ errorMoreAllowed: '" . gT('If you wish, you may upload %s more file(s); else you may return back to survey.','js') . "',
+ errorMaxReached: '" . gT('The maximum number of files has been uploaded. You may return back to survey.','js') . "',
+ errorTooMuch: '" . gT('The maximum number of files has been uploaded. You may return back to survey.','js') . "',
+ errorNeedMoreConfirm: '" . gT("You need to upload %s more files for this question.\nAre you sure you want to exit?",'js') . "'
};
";
$aSurveyInfo=getSurveyInfo($surveyid, $sLanguage);
@@ -361,10 +361,10 @@ function run($actionID)
- '.$clang->gT("Select file").'
+ '.gT("Select file").'
- '.sprintf($clang->gT("You can upload %s under %s KB each."),$qidattributes['allowed_filetypes'],$qidattributes['max_filesize']).'
+ '.sprintf(gT("You can upload %s under %s KB each."),$qidattributes['allowed_filetypes'],$qidattributes['max_filesize']).'
diff --git a/application/controllers/admin/assessments.php b/application/controllers/admin/assessments.php
index 81e483049f9..17bcb19d49b 100644
--- a/application/controllers/admin/assessments.php
+++ b/application/controllers/admin/assessments.php
@@ -54,7 +54,7 @@ public function index($iSurveyID)
if (Permission::model()->hasSurveyPermission($iSurveyID, 'assessments', 'read')) {
if ($iSurveyID == '') {
- show_error($clang->gT("No SID Provided"));
+ show_error(gT("No SID Provided"));
die();
}
@@ -83,8 +83,8 @@ private function _showAssessments($iSurveyID, $action)
{
$oAssessments = Assessment::model()->findAllByAttributes(array('sid' => $iSurveyID));
$aData = $this->_collectGroupData($iSurveyID);
- $aHeadings = array($clang->gT("Scope"), $clang->gT("Question group"), $clang->gT("Minimum"), $clang->gT("Maximum"));
- $aData['actiontitle'] = $clang->gT("Add");
+ $aHeadings = array(gT("Scope"), gT("Question group"), gT("Minimum"), gT("Maximum"));
+ $aData['actiontitle'] = gT("Add");
$aData['actionvalue'] = "assessmentadd";
$aData['editId'] = '';
@@ -106,7 +106,7 @@ private function _showAssessments($iSurveyID, $action)
Yii::app()->loadHelper('admin/htmleditor');
if ($surveyinfo['assessments']!='Y')
- $urls['message'] = array('title' => $clang->gT("Assessments mode not activated"), 'message' => sprintf($clang->gT("Assessment mode for this survey is not activated. You can activate it in the %s survey settings %s (tab 'Notification & data management')."),'',' '), 'class'=> 'warningheader');
+ $urls['message'] = array('title' => gT("Assessments mode not activated"), 'message' => sprintf(gT("Assessment mode for this survey is not activated. You can activate it in the %s survey settings %s (tab 'Notification & data management')."),'',' '), 'class'=> 'warningheader');
$urls['assessments_view'][]= $aData;
$this->_renderWrappedTemplate('', $urls, $aData);
}
@@ -133,7 +133,7 @@ private function _collectEditData(array $aData)
foreach ($assessments as $assessment) {
$editData = $assessment->attributes;
}
- $aData['actiontitle'] = $clang->gT("Edit");
+ $aData['actiontitle'] = gT("Edit");
$aData['actionvalue'] = "assessmentupdate";
$aData['editId'] = $editData['id'];
$aData['editdata'] = $editData;
diff --git a/application/controllers/admin/authentication.php b/application/controllers/admin/authentication.php
index 20e3a7b7641..42bcd3a8318 100644
--- a/application/controllers/admin/authentication.php
+++ b/application/controllers/admin/authentication.php
@@ -32,7 +32,7 @@ class Authentication extends Survey_Common_Action
public function index()
{
$this->_redirectIfLoggedIn();
-
+
// Make sure after first run / update the authdb plugin is registered and active
// it can not be deactivated
if (!class_exists('Authdb', false)) {
@@ -41,7 +41,7 @@ public function index()
$plugin = new Plugin();
$plugin->name = 'Authdb';
$plugin->active = 1;
- $plugin->save();
+ $plugin->save();
App()->getPluginManager()->loadPlugin('Authdb', $plugin->id);
} else {
$plugin->active = 1;
@@ -61,7 +61,7 @@ public function index()
if (!is_null($beforeLogin->get('default'))) {
$aData['defaultAuth'] = $beforeLogin->get('default');
}
- $newLoginForm = new PluginEvent('newLoginForm');
+ $newLoginForm = new PluginEvent('newLoginForm');
App()->getPluginManager()->dispatchEvent($newLoginForm);
$aData['summary'] = $this->_getSummary('logout');
$aData['pluginContent'] = $newLoginForm->getAllContent();
@@ -77,7 +77,7 @@ public function index()
$identity = $event->get('identity');
// Now authenticate
- if ($identity->authenticate())
+ if ($identity->authenticate())
{
FailedLoginAttempt::model()->deleteAttempts();
App()->user->setState('plugin', $authMethod);
@@ -92,7 +92,7 @@ public function index()
if (empty($message)) {
// If no message, return a default message
$clang = $this->getController()->lang;
- $message = $clang->gT('Incorrect username and/or password!');
+ $message = gT('Incorrect username and/or password!');
}
App()->user->setFlash('loginError', $message);
$this->getController()->redirect(array('/admin/authentication/sa/login'));
@@ -107,7 +107,7 @@ public function logout()
{
// Fetch the current user
$plugin = App()->user->getState('plugin', null); // Save for afterLogout, current user will be destroyed by then
-
+
/* Adding beforeLogout event */
$beforeLogout = new PluginEvent('beforeLogout');
App()->getPluginManager()->dispatchEvent($beforeLogout, array($plugin));
@@ -118,7 +118,7 @@ public function logout()
/* Adding afterLogout event */
$event = new PluginEvent('afterLogout');
App()->getPluginManager()->dispatchEvent($event, array($plugin));
-
+
$this->getController()->redirect(array('/admin/authentication/sa/login'));
}
@@ -166,17 +166,17 @@ private function _sendPasswordEmail($sEmailAddr, $aFields)
$clang = $this->getController()->lang;
$sFrom = Yii::app()->getConfig("siteadminname") . " <" . Yii::app()->getConfig("siteadminemail") . ">";
$sTo = $sEmailAddr;
- $sSubject = $clang->gT('User data');
+ $sSubject = gT('User data');
$sNewPass = createPassword();
$sSiteName = Yii::app()->getConfig('sitename');
$sSiteAdminBounce = Yii::app()->getConfig('siteadminbounce');
- $username = sprintf($clang->gT('Username: %s'), $aFields[0]['users_name']);
- $email = sprintf($clang->gT('Email: %s'), $sEmailAddr);
- $password = sprintf($clang->gT('New password: %s'), $sNewPass);
+ $username = sprintf(gT('Username: %s'), $aFields[0]['users_name']);
+ $email = sprintf(gT('Email: %s'), $sEmailAddr);
+ $password = sprintf(gT('New password: %s'), $sNewPass);
$body = array();
- $body[] = sprintf($clang->gT('Your user data for accessing %s'), Yii::app()->getConfig('sitename'));
+ $body[] = sprintf(gT('Your user data for accessing %s'), Yii::app()->getConfig('sitename'));
$body[] = $username;
$body[] = $password;
$body = implode("\n", $body);
@@ -184,11 +184,11 @@ private function _sendPasswordEmail($sEmailAddr, $aFields)
if (SendEmailMessage($body, $sSubject, $sTo, $sFrom, $sSiteName, false, $sSiteAdminBounce))
{
User::model()->updatePassword($aFields[0]['uid'], $sNewPass);
- $sMessage = $username . ' ' . $email . ' ' . $clang->gT('An email with your login data was sent to you.');
+ $sMessage = $username . ' ' . $email . ' ' . gT('An email with your login data was sent to you.');
}
else
{
- $sTmp = str_replace("{NAME}", '' . $aFields[0]['users_name'] . ' ', $clang->gT("Email to {NAME} ({EMAIL}) failed."));
+ $sTmp = str_replace("{NAME}", '' . $aFields[0]['users_name'] . ' ', gT("Email to {NAME} ({EMAIL}) failed."));
$sMessage = str_replace("{EMAIL}", $sEmailAddr, $sTmp) . ' ';
}
@@ -208,21 +208,19 @@ private function _getSummary($sMethod = 'login', $sSummary = '')
return $sSummary;
}
- $clang = $this->getController()->lang;
-
switch ($sMethod) {
case 'logout' :
- $sSummary = $clang->gT('Please log in first.');
+ $sSummary = gT('Please log in first.');
break;
case 'login' :
default :
- $sSummary = ' ' . sprintf($clang->gT('Welcome %s!'), Yii::app()->session['full_name']) . ' ';
+ $sSummary = ' ' . sprintf(gT('Welcome %s!'), Yii::app()->session['full_name']) . ' ';
if (!empty(Yii::app()->session['redirect_after_login']) && strpos(Yii::app()->session['redirect_after_login'], 'logout') === FALSE)
{
Yii::app()->session['metaHeader'] = ' ';
- $sSummary = '' . $clang->gT('Reloading screen. Please wait.') . ' ';
+ $sSummary = '
' . gT('Reloading screen. Please wait.') . ' ';
unset(Yii::app()->session['redirect_after_login']);
}
break;
diff --git a/application/controllers/admin/checkintegrity.php b/application/controllers/admin/checkintegrity.php
index 235834d25e8..416c929c993 100644
--- a/application/controllers/admin/checkintegrity.php
+++ b/application/controllers/admin/checkintegrity.php
@@ -28,7 +28,7 @@ public function __construct($controller, $id)
if (!Permission::model()->hasGlobalPermission('settings','read')){
$clang = $this->getController()->lang;
- Yii::app()->session['flashmessage'] = $clang->gT("You do not have sufficient rights to access this page.");
+ Yii::app()->session['flashmessage'] = gT("You do not have sufficient rights to access this page.");
$this->getController()->redirect($this->getController()->createUrl("/admin/"));
}
@@ -55,7 +55,7 @@ public function fixredundancy()
if(in_array($aTokenTable['table'],$oldsmultidelete))
{
Yii::app()->db->createCommand()->dropTable($aTokenTable['table']);
- $aData['messages'][] = sprintf($clang->gT('Deleting token table: %s'),$aTokenTable['table']);
+ $aData['messages'][] = sprintf(gT('Deleting token table: %s'),$aTokenTable['table']);
}
}
}
@@ -65,13 +65,13 @@ public function fixredundancy()
if(in_array($aSurveyTable['table'],$oldsmultidelete))
{
Yii::app()->db->createCommand()->dropTable($aSurveyTable['table']);
- $aData['messages'][] = sprintf($clang->gT('Deleting survey table: %s'),$aSurveyTable['table']);
+ $aData['messages'][] = sprintf(gT('Deleting survey table: %s'),$aSurveyTable['table']);
}
}
}
if(count($aData['messages'])==0)
{
- $aData['messages'][] = $clang->gT('No old survey or token table selected.');
+ $aData['messages'][] = gT('No old survey or token table selected.');
}
$this->_renderWrappedTemplate('checkintegrity', 'fix_view', $aData);
}
@@ -151,7 +151,7 @@ private function _deleteOrphanTokenTables(array $tokenTables, array $aData, Lime
foreach ($tokenTables as $aTokenTable)
{
Yii::app()->db->createCommand()->dropTable($aTokenTable);
- $aData['messages'][] = $clang->gT('Deleting orphan token table:') . ' ' . $aTokenTable;
+ $aData['messages'][] = gT('Deleting orphan token table:') . ' ' . $aTokenTable;
}
return $aData;
}
@@ -161,7 +161,7 @@ private function _dropOrphanSurveyTables(array $surveyTables, array $aData, Lime
foreach ($surveyTables as $aSurveyTable)
{
Yii::app()->db->createCommand()->dropTable($aSurveyTable);
- $aData['messages'][] = $clang->gT('Deleting orphan survey table:') . ' ' . $aSurveyTable;
+ $aData['messages'][] = gT('Deleting orphan survey table:') . ' ' . $aSurveyTable;
}
return $aData;
}
@@ -174,7 +174,7 @@ private function _deleteGroups(array $groups, array $aData, Limesurvey_lang $cla
$criteria->addInCondition('gid', $gids);
QuestionGroup::model()->deleteAll($criteria);
if (QuestionGroup::model()->hasErrors()) safeDie(QuestionGroup::model()->getError());
- $aData['messages'][] = sprintf($clang->gT('Deleting groups: %u groups deleted'), count($groups));
+ $aData['messages'][] = sprintf(gT('Deleting groups: %u groups deleted'), count($groups));
return $aData;
}
@@ -186,7 +186,7 @@ private function _deleteQuestions(array $questions, array $aData, Limesurvey_lan
$criteria->addInCondition('qid', $qids);
Question::model()->deleteAll($criteria);
if (Question::model()->hasErrors()) safeDie(Question::model()->getError());
- $aData['messages'][] = sprintf($clang->gT('Deleting questions: %u questions deleted'), count($questions));
+ $aData['messages'][] = sprintf(gT('Deleting questions: %u questions deleted'), count($questions));
return array($criteria, $aData);
}
@@ -198,7 +198,7 @@ private function _deleteSurveyLanguageSettings(array $surveyLanguageSettings, ar
$criteria->compare('surveyls_survey_id', $surveyls_survey_ids);
SurveyLanguageSetting::model()->deleteAll($criteria);
if (SurveyLanguageSetting::model()->hasErrors()) safeDie(SurveyLanguageSetting::model()->getError());
- $aData['messages'][] = sprintf($clang->gT('Deleting survey languagesettings: %u survey languagesettings deleted'), count($surveyLanguageSettings));
+ $aData['messages'][] = sprintf(gT('Deleting survey languagesettings: %u survey languagesettings deleted'), count($surveyLanguageSettings));
return array($criteria, $aData);
}
@@ -210,7 +210,7 @@ private function _deleteSurveys(array $surveys, array $aData, Limesurvey_lang $c
}
if (Survey::model()->hasErrors()) safeDie(Survey::model()->getError());
- $aData['messages'][] = sprintf($clang->gT('Deleting surveys: %u surveys deleted'), count($surveys));
+ $aData['messages'][] = sprintf(gT('Deleting surveys: %u surveys deleted'), count($surveys));
return $aData;
}
@@ -220,7 +220,7 @@ private function _deleteAnswers(array $answers, array $aData, Limesurvey_lang $c
Answer::model()->deleteAll('qid=:qid AND code=:code',array(':qid'=>$aAnswer['qid'],':code'=>$aAnswer['code']));
if (Answer::model()->hasErrors()) safeDie(Answer::model()->getError());
}
- $aData['messages'][] = sprintf($clang->gT('Deleting answers: %u answers deleted'), count($answers));
+ $aData['messages'][] = sprintf(gT('Deleting answers: %u answers deleted'), count($answers));
return $aData;
}
@@ -231,7 +231,7 @@ private function _deleteAssessments(array $assessments, array $aData, Limesurvey
$assessments_ids = array();
Assessment::model()->deleteByPk('id',$assessments_ids);
if (Assessment::model()->hasErrors()) safeDie(Assessment::model()->getError());
- $aData['messages'][] = sprintf($clang->gT('Deleting assessments: %u assessment entries deleted'), count($assessments));
+ $aData['messages'][] = sprintf(gT('Deleting assessments: %u assessment entries deleted'), count($assessments));
return $aData;
}
@@ -255,7 +255,7 @@ private function _deleteQuotaMembers(array $aData, Limesurvey_lang $clang)
QuotaMember::model()->deleteAll($criteria);
if (QuotaLanguageSetting::model()->hasErrors()) safeDie(QuotaLanguageSetting::model()->getError());
- $aData['messages'][] = $clang->gT('Deleting orphaned quota members.');
+ $aData['messages'][] = gT('Deleting orphaned quota members.');
return $aData;
}
@@ -280,7 +280,7 @@ private function _deleteQuotas(array $aData, Limesurvey_lang $clang)
Quota::model()->deleteAll($criteria);
if (Quota::model()->hasErrors()) safeDie(Quota::model()->getError());
- $aData['messages'][] = $clang->gT('Deleting orphaned quotas.');
+ $aData['messages'][] = gT('Deleting orphaned quotas.');
return $aData;
}
@@ -294,7 +294,7 @@ private function _deleteDefaultValues(array $aData, Limesurvey_lang $clang)
DefaultValue::model()->deleteAll($criteria);
if (DefaultValue::model()->hasErrors()) safeDie(DefaultValue::model()->getError());
- $aData['messages'][] = $clang->gT('Deleting orphaned default values.');
+ $aData['messages'][] = gT('Deleting orphaned default values.');
return $aData;
}
@@ -307,7 +307,7 @@ private function _deleteQuestionAttributes(array $questionAttributes, array $aDa
QuestionAttribute::model()->deleteAll($criteria);
if (QuestionAttribute::model()->hasErrors()) safeDie(QuestionAttribute::model()->getError());
- $aData['messages'][] = sprintf($clang->gT('Deleting question attributes: %u attributes deleted'), count($questionAttributes));
+ $aData['messages'][] = sprintf(gT('Deleting question attributes: %u attributes deleted'), count($questionAttributes));
return $aData;
}
@@ -318,7 +318,7 @@ private function _deleteConditions(array $conditions, array $aData, Limesurvey_l
Condition::model()->deleteByPk($cids);
if (Condition::model()->hasErrors()) safeDie(Condition::model()->getError());
- $aData['messages'][] = sprintf($clang->gT('Deleting conditions: %u conditions deleted'), count($condition));
+ $aData['messages'][] = sprintf(gT('Deleting conditions: %u conditions deleted'), count($condition));
return $aData;
}
@@ -419,7 +419,7 @@ protected function _checkintegrity()
$iRowCount = Question::model()->countByAttributes(array('qid' => $condition['cqid']));
if (Question::model()->hasErrors()) safeDie(Question::model()->getError());
if (!$iRowCount) {
- $aDelete['conditions'][] = array('cid' => $condition['cid'], 'reason' => $clang->gT('No matching CQID'));
+ $aDelete['conditions'][] = array('cid' => $condition['cid'], 'reason' => gT('No matching CQID'));
} else {
$okQuestion[$condition['cqid']] = $condition['cqid'];
}
@@ -431,12 +431,12 @@ protected function _checkintegrity()
list ($surveyid, $gid, $rest) = explode('X', $condition['cfieldname']);
$iRowCount = count(QuestionGroup::model()->findAllByAttributes(array('gid'=>$gid)));
if (QuestionGroup::model()->hasErrors()) safeDie(QuestionGroup::model()->getError());
- if (!$iRowCount) $aDelete['conditions'][] = array('cid' => $condition['cid'], 'reason' => $clang->gT('No matching CFIELDNAME group!') . " ($gid) ({$condition['cfieldname']})");
+ if (!$iRowCount) $aDelete['conditions'][] = array('cid' => $condition['cid'], 'reason' => gT('No matching CFIELDNAME group!') . " ($gid) ({$condition['cfieldname']})");
}
}
elseif (!$condition['cfieldname'])
{
- $aDelete['conditions'][] = array('cid' => $condition['cid'], 'reason' => $clang->gT('No CFIELDNAME field set!') . " ({$condition['cfieldname']})");
+ $aDelete['conditions'][] = array('cid' => $condition['cid'], 'reason' => gT('No CFIELDNAME field set!') . " ({$condition['cfieldname']})");
}
}
@@ -524,7 +524,7 @@ protected function _checkintegrity()
$iAssessmentCount = count(Survey::model()->findAllByPk($assessment['sid']));
if (Survey::model()->hasErrors()) safeDie(Survey::model()->getError());
if (!$iAssessmentCount) {
- $aDelete['assessments'][] = array('id' => $assessment['id'], 'assessment' => $assessment['name'], 'reason' => $clang->gT('No matching survey'));
+ $aDelete['assessments'][] = array('id' => $assessment['id'], 'assessment' => $assessment['name'], 'reason' => gT('No matching survey'));
}
}
@@ -537,7 +537,7 @@ protected function _checkintegrity()
$iAssessmentCount = count(QuestionGroup::model()->findAllByPk(array('gid'=>$assessment['gid'], 'language'=>$assessment['language'])));
if (QuestionGroup::model()->hasErrors()) safeDie(QuestionGroup::model()->getError());
if (!$iAssessmentCount) {
- $aDelete['assessments'][] = array('id' => $assessment['id'], 'assessment' => $assessment['name'], 'reason' => $clang->gT('No matching group'));
+ $aDelete['assessments'][] = array('id' => $assessment['id'], 'assessment' => $assessment['name'], 'reason' => gT('No matching group'));
}
}
/**********************************************************************/
@@ -552,7 +552,7 @@ protected function _checkintegrity()
$iAnswerCount = Question::model()->countByAttributes(array('qid' => $answer['qid']));
if (Question::model()->hasErrors()) safeDie(Question::model()->getError());
if (!$iAnswerCount) {
- $aDelete['answers'][] = array('qid' => $answer['qid'], 'code' => $answer['code'], 'reason' => $clang->gT('No matching question'));
+ $aDelete['answers'][] = array('qid' => $answer['qid'], 'code' => $answer['code'], 'reason' => gT('No matching question'));
} else {
$okQuestion[$answer['qid']] = $answer['qid'];
}
@@ -606,7 +606,7 @@ protected function _checkintegrity()
foreach ($surveys_languagesettings as $surveys_languagesetting)
{
- $aDelete['surveylanguagesettings'][] = array('slid' => $surveys_languagesetting['surveyls_survey_id'], 'reason' => $clang->gT('The related survey is missing.'));
+ $aDelete['surveylanguagesettings'][] = array('slid' => $surveys_languagesetting['surveyls_survey_id'], 'reason' => gT('The related survey is missing.'));
}
/**********************************************************************/
@@ -623,11 +623,11 @@ protected function _checkintegrity()
{
//Make sure the group exists
if (!in_array($question['gid'], $gids)) {
- $aDelete['questions'][] = array('qid' => $question['qid'], 'reason' => $clang->gT('No matching group') . " ({$question['gid']})");
+ $aDelete['questions'][] = array('qid' => $question['qid'], 'reason' => gT('No matching group') . " ({$question['gid']})");
}
//Make sure survey exists
if (!in_array($question['sid'], $sids)) {
- $aDelete['questions'][] = array('qid' => $question['qid'], 'reason' => $clang->gT('There is no matching survey.') . " ({$question['sid']})");
+ $aDelete['questions'][] = array('qid' => $question['qid'], 'reason' => gT('There is no matching survey.') . " ({$question['sid']})");
}
}
@@ -643,7 +643,7 @@ protected function _checkintegrity()
$groups = QuestionGroup::model()->findAll($criteria);
foreach ($groups as $group)
{
- $aDelete['groups'][] = array('gid' => $group['gid'], 'reason' => $clang->gT('There is no matching survey.') . ' SID:' . $group['sid']);
+ $aDelete['groups'][] = array('gid' => $group['gid'], 'reason' => gT('There is no matching survey.') . ' SID:' . $group['sid']);
}
/**********************************************************************/
@@ -691,14 +691,14 @@ protected function _checkintegrity()
$SurveyText = $aTableParts[1];
$iSurveyID = $aTableParts[2];
$sDateTime = $aTableParts[3];
- $sType = $clang->gT('responses');
+ $sType = gT('responses');
} elseif (count($aTableParts) == 5) {
//This is a timings table (
$sOldText = $aTableParts[0];
$SurveyText = $aTableParts[1];
$iSurveyID = $aTableParts[2];
$sDateTime = $aTableParts[4];
- $sType = $clang->gT('timings');
+ $sType = gT('timings');
}
$iYear = substr($sDateTime, 0, 4);
$iMonth = substr($sDateTime, 4, 2);
@@ -711,7 +711,7 @@ protected function _checkintegrity()
if ($aFirstRow['recordcount']==0) { // empty table - so add it to immediate deletion
$aDelete['orphansurveytables'][] = $sTableName;
} else {
- $aOldSurveyTableAsk[] = array('table' => $sTableName, 'details' => sprintf($clang->gT('Survey ID %d saved at %s containing %d record(s) (%s)'), $iSurveyID, $sDate, $aFirstRow['recordcount'], $sType));
+ $aOldSurveyTableAsk[] = array('table' => $sTableName, 'details' => sprintf(gT('Survey ID %d saved at %s containing %d record(s) (%s)'), $iSurveyID, $sDate, $aFirstRow['recordcount'], $sType));
}
}
}
@@ -772,7 +772,7 @@ protected function _checkintegrity()
}
else
{
- $aOldTokenTableAsk[] = array('table' => $sTableName, 'details' => sprintf($clang->gT('Survey ID %d saved at %s containing %d record(s)'), $iSurveyID, $sDate, $aFirstRow['recordcount']));
+ $aOldTokenTableAsk[] = array('table' => $sTableName, 'details' => sprintf(gT('Survey ID %d saved at %s containing %d record(s)'), $iSurveyID, $sDate, $aFirstRow['recordcount']));
}
}
}
diff --git a/application/controllers/admin/conditionsaction.php b/application/controllers/admin/conditionsaction.php
index dc103f56955..06b32f832ec 100644
--- a/application/controllers/admin/conditionsaction.php
+++ b/application/controllers/admin/conditionsaction.php
@@ -66,29 +66,29 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
if (Yii::app()->getConfig('stringcomparizonoperators') == 1)
{
$method = array(
- "<" => $clang->gT("Less than"),
- "<=" => $clang->gT("Less than or equal to"),
- "==" => $clang->gT("equals"),
- "!=" => $clang->gT("Not equal to"),
- ">=" => $clang->gT("Greater than or equal to"),
- ">" => $clang->gT("Greater than"),
- "RX" => $clang->gT("Regular expression"),
- "a $clang->gT("Less than (Strings)"),
- "a<=b" => $clang->gT("Less than or equal to (Strings)"),
- "a>=b" => $clang->gT("Greater than or equal to (Strings)"),
- "a>b" => $clang->gT("Greater than (Strings)")
+ "<" => gT("Less than"),
+ "<=" => gT("Less than or equal to"),
+ "==" => gT("equals"),
+ "!=" => gT("Not equal to"),
+ ">=" => gT("Greater than or equal to"),
+ ">" => gT("Greater than"),
+ "RX" => gT("Regular expression"),
+ "a gT("Less than (Strings)"),
+ "a<=b" => gT("Less than or equal to (Strings)"),
+ "a>=b" => gT("Greater than or equal to (Strings)"),
+ "a>b" => gT("Greater than (Strings)")
);
}
else
{
$method = array(
- "<" => $clang->gT("Less than"),
- "<=" => $clang->gT("Less than or equal to"),
- "==" => $clang->gT("equals"),
- "!=" => $clang->gT("Not equal to"),
- ">=" => $clang->gT("Greater than or equal to"),
- ">" => $clang->gT("Greater than"),
- "RX" => $clang->gT("Regular expression")
+ "<" => gT("Less than"),
+ "<=" => gT("Less than or equal to"),
+ "==" => gT("equals"),
+ "!=" => gT("Not equal to"),
+ ">=" => gT("Greater than or equal to"),
+ ">" => gT("Greater than"),
+ "RX" => gT("Regular expression")
);
}
@@ -121,8 +121,8 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
//MAKE SURE THAT THERE IS A SID
if (!isset($iSurveyID) || !$iSurveyID)
{
- $conditionsoutput = $clang->gT("You have not selected a survey").str_repeat($br, 2);
- $conditionsoutput .= CHtml::submitButton($clang->gT("Main admin screen"), array(
+ $conditionsoutput = gT("You have not selected a survey").str_repeat($br, 2);
+ $conditionsoutput .= CHtml::submitButton(gT("Main admin screen"), array(
'onclick' => "window.open('".$this->getController()->createUrl("admin/")."', '_top')"
)).$br;
safeDie($conditionsoutput);
@@ -138,25 +138,25 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$resetsurveylogicoutput = $br;
$resetsurveylogicoutput .= CHtml::openTag('table', array('class'=>'alertbox'));
$resetsurveylogicoutput .= CHtml::openTag('tr').CHtml::openTag('td', array('colspan'=>'2'));
- $resetsurveylogicoutput .= CHtml::tag('font', array('size'=>'1'), CHtml::tag('strong', array(), $clang->gT("Reset Survey Logic")));
+ $resetsurveylogicoutput .= CHtml::tag('font', array('size'=>'1'), CHtml::tag('strong', array(), gT("Reset Survey Logic")));
$resetsurveylogicoutput .= CHtml::closeTag('td').CHtml::closeTag('tr');
if (!isset($_GET['ok']))
{
- $button_yes = CHtml::submitButton($clang->gT("Yes"), array(
+ $button_yes = CHtml::submitButton(gT("Yes"), array(
'onclick' => "window.open('".$this->getController()->createUrl("admin/conditions/sa/index/subaction/resetsurveylogic/surveyid/$iSurveyID")."?ok=Y"."', '_top')"
));
- $button_cancel = CHtml::submitButton($clang->gT("Cancel"), array(
+ $button_cancel = CHtml::submitButton(gT("Cancel"), array(
'onclick' => "window.open('".$this->getController()->createUrl("admin/survey/sa/view/surveyid/$iSurveyID")."', '_top')"
));
- $messagebox_content = $clang->gT("You are about to delete all conditions on this survey's questions")."($iSurveyID)"
- . $br . $clang->gT("We recommend that before you proceed, you export the entire survey from the main administration screen.")
- . $br . $clang->gT("Continue?")
+ $messagebox_content = gT("You are about to delete all conditions on this survey's questions")."($iSurveyID)"
+ . $br . gT("We recommend that before you proceed, you export the entire survey from the main administration screen.")
+ . $br . gT("Continue?")
. $br . $button_yes . $button_cancel;
$this->_renderWrappedTemplate('conditions', array('message' => array(
- 'title' => $clang->gT("Warning"),
+ 'title' => gT("Warning"),
'message' => $messagebox_content
)));
exit;
@@ -165,7 +165,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
{
LimeExpressionManager::RevertUpgradeConditionsToRelevance($iSurveyID);
Condition::model()->deleteRecords("qid in (select qid from {{questions}} where sid={$iSurveyID})");
- Yii::app()->session['flashmessage']=$clang->gT("All conditions in this survey have been deleted.");
+ Yii::app()->session['flashmessage']=gT("All conditions in this survey have been deleted.");
$this->getController()->redirect(array('admin/survey/sa/view/surveyid/'.$iSurveyID));
}
@@ -176,8 +176,8 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// MAKE SURE THAT THERE IS A QID
if ( !isset($qid) || !$qid )
{
- $conditionsoutput = $clang->gT("You have not selected a question").str_repeat($br, 2);
- $conditionsoutput .= CHtml::submitButton($clang->gT("Main admin screen"), array(
+ $conditionsoutput = gT("You have not selected a question").str_repeat($br, 2);
+ $conditionsoutput .= CHtml::submitButton(gT("Main admin screen"), array(
'onclick' => "window.open('".$this->getController()->createUrl("admin/")."', '_top')"
)).$br;
safeDie($conditionsoutput);
@@ -215,7 +215,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
(!isset($p_cquestions) && !isset($p_csrctoken))
)
{
- $conditionsoutput_action_error .= CHtml::script("\n\n");
+ $conditionsoutput_action_error .= CHtml::script("\n\n");
}
else
{
@@ -294,7 +294,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
(!isset($p_cquestions) && !isset($p_csrctoken))
)
{
- $conditionsoutput_action_error .= CHtml::script("\n\n");
+ $conditionsoutput_action_error .= CHtml::script("\n\n");
}
else
{
@@ -407,7 +407,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$newindex++;
}
LimeExpressionManager::UpgradeConditionsToRelevance(NULL,$qid);
- Yii::app()->session['flashmessage'] = $clang->gT("All conditions scenarios were renumbered.");
+ Yii::app()->session['flashmessage'] = gT("All conditions scenarios were renumbered.");
@@ -489,20 +489,20 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
if (isset($conditionDuplicated) && $conditionDuplicated ==true)
{
$CopyConditionsMessage = CHtml::tag('div', array('class'=>'partialheader'),
- '('.$clang->gT("Condition successfully copied (some were skipped because they were duplicates)").')'
+ '('.gT("Condition successfully copied (some were skipped because they were duplicates)").')'
);
}
else
{
$CopyConditionsMessage = CHtml::tag('div', array('class'=>'successheader'),
- '('.$clang->gT("Condition successfully copied").')'
+ '('.gT("Condition successfully copied").')'
);
}
}
else
{
$CopyConditionsMessage = CHtml::tag('div', array('class'=>'warningheader'),
- '('.$clang->gT("No conditions could be copied (due to duplicates)").')'
+ '('.gT("No conditions could be copied (due to duplicates)").')'
);
}
}
@@ -691,14 +691,14 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
}
break;
case "C": //Array Y/N/NA
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "Y", $clang->gT("Yes"));
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "U", $clang->gT("Uncertain"));
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "N", $clang->gT("No"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "Y", gT("Yes"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "U", gT("Uncertain"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "N", gT("No"));
break;
case "E": //Array >/=/<
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "I", $clang->gT("Increase"));
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "S", $clang->gT("Same"));
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "D", $clang->gT("Decrease"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "I", gT("Increase"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "S", gT("Same"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "D", gT("Decrease"));
break;
case "F": //Array Flexible Row
case "H": //Array Flexible Column
@@ -718,7 +718,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "", gT("No answer"));
}
} //while
@@ -846,8 +846,8 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']."#0", "", $clang->gT("No answer"));
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']."#1", "", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']."#0", "", gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']."#1", "", gT("No answer"));
}
} //while
}
@@ -867,7 +867,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], "", gT("No answer"));
}
} //while
@@ -896,14 +896,14 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$i, " ", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$i, " ", gT("No answer"));
}
}
unset($quicky);
} // End if type R
elseif($rows['type'] == "M" || $rows['type'] == "P")
{
- $shortanswer = " [".$clang->gT("Group of checkboxes")."]";
+ $shortanswer = " [".gT("Group of checkboxes")."]";
$shortquestion = $rows['title'].":$shortanswer ".strip_tags($rows['question']);
$cquestions[] = array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'].$X.$rows['gid'].$X.$rows['qid']);
@@ -918,11 +918,11 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], $arows['title'], $theanswer);
$shortanswer = "{$arows['title']}: [" . strip_tags($arows['question']) . "]";
- $shortanswer .= "[".$clang->gT("Single checkbox")."]";
+ $shortanswer .= "[".gT("Single checkbox")."]";
$shortquestion=$rows['title'].":$shortanswer ".strip_tags($rows['question']);
$cquestions[]=array($shortquestion, $rows['qid'], $rows['type'], "+".$rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']);
- $canswers[]=array("+".$rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], 'Y', $clang->gT("checked"));
- $canswers[]=array("+".$rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], '', $clang->gT("not checked"));
+ $canswers[]=array("+".$rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], 'Y', gT("checked"));
+ $canswers[]=array("+".$rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title'], '', gT("not checked"));
}
}
elseif($rows['type'] == "X") //Boilerplate question
@@ -935,21 +935,21 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
switch ($rows['type'])
{
case "Y": // Y/N/NA
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "Y", $clang->gT("Yes"));
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "N", $clang->gT("No"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "Y", gT("Yes"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "N", gT("No"));
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", gT("No answer"));
}
break;
case "G": //Gender
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "F", $clang->gT("Female"));
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "M", $clang->gT("Male"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "F", gT("Female"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "M", gT("Male"));
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", gT("No answer"));
}
break;
case "5": // 5 choice
@@ -960,7 +960,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", gT("No answer"));
}
break;
@@ -969,7 +969,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", gT("No answer"));
}
break;
@@ -991,7 +991,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", gT("No answer"));
}
}
elseif ($rows['type'] != "M" &&
@@ -1005,13 +1005,13 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$rows['type'] == "!") &&
$rows['other'] == "Y" )
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "-oth-", $clang->gT("Other"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "-oth-", gT("Other"));
}
// Only Show No-Answer if question is not mandatory
if ($rows['mandatory'] != 'Y')
{
- $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", $clang->gT("No answer"));
+ $canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], " ", gT("No answer"));
}
}
break;
@@ -1022,7 +1022,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
//END Gather Information for this question
- $questionNavOptions = CHtml::openTag('optgroup', array('class'=>'activesurveyselect', 'label'=>$clang->gT("Before","js")));
+ $questionNavOptions = CHtml::openTag('optgroup', array('class'=>'activesurveyselect', 'label'=>gT("Before","js")));
foreach ($theserows as $row)
{
$question=$row['question'];
@@ -1043,7 +1043,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
);
}
$questionNavOptions .= CHtml::closeTag('optgroup');
- $questionNavOptions .= CHtml::openTag('optgroup', array('class'=>'activesurveyselect', 'label'=>$clang->gT("Current","js")));
+ $questionNavOptions .= CHtml::openTag('optgroup', array('class'=>'activesurveyselect', 'label'=>gT("Current","js")));
$question = strip_tags($questiontext);
if (strlen($question)<35)
{
@@ -1060,7 +1060,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
'selected'=>'selected'),
$questiontitle .': '. $questiontextshort);
$questionNavOptions .= CHtml::closeTag('optgroup');
- $questionNavOptions .= CHtml::openTag('optgroup', array('class'=> 'activesurveyselect', 'label'=>$clang->gT("After","js")));
+ $questionNavOptions .= CHtml::openTag('optgroup', array('class'=> 'activesurveyselect', 'label'=>gT("After","js")));
foreach ($postrows as $row)
{
@@ -1172,7 +1172,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$scenariocount=count($scenarioresult);
$showreplace="$questiontitle". $this->_showSpeaker($questiontext);
- $onlyshow=sprintf($clang->gT("Only show question %s IF"),$showreplace);
+ $onlyshow=sprintf(gT("Only show question %s IF"),$showreplace);
$aData['conditionsoutput'] = '';
$aData['extraGetParams'] = $extraGetParams;
@@ -1198,7 +1198,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
}
if ($s > 0)
{
- $scenariotext = " -------- ".$clang->gT("OR")." Scenario {$scenarionr['scenario']} --------";
+ $scenariotext = " -------- ".gT("OR")." Scenario {$scenarionr['scenario']} --------";
}
if ($subaction == "copyconditionsform" || $subaction == "copyconditions")
{
@@ -1217,14 +1217,14 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$subaction == "deletescenario" || $subaction == "delete")
)
{
- $img_tag = CHtml::image($imageurl.'/scenario_delete.png', $clang->gT("Delete this scenario"), array(
+ $img_tag = CHtml::image($imageurl.'/scenario_delete.png', gT("Delete this scenario"), array(
'name'=>'DeleteWholeGroup'
));
$additional_main_content = CHtml::link($img_tag, '#', array(
- 'onclick' => "if ( confirm('".$clang->gT("Are you sure you want to delete all conditions set in this scenario?", "js")."')) { document.getElementById('deletescenario{$scenarionr['scenario']}').submit();}"
+ 'onclick' => "if ( confirm('".gT("Are you sure you want to delete all conditions set in this scenario?", "js")."')) { document.getElementById('deletescenario{$scenarionr['scenario']}').submit();}"
));
- $img_tag = CHtml::image($imageurl.'/scenario_edit.png', $clang->gT("Edit scenario"), array(
+ $img_tag = CHtml::image($imageurl.'/scenario_edit.png', gT("Edit scenario"), array(
'name'=>'DeleteWholeGroup'
));
$additional_main_content .= CHtml::link($img_tag, '#', array(
@@ -1346,14 +1346,14 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$aViewUrls['output'] .= "\n"
."\t\n"
.""
- .$clang->gT("and")." ";
+ .gT("and")."
";
}
elseif (isset($currentfield))
{
$aViewUrls['output'] .= "\n"
.CHtml::form(array("/admin/conditions/sa/index/subaction/copyconditions/surveyid/{$iSurveyID}/gid/{$gid}/qid/{$qid}/"), 'post', array('id'=>"copyconditions",'name'=>"copyconditions"))
- ."\n";
+ ."\n";
//CopyConditionsMessage
@@ -1606,10 +1606,10 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig("generalscripts").'jquery/jquery.multiselect.min.js');
// TODO
- $aViewUrls['output'] .= "";
+ $aViewUrls['output'] .= "";
$aViewUrls['output'] .= "\t\n"
- ."\t
".$clang->gT("Copy the selected conditions to").":
\n"
+ ."\t
".gT("Copy the selected conditions to").":
\n"
."\t
\n"
."\t\t
\n";
if (isset($pquestions) && count($pquestions) != 0)
@@ -1633,8 +1633,8 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
}
$aViewUrls['output'] .= "\t\n"
- // ."\t\t
gT("Are you sure you want to copy these condition(s) to the questions you have selected?","js")."')){ prepareCopyconditions(); return true;} else { return false;}\" $disableCopyCondition/>\n"
- ."\t\t
\n"
+ // ."\t\t
\n"
+ ."\t\t
\n"
."
\n"
."
\n"
."
\n"
@@ -1658,7 +1658,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
else
{
$aViewUrls['output'] .= "
\n"
- ." \n"
+ ." \n"
."
\n";
}
@@ -1693,11 +1693,11 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$aViewUrls['output'] .= CHtml::form(array("/admin/conditions/sa/index/subaction/{$subaction}/surveyid/{$iSurveyID}/gid/{$gid}/qid/{$qid}/"), 'post', array('id'=>"editconditions",'name'=>"editconditions"));
if ($subaction == "editthiscondition" && isset($p_cid))
{
- $mytitle = $clang->gT("Edit condition");
+ $mytitle = gT("Edit condition");
}
else
{
- $mytitle = $clang->gT("Add condition");
+ $mytitle = gT("Add condition");
}
$aViewUrls['output'] .= "\n";
@@ -1708,8 +1708,8 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
( $subaction == "editthiscondition" && isset($scenario) && $scenario == 1) )
{
$scenarioAddBtn = "\t
"
- ." \n";
- $scenarioTxt = "
".$clang->gT("Default scenario")." ";
+ ."
\n";
+ $scenarioTxt = "
".gT("Default scenario")." ";
$scenarioInputStyle = "style = 'display: none;'";
}
else
@@ -1720,7 +1720,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
}
$aViewUrls['output'] .="
\n"
- ."
$scenarioAddBtn ".$clang->gT("Scenario")."
\n"
+ ."
$scenarioAddBtn ".gT("Scenario")."
\n"
."
"
."$scenarioTxt\n"
."
\n"
@@ -1728,12 +1728,12 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Begin "Question" row
$aViewUrls['output'] .="
\n"
- ."
".$clang->gT("Question")."
\n"
+ ."
".gT("Question")."
\n"
."
\n"
."\t
\n"
."\t
\n";
// Previous question tab
@@ -1790,7 +1790,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Begin "Comparison operator" row
$aViewUrls['output'] .="
\n"
- ."
".$clang->gT("Comparison operator")."
\n"
+ ."
".gT("Comparison operator")."
\n"
."
\n"
."
\n";
foreach ($method as $methodCode => $methodTxt)
@@ -1805,7 +1805,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Begin "Answer" row
$aViewUrls['output'] .="\n"
- ."
".$clang->gT("Answer")."
\n";
+ ."
".gT("Answer")."
\n";
if ($subaction == "editthiscondition")
{
@@ -1853,24 +1853,24 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
."
\n"
."
\n"
."\t
\n";
// Predefined answers tab
$aViewUrls['output'] .= "\t
\n"
."\t\t\n"
."\t\t \n"
- ."\t\t".$clang->gT("Predefined answer options for this question")." \n"
+ ."\t\t".gT("Predefined answer options for this question")." \n"
."\t
\n";
// Constant tab
$aViewUrls['output'] .= "\t
\n"
."\t\t
\n"
- ."\t\t
".$clang->gT("Constant value")."
\n"
+ ."\t\t
".gT("Constant value")."
\n"
."\t
\n";
// Previous answers tab @SGQA@ placeholders
$aViewUrls['output'] .= "\t
\n"
@@ -1888,7 +1888,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
}
}
$aViewUrls['output'] .= "\t\t\n"
- ."\t\t".$clang->gT("Answer from previous questions")." \n"
+ ."\t\t".gT("Answer from previous questions")." \n"
."\t
\n";
// Token tab
@@ -1900,13 +1900,13 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
}
$aViewUrls['output'] .= "\t\t\n"
- ."\t\t
".$clang->gT("Attributes values from the participant's token")." \n"
+ ."\t\t
".gT("Attributes values from the participant's token")." \n"
."\t
\n";
// Regexp Tab
$aViewUrls['output'] .= "\t
\n"
."\t\t
\n"
- ."\t\t
\n"
+ ."\t\t
\n"
."\t
\n";
$aViewUrls['output'] .= "
\n"; // end conditiontarget div
@@ -1917,13 +1917,13 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
if ($subaction == "editthiscondition" && isset($p_cid))
{
- $submitLabel = $clang->gT("Update condition");
+ $submitLabel = gT("Update condition");
$submitSubaction = "updatecondition";
$submitcid = sanitize_int($p_cid);
}
else
{
- $submitLabel = $clang->gT("Add condition");
+ $submitLabel = gT("Add condition");
$submitSubaction = "insertcondition";
$submitcid = "";
}
@@ -1933,7 +1933,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
// Begin buttons row
$aViewUrls['output'] .= "
\n"
- ."\t
\n"
+ ."\t
\n"
."\t
\n"
."
\n"
."
\n"
@@ -2088,10 +2088,10 @@ private function _showSpeaker($hinttext)
//output with hoover effect
$reshtml= "
gT("Question","js").": $jshinttext')\" />"
+ ." onclick=\"alert('".gT("Question","js").": $jshinttext')\" />"
." \"$shortstring...\" "
."
gT("Question","js").": $jshinttext')\" />";
+ ." onclick=\"alert('".gT("Question","js").": $jshinttext')\" />";
}
else
{
diff --git a/application/controllers/admin/database.php b/application/controllers/admin/database.php
index 94bf32837e1..62a5ad18264 100644
--- a/application/controllers/admin/database.php
+++ b/application/controllers/admin/database.php
@@ -101,7 +101,7 @@ function index($sa = null)
}
}
}
- Yii::app()->session['flashmessage'] = $clang->gT("Default value settings were successfully saved.");
+ Yii::app()->session['flashmessage'] = gT("Default value settings were successfully saved.");
LimeExpressionManager::SetDirtyFlag();
if ($sDBOutput != '')
@@ -159,7 +159,7 @@ function index($sa = null)
'scale_id'=>$iScaleID));
if (!$iInsertCount) // Checked
{
- Yii::app()->setFlashMessage($clang->gT("Failed to update answers"),'error');
+ Yii::app()->setFlashMessage(gT("Failed to update answers"),'error');
}
} // foreach ($alllanguages as $language)
if(isset($sOldCode) && $sCode !== $sOldCode) {
@@ -171,11 +171,11 @@ function index($sa = null)
LimeExpressionManager::UpgradeConditionsToRelevance($iSurveyID);
if (!Yii::app()->request->getPost('bFullPOST'))
{
- Yii::app()->setFlashMessage($clang->gT("Not all answer options were saved. This usually happens due to server limitations ( PHP setting max_input_vars) - please contact your system administrator."));
+ Yii::app()->setFlashMessage(gT("Not all answer options were saved. This usually happens due to server limitations ( PHP setting max_input_vars) - please contact your system administrator."));
}
else
{
- Yii::app()->session['flashmessage']= $clang->gT("Answer options were successfully saved.");
+ Yii::app()->session['flashmessage']= gT("Answer options were successfully saved.");
}
LimeExpressionManager::SetDirtyFlag();
if ($sDBOutput != '')
@@ -212,7 +212,7 @@ function index($sa = null)
$iInsertCount = Question::model()->deleteAllByAttributes(array('qid'=>$iDeletedQID));
if (!$iInsertCount)
{
- Yii::app()->setFlashMessage($clang->gT("Failed to delete answer"),'error');
+ Yii::app()->setFlashMessage(gT("Failed to delete answer"),'error');
}
}
}
@@ -309,16 +309,16 @@ function index($sa = null)
$aErrors=$oSubQuestion->getErrors();
if(count($aErrors))
{
- //$sErrorMessage=$clang->gT("Question could not be updated with this errors:");
+ //$sErrorMessage=gT("Question could not be updated with this errors:");
foreach($aErrors as $sAttribute=>$aStringErrors)
{
foreach($aStringErrors as $sStringErrors)
- Yii::app()->setFlashMessage(sprintf($clang->gT("Error on %s for subquestion %s: %s"), $sAttribute,$aCodes[$iScaleID][$iPosition],$sStringErrors),'error');
+ Yii::app()->setFlashMessage(sprintf(gT("Error on %s for subquestion %s: %s"), $sAttribute,$aCodes[$iScaleID][$iPosition],$sStringErrors),'error');
}
}
else
{
- Yii::app()->setFlashMessage(sprintf($clang->gT("Subquestions %s could not be updated."),$aCodes[$iScaleID][$iPosition]),'error');
+ Yii::app()->setFlashMessage(sprintf(gT("Subquestions %s could not be updated."),$aCodes[$iScaleID][$iPosition]),'error');
}
}
$iPosition++;
@@ -332,11 +332,11 @@ function index($sa = null)
{
if (!Yii::app()->request->getPost('bFullPOST'))
{
- Yii::app()->session['flashmessage'] = $clang->gT("Not all subquestions were saved. This usually happens due to server limitations ( PHP setting max_input_vars) - please contact your system administrator.");
+ Yii::app()->session['flashmessage'] = gT("Not all subquestions were saved. This usually happens due to server limitations ( PHP setting max_input_vars) - please contact your system administrator.");
}
else
{
- Yii::app()->session['flashmessage'] = $clang->gT("Subquestions were successfully saved.");
+ Yii::app()->session['flashmessage'] = gT("Subquestions were successfully saved.");
}
}
//$action='editsubquestions';
@@ -356,7 +356,7 @@ function index($sa = null)
$sBaseLanguage = Survey::model()->findByPk($iSurveyID)->language;
if (strlen(Yii::app()->request->getPost('title')) < 1)
{
- Yii::app()->setFlashMessage($clang->gT("The question could not be added. You must enter at least a question code."),'error');
+ Yii::app()->setFlashMessage(gT("The question could not be added. You must enter at least a question code."),'error');
}
else
{
@@ -401,7 +401,7 @@ function index($sa = null)
foreach($aErrors as $sAttribute=>$aStringErrors)
{
foreach($aStringErrors as $sStringErrors)
- Yii::app()->setFlashMessage(sprintf($clang->gT("Question could not be created with error on %s: %s"), $sAttribute,$sStringErrors),'error');
+ Yii::app()->setFlashMessage(sprintf(gT("Question could not be created with error on %s: %s"), $sAttribute,$sStringErrors),'error');
}
}
// Add other languages
@@ -440,12 +440,12 @@ function index($sa = null)
foreach($aErrors as $sAttribute=>$aStringErrors)
{
foreach($aStringErrors as $sStringErrors)
- Yii::app()->setFlashMessage(sprintf($clang->gT("Question in language %s could not be created with error on %s: %s"), $alang, $sAttribute,$sStringErrors),'error');
+ Yii::app()->setFlashMessage(sprintf(gT("Question in language %s could not be created with error on %s: %s"), $alang, $sAttribute,$sStringErrors),'error');
}
}
# if (!$langqid)
# {
-# Yii::app()->setFlashMessage($clang->gT("Question in language %s could not be created."),'error');
+# Yii::app()->setFlashMessage(gT("Question in language %s could not be created."),'error');
# }
}
}
@@ -454,7 +454,7 @@ function index($sa = null)
if (!$iQuestionID)
{
- Yii::app()->setFlashMessage($clang->gT("Question could not be created."),'error');
+ Yii::app()->setFlashMessage(gT("Question could not be created."),'error');
} else {
if ($sAction == 'copyquestion') {
@@ -579,7 +579,7 @@ function index($sa = null)
}
Question::model()->updateQuestionOrder($iQuestionGroupID, $iSurveyID);
- Yii::app()->session['flashmessage'] = $clang->gT("Question was successfully added.");
+ Yii::app()->session['flashmessage'] = gT("Question was successfully added.");
}
@@ -726,7 +726,7 @@ function index($sa = null)
}
if (isset($cccount) && $cccount)
{
- Yii::app()->setFlashMessage($clang->gT("Question could not be updated. There are conditions for other questions that rely on the answers to this question and changing the type will cause problems. You must delete these conditions before you can change the type of this question."),'error');
+ Yii::app()->setFlashMessage(gT("Question could not be updated. There are conditions for other questions that rely on the answers to this question and changing the type will cause problems. You must delete these conditions before you can change the type of this question."),'error');
}
else
{
@@ -799,12 +799,12 @@ function index($sa = null)
foreach($aErrors as $sAttribute=>$aStringErrors)
{
foreach($aStringErrors as $sStringErrors)
- Yii::app()->setFlashMessage(sprintf($clang->gT("Question could not be updated with error on %s: %s"), $sAttribute,$sStringErrors),'error');
+ Yii::app()->setFlashMessage(sprintf(gT("Question could not be updated with error on %s: %s"), $sAttribute,$sStringErrors),'error');
}
}
else
{
- Yii::app()->setFlashMessage($clang->gT("Question could not be updated."),'error');
+ Yii::app()->setFlashMessage(gT("Question could not be updated."),'error');
}
}
}
@@ -832,7 +832,7 @@ function index($sa = null)
// Remove old subquestion scales
Question::model()->deleteAllByAttributes(array('parent_qid' => $iQuestionID), 'scale_id >= :scale_id', array(':scale_id' => $iSubquestionScales));
if(!isset($bOnError) || !$bOnError)// This really a quick hack and need a better system
- Yii::app()->setFlashMessage($clang->gT("Question was successfully saved."));
+ Yii::app()->setFlashMessage(gT("Question was successfully saved."));
// }
// else
// {
@@ -841,9 +841,9 @@ function index($sa = null)
// $errormsg="";
// if (!is_null($array_result['notAbove']))
// {
- // $errormsg.=$clang->gT("This question relies on other question's answers and can't be moved above groupId:","js")
- // . " " . $array_result['notAbove'][0][0] . " " . $clang->gT("in position","js")." ".$array_result['notAbove'][0][1]."\\n"
- // . $clang->gT("See conditions:")."\\n";
+ // $errormsg.=gT("This question relies on other question's answers and can't be moved above groupId:","js")
+ // . " " . $array_result['notAbove'][0][0] . " " . gT("in position","js")." ".$array_result['notAbove'][0][1]."\\n"
+ // . gT("See conditions:")."\\n";
//
// foreach ($array_result['notAbove'] as $notAboveCond)
// {
@@ -853,9 +853,9 @@ function index($sa = null)
// }
// if (!is_null($array_result['notBelow']))
// {
- // $errormsg.=$clang->gT("Some questions rely on this question's answers. You can't move this question below groupId:","js")
- // . " " . $array_result['notBelow'][0][0] . " " . $clang->gT("in position","js")." ".$array_result['notBelow'][0][1]."\\n"
- // . $clang->gT("See conditions:")."\\n";
+ // $errormsg.=gT("Some questions rely on this question's answers. You can't move this question below groupId:","js")
+ // . " " . $array_result['notBelow'][0][0] . " " . gT("in position","js")." ".$array_result['notBelow'][0][1]."\\n"
+ // . gT("See conditions:")."\\n";
//
// foreach ($array_result['notBelow'] as $notBelowCond)
// {
@@ -869,7 +869,7 @@ function index($sa = null)
}
else
{
- Yii::app()->setFlashMessage($clang->gT("Question could not be updated"),'error');
+ Yii::app()->setFlashMessage(gT("Question could not be updated"),'error');
}
}
LimeExpressionManager::UpgradeConditionsToRelevance($iSurveyID);
@@ -937,7 +937,7 @@ function index($sa = null)
}
}
- Yii::app()->session['flashmessage'] = $clang->gT("Survey text elements successfully saved.");
+ Yii::app()->session['flashmessage'] = gT("Survey text elements successfully saved.");
if ($sDBOutput != '')
{
@@ -1087,14 +1087,14 @@ function index($sa = null)
|| validateEmailAddress(Yii::app()->request->getPost('adminemail'))) {
$updatearray['adminemail'] = Yii::app()->request->getPost('adminemail');
} else {
- $warning .= $clang->gT("Warning! Notification email was not updated because it was not valid.").'
';
+ $warning .= gT("Warning! Notification email was not updated because it was not valid.").'
';
}
// make sure we only update bounce email if it is valid
if (Yii::app()->request->getPost('bounce_email', '') == ''
|| validateEmailAddress(Yii::app()->request->getPost('bounce_email'))) {
$updatearray['bounce_email'] = Yii::app()->request->getPost('bounce_email');
} else {
- $warning .= $clang->gT("Warning! Bounce email was not updated because it was not valid.").'
';
+ $warning .= gT("Warning! Bounce email was not updated because it was not valid.").'
';
}
// use model
@@ -1144,11 +1144,11 @@ function index($sa = null)
if ($usresult)
{
- Yii::app()->session['flashmessage'] = $warning.$clang->gT("Survey settings were successfully saved.");
+ Yii::app()->session['flashmessage'] = $warning.gT("Survey settings were successfully saved.");
}
else
{
- Yii::app()->session['flashmessage'] = $clang->gT("Error:").'
'.$clang->gT("Survey could not be updated.");
+ Yii::app()->session['flashmessage'] = gT("Error:").'
'.gT("Survey could not be updated.");
}
if (Yii::app()->request->getPost('action') == "updatesurveysettingsandeditlocalesettings")
diff --git a/application/controllers/admin/dataentry.php b/application/controllers/admin/dataentry.php
index 9d79fad2235..2af5b55049f 100644
--- a/application/controllers/admin/dataentry.php
+++ b/application/controllers/admin/dataentry.php
@@ -96,13 +96,13 @@ function vvimport()
}
else
{
- Yii::app()->session['flashmessage'] = $clang->gT("This survey is not active. You must activate the survey before attempting to import a VVexport file.");
+ Yii::app()->session['flashmessage'] = gT("This survey is not active. You must activate the survey before attempting to import a VVexport file.");
$this->getController()->redirect($this->getController()->createUrl("/admin/survey/sa/view/surveyid/{$iSurveyId}"));
}
}
else
{
- Yii::app()->session['flashmessage'] = $clang->gT("You do not have sufficient rights to access this page.");
+ Yii::app()->session['flashmessage'] = gT("You do not have sufficient rights to access this page.");
$this->getController()->redirect($this->getController()->createUrl("/admin/survey/sa/view/surveyid/{$iSurveyId}"));
}
}
@@ -155,8 +155,8 @@ private function _handleFileUpload($iSurveyId, $aData)
$aResult=CSVImportResponses($filePath,$iSurveyId,$aOptions);
unlink($filePath); //delete the uploaded file
$aData['class']="";
- $aData['title']=$clang->gT("Import a VV response data file");
- $aData['aResult']['success'][]=$clang->gT("File upload succeeded.");
+ $aData['title']=gT("Import a VV response data file");
+ $aData['aResult']['success'][]=gT("File upload succeeded.");
if(isset($aResult['success'])){
$aData['aResult']['success']=array_merge($aData['aResult']['success'],$aResult['success']);
}
@@ -202,15 +202,15 @@ private function _moveUploadedFile($aData)
if(!$fileVV->SaveAs($sFullFilePath))
{
$aData['class']='error warningheader';
- $aData['title']=$clang->gT("Error");
+ $aData['title']=gT("Error");
$aData['aResult']['errors'][] = sprintf(
- $clang->gT("An error occurred uploading your file. This may be caused by incorrect permissions in your %s folder."),
+ gT("An error occurred uploading your file. This may be caused by incorrect permissions in your %s folder."),
Yii::app()->getConfig('tempdir')
);
$aData['aResult']['errors'][] = "
".
$aData['aUrls'][] = array(
'link'=>$this->getController()->createUrl('admin/dataentry/sa/vvimport/surveyid/'.$aData['surveyid']),
- 'text'=>$aData['aUrlText'][] = $clang->gT("Back to Response Import"),
+ 'text'=>$aData['aUrlText'][] = gT("Back to Response Import"),
);
$this->_renderWrappedTemplate('dataentry', 'vvimport_result', $aData);
die;
@@ -483,7 +483,7 @@ public function editdata($subaction, $id, $surveyid, $language='')
{
$surveytable = "{{survey_".$surveyid.'}}';
$aData['clang'] = $clang = $this->getController()->lang;
- $aData['display']['menu_bars']['browse'] = $clang->gT("Data entry");
+ $aData['display']['menu_bars']['browse'] = gT("Data entry");
Yii::app()->loadHelper('database');
@@ -510,7 +510,7 @@ public function editdata($subaction, $id, $surveyid, $language='')
// Perform a case insensitive natural sort on group name then question title of a multidimensional array
// $fnames = (Field Name in Survey Table, Short Title of Question, Question Type, Field Name, Question Code, Predetermined Answer if exist)
- $fnames['completed'] = array('fieldname'=>"completed", 'question'=>$clang->gT("Completed"), 'type'=>'completed');
+ $fnames['completed'] = array('fieldname'=>"completed", 'question'=>gT("Completed"), 'type'=>'completed');
$fnames=array_merge($fnames,createFieldMap($surveyid,'full',false,false,$sDataEntryLanguage));
$nfncount = count($fnames)-1;
@@ -649,8 +649,8 @@ public function editdata($subaction, $id, $surveyid, $language='')
$selected = (empty($idrow['submitdate'])) ? 'N' : $completedate;
$select_options = array(
- 'N' => $clang->gT('No'),
- $completedate => $clang->gT('Yes')
+ 'N' => gT('No'),
+ $completedate => gT('Yes')
);
$aDataentryoutput .= CHtml::dropDownList('completed', $selected, $select_options);
@@ -714,9 +714,9 @@ public function editdata($subaction, $id, $surveyid, $language='')
break;
case "G": //GENDER drop-down list
$select_options = array(
- '' => $clang->gT("Please choose").'...',
- 'F' => $clang->gT("Female"),
- 'M' => $clang->gT("Male")
+ '' => gT("Please choose").'...',
+ 'F' => gT("Female"),
+ 'M' => gT("Male")
);
$aDataentryoutput .= CHtml::listBox($fname['fieldname'], $idrow[$fname['fieldname']], $select_options);
break;
@@ -744,7 +744,7 @@ public function editdata($subaction, $id, $surveyid, $language='')
$aDataentryoutput .= "\t\n"
."gT("Please choose").".. \n";
+ $aDataentryoutput .= ">".gT("Please choose")."..\n";
if (!isset($optCategorySeparator))
{
@@ -802,7 +802,7 @@ public function editdata($subaction, $id, $surveyid, $language='')
{
$aDataentryoutput .= "gT("Other")." \n";
+ $aDataentryoutput .= ">".gT("Other")."\n";
}
$aDataentryoutput .= "\t \n";
}
@@ -813,7 +813,7 @@ public function editdata($subaction, $id, $surveyid, $language='')
$aDataentryoutput .= "\t\n"
."gT("Please choose").".. \n";
+ $aDataentryoutput .= ">".gT("Please choose")."..\n";
foreach ($lresult->readAll() as $llrow)
{
@@ -854,15 +854,15 @@ public function editdata($subaction, $id, $surveyid, $language='')
$aDataentryoutput .= "\n";
$aDataentryoutput .="";
if($i==1){
- $aDataentryoutput .=$clang->gT('First choice');
+ $aDataentryoutput .=gT('First choice');
}else{
- $aDataentryoutput .=$clang->gT('Next choice');
+ $aDataentryoutput .=gT('Next choice');
}
$aDataentryoutput .=" ";
$aDataentryoutput .= "\n";
(!isset($currentvalues[$i-1])) ? $selected=" selected=\"selected\"" : $selected="";
- $aDataentryoutput .= "\t".$clang->gT('None')." \n";
+ $aDataentryoutput .= "\t".gT('None')." \n";
foreach ($answers as $ansrow)
{
(isset($currentvalues[$i-1]) && $currentvalues[$i-1]==$ansrow['code']) ? $selected=" selected=\"selected\"" : $selected="";
@@ -888,8 +888,8 @@ public function editdata($subaction, $id, $surveyid, $language='')
$aDataentryoutput .= "";
+ echo "";
}
}
diff --git a/application/core/LSUserIdentity.php b/application/core/LSUserIdentity.php
index 8cfeda29d8d..f60aacca7d6 100644
--- a/application/core/LSUserIdentity.php
+++ b/application/core/LSUserIdentity.php
@@ -15,34 +15,34 @@
/**
* For 2.06 most of the functionality in this class will be moved to the LSWebUser class.
* To not delay release of 2.05 this class was kept the way it is now.
- *
+ *
* @@TODO Move to LSWebUser and change documentation / workflow for authentication plugins
*/
class LSUserIdentity extends CUserIdentity {
const ERROR_IP_LOCKED_OUT = 98;
const ERROR_UNKNOWN_HANDLER = 99;
-
+
protected $config = array();
-
+
/**
* The userid
- *
+ *
* @var int
*/
- public $id = null;
+ public $id = null;
/**
* A User::model() object
- *
+ *
* @var User
*/
public $user;
-
+
/**
* This is the name of the plugin to handle authentication
* default handler is used for remote control
- *
+ *
* @var string
*/
public $plugin = 'Authdb';
@@ -50,16 +50,16 @@ class LSUserIdentity extends CUserIdentity {
public function authenticate() {
// First initialize the result, we can later retieve it to get the exact error code/message
$result = new LSAuthResult(self::ERROR_NONE);
-
+
// Check if the ip is locked out
if (FailedLoginAttempt::model()->isLockedOut()) {
$message = sprintf(gT('You have exceeded the number of maximum login attempts. Please wait %d minutes before trying again.'), App()->getConfig('timeOutTime') / 60);
$result->setError(self::ERROR_IP_LOCKED_OUT, $message);
}
-
+
// If still ok, continue
if ($result->isValid())
- {
+ {
if (is_null($this->plugin)) {
$result->setError(self::ERROR_UNKNOWN_HANDLER);
} else {
@@ -75,7 +75,7 @@ public function authenticate() {
}
}
}
-
+
if ($result->isValid()) {
// Perform postlogin
$this->postLogin();
@@ -85,18 +85,18 @@ public function authenticate() {
FailedLoginAttempt::model()->addAttempt($userHostAddress);
App()->session->regenerateID(); // Handled on login by Yii
}
-
+
$this->errorCode = $result->getCode();
$this->errorMessage = $result->getMessage();
-
- return $result->isValid();
+
+ return $result->isValid();
}
-
+
public function getConfig()
{
return $this->config;
}
-
+
/**
* Returns the current user's ID
*
@@ -107,7 +107,7 @@ public function getId()
{
return $this->id;
}
-
+
/**
* Returns the active user's record
*
@@ -118,18 +118,18 @@ public function getUser()
{
return $this->user;
}
-
+
protected function postLogin()
{
$user = $this->getUser();
App()->user->login($this);
-
+
// Check for default password
if ($this->password === 'password') {
App()->user->setFlash('pwdnotify', gT('Warning: You are still using the default password (\'password\'). Please change your password and re-login again.'));
}
- // Do session setup
+ // Do session setup
Yii::app()->session['loginID'] = (int) $user->uid;
Yii::app()->session['user'] = $user->users_name;
Yii::app()->session['full_name'] = $user->full_name;
@@ -138,7 +138,7 @@ protected function postLogin()
Yii::app()->session['questionselectormode'] = $user->questionselectormode;
Yii::app()->session['dateformat'] = $user->dateformat;
Yii::app()->session['session_hash'] = hash('sha256',getGlobalSetting('SessionName').$user->users_name.$user->uid);
-
+
// Perform language settings
if (App()->request->getPost('loginlang','default') != 'default')
{
@@ -156,16 +156,14 @@ protected function postLogin()
}
Yii::app()->session['adminlang'] = $sLanguage;
- $lang = new limesurvey_lang($sLanguage);
- App()->lang = $lang;
- App()->getController()->lang= $lang;
+ App()->setLanguage($sLanguage);
}
-
+
public function setPlugin($name) {
$this->plugin = $name;
}
-
+
public function setConfig($config) {
$this->config = $config;
- }
+ }
}
\ No newline at end of file
diff --git a/application/core/LSWebUser.php b/application/core/LSWebUser.php
index 7b17509c2ff..bc2b61177e5 100644
--- a/application/core/LSWebUser.php
+++ b/application/core/LSWebUser.php
@@ -1,24 +1,23 @@
-loginUrl = Yii::app()->createUrl('admin/authentication', array('sa' => 'login'));
-
+
// Try to fix missing language in plugin controller
Yii::import('application.libraries.Limesurvey_lang');
- if (empty(Yii::app()->session['adminlang']))
+ if (empty(Yii::app()->session['adminlang']))
{
Yii::app()->session["adminlang"] = Yii::app()->getConfig("defaultlang");
}
-
- $lang = new Limesurvey_lang(Yii::app()->session['adminlang']);
- Yii::app()->setLang($lang);
+
+ Yii::app()->setLanguage(Yii::app()->session['adminlang']);
}
public function checkAccess($operation, $params = array(), $allowCaching = true)
@@ -31,30 +30,30 @@ public function checkAccess($operation, $params = array(), $allowCaching = true)
{
return parent::checkAccess($operation, $params, $allowCaching);
}
-
+
}
- public function getStateKeyPrefix()
+ public function getStateKeyPrefix()
{
return $this->sessionVariable;
}
-
-
+
+
public function setFlash($key, $value, $defaultValue = null) {
$this->setState("flash.$key", $value, $defaultValue);
}
public function hasFlash($key) {
$this->hasState("flash.$key");
}
-
+
public function getFlashes($delete = true)
{
$result = $this->getState('flash', array());
$this->removeState('flash');
return $result;
}
-
- public function getState($key, $defaultValue = null)
+
+ public function getState($key, $defaultValue = null)
{
if (!isset($_SESSION[$this->sessionVariable]) || !Hash::check($_SESSION[$this->sessionVariable], $key))
{
@@ -65,7 +64,7 @@ public function getState($key, $defaultValue = null)
return Hash::get($_SESSION[$this->sessionVariable], $key);
}
}
-
+
/**
* Removes a state variable.
* @param string $key
@@ -75,7 +74,7 @@ public function removeState($key)
$this->setState($key, null);
}
- public function setState($key, $value, $defaultValue = null)
+ public function setState($key, $value, $defaultValue = null)
{
$current = isset($_SESSION[$this->sessionVariable]) ? $_SESSION[$this->sessionVariable] : array();
if($value === $defaultValue)
@@ -86,14 +85,14 @@ public function setState($key, $value, $defaultValue = null)
{
$_SESSION[$this->sessionVariable] = Hash::insert($current, $key, $value);
}
-
-
+
+
}
- public function hasState($key)
+ public function hasState($key)
{
return isset($_SESSION[$this->sessionVariable]) && Hash::check($_SESSION[$this->sessionVariable], $key);
}
-
+
}
?>
\ No newline at end of file
diff --git a/application/core/LSYii_Application.php b/application/core/LSYii_Application.php
index f7adfcd40fe..ea109547a9d 100644
--- a/application/core/LSYii_Application.php
+++ b/application/core/LSYii_Application.php
@@ -1,4 +1,4 @@
- 'vardump', // show in firebug/console
'showInFireBug' => true
);
-
+
// if debugsql = 1 we add sql logging to the output
if (array_key_exists('debugsql', $config['config']) && $config['config']['debugsql'] == 1) {
// Add logging of trace
@@ -105,17 +105,17 @@ public function __construct($config = null)
if (!isset($config['components']['session']))
{
$config['components']['session']=array();
- }
+ }
$config['components']['session']=array_merge_recursive($config['components']['session'],array(
'cookieParams' => array(
'httponly' => true,
),
- ));
+ ));
if (!isset($config['components']['assetManager']))
{
$config['components']['assetManager']=array();
- }
+ }
$config['components']['assetManager']=array_merge_recursive($config['components']['assetManager'],array(
'basePath'=> dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'assets' // Enable to activate cookie protection
));
@@ -127,7 +127,7 @@ public function __construct($config = null)
$email_config = require(__DIR__ . '/../config/email.php');
$version_config = require(__DIR__ . '/../config/version.php');
$settings = array_merge($ls_config, $version_config, $email_config);
-
+
if(file_exists(__DIR__ . '/../config/config.php'))
{
$ls_config = require(__DIR__ . '/../config/config.php');
@@ -142,8 +142,8 @@ public function __construct($config = null)
App()->getAssetManager()->setBaseUrl(Yii::app()->getBaseUrl(false) . '/tmp/assets');
// Now initialize the plugin manager
- $this->initPluginManager();
-
+ $this->initPluginManager();
+
}
@@ -167,7 +167,7 @@ public function initLanguage()
}
/**
* This method handles initialization of the plugin manager
- *
+ *
* When you want to insert your own plugin manager, or experiment with different settings
* then this is where you should do that.
*/
@@ -177,11 +177,11 @@ public function initPluginManager()
Yii::import('application.libraries.PluginManager.Storage.*');
Yii::import('application.libraries.PluginManager.Question.*');
$this->pluginManager = new PluginManager($this->getApi());
-
+
// And load the active plugins
$this->pluginManager->loadPlugins();
}
-
+
/**
* Loads a helper
*
@@ -218,17 +218,17 @@ public function setConfig($name, $value)
{
$this->config[$name] = $value;
}
-
+
/**
- * Set a 'flash message'.
- *
+ * Set a 'flash message'.
+ *
* A flahs message will be shown on the next request and can contain a message
* to tell that the action was successful or not. The message is displayed and
* cleared when it is shown in the view using the widget:
*
* $this->widget('application.extensions.FlashMessage.FlashMessage');
- *
- *
+ *
+ *
* @param string $message
* @param string $type
* @return LSYii_Application Provides a fluent interface
@@ -279,25 +279,26 @@ public function getConfig($name, $default = false)
* @param Limesurvey_lang
* @return void
*/
- public function setLang(Limesurvey_lang $lang)
+ public function setLanguage( $sLanguage )
{
- $this->lang = $lang;
+ $this->messages->catalog = $sLanguage;
+ parent::setLanguage($sLanguage);
}
-
+
/**
* Get the Api object.
*/
public function getApi()
{
if (!isset($this->api))
- {
+ {
$this->api = new LimesurveyApi();
}
return $this->api;
}
/**
* Get the pluginManager
- *
+ *
* @return PluginManager
*/
public function getPluginManager()
diff --git a/application/core/Survey_Common_Action.php b/application/core/Survey_Common_Action.php
index a9ff11bd94d..6bd196bccc7 100644
--- a/application/core/Survey_Common_Action.php
+++ b/application/core/Survey_Common_Action.php
@@ -343,7 +343,7 @@ protected function _renderWrappedTemplate($sAction = '', $aViewUrls = array(), $
Yii::app()->getController()->_loadEndScripts();
if(!isset($aData['display']['footer']) || $aData['display']['footer'] !== false)
- Yii::app()->getController()->_getAdminFooter('http://manual.limesurvey.org', $clang->gT('LimeSurvey online manual'));
+ Yii::app()->getController()->_getAdminFooter('http://manual.limesurvey.org', gT('LimeSurvey online manual'));
$out = ob_get_contents();
ob_clean();
@@ -383,7 +383,7 @@ function _questionbar($iSurveyID, $gid, $qid, $action = null)
$sumresult1 = Survey::model()->findByPk($iSurveyID);
if (is_null($sumresult1))
{
- Yii::app()->session['flashmessage'] = $clang->gT("Invalid survey ID");
+ Yii::app()->session['flashmessage'] = gT("Invalid survey ID");
$this->getController()->redirect(array("admin/index"));
} // if surveyid is invalid then die to prevent errors at a later time
$surveyinfo = $sumresult1->attributes;
@@ -525,7 +525,7 @@ function _surveybar($iSurveyID, $gid=null)
$sumresult1 = Survey::model()->with(array('languagesettings'=>array('condition'=>'surveyls_language=language')))->find('sid = :surveyid', array(':surveyid' => $iSurveyID)); //$sumquery1, 1) ; //Checked
if (is_null($sumresult1))
{
- Yii::app()->session['flashmessage'] = $clang->gT("Invalid survey ID");
+ Yii::app()->session['flashmessage'] = gT("Invalid survey ID");
$this->getController()->redirect(array("admin/index"));
} // if surveyid is invalid then die to prevent errors at a later time
$surveyinfo = $sumresult1->attributes;
@@ -561,11 +561,11 @@ function _surveybar($iSurveyID, $gid=null)
// TEST BUTTON
if (!$activated)
{
- $aData['icontext'] = $clang->gT("Test this survey");
+ $aData['icontext'] = gT("Test this survey");
}
else
{
- $aData['icontext'] = $clang->gT("Execute this survey");
+ $aData['icontext'] = gT("Execute this survey");
}
$aData['baselang'] = Survey::model()->findByPk($iSurveyID)->language;
@@ -639,7 +639,7 @@ function _surveybar($iSurveyID, $gid=null)
}
else
{
- $aData['groups'] = "" . $clang->gT("None") . " ";
+ $aData['groups'] = "" . gT("None") . " ";
}
$aData['GidPrev'] = $GidPrev = getGidPrevious($iSurveyID, $gid);
@@ -682,70 +682,70 @@ function _surveysummary($iSurveyID, $action=null, $gid=null)
$surveysummary2 = "";
if ($aSurveyInfo['anonymized'] != "N")
{
- $surveysummary2 .= $clang->gT("Responses to this survey are anonymized.") . " ";
+ $surveysummary2 .= gT("Responses to this survey are anonymized.") . " ";
}
else
{
- $surveysummary2 .= $clang->gT("Responses to this survey are NOT anonymized.") . " ";
+ $surveysummary2 .= gT("Responses to this survey are NOT anonymized.") . " ";
}
if ($aSurveyInfo['format'] == "S")
{
- $surveysummary2 .= $clang->gT("It is presented question by question.") . " ";
+ $surveysummary2 .= gT("It is presented question by question.") . " ";
}
elseif ($aSurveyInfo['format'] == "G")
{
- $surveysummary2 .= $clang->gT("It is presented group by group.") . " ";
+ $surveysummary2 .= gT("It is presented group by group.") . " ";
}
else
{
- $surveysummary2 .= $clang->gT("It is presented on one single page.") . " ";
+ $surveysummary2 .= gT("It is presented on one single page.") . " ";
}
if ($aSurveyInfo['questionindex'] > 0)
{
if ($aSurveyInfo['format'] == 'A')
{
- $surveysummary2 .= $clang->gT("No question index will be shown with this format.") . " ";
+ $surveysummary2 .= gT("No question index will be shown with this format.") . " ";
}
elseif ($aSurveyInfo['questionindex'] == 1)
{
- $surveysummary2 .= $clang->gT("A question index will be shown; participants will be able to jump between viewed questions.") . " ";
+ $surveysummary2 .= gT("A question index will be shown; participants will be able to jump between viewed questions.") . " ";
}
elseif ($aSurveyInfo['questionindex'] == 2)
{
- $surveysummary2 .= $clang->gT("A full question index will be shown; participants will be able to jump between relevant questions.") . " ";
+ $surveysummary2 .= gT("A full question index will be shown; participants will be able to jump between relevant questions.") . " ";
}
}
if ($aSurveyInfo['datestamp'] == "Y")
{
- $surveysummary2 .= $clang->gT("Responses will be date stamped.") . " ";
+ $surveysummary2 .= gT("Responses will be date stamped.") . " ";
}
if ($aSurveyInfo['ipaddr'] == "Y")
{
- $surveysummary2 .= $clang->gT("IP Addresses will be logged") . " ";
+ $surveysummary2 .= gT("IP Addresses will be logged") . " ";
}
if ($aSurveyInfo['refurl'] == "Y")
{
- $surveysummary2 .= $clang->gT("Referrer URL will be saved.") . " ";
+ $surveysummary2 .= gT("Referrer URL will be saved.") . " ";
}
if ($aSurveyInfo['usecookie'] == "Y")
{
- $surveysummary2 .= $clang->gT("It uses cookies for access control.") . " ";
+ $surveysummary2 .= gT("It uses cookies for access control.") . " ";
}
if ($aSurveyInfo['allowregister'] == "Y")
{
- $surveysummary2 .= $clang->gT("If tokens are used, the public may register for this survey") . " ";
+ $surveysummary2 .= gT("If tokens are used, the public may register for this survey") . " ";
}
if ($aSurveyInfo['allowsave'] == "Y" && $aSurveyInfo['tokenanswerspersistence'] == 'N')
{
- $surveysummary2 .= $clang->gT("Participants can save partially finished surveys") . " \n";
+ $surveysummary2 .= gT("Participants can save partially finished surveys") . " \n";
}
if ($aSurveyInfo['emailnotificationto'] != '')
{
- $surveysummary2 .= $clang->gT("Basic email notification is sent to:") .' '. htmlspecialchars($aSurveyInfo['emailnotificationto'])." \n";
+ $surveysummary2 .= gT("Basic email notification is sent to:") .' '. htmlspecialchars($aSurveyInfo['emailnotificationto'])." \n";
}
if ($aSurveyInfo['emailresponseto'] != '')
{
- $surveysummary2 .= $clang->gT("Detailed email notification with response data is sent to:") .' '. htmlspecialchars($aSurveyInfo['emailresponseto'])." \n";
+ $surveysummary2 .= gT("Detailed email notification with response data is sent to:") .' '. htmlspecialchars($aSurveyInfo['emailresponseto'])." \n";
}
$dateformatdetails = getDateFormatData(Yii::app()->session['dateformat']);
@@ -828,11 +828,11 @@ function _surveysummary($iSurveyID, $action=null, $gid=null)
if ($activated == "N")
{
- $aData['activatedlang'] = $clang->gT("No");
+ $aData['activatedlang'] = gT("No");
}
else
{
- $aData['activatedlang'] = $clang->gT("Yes");
+ $aData['activatedlang'] = gT("Yes");
}
$aData['activated'] = $activated;
@@ -843,14 +843,14 @@ function _surveysummary($iSurveyID, $action=null, $gid=null)
$aData['warnings'] = "";
if ($activated == "N" && $sumcount3 == 0)
{
- $aData['warnings'] = $clang->gT("Survey cannot be activated yet.") . " \n";
+ $aData['warnings'] = gT("Survey cannot be activated yet.") . " \n";
if ($sumcount2 == 0 && Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'create'))
{
- $aData['warnings'] .= "[" . $clang->gT("You need to add question groups") . "] ";
+ $aData['warnings'] .= "[" . gT("You need to add question groups") . "] ";
}
if ($sumcount3 == 0 && Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'create'))
{
- $aData['warnings'] .= "[" . $clang->gT("You need to add questions") . "] ";
+ $aData['warnings'] .= "[" . gT("You need to add questions") . "] ";
}
}
$aData['hints'] = $surveysummary2;
@@ -974,14 +974,14 @@ protected function _filterImportedResources($extractdir, $destdir)
{
$aErrorFilesInfo[] = Array(
"filename" => $direntry,
- "status" => $clang->gT("Copy failed")
+ "status" => gT("Copy failed")
);
}
else
{
$aImportedFilesInfo[] = Array(
"filename" => $direntry,
- "status" => $clang->gT("OK")
+ "status" => gT("OK")
);
}
}
@@ -990,7 +990,7 @@ protected function _filterImportedResources($extractdir, $destdir)
// Extension forbidden
$aErrorFilesInfo[] = Array(
"filename" => $direntry,
- "status" => $clang->gT("Forbidden Extension")
+ "status" => gT("Forbidden Extension")
);
}
unlink($extractdir . "/" . $direntry);
diff --git a/application/core/plugins/Authdb/Authdb.php b/application/core/plugins/Authdb/Authdb.php
index 6dd00efa8d9..dbf4c77b723 100644
--- a/application/core/plugins/Authdb/Authdb.php
+++ b/application/core/plugins/Authdb/Authdb.php
@@ -158,7 +158,7 @@ public function listExportOptions()
case 'xls':
$label = gT("Microsoft Excel");
if (!function_exists('iconv')) {
- $label .= ''.$clang->gT("(Iconv Library not installed)").' ';
+ $label .= ''.gT("(Iconv Library not installed)").' ';
}
$event->set('label', $label);
break;
diff --git a/application/core/plugins/ExportSTATAxml/STATAxmlWriter.php b/application/core/plugins/ExportSTATAxml/STATAxmlWriter.php
index 1bbc880fccb..a6a2ec88201 100644
--- a/application/core/plugins/ExportSTATAxml/STATAxmlWriter.php
+++ b/application/core/plugins/ExportSTATAxml/STATAxmlWriter.php
@@ -217,74 +217,74 @@ function createStataFieldmap($survey, $sLanguage, $oOptions)
{
$aFieldmap['answers'][$aQuestion['qid']]['0'][$yvalue] = array(
'code' => $yvalue,
- 'answer' => $clang->gT('Yes')
+ 'answer' => gT('Yes')
);
$aFieldmap['answers'][$aQuestion['qid']]['0']['0'] = array(
'code' => 0,
- 'answer' => $clang->gT('Not Selected')
+ 'answer' => gT('Not Selected')
);
}
elseif ($aQuestion['type'] == "P")
{
$aFieldmap['answers'][$aQuestion['qid']]['0'][$yvalue] = array(
'code' => $yvalue,
- 'answer' => $clang->gT('Yes')
+ 'answer' => gT('Yes')
);
$aFieldmap['answers'][$aQuestion['qid']]['0']['0'] = array(
'code' => 0,
- 'answer' => $clang->gT('Not Selected')
+ 'answer' => gT('Not Selected')
);
}
elseif ($aQuestion['type'] == "G")
{
$aFieldmap['answers'][$aQuestion['qid']]['0']['0'] = array(
'code' => 'F',
- 'answer' => $clang->gT('Female')
+ 'answer' => gT('Female')
);
$aFieldmap['answers'][$aQuestion['qid']]['0']['1'] = array(
'code' => 'M',
- 'answer' => $clang->gT('Male')
+ 'answer' => gT('Male')
);
}
elseif ($aQuestion['type'] == "Y")
{
$aFieldmap['answers'][$aQuestion['qid']]['0'][$yvalue] = array(
'code' => $yvalue,
- 'answer' => $clang->gT('Yes')
+ 'answer' => gT('Yes')
);
$aFieldmap['answers'][$aQuestion['qid']]['0'][$nvalue] = array(
'code' => $nvalue,
- 'answer' => $clang->gT('No')
+ 'answer' => gT('No')
);
}
elseif ($aQuestion['type'] == "C")
{
$aFieldmap['answers'][$aQuestion['qid']]['0']['1'] = array(
'code' => 1,
- 'answer' => $clang->gT('Yes')
+ 'answer' => gT('Yes')
);
$aFieldmap['answers'][$aQuestion['qid']]['0']['0'] = array(
'code' => 2,
- 'answer' => $clang->gT('No')
+ 'answer' => gT('No')
);
$aFieldmap['answers'][$aQuestion['qid']]['0']['9'] = array(
'code' => 3,
- 'answer' => $clang->gT('Uncertain')
+ 'answer' => gT('Uncertain')
);
}
elseif ($aQuestion['type'] == "E")
{
$aFieldmap['answers'][$aQuestion['qid']]['0']['1'] = array(
'code' => 1,
- 'answer' => $clang->gT('Increase')
+ 'answer' => gT('Increase')
);
$aFieldmap['answers'][$aQuestion['qid']]['0']['0'] = array(
'code' => 2,
- 'answer' => $clang->gT('Same')
+ 'answer' => gT('Same')
);
$aFieldmap['answers'][$aQuestion['qid']]['0']['-1'] = array(
'code' => 3,
- 'answer' => $clang->gT('Decrease')
+ 'answer' => gT('Decrease')
);
}
} // close: no-other/comment variable
diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php
index ab7dae2dd79..6eb9d3b6640 100644
--- a/application/helpers/SurveyRuntimeHelper.php
+++ b/application/helpers/SurveyRuntimeHelper.php
@@ -306,13 +306,13 @@ function run($surveyid,$args) {
$LEMskipReprocessing=true;
$move = "movenext"; // so will re-display the survey
$invalidLastPage=true;
- $backpopup=$clang->gT("Please use the LimeSurvey navigation buttons or index. It appears you attempted to use the browser back button to re-submit a page.");
+ $backpopup=gT("Please use the LimeSurvey navigation buttons or index. It appears you attempted to use the browser back button to re-submit a page.");
}
}
if(isset($move) && $move=="clearcancel")
{
$moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, true, false, true);
- //$backpopup=$clang->gT("Clear all need confirmation.");
+ //$backpopup=gT("Clear all need confirmation.");
}
if (!(isset($_POST['saveall']) || isset($_POST['saveprompt']) || isset($_GET['sid']) || $LEMskipReprocessing || (isset($move) && (preg_match('/^changelang_/',$move)))))
{
@@ -422,7 +422,7 @@ function run($surveyid,$args) {
//First, see if we are moving backwards or doing a Save so far, and its OK not to check:
if (
(isset($move) && ($move == "moveprev" || (is_int($move) && $_SESSION[$LEMsessid]['prevstep'] == $_SESSION[$LEMsessid]['maxstep']) || $_SESSION[$LEMsessid]['prevstep'] == $_SESSION[$LEMsessid]['step'])) ||
- (isset($_POST['saveall']) && $_POST['saveall'] == $clang->gT("Save your responses so far")))
+ (isset($_POST['saveall']) && $_POST['saveall'] == gT("Save your responses so far")))
{
if (Yii::app()->getConfig('allowmandbackwards') == 1)
{
@@ -566,13 +566,13 @@ function run($surveyid,$args) {
*/
// can't kill session before end message, otherwise INSERTANS doesn't work.
$completed = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitEndtextI', false, NULL, array(), true );
- $completed .= "" . $clang->gT("Did Not Save") . " \n\n";
- $completed .= $clang->gT("Your survey responses have not been recorded. This survey is not yet active.") . " \n";
+ $completed .= "" . gT("Did Not Save") . " \n\n";
+ $completed .= gT("Your survey responses have not been recorded. This survey is not yet active.") . " \n";
if ($thissurvey['printanswers'] == 'Y')
{
// 'Clear all' link is only relevant for survey with printanswers enabled
// in other cases the session is cleared at submit time
- $completed .= "" . $clang->gT("Clear Responses") . " \n";
+ $completed .= "" . gT("Clear Responses") . " \n";
}
@@ -627,8 +627,8 @@ function run($surveyid,$args) {
if (trim(strip_tags($thissurvey['surveyls_endtext'])) == '')
{
- $completed = "" . $clang->gT("Thank you!") . " \n\n"
- . $clang->gT("Your survey responses have been recorded.") . " \n";
+ $completed = "" . gT("Thank you!") . " \n\n"
+ . gT("Your survey responses have been recorded.") . " \n";
}
else
{
@@ -641,14 +641,14 @@ function run($surveyid,$args) {
$url = Yii::app()->getController()->createUrl("/printanswers/view/surveyid/{$surveyid}");
$completed .= " "
. ""
- . $clang->gT("Print your answers.")
+ . gT("Print your answers.")
. " \n";
}
//*****************************************
if ($thissurvey['publicstatistics'] == 'Y' && $thissurvey['printanswers'] == 'Y')
{
- $completed .=' ' . $clang->gT("or");
+ $completed .=' ' . gT("or");
}
// Link to Public statistics **********
@@ -657,7 +657,7 @@ function run($surveyid,$args) {
$url = Yii::app()->getController()->createUrl("/statistics_user/action/surveyid/{$surveyid}/language/".$_SESSION[$LEMsessid]['s_lang']);
$completed .= " "
. ""
- . $clang->gT("View the statistics for this survey.")
+ . gT("View the statistics for this survey.")
. " \n";
}
//*****************************************
@@ -727,7 +727,7 @@ function run($surveyid,$args) {
//SURVEY DOES NOT EXIST. POLITELY EXIT.
echo templatereplace(file_get_contents($sTemplatePath."startpage.pstpl"), array(), $redata);
echo "\t \n";
- echo "\t" . $clang->gT("Sorry. There is no matching survey.") . " \n";
+ echo "\t" . gT("Sorry. There is no matching survey.") . " \n";
echo templatereplace(file_get_contents($sTemplatePath."endpage.pstpl"), array(), $redata);
doFooter();
exit;
@@ -744,13 +744,13 @@ function run($surveyid,$args) {
$gseq = LimeExpressionManager::GetGroupSeq($_gid);
if ($gseq == -1)
{
- echo $clang->gT('Invalid group number for this survey: ') . $_gid;
+ echo gT('Invalid group number for this survey: ') . $_gid;
exit;
}
$moveResult = LimeExpressionManager::JumpTo($gseq + 1, true);
if (is_null($moveResult))
{
- echo $clang->gT('This group contains no questions. You must add questions to this group before you can preview it');
+ echo gT('This group contains no questions. You must add questions to this group before you can preview it');
exit;
}
if (isset($moveResult))
@@ -768,8 +768,8 @@ function run($surveyid,$args) {
if (($show_empty_group) || !isset($_SESSION[$LEMsessid]['grouplist']))
{
$gid = -1; // Make sure the gid is unused. This will assure that the foreach (fieldarray as ia) has no effect.
- $groupname = $clang->gT("Submit your answers");
- $groupdescription = $clang->gT("There are no more questions. Please press the button to finish this survey.");
+ $groupname = gT("Submit your answers");
+ $groupdescription = gT("There are no more questions. Please press the button to finish this survey.");
}
else if ($surveyMode != 'survey')
{
@@ -1004,19 +1004,19 @@ function run($surveyid,$args) {
//Display the "mandatory" message on page if necessary
if (!$showpopups && $stepInfo['mandViolation'] && $okToShowErrors)
{
- echo "" . $clang->gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed.") . "
";
+ echo "" . gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed.") . "
";
}
//Display the "validation" message on page if necessary
if (!$showpopups && !$stepInfo['valid'] && $okToShowErrors)
{
- echo "" . $clang->gT("One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.") . "
";
+ echo "" . gT("One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.") . "
";
}
//Display the "file validation" message on page if necessary
if (!$showpopups && isset($filenotvalidated) && $filenotvalidated == true && $okToShowErrors)
{
- echo "" . $clang->gT("One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.") . "
";
+ echo "" . gT("One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.") . "
";
}
$_gseq = -1;
@@ -1155,7 +1155,7 @@ function run($surveyid,$args) {
if ($thissurvey['active'] != "Y")
{
- echo "" . $clang->gT("This survey is currently not active. You will not be able to save your responses.") . "
\n";
+ echo "" . gT("This survey is currently not active. You will not be able to save your responses.") . "
\n";
}
diff --git a/application/helpers/admin/activate_helper.php b/application/helpers/admin/activate_helper.php
index 7b77d1b40a5..06baa6294db 100644
--- a/application/helpers/admin/activate_helper.php
+++ b/application/helpers/admin/activate_helper.php
@@ -81,7 +81,7 @@ function checkGroup($postsid)
{ //TIBO
if ($row['count'] == 0)
{
- $failedgroupcheck[]=array($row['gid'], $row['group_name'], ": ".$clang->gT("This group does not contain any question(s)."));
+ $failedgroupcheck[]=array($row['gid'], $row['group_name'], ": ".gT("This group does not contain any question(s)."));
}
}
if(isset($failedgroupcheck))
@@ -125,7 +125,7 @@ function checkQuestions($postsid, $iSurveyID, $qtypes)
$chacount=count($charesult);
if ($chacount == 0)
{
- $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question has no subquestions."), $chkrow['gid']);
+ $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".gT("This question has no subquestions."), $chkrow['gid']);
}
}
if ($qtypes[$chkrow['type']]['answerscales']>0)
@@ -135,7 +135,7 @@ function checkQuestions($postsid, $iSurveyID, $qtypes)
$chacount=count($charesult);
if ($chacount == 0)
{
- $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question has no answers."), $chkrow['gid']);
+ $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".gT("This question has no answers."), $chkrow['gid']);
}
}
}
@@ -145,7 +145,7 @@ function checkQuestions($postsid, $iSurveyID, $qtypes)
$chkresult = Yii::app()->db->createCommand($chkquery)->query()->readAll();
foreach ($chkresult as $chkrow)
{
- $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question does not have a question 'type' set."), $chkrow['gid']);
+ $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".gT("This question does not have a question 'type' set."), $chkrow['gid']);
}
@@ -155,14 +155,14 @@ function checkQuestions($postsid, $iSurveyID, $qtypes)
$chkquery = "SELECT q.qid, question, gid FROM {{questions}} as q WHERE (select count(*) from {{answers}} as a where a.qid=q.qid and scale_id=0)=0 and sid={$iSurveyID} AND type IN ('F', 'H', 'W', 'Z', '1') and q.parent_qid=0";
$chkresult = Yii::app()->db->createCommand($chkquery)->query()->readAll();
foreach($chkresult as $chkrow){
- $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question requires answers, but none are set."), $chkrow['gid']);
+ $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".gT("This question requires answers, but none are set."), $chkrow['gid']);
} // while
//CHECK THAT DUAL Array has answers set
$chkquery = "SELECT q.qid, question, gid FROM {{questions}} as q WHERE (select count(*) from {{answers}} as a where a.qid=q.qid and scale_id=1)=0 and sid={$iSurveyID} AND type='1' and q.parent_qid=0";
$chkresult = Yii::app()->db->createCommand($chkquery)->query()->readAll();
foreach ($chkresult as $chkrow){
- $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question requires a second answer set but none is set."), $chkrow['gid']);
+ $failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".gT("This question requires a second answer set but none is set."), $chkrow['gid']);
} // while
//TO AVOID NATURAL SORT ORDER ISSUES, FIRST GET ALL QUESTIONS IN NATURAL SORT ORDER, AND FIND OUT WHICH NUMBER IN THAT ORDER THIS QUESTION IS
@@ -207,7 +207,7 @@ function checkQuestions($postsid, $iSurveyID, $qtypes)
}
if ($qidfound == 1)
{
- $failedcheck[]=array($conrow['qid'], $conrow['question'], ": ".$clang->gT("This question has a condition set, however the condition is based on a question that appears after it."), $conrow['gid']);
+ $failedcheck[]=array($conrow['qid'], $conrow['question'], ": ".gT("This question has a condition set, however the condition is based on a question that appears after it."), $conrow['gid']);
}
$b++;
}
diff --git a/application/helpers/admin/htmleditor_helper.php b/application/helpers/admin/htmleditor_helper.php
index 457faf81da3..fb22ff56f1c 100644
--- a/application/helpers/admin/htmleditor_helper.php
+++ b/application/helpers/admin/htmleditor_helper.php
@@ -199,8 +199,8 @@ function getPopupEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=nu
$htmlcode .= ""
. "\n"
- . "\t gT("Start HTML editor in a popup window")."\" id='".$fieldname."_popupctrlena' src='".Yii::app()->getConfig('adminimageurl')."edithtmlpopup.png' $imgopts class='btneditanswerena' />\n"
- . "\t gT("Give focus to the HTML editor popup window")."\" id='".$fieldname."_popupctrldis' src='".Yii::app()->getConfig('adminimageurl')."edithtmlpopup_disabled.png' style='display:none' $imgopts class='btneditanswerdis' />\n"
+ . "\t\n"
+ . "\t\n"
. " \n";
return $htmlcode;
diff --git a/application/helpers/admin/import_helper.php b/application/helpers/admin/import_helper.php
index f78b04a281f..b86c792d8b0 100644
--- a/application/helpers/admin/import_helper.php
+++ b/application/helpers/admin/import_helper.php
@@ -35,7 +35,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
if (substr($bigarray[0], 0, 23) != "# LimeSurvey Group Dump")
{
- $results['fatalerror'] = $clang->gT("This file is not a LimeSurvey question file. Import failed.");
+ $results['fatalerror'] = gT("This file is not a LimeSurvey question file. Import failed.");
$importversion=0;
}
else
@@ -45,7 +45,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
if ((int)$importversion<112)
{
- $results['fatalerror'] = $clang->gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
+ $results['fatalerror'] = gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
}
for ($i=0; $i<9; $i++) //skipping the first lines that are not needed
@@ -226,7 +226,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
$groupssupportbaselang = doesImportArraySupportLanguage($grouparray,Array($gidfieldnum),$langfieldnum,$sBaseLanguage,true);
if (!$groupssupportbaselang)
{
- $results['fatalerror']=$clang->gT("You can't import a group which doesn't support at least the survey base language.");
+ $results['fatalerror']=gT("You can't import a group which doesn't support at least the survey base language.");
return $results;
}
}
@@ -238,7 +238,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
$questionssupportbaselang = doesImportArraySupportLanguage($questionarray,Array($qidfieldnum), $langfieldnum,$sBaseLanguage,true);
if (!$questionssupportbaselang)
{
- $results['fatalerror']=$clang->gT("You can't import a question which doesn't support at least the survey base language.");
+ $results['fatalerror']=gT("You can't import a question which doesn't support at least the survey base language.");
return $results;
}
}
@@ -252,7 +252,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
$answerssupportbaselang = doesImportArraySupportLanguage($answerarray,$answercodekeysarr,$langfieldnum,$sBaseLanguage);
if (!$answerssupportbaselang)
{
- $results['fatalerror']=$clang->gT("You can't import answers which doesn't support at least the survey base language.");
+ $results['fatalerror']=gT("You can't import answers which doesn't support at least the survey base language.");
return $results;
}
@@ -267,7 +267,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
$labelsetssupportbaselang = doesImportArraySupportLanguage($labelsetsarray,Array($lidfilednum),$langfieldnum,$sBaseLanguage,true);
if (!$labelsetssupportbaselang)
{
- $results['fatalerror']=$clang->gT("You can't import label sets which don't support the current survey's base language");
+ $results['fatalerror']=gT("You can't import label sets which don't support the current survey's base language");
return $results;
}
}
@@ -537,7 +537,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
{
$qinsert = "insert INTO {{answers}} (qid,code,answer,sortorder,language,assessment_value)
VALUES ({$aQIDReplacements[$oldqid]},'".$labelrow['code']."','".$labelrow['title']."','".$labelrow['sortorder']."','".$labelrow['language']."','".$labelrow['assessment_value']."')";
- $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie($clang->gT("Error").": Failed to insert answer (lid1) \n$qinsert \n");
+ $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie(gT("Error").": Failed to insert answer (lid1) \n$qinsert \n");
}
else
{
@@ -553,7 +553,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
$qinsert = "insert INTO {{questions}} ($fieldname parent_qid,title,question,question_order,language,scale_id,type, sid, gid)
VALUES ($data{$aQIDReplacements[$oldqid]},'".$labelrow['code']."','".$labelrow['title']."','".$labelrow['sortorder']."','".$labelrow['language']."',1,'{$questionrowdata['type']}',{$questionrowdata['sid']},{$questionrowdata['gid']})";
- $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie ($clang->gT("Error").": Failed to insert question \n$qinsert \n");
+ $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie (gT("Error").": Failed to insert question \n$qinsert \n");
if ($fieldname=='')
{
$aSQIDReplacements[$labelrow['code'].'_'.$saveqid]=getLastInsertID('{{questions}}');
@@ -569,7 +569,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
{
$qinsert = "insert INTO {{answers}} (qid,code,answer,sortorder,language,assessment_value,scale_id)
VALUES ({$aQIDReplacements[$oldqid]},'".$labelrow['code']."','".$labelrow['title']."','".$labelrow['sortorder']."','".$labelrow['language']."','".$labelrow['assessment_value']."',1)";
- $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie ($clang->gT("Error").": Failed to insert answer (lid2) \n$qinsert \n");
+ $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie (gT("Error").": Failed to insert answer (lid2) \n$qinsert \n");
}
}
}
@@ -586,7 +586,7 @@ function CSVImportGroup($sFullFilePath, $iNewSID)
$answerrowdata=array_combine($answerfieldnames,$answerfieldcontents);
if ($answerrowdata===false)
{
- $importquestion.=' '.$clang->gT("Faulty line in import - fields and data don't match").":".implode(',',$answerfieldcontents);
+ $importquestion.=' '.gT("Faulty line in import - fields and data don't match").":".implode(',',$answerfieldcontents);
}
// Skip not supported languages
if (!in_array($answerrowdata['language'],$aLanguagesSupported))
@@ -803,7 +803,7 @@ function XMLImportGroup($sFullFilePath, $iNewSID)
if (!in_array($sBaseLanguage,$importlanguages))
{
- $results['fatalerror'] = $clang->gT("The languages of the imported group file must at least include the base language of this survey.");
+ $results['fatalerror'] = gT("The languages of the imported group file must at least include the base language of this survey.");
return $results;
}
// First get an overview of fieldnames - it's not useful for the moment but might be with newer versions
@@ -1131,13 +1131,13 @@ function CSVImportQuestion($sFullFilePath, $iNewSID, $newgid)
}
else // unknown file - show error message
{
- $results['fatalerror'] = $clang->gT("This file is not a LimeSurvey question file. Import failed.");
+ $results['fatalerror'] = gT("This file is not a LimeSurvey question file. Import failed.");
return $results;
}
if ((int)$importversion<112)
{
- $results['fatalerror'] = $clang->gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
+ $results['fatalerror'] = gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
return $results;
}
@@ -1275,7 +1275,7 @@ function CSVImportQuestion($sFullFilePath, $iNewSID, $newgid)
$questionssupportbaselang = doesImportArraySupportLanguage($questionarray, array($qidfieldnum), $langfieldnum, $sBaseLanguage);
if (!$questionssupportbaselang)
{
- $results['fatalerror']=$clang->gT("You can't import a question which doesn't support at least the survey base language.");
+ $results['fatalerror']=gT("You can't import a question which doesn't support at least the survey base language.");
return $results;
}
}
@@ -1289,7 +1289,7 @@ function CSVImportQuestion($sFullFilePath, $iNewSID, $newgid)
$answerssupportbaselang = doesImportArraySupportLanguage($answerarray,$answercodekeysarr,$langfieldnum,$sBaseLanguage);
if (!$answerssupportbaselang)
{
- $results['fatalerror']=$clang->gT("You can't import answers which doesn't support at least the survey base language.");
+ $results['fatalerror']=gT("You can't import answers which doesn't support at least the survey base language.");
return $results;
}
@@ -1304,7 +1304,7 @@ function CSVImportQuestion($sFullFilePath, $iNewSID, $newgid)
$labelsetssupportbaselang = doesImportArraySupportLanguage($labelsetsarray,Array($lidfilednum),$langfieldnum,$sBaseLanguage,true);
if (!$labelsetssupportbaselang)
{
- $results['fatalerror']=$clang->gT("You can't import label sets which don't support the current survey's base language");
+ $results['fatalerror']=gT("You can't import label sets which don't support the current survey's base language");
return $results;
}
}
@@ -1556,7 +1556,7 @@ function CSVImportQuestion($sFullFilePath, $iNewSID, $newgid)
if (in_array($labelrow['language'],$aLanguagesSupported)){
$qinsert = "insert INTO {{answers}} (qid,code,answer,sortorder,language,assessment_value,scale_id)
VALUES ($newqid,'".$labelrow['code']."','".$labelrow['title']."','".$labelrow['sortorder']."','".$labelrow['language']."','".$labelrow['assessment_value']."',1)";
- $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie($clang->gT("Error").": Failed to insert answer \n$qinsert \n");
+ $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie(gT("Error").": Failed to insert answer \n$qinsert \n");
}
}
}
@@ -1571,7 +1571,7 @@ function CSVImportQuestion($sFullFilePath, $iNewSID, $newgid)
$answerrowdata=array_combine($answerfieldnames,$answerfieldcontents);
if ($answerrowdata===false)
{
- $importquestion.=' '.$clang->gT("Faulty line in import - fields and data don't match").":".implode(',',$answerfieldcontents);
+ $importquestion.=' '.gT("Faulty line in import - fields and data don't match").":".implode(',',$answerfieldcontents);
}
// Skip not supported languages
if (!in_array($answerrowdata['language'],$aLanguagesSupported))
@@ -1723,7 +1723,7 @@ function XMLImportQuestion($sFullFilePath, $iNewSID, $newgid)
if (!in_array($sBaseLanguage,$importlanguages))
{
- $results['fatalerror'] = $clang->gT("The languages of the imported question file must at least include the base language of this survey.");
+ $results['fatalerror'] = gT("The languages of the imported question file must at least include the base language of this survey.");
return $results;
}
// First get an overview of fieldnames - it's not useful for the moment but might be with newer versions
@@ -1784,7 +1784,7 @@ function XMLImportQuestion($sFullFilePath, $iNewSID, $newgid)
$result = $ques->save();
if (!$result)
{
- $results['fatalerror'] = CHtml::errorSummary($ques,$clang->gT("The question could not be imported for the following reasons:"));
+ $results['fatalerror'] = CHtml::errorSummary($ques,gT("The question could not be imported for the following reasons:"));
return $results;
}
if (!isset($aQIDReplacements[$oldqid]))
@@ -1966,7 +1966,7 @@ function CSVImportLabelset($sFullFilePath, $options)
fclose($handle);
if (substr($bigarray[0], 0, 27) != "# LimeSurvey Label Set Dump" && substr($bigarray[0], 0, 28) != "# PHPSurveyor Label Set Dump")
{
- $results['fatalerror']=$clang->gT("This file is not a LimeSurvey label set file. Import failed.");
+ $results['fatalerror']=gT("This file is not a LimeSurvey label set file. Import failed.");
return $results;
}
@@ -2105,7 +2105,7 @@ function CSVImportLabelset($sFullFilePath, $options)
$query = "DELETE FROM {{labelsets}} WHERE lid=$newlid";
$result = Yii::app()->db->createCommand($query)->execute() or safeDie("Couldn't delete labelset $query ");
$newlid=$lsmatch;
- $results['warnings'][]=$clang->gT("Label set was not imported because the same label set already exists.")." ".sprintf($clang->gT("Existing LID: %s"),$newlid);
+ $results['warnings'][]=gT("Label set was not imported because the same label set already exists.")." ".sprintf(gT("Existing LID: %s"),$newlid);
}
//END CHECK FOR DUPLICATES
@@ -2221,7 +2221,7 @@ function XMLImportLabelsets($sFullFilePath, $options)
$results['labelsets']--;
$newlid=$lsmatch;
- $results['warnings'][]=$clang->gT("Label set was not imported because the same label set already exists.")." ".sprintf($clang->gT("Existing LID: %s"),$newlid);
+ $results['warnings'][]=gT("Label set was not imported because the same label set already exists.")." ".sprintf(gT("Existing LID: %s"),$newlid);
}
}
@@ -2277,13 +2277,13 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
}
else // unknown file - show error message
{
- $importresults['error'] = $clang->gT("This file is not a LimeSurvey survey file. Import failed.")."\n";
+ $importresults['error'] = gT("This file is not a LimeSurvey survey file. Import failed.")."\n";
return $importresults;
}
if ((int)$importversion<112)
{
- $importresults['error'] = $clang->gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
+ $importresults['error'] = gT("This file is too old. Only files from LimeSurvey version 1.50 (DBVersion 112) and newer are supported.");
return $importresults;
}
@@ -2605,17 +2605,17 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
{
if ($importingfrom == "http")
{
- $importsurvey .= " \n";
- $importsurvey .= $clang->gT("Import of this survey file failed")." \n";
- $importsurvey .= $clang->gT("File does not contain LimeSurvey data in the correct format.")." \n"; //Couldn't find the SID - cannot continue
- $importsurvey .= " \n";
+ $importsurvey .= " \n";
+ $importsurvey .= gT("Import of this survey file failed")." \n";
+ $importsurvey .= gT("File does not contain LimeSurvey data in the correct format.")." \n"; //Couldn't find the SID - cannot continue
+ $importsurvey .= " \n";
$importsurvey .= " \n";
unlink($sFullFilePath); //Delete the uploaded file
return;
}
else
{
- $clang->eT("Import of this survey file failed")."\n".$clang->gT("File does not contain LimeSurvey data in the correct format.")."\n";
+ eT("Import of this survey file failed")."\n".gT("File does not contain LimeSurvey data in the correct format.")."\n";
return;
}
}
@@ -2639,7 +2639,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
$surveyrowdata['sid']=$iNewSID;
$surveyrowdata['active']='N';
- if (validateTemplateDir($surveyrowdata['template'])!==$surveyrowdata['template']) $importresults['importwarnings'][] = sprintf($clang->gT('Template %s not found, please review when activating.'),$surveyrowdata['template']);
+ if (validateTemplateDir($surveyrowdata['template'])!==$surveyrowdata['template']) $importresults['importwarnings'][] = sprintf(gT('Template %s not found, please review when activating.'),$surveyrowdata['template']);
//if (isset($surveyrowdata['datecreated'])) {$surveyrowdata['datecreated'] = $connect->BindTimeStamp($surveyrowdata['datecreated']);}
unset($surveyrowdata['attribute1']);
@@ -2658,7 +2658,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
$surveyrowdata['bounce_email']=$surveyrowdata['adminemail'];
if (empty($surveyrowdata['datecreated'])) {$surveyrowdata['datecreated'] = new CDbExpression('NOW()'); }
- $iNewSID = Survey::model()->insertNewSurvey($surveyrowdata) or safeDie ("
".$clang->gT("Import of this survey file failed")."
{$surveyarray[0]}
\n" );
+ $iNewSID = Survey::model()->insertNewSurvey($surveyrowdata) or safeDie ("
".gT("Import of this survey file failed")."
{$surveyarray[0]}
\n" );
// Now import the survey language settings
$fieldorders=str_getcsv($surveylsarray[0],',','"');
@@ -2686,7 +2686,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
unset($surveylsrowdata['surveyls_attributecaptions']);
$surveylsrowdata['surveyls_survey_id']=$iNewSID;
- $lsiresult = SurveyLanguageSetting::model()->insertNewSurvey($surveylsrowdata) or safeDie("
".$clang->gT("Import of this survey file failed")."
");
+ $lsiresult = SurveyLanguageSetting::model()->insertNewSurvey($surveylsrowdata) or safeDie("
".gT("Import of this survey file failed")."
");
}
@@ -2824,7 +2824,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
//Now an additional integrity check if there are any groups not belonging into this survey
if ($grouprowdata['sid'] != $iOldSID)
{
- $results['fatalerror'] = $clang->gT("A group in the CSV/SQL file is not part of the same survey. The import of the survey was stopped.")."
\n";
+ $results['fatalerror'] = gT("A group in the CSV/SQL file is not part of the same survey. The import of the survey was stopped.")."
\n";
return $results;
}
$grouprowdata['sid']=$iNewSID;
@@ -2850,7 +2850,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
if (isset($grouprowdata['gid'])) switchMSSQLIdentityInsert('groups',true);
- $sInsertID = QuestionGroup::model()->insertRecords($grouprowdata) or safeDie($clang->gT('Error').": Failed to insert group
\
\n");
+ $sInsertID = QuestionGroup::model()->insertRecords($grouprowdata) or safeDie(gT('Error').": Failed to insert group
\
\n");
if (isset($grouprowdata['gid'])) switchMSSQLIdentityInsert('groups',false);
if (!isset($grouprowdata['gid']))
@@ -2955,12 +2955,12 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
$attempts++;
if ($attempts > 10)
{
- safeDie($clang->gT("Error").": Failed to resolve question code problems after 10 attempts.
");
+ safeDie(gT("Error").": Failed to resolve question code problems after 10 attempts.
");
}
}
if (!$oQuestion->save())
{
- // safeDie($clang->gT("Error while saving: "). print_r($oQuestion->errors, true));
+ // safeDie(gT("Error while saving: "). print_r($oQuestion->errors, true));
//
// In PHP 5.2.10 a bug is triggered that resets the foreach loop when inserting a record
// Problem is that it is the default PHP version on Ubuntu 12.04 LTS (which is currently very common in use)
@@ -2971,7 +2971,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
// Set a warning if question title was updated
if(isset($sNewTitle))
{
- $importresults['importwarnings'][] = sprintf($clang->gT("Question code %s was updated to %s."),$sOldTitle,$sNewTitle);
+ $importresults['importwarnings'][] = sprintf(gT("Question code %s was updated to %s."),$sOldTitle,$sNewTitle);
$aQuestionCodeReplacements[$sOldTitle]=$sNewTitle;
unset($sNewTitle);
unset($sOldTitle);
@@ -3000,7 +3000,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
if ($qtypes[$questionrowdata['type']]['subquestions']<2)
{
$aInsertData=array('qid'=>$aQIDReplacements[$oldqid],'code'=>$labelrow['code'],'answer'=>$labelrow['title'],'sortorder'=>$labelrow['sortorder'],'language'=>$labelrow['language'],'assessment_value'=>$labelrow['assessment_value']);
- Answer::model()->insertRecords($aInsertData) or safeDie($clang->gT("Error").": Failed to insert data [4]
");
+ Answer::model()->insertRecords($aInsertData) or safeDie(gT("Error").": Failed to insert data [4]
");
}
else
{
@@ -3015,7 +3015,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
$qinsert = "insert INTO {{questions}} ($fieldname parent_qid,title,question,question_order,language,scale_id,type, sid, gid)
VALUES ($data{$aQIDReplacements[$oldqid]},'".$labelrow['code']."','".$labelrow['title']."','".$labelrow['sortorder']."','".$labelrow['language']."',1,'{$questionrowdata['type']}',{$questionrowdata['sid']},{$questionrowdata['gid']})";
- $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie ($clang->gT("Error").": Failed to insert question
\n$qinsert
\n");
+ $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie (gT("Error").": Failed to insert question
\n$qinsert
\n");
if ($fieldname=='')
{
$aSQIDReplacements[$labelrow['code'].'_'.$saveqid]=getLastInsertID('{{questions}}');
@@ -3033,7 +3033,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
{
$qinsert = "insert INTO {{answers}} (qid,code,answer,sortorder,language,assessment_value,scale_id)
VALUES ({$aQIDReplacements[$oldqid]},'".$labelrow['code']."','".$labelrow['title']."','".$labelrow['sortorder']."','".$labelrow['language']."','".$labelrow['assessment_value']."',1)";
- $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie ($clang->gT("Error").": Failed to insert answer (lid2)
\n$qinsert
\n");
+ $qres = Yii::app()->db->createCommand($qinsert)->query() or safeDie (gT("Error").": Failed to insert answer (lid2)
\n$qinsert
\n");
}
}
}
@@ -3058,7 +3058,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
}
if ($answerrowdata===false)
{
- $importquestion.='
'.$clang->gT("Faulty line in import - fields and data don't match").":".implode(',',$answerfieldcontents);
+ $importquestion.='
'.gT("Faulty line in import - fields and data don't match").":".implode(',',$answerfieldcontents);
}
// Skip not supported languages
if (!in_array($answerrowdata['language'],$aLanguagesSupported))
@@ -3147,12 +3147,12 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
$attempts++;
if ($attempts > 10)
{
- safeDie($clang->gT("Error").": Failed to resolve question code problems after 10 attempts.
");
+ safeDie(gT("Error").": Failed to resolve question code problems after 10 attempts.
");
}
}
if (!$question->save())
{
- // safeDie($clang->gT("Error while saving: "). print_r($question->errors, true));
+ // safeDie(gT("Error while saving: "). print_r($question->errors, true));
//
// In PHP 5.2.10 and some later versions a bug is triggered that resets the foreach loop when inserting a record
// Problem is that it is the default PHP version on Ubuntu 12.04 LTS (which is currently very common in use)
@@ -3163,7 +3163,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
// Set a warning if question title was updated
if(isset($sNewTitle))
{
- $importresults['importwarnings'][] = sprintf($clang->gT("Title of subquestion %s was updated to %s."),$sOldTitle,$sNewTitle);// Maybe add the question title ?
+ $importresults['importwarnings'][] = sprintf(gT("Title of subquestion %s was updated to %s."),$sOldTitle,$sNewTitle);// Maybe add the question title ?
$aQuestionCodeReplacements[$sOldTitle]=$sNewTitle;
unset($sNewTitle);
unset($sOldTitle);
@@ -3327,7 +3327,7 @@ function CSVImportSurvey($sFullFilePath,$iDesiredSurveyId=NULL,$bTranslateLinks=
$asrowdata=array("quotals_quota_id" => $newquotaid,
"quotals_language" => $defaultsurveylanguage,
"quotals_name" => $quotadata[$i]["name"],
- "quotals_message" => $clang->gT("Sorry your responses have exceeded a quota on this survey."),
+ "quotals_message" => gT("Sorry your responses have exceeded a quota on this survey."),
"quotals_url" => "",
"quotals_urldescrip" => "");
$i++;
@@ -3500,7 +3500,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
if (!$xml || $xml->LimeSurveyDocType!='Survey')
{
- $results['error'] = $clang->gT("This is not a valid LimeSurvey survey structure XML file.");
+ $results['error'] = gT("This is not a valid LimeSurvey survey structure XML file.");
return $results;
}
@@ -3596,10 +3596,10 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
// Fill a optionnal array of error
foreach($aBadData as $key=>$value)
{
- $results['importwarnings'][]=sprintf($clang->gT("This survey setting has not been imported: %s => %s"),$key,$value);
+ $results['importwarnings'][]=sprintf(gT("This survey setting has not been imported: %s => %s"),$key,$value);
}
- $iNewSID = $results['newsid'] = Survey::model()->insertNewSurvey($insertdata) or safeDie($clang->gT("Error").": Failed to insert data [1]
");
+ $iNewSID = $results['newsid'] = Survey::model()->insertNewSurvey($insertdata) or safeDie(gT("Error").": Failed to insert data [1]
");
$results['surveys']++;
}
@@ -3643,7 +3643,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
- $result = SurveyLanguageSetting::model()->insertNewSurvey($insertdata) or safeDie($clang->gT("Error").": Failed to insert data [2]
");
+ $result = SurveyLanguageSetting::model()->insertNewSurvey($insertdata) or safeDie(gT("Error").": Failed to insert data [2]
");
}
@@ -3676,7 +3676,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
switchMSSQLIdentityInsert('groups',true);
$insertdata['gid']=$aGIDReplacements[$oldgid];
}
- $newgid = QuestionGroup::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data [3]
");
+ $newgid = QuestionGroup::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data [3]
");
$results['groups']++;
if (!isset($aGIDReplacements[$oldgid]))
@@ -3767,12 +3767,12 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$attempts++;
if ($attempts > 10)
{
- safeDie($clang->gT("Error").": Failed to resolve question code problems after 10 attempts.
");
+ safeDie(gT("Error").": Failed to resolve question code problems after 10 attempts.
");
}
}
if (!$oQuestion->save())
{
- // safeDie($clang->gT("Error while saving: "). print_r($oQuestion->errors, true));
+ // safeDie(gT("Error while saving: "). print_r($oQuestion->errors, true));
//
// In PHP 5.2.10 a bug is triggered that resets the foreach loop when inserting a record
// Problem is that it is the default PHP version on Ubuntu 12.04 LTS (which is currently very common in use)
@@ -3783,7 +3783,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
// Set a warning if question title was updated
if(isset($sNewTitle))
{
- $results['importwarnings'][] = sprintf($clang->gT("Question code %s was updated to %s."),$sOldTitle,$sNewTitle);
+ $results['importwarnings'][] = sprintf(gT("Question code %s was updated to %s."),$sOldTitle,$sNewTitle);
$aQuestionCodeReplacements[$sOldTitle]=$sNewTitle;
unset($sNewTitle);
unset($sOldTitle);
@@ -3875,12 +3875,12 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$attempts++;
if ($attempts > 10)
{
- safeDie($clang->gT("Error").": Failed to resolve question code problems after 10 attempts.
");
+ safeDie(gT("Error").": Failed to resolve question code problems after 10 attempts.
");
}
}
if (!$question->save())
{
- // safeDie($clang->gT("Error while saving: "). print_r($question->errors, true));
+ // safeDie(gT("Error while saving: "). print_r($question->errors, true));
//
// In PHP 5.2.10 a bug is triggered that resets the foreach loop when inserting a record
// Problem is that it is the default PHP version on Ubuntu 12.04 LTS (which is currently very common in use)
@@ -3891,7 +3891,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
// Set a warning if question title was updated
if(isset($sNewTitle))
{
- $results['importwarnings'][] = sprintf($clang->gT("Title of subquestion %s was updated to %s."),$sOldTitle,$sNewTitle);// Maybe add the question title ?
+ $results['importwarnings'][] = sprintf(gT("Title of subquestion %s was updated to %s."),$sOldTitle,$sNewTitle);// Maybe add the question title ?
$aQuestionCodeReplacements[$sOldTitle]=$sNewTitle;
unset($sNewTitle);
unset($sOldTitle);
@@ -3976,12 +3976,12 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$insertdata['language']=$sLanguage;
if ($insertdata)
XSSFilterArray($insertdata);
- $result=QuestionAttribute::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data[7]
");
+ $result=QuestionAttribute::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data[7]
");
}
}
else
{
- $result=QuestionAttribute::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data[8]
");
+ $result=QuestionAttribute::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data[8]
");
}
$results['question_attributes']++;
}
@@ -4005,7 +4005,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
if ($insertdata)
XSSFilterArray($insertdata);
// now translate any links
- $result=DefaultValue::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data[9]
");
+ $result=DefaultValue::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data[9]
");
$results['defaultvalues']++;
}
}
@@ -4082,7 +4082,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
}
// now translate any links
- $result=Condition::model()->insertRecords($insertdata) or safeDie ($clang->gT("Error").": Failed to insert data[10]
");
+ $result=Condition::model()->insertRecords($insertdata) or safeDie (gT("Error").": Failed to insert data[10]
");
$results['conditions']++;
}
}
@@ -4108,7 +4108,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$insertdata['sid']=$iNewSID; // remap the survey id
unset($insertdata['id']);
// now translate any links
- $result=Assessment::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data[11]
");
+ $result=Assessment::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data[11]
");
$results['assessments']++;
}
}
@@ -4129,7 +4129,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$oldid=$insertdata['id'];
unset($insertdata['id']);
// now translate any links
- $result=Quota::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data[12]
");
+ $result=Quota::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data[12]
");
$aQuotaReplacements[$oldid] = getLastInsertID('{{quota}}');
$results['quota']++;
}
@@ -4151,7 +4151,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$insertdata['quota_id']=$aQuotaReplacements[(int)$insertdata['quota_id']]; // remap the qid
unset($insertdata['id']);
// now translate any links
- $result=QuotaMember::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data[13]
");
+ $result=QuotaMember::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data[13]
");
$results['quotamembers']++;
}
}
@@ -4169,7 +4169,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
}
$insertdata['quotals_quota_id']=$aQuotaReplacements[(int)$insertdata['quotals_quota_id']]; // remap the qid
unset($insertdata['quotals_id']);
- $result=QuotaLanguageSetting::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data
");
+ $result=QuotaLanguageSetting::model()->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data
");
$results['quotals']++;
}
}
@@ -4195,7 +4195,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$insertdata['targetqid'] =$aQIDReplacements[(int)$insertdata['targetqid']]; // remap the qid
}
unset($insertdata['id']);
- $result=SurveyURLParameter::model()->insertRecord($insertdata) or safeDie($clang->gT("Error").": Failed to insert data[14]
");
+ $result=SurveyURLParameter::model()->insertRecord($insertdata) or safeDie(gT("Error").": Failed to insert data[14]
");
$results['survey_url_parameters']++;
}
}
@@ -4208,7 +4208,7 @@ function XMLImportSurvey($sFullFilePath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
translateInsertansTags($iNewSID,$iOldSID,$aOldNewFieldmap);
replaceExpressionCodes($iNewSID,$aQuestionCodeReplacements);
if (count($aQuestionCodeReplacements)) {
- array_unshift($results['importwarnings'] , "
".$clang->gT('Attention: Several question codes were updated. Please check these carefully as the update may not be perfect with customized expressions.').' ');
+ array_unshift($results['importwarnings'] , "
".gT('Attention: Several question codes were updated. Please check these carefully as the update may not be perfect with customized expressions.').' ');
}
LimeExpressionManager::RevertUpgradeConditionsToRelevance($iNewSID);
LimeExpressionManager::UpgradeConditionsToRelevance($iNewSID);
@@ -4258,7 +4258,7 @@ function XMLImportTokens($sFullFilePath,$iSurveyID,$sCreateMissingAttributeField
$results['warnings']=array();
if ($xml->LimeSurveyDocType!='Tokens')
{
- $results['error'] = $clang->gT("This is not a valid token data XML file.");
+ $results['error'] = gT("This is not a valid token data XML file.");
return $results;
}
@@ -4308,7 +4308,7 @@ function XMLImportTokens($sFullFilePath,$iSurveyID,$sCreateMissingAttributeField
$token->setAttributes($insertdata, false);
if (!$token->save())
{
- $results['warnings'][]=$clang->gT("Skipped tokens entry:").' '. implode('. ',$token->errors['token']);
+ $results['warnings'][]=gT("Skipped tokens entry:").' '. implode('. ',$token->errors['token']);
};
$results['tokens']++;
}
@@ -4334,7 +4334,7 @@ function XMLImportResponses($sFullFilePath,$iSurveyID,$aFieldReMap=array())
$oXMLReader->read();
if ($oXMLReader->value!='Responses')
{
- $results['error'] = $clang->gT("This is not a valid response data XML file.");
+ $results['error'] = gT("This is not a valid response data XML file.");
return $results;
}
}
@@ -4365,7 +4365,7 @@ function XMLImportResponses($sFullFilePath,$iSurveyID,$aFieldReMap=array())
}
}
- $result = SurveyDynamic::model($iSurveyID)->insertRecords($aInsertData) or safeDie($clang->gT("Error").": Failed to insert data[16]
");
+ $result = SurveyDynamic::model($iSurveyID)->insertRecords($aInsertData) or safeDie(gT("Error").": Failed to insert data[16]
");
$results['responses']++;
}
}
@@ -4422,7 +4422,7 @@ function CSVImportResponses($sFullFilePath,$iSurveyId,$aOptions=array())
$aLemFieldNames=LimeExpressionManager::getLEMqcode2sgqa($iSurveyId);
$aKeyForFieldNames=array();// An array assicated each fieldname with corresponding responses key
if(!$aCsvHeader){
- $CSVImportResult['errors'][]=$clang->gT("File seems empty or has only one line");
+ $CSVImportResult['errors'][]=gT("File seems empty or has only one line");
return $CSVImportResult;
}
// Assign fieldname with $aFileResponses[] key
@@ -4470,7 +4470,7 @@ function CSVImportResponses($sFullFilePath,$iSurveyId,$aOptions=array())
}
// check if forced error failed
if(isset($force_import_failed)){
- $CSVImportResult['errors'][]=$clang->gT("Import failed: Forced import was requested but the input file doesn't contain enough columns to fill the survey.");
+ $CSVImportResult['errors'][]=gT("Import failed: Forced import was requested but the input file doesn't contain enough columns to fill the survey.");
return $CSVImportResult;
}
@@ -4482,7 +4482,7 @@ function CSVImportResponses($sFullFilePath,$iSurveyId,$aOptions=array())
}
}
if( ! isset($import_ok)){
- $CSVImportResult['errors'][]=$clang->gT("Import failed: No answers could be mapped.");
+ $CSVImportResult['errors'][]=gT("Import failed: No answers could be mapped.");
return $CSVImportResult;
}
@@ -4615,23 +4615,23 @@ function CSVImportResponses($sFullFilePath,$iSurveyId,$aOptions=array())
// End of import
// Construction of returned information
if($iNbResponseLine){
- $CSVImportResult['success'][]=sprintf($clang->gT("%s response lines in your file."),$iNbResponseLine);
+ $CSVImportResult['success'][]=sprintf(gT("%s response lines in your file."),$iNbResponseLine);
}else{
- $CSVImportResult['errors'][]=$clang->gT("No response lines in your file.");
+ $CSVImportResult['errors'][]=gT("No response lines in your file.");
}
if(count($aResponsesInserted)){
- $CSVImportResult['success'][]=sprintf($clang->gT("%s responses were inserted."),count($aResponsesInserted));
+ $CSVImportResult['success'][]=sprintf(gT("%s responses were inserted."),count($aResponsesInserted));
// Maybe add implode aResponsesInserted array
}
if(count($aResponsesUpdated)){
- $CSVImportResult['success'][]=sprintf($clang->gT("%s responses were updated."),count($aResponsesUpdated));
+ $CSVImportResult['success'][]=sprintf(gT("%s responses were updated."),count($aResponsesUpdated));
}
if(count($aResponsesError)){
- $CSVImportResult['errors'][]=sprintf($clang->gT("%s responses cannot be inserted or updated."),count($aResponsesError));
+ $CSVImportResult['errors'][]=sprintf(gT("%s responses cannot be inserted or updated."),count($aResponsesError));
}
if(count($aExistingsId) && ($aOptions['sExistingId']=='skip' || $aOptions['sExistingId']=='ignore'))
{
- $CSVImportResult['warnings'][]=sprintf($clang->gT("%s responses already exist."),count($aExistingsId));
+ $CSVImportResult['warnings'][]=sprintf(gT("%s responses already exist."),count($aExistingsId));
}
return $CSVImportResult;
}
@@ -4646,7 +4646,7 @@ function XMLImportTimings($sFullFilePath,$iSurveyID,$aFieldReMap=array())
$xml = simplexml_load_string($sXMLdata,'SimpleXMLElement',LIBXML_NONET);
if ($xml->LimeSurveyDocType!='Timings')
{
- $results['error'] = $clang->gT("This is not a valid timings data XML file.");
+ $results['error'] = gT("This is not a valid timings data XML file.");
return $results;
}
@@ -4678,7 +4678,7 @@ function XMLImportTimings($sFullFilePath,$iSurveyID,$aFieldReMap=array())
$insertdata[$key]=(string)$value;
}
- $result = SurveyTimingDynamic::model($iSurveyID)->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data[17]
");
+ $result = SurveyTimingDynamic::model($iSurveyID)->insertRecords($insertdata) or safeDie(gT("Error").": Failed to insert data[17]
");
$results['responses']++;
}
@@ -4834,7 +4834,7 @@ function TSVImportSurvey($sFullFilePath)
$surveyinfo['startdate']=NULL;
$surveyinfo['active']='N';
// unset($surveyinfo['datecreated']);
- $iNewSID = Survey::model()->insertNewSurvey($surveyinfo) ; //or safeDie($clang->gT("Error").": Failed to insert survey
");
+ $iNewSID = Survey::model()->insertNewSurvey($surveyinfo) ; //or safeDie(gT("Error").": Failed to insert survey
");
if ($iNewSID==false)
{
$results['error'] = Survey::model()->getErrors();
@@ -4870,7 +4870,7 @@ function TSVImportSurvey($sFullFilePath)
$result = SurveyLanguageSetting::model()->insertNewSurvey($insertdata);//
if(!$result){
- $results['error'][] = $clang->gT("Error")." : ".$clang->gT("Failed to insert survey language");
+ $results['error'][] = gT("Error")." : ".gT("Failed to insert survey language");
break;
}
$results['languages']++;
@@ -4926,7 +4926,7 @@ function TSVImportSurvey($sFullFilePath)
}
$newgid = QuestionGroup::model()->insertRecords($insertdata);
if(!$newgid){
- $results['error'][] = $clang->gT("Error")." : ".$clang->gT("Failed to insert group").". ".$clang->gT("Text file row number ").$rownumber." (".$gname.")";
+ $results['error'][] = gT("Error")." : ".gT("Failed to insert group").". ".gT("Text file row number ").$rownumber." (".$gname.")";
break;
}
if (!isset($ginfo[$sGroupseq]))
@@ -4974,7 +4974,7 @@ function TSVImportSurvey($sFullFilePath)
// Insert question and keep the qid for multi language survey
$result = Question::model()->insertRecords($insertdata);
if(!$result){
- $results['error'][] = $clang->gT("Error")." : ".$clang->gT("Could not insert question").". ".$clang->gT("Text file row number ").$rownumber." (".$qname.")";
+ $results['error'][] = gT("Error")." : ".gT("Could not insert question").". ".gT("Text file row number ").$rownumber." (".$qname.")";
break;
}
$newqid = $result;
@@ -5023,7 +5023,7 @@ function TSVImportSurvey($sFullFilePath)
$insertdata['value'] = $val;
$result=QuestionAttribute::model()->insertRecords($insertdata);//
if(!$result){
- $results['importwarnings'][] = $clang->gT("Warning")." : ".$clang->gT("Failed to insert question attribute").". ".$clang->gT("Text file row number ").$rownumber." ({$key})";
+ $results['importwarnings'][] = gT("Warning")." : ".gT("Failed to insert question attribute").". ".gT("Text file row number ").$rownumber." ({$key})";
break;
}
$results['question_attributes']++;
@@ -5041,7 +5041,7 @@ function TSVImportSurvey($sFullFilePath)
$insertdata['defaultvalue'] = $row['default'];
$result = DefaultValue::model()->insertRecords($insertdata);
if(!$result){
- $results['importwarnings'][] = $clang->gT("Warning")." : ".$clang->gT("Failed to insert default value").". ".$clang->gT("Text file row number ").$rownumber;
+ $results['importwarnings'][] = gT("Warning")." : ".gT("Failed to insert default value").". ".gT("Text file row number ").$rownumber;
break;
}
$results['defaultvalues']++;
@@ -5067,7 +5067,7 @@ function TSVImportSurvey($sFullFilePath)
$insertdata['defaultvalue'] = $row['default'];
$result = DefaultValue::model()->insertRecords($insertdata);
if(!$result){
- $results['importwarnings'][] = $clang->gT("Warning")." : ".$clang->gT("Failed to insert default value").". ".$clang->gT("Text file row number ").$rownumber;
+ $results['importwarnings'][] = gT("Warning")." : ".gT("Failed to insert default value").". ".gT("Text file row number ").$rownumber;
break;
}
$results['defaultvalues']++;
@@ -5105,7 +5105,7 @@ function TSVImportSurvey($sFullFilePath)
// Insert sub question and keep the sqid for multi language survey
$newsqid = Question::model()->insertRecords($insertdata);
if(!$newsqid){
- $results['error'][] = $clang->gT("Error")." : ".$clang->gT("Could not insert subquestion").". ".$clang->gT("Text file row number ").$rownumber." (".$qname.")";
+ $results['error'][] = gT("Error")." : ".gT("Could not insert subquestion").". ".gT("Text file row number ").$rownumber." (".$qname.")";
break;
}
if (!isset($sqinfo[$fullsqname]))
@@ -5127,7 +5127,7 @@ function TSVImportSurvey($sFullFilePath)
$insertdata['defaultvalue'] = $row['default'];
$result = DefaultValue::model()->insertRecords($insertdata);
if(!$result){
- $results['importwarnings'][] = $clang->gT("Warning")." : ".$clang->gT("Failed to insert default value").". ".$clang->gT("Text file row number ").$rownumber;
+ $results['importwarnings'][] = gT("Warning")." : ".gT("Failed to insert default value").". ".gT("Text file row number ").$rownumber;
break;
}
$results['defaultvalues']++;
@@ -5145,7 +5145,7 @@ function TSVImportSurvey($sFullFilePath)
$insertdata['sortorder'] = ++$aseq;
$result = Answer::model()->insertRecords($insertdata); // or safeDie("Error: Failed to insert answer
");
if(!$result){
- $results['error'][] = $clang->gT("Error")." : ".$clang->gT("Could not insert answer").". ".$clang->gT("Text file row number ").$rownumber;
+ $results['error'][] = gT("Error")." : ".gT("Could not insert answer").". ".gT("Text file row number ").$rownumber;
}
$results['answers']++;
break;
diff --git a/application/helpers/admin/label_helper.php b/application/helpers/admin/label_helper.php
index ee1614559d8..29d872ee8a2 100644
--- a/application/helpers/admin/label_helper.php
+++ b/application/helpers/admin/label_helper.php
@@ -104,7 +104,7 @@ function insertlabelset()
$result=LabelSet::model()->insertRecords($data);
if (!$result)
{
- Yii::app()->session['flashmessage'] = $clang->gT("Inserting the label set failed.");
+ Yii::app()->session['flashmessage'] = gT("Inserting the label set failed.");
}
else
{
@@ -126,7 +126,7 @@ function modlabelsetanswers($lid)
$ajax = true;
}
if (!isset($_POST['method'])) {
- $_POST['method'] = $clang->gT("Save");
+ $_POST['method'] = gT("Save");
}
$sPostData = Yii::app()->getRequest()->getPost('dataToSend');
@@ -184,16 +184,16 @@ function modlabelsetanswers($lid)
}
if(count($aErrors))
{
- Yii::app()->session['flashmessage'] = $clang->gT("Not all labels were updated successfully.");
+ Yii::app()->session['flashmessage'] = gT("Not all labels were updated successfully.");
}
else
{
- Yii::app()->session['flashmessage'] = $clang->gT("Labels sucessfully updated");
+ Yii::app()->session['flashmessage'] = gT("Labels sucessfully updated");
}
}
else
{
- Yii::app()->setFlashMessage($clang->gT("Can't update labels because you are using duplicated codes"),'error');
+ Yii::app()->setFlashMessage(gT("Can't update labels because you are using duplicated codes"),'error');
}
if ($ajax){ die(); }
diff --git a/application/helpers/admin/statistics_helper.php b/application/helpers/admin/statistics_helper.php
index 393ba3f7d7c..a1cb3007ad3 100644
--- a/application/helpers/admin/statistics_helper.php
+++ b/application/helpers/admin/statistics_helper.php
@@ -62,7 +62,7 @@ function createChart($iQuestionID, $iSurveyID, $type=null, $lbl, $gdata, $grawda
}
else
{
- Yii::app()->setFlashMessage(sprintf($clang->gT('The fonts file %s was not found in
/fonts directory. Please, see the txt file for your language in fonts directory to generate the charts.'),$neededfontfile),'error');
+ Yii::app()->setFlashMessage(sprintf(gT('The fonts file %s was not found in /fonts directory. Please, see the txt file for your language in fonts directory to generate the charts.'),$neededfontfile),'error');
$bErrorGenerate=true;// Don't do a graph again.
return false;
}
@@ -80,7 +80,7 @@ function createChart($iQuestionID, $iSurveyID, $type=null, $lbl, $gdata, $grawda
$graph->loadColorPalette($homedir.DIRECTORY_SEPARATOR.'styles'.DIRECTORY_SEPARATOR.$admintheme.DIRECTORY_SEPARATOR.'limesurvey.pal');
$graph->setFontProperties($rootdir.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR.$chartfontfile,$chartfontsize);
$graph->setFontProperties($rootdir.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR.$chartfontfile,$chartfontsize);
- $graph->drawTitle(0,0,$clang->gT('Sorry, but this question has too many answer options to be shown properly in a graph.','unescaped'),30,30,30,690,200);
+ $graph->drawTitle(0,0,gT('Sorry, but this question has too many answer options to be shown properly in a graph.','unescaped'),30,30,30,690,200);
$cache->WriteToCache("graph".$iSurveyID.$language.$iQuestionID,$DataSet,$graph);
$cachefilename=basename($cache->GetFileFromCache("graph".$iSurveyID.$language.$iQuestionID,$DataSet));
unset($graph);
@@ -99,7 +99,7 @@ function createChart($iQuestionID, $iSurveyID, $type=null, $lbl, $gdata, $grawda
$graph->loadColorPalette($homedir.DIRECTORY_SEPARATOR.'styles'.DIRECTORY_SEPARATOR.$admintheme.DIRECTORY_SEPARATOR.'limesurvey.pal');
$graph->setFontProperties($rootdir.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR.$chartfontfile,$chartfontsize);
$graph->setFontProperties($rootdir.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR.$chartfontfile,$chartfontsize);
- $graph->drawTitle(0,0,$clang->gT('Sorry, but this question has no responses yet so a graph cannot be shown.','unescaped'),30,30,30,690,200);
+ $graph->drawTitle(0,0,gT('Sorry, but this question has no responses yet so a graph cannot be shown.','unescaped'),30,30,30,690,200);
$cache->WriteToCache("graph".$iSurveyID.$language.$iQuestionID,$DataSet,$graph);
$cachefilename=basename($cache->GetFileFromCache("graph".$iSurveyID.$language.$iQuestionID,$DataSet));
unset($graph);
@@ -1514,7 +1514,7 @@ protected function buildOutputList($rt, $language, $surveyid, $outputType, $sql,
}
//output
- $labelno = sprintf($clang->gT('Label %s'),'1');
+ $labelno = sprintf(gT('Label %s'),'1');
}
//label 2
@@ -1536,7 +1536,7 @@ protected function buildOutputList($rt, $language, $surveyid, $outputType, $sql,
}
//output
- $labelno = sprintf($clang->gT('Label %s'),'2');
+ $labelno = sprintf(gT('Label %s'),'2');
}
//get data
diff --git a/application/helpers/common_helper.php b/application/helpers/common_helper.php
index 6db6d55597b..2a3be6ba164 100644
--- a/application/helpers/common_helper.php
+++ b/application/helpers/common_helper.php
@@ -30,25 +30,70 @@ function comparePermission($aPermissionA,$aPermissionB)
/**
* Translation helper function.
- * @param string $string
- * @param string $escapemode
+ * @param string $sToTranslate
+ * @param string $sEscapeMode
*/
-function gT($string, $escapemode = 'html')
+function gT($sToTranslate, $sEscapeMode = 'html')
{
- Yii::import('application.libraries.Limesurvey_lang');
- if (isset(App()->lang))
- {
- return App()->lang->gT($string, $escapemode);
- }
- else
- {
- return $string;
- }
+ return quoteText(Yii::t('app',$sToTranslate),$sEscapeMode);
+}
+
+/**
+ * Translation helper function which outputs right away.
+ * @param string $sToTranslate
+ * @param string $sEscapeMode
+ */
+function eT($sToTranslate, $sEscapeMode = 'html')
+{
+ echo gT($sToTranslate,$sEscapeMode);
+}
+
+/**
+ * Translation helper function for plural forms
+ * @param string $sToTranslate
+ * @param integer $iCount
+ * @param string $sEscapeMode
+ */
+function ngT($sToTranslate, $iCount, $sEscapeMode = 'html')
+{
+ return quoteText(Yii::t('app',$sToTranslate,$iCount),$sEscapeMode);
}
-function eT($string, $escapemode = 'html')
+/**
+ * Translation helper function for plural forms which outputs right away
+ * @param string $sToTranslate
+ * @param integer $iCount
+ * @param string $sEscapeMode
+ */
+function egT($sToTranslate, $iCount, $sEscapeMode = 'html')
{
- echo gT($string, $escapemode);
+ echo ngT($sToTranslate,$iCount,$sEscapeMode);
+}
+
+
+/**
+* Quotes a translation according to purpose
+*
+* @param mixed $sText Text to quote
+* @param string $sEscapeMode Optional - One of the values 'html','js' or 'unescaped' - defaults to 'html'
+*/
+function quoteText($sText, $sEscapeMode = 'html')
+{
+ switch ($sEscapeMode)
+ {
+ case 'html':
+ return HTMLEscape($sText);
+ break;
+ case 'js':
+ return javascriptEscape($sText);
+ break;
+ case 'unescaped':
+ return $sText;
+ break;
+ default:
+ return "Unsupported EscapeMode in gT method";
+ break;
+ }
}
/**
@@ -72,183 +117,183 @@ function getQuestionTypeList($SelectedCode = "T", $ReturnType = "selector")
$publicurl = Yii::app()->getConfig('publicurl');
$clang = Yii::app()->lang;
- $group['Arrays'] = $clang->gT('Arrays');
- $group['MaskQuestions'] = $clang->gT("Mask questions");
- $group['SinChoiceQues'] = $clang->gT("Single choice questions");
- $group['MulChoiceQues'] = $clang->gT("Multiple choice questions");
- $group['TextQuestions'] = $clang->gT("Text questions");
+ $group['Arrays'] = gT('Arrays');
+ $group['MaskQuestions'] = gT("Mask questions");
+ $group['SinChoiceQues'] = gT("Single choice questions");
+ $group['MulChoiceQues'] = gT("Multiple choice questions");
+ $group['TextQuestions'] = gT("Text questions");
$qtypes = array(
- "1" => array('description' => $clang->gT("Array dual scale"),
+ "1" => array('description' => gT("Array dual scale"),
'group' => $group['Arrays'],
'subquestions' => 1,
'assessable' => 1,
'hasdefaultvalues' => 0,
'answerscales' => 2),
- "5" => array('description' => $clang->gT("5 Point Choice"),
+ "5" => array('description' => gT("5 Point Choice"),
'group' => $group['SinChoiceQues'],
'subquestions' => 0,
'hasdefaultvalues' => 0,
'assessable' => 0,
'answerscales' => 0),
- "A" => array('description' => $clang->gT("Array (5 Point Choice)"),
+ "A" => array('description' => gT("Array (5 Point Choice)"),
'group' => $group['Arrays'],
'subquestions' => 1,
'hasdefaultvalues' => 0,
'assessable' => 1,
'answerscales' => 0),
- "B" => array('description' => $clang->gT("Array (10 Point Choice)"),
+ "B" => array('description' => gT("Array (10 Point Choice)"),
'group' => $group['Arrays'],
'subquestions' => 1,
'hasdefaultvalues' => 0,
'assessable' => 1,
'answerscales' => 0),
- "C" => array('description' => $clang->gT("Array (Yes/No/Uncertain)"),
+ "C" => array('description' => gT("Array (Yes/No/Uncertain)"),
'group' => $group['Arrays'],
'subquestions' => 1,
'hasdefaultvalues' => 0,
'assessable' => 1,
'answerscales' => 0),
- "D" => array('description' => $clang->gT("Date/Time"),
+ "D" => array('description' => gT("Date/Time"),
'group' => $group['MaskQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 1,
'assessable' => 0,
'answerscales' => 0),
- "E" => array('description' => $clang->gT("Array (Increase/Same/Decrease)"),
+ "E" => array('description' => gT("Array (Increase/Same/Decrease)"),
'group' => $group['Arrays'],
'subquestions' => 1,
'hasdefaultvalues' => 0,
'assessable' => 1,
'answerscales' => 0),
- "F" => array('description' => $clang->gT("Array"),
+ "F" => array('description' => gT("Array"),
'group' => $group['Arrays'],
'subquestions' => 1,
'hasdefaultvalues' => 0,
'assessable' => 1,
'answerscales' => 1),
- "G" => array('description' => $clang->gT("Gender"),
+ "G" => array('description' => gT("Gender"),
'group' => $group['MaskQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 0,
'assessable' => 0,
'answerscales' => 0),
- "H" => array('description' => $clang->gT("Array by column"),
+ "H" => array('description' => gT("Array by column"),
'group' => $group['Arrays'],
'hasdefaultvalues' => 0,
'subquestions' => 1,
'assessable' => 1,
'answerscales' => 1),
- "I" => array('description' => $clang->gT("Language Switch"),
+ "I" => array('description' => gT("Language Switch"),
'group' => $group['MaskQuestions'],
'hasdefaultvalues' => 0,
'subquestions' => 0,
'assessable' => 0,
'answerscales' => 0),
- "K" => array('description' => $clang->gT("Multiple Numerical Input"),
+ "K" => array('description' => gT("Multiple Numerical Input"),
'group' => $group['MaskQuestions'],
'hasdefaultvalues' => 1,
'subquestions' => 1,
'assessable' => 1,
'answerscales' => 0),
- "L" => array('description' => $clang->gT("List (Radio)"),
+ "L" => array('description' => gT("List (Radio)"),
'group' => $group['SinChoiceQues'],
'subquestions' => 0,
'hasdefaultvalues' => 1,
'assessable' => 1,
'answerscales' => 1),
- "M" => array('description' => $clang->gT("Multiple choice"),
+ "M" => array('description' => gT("Multiple choice"),
'group' => $group['MulChoiceQues'],
'subquestions' => 1,
'hasdefaultvalues' => 1,
'assessable' => 1,
'answerscales' => 0),
- "N" => array('description' => $clang->gT("Numerical Input"),
+ "N" => array('description' => gT("Numerical Input"),
'group' => $group['MaskQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 1,
'assessable' => 0,
'answerscales' => 0),
- "O" => array('description' => $clang->gT("List with comment"),
+ "O" => array('description' => gT("List with comment"),
'group' => $group['SinChoiceQues'],
'subquestions' => 0,
'hasdefaultvalues' => 1,
'assessable' => 1,
'answerscales' => 1),
- "P" => array('description' => $clang->gT("Multiple choice with comments"),
+ "P" => array('description' => gT("Multiple choice with comments"),
'group' => $group['MulChoiceQues'],
'subquestions' => 1,
'hasdefaultvalues' => 1,
'assessable' => 1,
'answerscales' => 0),
- "Q" => array('description' => $clang->gT("Multiple Short Text"),
+ "Q" => array('description' => gT("Multiple Short Text"),
'group' => $group['TextQuestions'],
'subquestions' => 1,
'hasdefaultvalues' => 1,
'assessable' => 0,
'answerscales' => 0),
- "R" => array('description' => $clang->gT("Ranking"),
+ "R" => array('description' => gT("Ranking"),
'group' => $group['MaskQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 0,
'assessable' => 1,
'answerscales' => 1),
- "S" => array('description' => $clang->gT("Short Free Text"),
+ "S" => array('description' => gT("Short Free Text"),
'group' => $group['TextQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 1,
'assessable' => 0,
'answerscales' => 0),
- "T" => array('description' => $clang->gT("Long Free Text"),
+ "T" => array('description' => gT("Long Free Text"),
'group' => $group['TextQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 1,
'assessable' => 0,
'answerscales' => 0),
- "U" => array('description' => $clang->gT("Huge Free Text"),
+ "U" => array('description' => gT("Huge Free Text"),
'group' => $group['TextQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 1,
'assessable' => 0,
'answerscales' => 0),
- "X" => array('description' => $clang->gT("Text display"),
+ "X" => array('description' => gT("Text display"),
'group' => $group['MaskQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 0,
'assessable' => 0,
'answerscales' => 0),
- "Y" => array('description' => $clang->gT("Yes/No"),
+ "Y" => array('description' => gT("Yes/No"),
'group' => $group['MaskQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 0,
'assessable' => 0,
'answerscales' => 0),
- "!" => array('description' => $clang->gT("List (Dropdown)"),
+ "!" => array('description' => gT("List (Dropdown)"),
'group' => $group['SinChoiceQues'],
'subquestions' => 0,
'hasdefaultvalues' => 1,
'assessable' => 1,
'answerscales' => 1),
- ":" => array('description' => $clang->gT("Array (Numbers)"),
+ ":" => array('description' => gT("Array (Numbers)"),
'group' => $group['Arrays'],
'subquestions' => 2,
'hasdefaultvalues' => 0,
'assessable' => 1,
'answerscales' => 0),
- ";" => array('description' => $clang->gT("Array (Texts)"),
+ ";" => array('description' => gT("Array (Texts)"),
'group' => $group['Arrays'],
'subquestions' => 2,
'hasdefaultvalues' => 0,
'assessable' => 0,
'answerscales' => 0),
- "|" => array('description' => $clang->gT("File upload"),
+ "|" => array('description' => gT("File upload"),
'group' => $group['MaskQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 0,
'assessable' => 0,
'answerscales' => 0),
- "*" => array('description' => $clang->gT("Equation"),
+ "*" => array('description' => gT("Equation"),
'group' => $group['MaskQuestions'],
'subquestions' => 0,
'hasdefaultvalues' => 0,
@@ -413,25 +458,25 @@ function getSurveyList($returnarray=false, $surveyid=false)
//Only show each activesurvey group if there are some
if ($activesurveys!='')
{
- $surveyselecter .= "\n";
+ $surveyselecter .= "\n";
$surveyselecter .= $activesurveys . " ";
}
if ($expiredsurveys!='')
{
- $surveyselecter .= "\n";
+ $surveyselecter .= "\n";
$surveyselecter .= $expiredsurveys . " ";
}
if ($inactivesurveys!='')
{
- $surveyselecter .= "\n";
+ $surveyselecter .= "\n";
$surveyselecter .= $inactivesurveys . " ";
}
if (!isset($svexist))
{
- $surveyselecter = "".$clang->gT("Please choose...")." \n".$surveyselecter;
+ $surveyselecter = "".gT("Please choose...")." \n".$surveyselecter;
} else
{
- $surveyselecter = "".$clang->gT("None")." \n".$surveyselecter;
+ $surveyselecter = "".gT("None")." \n".$surveyselecter;
}
return $surveyselecter;
}
@@ -544,12 +589,12 @@ function getQuestions($surveyid,$gid,$selectedqid)
if (!isset($qexists))
{
- $sQuestionselecter = "".$clang->gT("Please choose...")." \n".$sQuestionselecter;
+ $sQuestionselecter = "".gT("Please choose...")." \n".$sQuestionselecter;
}
else
{
$link = Yii::app()->getController()->createUrl("/admin/survey/sa/view/surveyid/".$surveyid."/gid/".$gid);
- $sQuestionselecter = "".$clang->gT("None")." \n".$sQuestionselecter;
+ $sQuestionselecter = "".gT("None")." \n".$sQuestionselecter;
}
return $sQuestionselecter;
}
@@ -1110,9 +1155,9 @@ function getNotificationList($notificationcode)
{
$clang = Yii::app()->lang;
$ntypes = array(
- "0"=>$clang->gT("No email notification"),
- "1"=>$clang->gT("Basic email notification"),
- "2"=>$clang->gT("Detailed email notification with result codes")
+ "0"=>gT("No email notification"),
+ "1"=>gT("Basic email notification"),
+ "2"=>gT("Detailed email notification with result codes")
);
if (!isset($ntypeselector)) {$ntypeselector="";}
foreach($ntypes as $ntcode=>$ntdescription)
@@ -1152,8 +1197,8 @@ function getGroupList($gid,$surveyid)
}
if ($groupselecter)
{
- if (!isset($gvexist)) {$groupselecter = "".$clang->gT("Please choose...")." \n".$groupselecter;}
- else {$groupselecter .= "".$clang->gT("None")." \n";}
+ if (!isset($gvexist)) {$groupselecter = "".gT("Please choose...")." \n".$groupselecter;}
+ else {$groupselecter .= "".gT("None")." \n";}
}
return $groupselecter;
}
@@ -1222,8 +1267,8 @@ function getGroupListLang($gid, $language, $surveyid)
if ($groupselecter)
{
$link = Yii::app()->getController()->createUrl("/admin/survey/sa/view/surveyid/".$surveyid);
- if (!isset($gvexist)) {$groupselecter = "".$clang->gT("Please choose...")." \n".$groupselecter;}
- else {$groupselecter .= "".$clang->gT("None")." \n";}
+ if (!isset($gvexist)) {$groupselecter = "".gT("Please choose...")." \n".$groupselecter;}
+ else {$groupselecter .= "".gT("None")." \n";}
}
return $groupselecter;
}
@@ -1551,13 +1596,13 @@ function fixMovedQuestionConditions($qid,$oldgid,$newgid) //Function rewrites th
*/
function returnGlobal($stringname,$bRestrictToString=false)
{
- $urlParam=Yii::app()->request->getParam($stringname);
+ $urlParam=Yii::app()->request->getParam($stringname);
if(is_null($urlParam) && $aCookies=Yii::app()->request->getCookies() && $stringname!='sid')
{
if(isset($aCookies[$stringname]))
{
$urlParam = $aCookies[$stringname];
- }
+ }
}
$bUrlParamIsArray=is_array($urlParam);// Needed to array map or if $bRestrictToString
if (!is_null($urlParam) && $stringname!='' && (!$bUrlParamIsArray || !$bRestrictToString))
@@ -1651,8 +1696,8 @@ function getExtendedAnswer($iSurveyID, $sFieldCode, $sValue, $oLanguage)
return false;
// If it is a comment field there is nothing to convert here
- if ($fields['aid']=='comment') return $sValue;
-
+ if ($fields['aid']=='comment') return $sValue;
+
//Find out the question type
$this_type = $fields['type'];
switch($this_type)
@@ -2086,7 +2131,7 @@ function createCompleteSGQA($iSurveyID,$aFilters,$sLanguage) {
break;
case "A": // ARRAY OF 5 POINT CHOICE QUESTIONS
case "B": // ARRAY OF 10 POINT CHOICE QUESTIONS
- case "C": // ARRAY OF YES\No\$clang->gT("Uncertain") QUESTIONS
+ case "C": // ARRAY OF YES\No\gT("Uncertain") QUESTIONS
case "E": // ARRAY OF Increase/Same/Decrease QUESTIONS
case "F": // FlEXIBLE ARRAY
case "H": // ARRAY (By Column)
@@ -2110,7 +2155,7 @@ function createCompleteSGQA($iSurveyID,$aFilters,$sLanguage) {
case ";": //ARRAY (Multi Flex) (Text)
case ":": //ARRAY (Multi Flex) (Numbers)
$result = Question::model()->getQuestionsForStatistics('title, question', "parent_qid=$flt[qid] AND language = '{$sLanguage}' AND scale_id = 0", 'question_order');
-
+
foreach($result as $row)
{
$fresult = Question::model()->getQuestionsForStatistics('title, question', "parent_qid=$flt[qid] AND language = '{$sLanguage}' AND scale_id = 1", 'question_order');
@@ -2201,7 +2246,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["id"]['title']="";
- $fieldmap["id"]['question']=$clang->gT("Response ID");
+ $fieldmap["id"]['question']=gT("Response ID");
$fieldmap["id"]['group_name']="";
}
@@ -2209,7 +2254,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["submitdate"]['title']="";
- $fieldmap["submitdate"]['question']=$clang->gT("Date submitted");
+ $fieldmap["submitdate"]['question']=gT("Date submitted");
$fieldmap["submitdate"]['group_name']="";
}
@@ -2217,7 +2262,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["lastpage"]['title']="";
- $fieldmap["lastpage"]['question']=$clang->gT("Last page");
+ $fieldmap["lastpage"]['question']=gT("Last page");
$fieldmap["lastpage"]['group_name']="";
}
@@ -2225,7 +2270,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["startlanguage"]['title']="";
- $fieldmap["startlanguage"]['question']=$clang->gT("Start language");
+ $fieldmap["startlanguage"]['question']=gT("Start language");
$fieldmap["startlanguage"]['group_name']="";
}
@@ -2243,7 +2288,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["token"]['title']="";
- $fieldmap["token"]['question']=$clang->gT("Token");
+ $fieldmap["token"]['question']=gT("Token");
$fieldmap["token"]['group_name']="";
}
}
@@ -2258,7 +2303,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["startdate"]['title']="";
- $fieldmap["startdate"]['question']=$clang->gT("Date started");
+ $fieldmap["startdate"]['question']=gT("Date started");
$fieldmap["startdate"]['group_name']="";
}
@@ -2271,7 +2316,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["datestamp"]['title']="";
- $fieldmap["datestamp"]['question']=$clang->gT("Date last action");
+ $fieldmap["datestamp"]['question']=gT("Date last action");
$fieldmap["datestamp"]['group_name']="";
}
@@ -2287,7 +2332,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["ipaddr"]['title']="";
- $fieldmap["ipaddr"]['question']=$clang->gT("IP address");
+ $fieldmap["ipaddr"]['question']=gT("IP address");
$fieldmap["ipaddr"]['group_name']="";
}
}
@@ -2298,7 +2343,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
if ($style == "full")
{
$fieldmap["refurl"]['title']="";
- $fieldmap["refurl"]['question']=$clang->gT("Referrer URL");
+ $fieldmap["refurl"]['question']=gT("Referrer URL");
$fieldmap["refurl"]['group_name']="";
}
}
@@ -2426,7 +2471,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
{
$fieldmap[$fieldname]['title']=$arow['title'];
$fieldmap[$fieldname]['question']=$arow['question'];
- $fieldmap[$fieldname]['subquestion']=$clang->gT("Other");
+ $fieldmap[$fieldname]['subquestion']=gT("Other");
$fieldmap[$fieldname]['group_name']=$arow['group_name'];
$fieldmap[$fieldname]['mandatory']=$arow['mandatory'];
$fieldmap[$fieldname]['hasconditions']=$conditions;
@@ -2454,7 +2499,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
{
$fieldmap[$fieldname]['title']=$arow['title'];
$fieldmap[$fieldname]['question']=$arow['question'];
- $fieldmap[$fieldname]['subquestion']=$clang->gT("Comment");
+ $fieldmap[$fieldname]['subquestion']=gT("Comment");
$fieldmap[$fieldname]['group_name']=$arow['group_name'];
$fieldmap[$fieldname]['mandatory']=$arow['mandatory'];
$fieldmap[$fieldname]['hasconditions']=$conditions;
@@ -2533,7 +2578,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
$fieldmap[$fieldname]['question']=$arow['question'];
$fieldmap[$fieldname]['subquestion']=$abrow['question'];
$fieldmap[$fieldname]['group_name']=$arow['group_name'];
- $fieldmap[$fieldname]['scale']=$clang->gT('Scale 1');
+ $fieldmap[$fieldname]['scale']=gT('Scale 1');
$fieldmap[$fieldname]['mandatory']=$arow['mandatory'];
$fieldmap[$fieldname]['hasconditions']=$conditions;
$fieldmap[$fieldname]['usedinconditions']=$usedinconditions;
@@ -2551,7 +2596,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
$fieldmap[$fieldname]['question']=$arow['question'];
$fieldmap[$fieldname]['subquestion']=$abrow['question'];
$fieldmap[$fieldname]['group_name']=$arow['group_name'];
- $fieldmap[$fieldname]['scale']=$clang->gT('Scale 2');
+ $fieldmap[$fieldname]['scale']=gT('Scale 2');
$fieldmap[$fieldname]['mandatory']=$arow['mandatory'];
$fieldmap[$fieldname]['hasconditions']=$conditions;
$fieldmap[$fieldname]['usedinconditions']=$usedinconditions;
@@ -2577,7 +2622,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
{
$fieldmap[$fieldname]['title']=$arow['title'];
$fieldmap[$fieldname]['question']=$arow['question'];
- $fieldmap[$fieldname]['subquestion']=sprintf($clang->gT('Rank %s'),$i);
+ $fieldmap[$fieldname]['subquestion']=sprintf(gT('Rank %s'),$i);
$fieldmap[$fieldname]['group_name']=$arow['group_name'];
$fieldmap[$fieldname]['mandatory']=$arow['mandatory'];
$fieldmap[$fieldname]['hasconditions']=$conditions;
@@ -2637,7 +2682,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
foreach ($abrows as $abrow)
{
$fieldname="{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['title']}";
-
+
if (isset($fieldmap[$fieldname])) $aDuplicateQIDs[$arow['qid']]=array('fieldname'=>$fieldname,'question'=>$arow['question'],'gid'=>$arow['gid']);
$fieldmap[$fieldname]=array("fieldname"=>$fieldname,
'type'=>$arow['type'],
@@ -2673,7 +2718,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
{
$fieldmap[$fieldname]['title']=$arow['title'];
$fieldmap[$fieldname]['question']=$arow['question'];
- $fieldmap[$fieldname]['subquestion']=$clang->gT('Comment');
+ $fieldmap[$fieldname]['subquestion']=gT('Comment');
$fieldmap[$fieldname]['group_name']=$arow['group_name'];
$fieldmap[$fieldname]['mandatory']=$arow['mandatory'];
$fieldmap[$fieldname]['hasconditions']=$conditions;
@@ -2692,7 +2737,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
{
$fieldmap[$fieldname]['title']=$arow['title'];
$fieldmap[$fieldname]['question']=$arow['question'];
- $fieldmap[$fieldname]['subquestion']=$clang->gT('Other');
+ $fieldmap[$fieldname]['subquestion']=gT('Other');
$fieldmap[$fieldname]['group_name']=$arow['group_name'];
$fieldmap[$fieldname]['mandatory']=$arow['mandatory'];
$fieldmap[$fieldname]['hasconditions']=$conditions;
@@ -2710,7 +2755,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
{
$fieldmap[$fieldname]['title']=$arow['title'];
$fieldmap[$fieldname]['question']=$arow['question'];
- $fieldmap[$fieldname]['subquestion']=$clang->gT('Other comment');
+ $fieldmap[$fieldname]['subquestion']=gT('Other comment');
$fieldmap[$fieldname]['group_name']=$arow['group_name'];
$fieldmap[$fieldname]['mandatory']=$arow['mandatory'];
$fieldmap[$fieldname]['hasconditions']=$conditions;
@@ -2775,7 +2820,7 @@ function createFieldMap($surveyid, $style='short', $force_refresh=false, $questi
* @return bool
*/
function hasFileUploadQuestion($iSurveyID) {
- $iCount = Question::model()->count( "sid=:surveyid AND parent_qid=0 AND type='|'", array(':surveyid' => $iSurveyID));
+ $iCount = Question::model()->count( "sid=:surveyid AND parent_qid=0 AND type='|'", array(':surveyid' => $iSurveyID));
return $iCount>0 ;
}
@@ -2805,21 +2850,21 @@ function createTimingsFieldMap($surveyid, $style='full', $force_refresh=false, $
//do something
$fields = createFieldMap($surveyid, $style, $force_refresh, $questionid, $sQuestionLanguage);
- $fieldmap['interviewtime']=array('fieldname'=>'interviewtime','type'=>'interview_time','sid'=>$surveyid, 'gid'=>'', 'qid'=>'', 'aid'=>'', 'question'=>$clang->gT('Total time'), 'title'=>'interviewtime');
+ $fieldmap['interviewtime']=array('fieldname'=>'interviewtime','type'=>'interview_time','sid'=>$surveyid, 'gid'=>'', 'qid'=>'', 'aid'=>'', 'question'=>gT('Total time'), 'title'=>'interviewtime');
foreach ($fields as $field) {
if (!empty($field['gid'])) {
// field for time spent on page
$fieldname="{$field['sid']}X{$field['gid']}time";
if (!isset($fieldmap[$fieldname]))
{
- $fieldmap[$fieldname]=array("fieldname"=>$fieldname, 'type'=>"page_time", 'sid'=>$surveyid, "gid"=>$field['gid'], "group_name"=>$field['group_name'], "qid"=>'', 'aid'=>'', 'title'=>'groupTime'.$field['gid'], 'question'=>$clang->gT('Group time').": ".$field['group_name']);
+ $fieldmap[$fieldname]=array("fieldname"=>$fieldname, 'type'=>"page_time", 'sid'=>$surveyid, "gid"=>$field['gid'], "group_name"=>$field['group_name'], "qid"=>'', 'aid'=>'', 'title'=>'groupTime'.$field['gid'], 'question'=>gT('Group time').": ".$field['group_name']);
}
// field for time spent on answering a question
$fieldname="{$field['sid']}X{$field['gid']}X{$field['qid']}time";
if (!isset($fieldmap[$fieldname]))
{
- $fieldmap[$fieldname]=array("fieldname"=>$fieldname, 'type'=>"answer_time", 'sid'=>$surveyid, "gid"=>$field['gid'], "group_name"=>$field['group_name'], "qid"=>$field['qid'], 'aid'=>'', "title"=>$field['title'].'Time', "question"=>$clang->gT('Question time').": ".$field['title']);
+ $fieldmap[$fieldname]=array("fieldname"=>$fieldname, 'type'=>"answer_time", 'sid'=>$surveyid, "gid"=>$field['gid'], "group_name"=>$field['group_name'], "qid"=>$field['qid'], 'aid'=>'', "title"=>$field['title'].'Time', "question"=>gT('Question time').": ".$field['title']);
}
}
}
@@ -3057,1178 +3102,1178 @@ function questionAttributes($returnByName=false)
$qattributes["alphasort"]=array(
"types"=>"!LOWZ",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT("Sort the answer options alphabetically"),
- "caption"=>$clang->gT('Sort answers alphabetically'));
+ "help"=>gT("Sort the answer options alphabetically"),
+ "caption"=>gT('Sort answers alphabetically'));
$qattributes["answer_width"]=array(
"types"=>"ABCEF1:;",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'integer',
'min'=>'1',
'max'=>'100',
- "help"=>$clang->gT('Set the percentage width of the (sub-)question column (1-100)'),
- "caption"=>$clang->gT('(Sub-)question width'));
+ "help"=>gT('Set the percentage width of the (sub-)question column (1-100)'),
+ "caption"=>gT('(Sub-)question width'));
$qattributes["repeat_headings"]=array(
"types"=>"F:1;",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'integer',
'default'=>'',
- "help"=>$clang->gT('Repeat headings every X subquestions (Set to 0 to deactivate heading repeat, deactivate minimum repeat headings from config).'),
- "caption"=>$clang->gT('Repeat headers'));
+ "help"=>gT('Repeat headings every X subquestions (Set to 0 to deactivate heading repeat, deactivate minimum repeat headings from config).'),
+ "caption"=>gT('Repeat headers'));
$qattributes["array_filter"]=array(
"types"=>"1ABCEF:;MPLKQR",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT("Enter the code(s) of Multiple choice question(s) (separated by semicolons) to only show the matching answer options in this question."),
- "caption"=>$clang->gT('Array filter'));
+ "help"=>gT("Enter the code(s) of Multiple choice question(s) (separated by semicolons) to only show the matching answer options in this question."),
+ "caption"=>gT('Array filter'));
$qattributes["array_filter_exclude"]=array(
"types"=>"1ABCEF:;MPLKQR",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT("Enter the code(s) of Multiple choice question(s) (separated by semicolons) to exclude the matching answer options in this question."),
- "caption"=>$clang->gT('Array filter exclusion'));
+ "help"=>gT("Enter the code(s) of Multiple choice question(s) (separated by semicolons) to exclude the matching answer options in this question."),
+ "caption"=>gT('Array filter exclusion'));
$qattributes["array_filter_style"]=array(
"types"=>"1ABCEF:;MPLKQR",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('Hidden'),
- 1=>$clang->gT('Disabled')),
+ 'options'=>array(0=>gT('Hidden'),
+ 1=>gT('Disabled')),
'default'=>0,
- "help"=>$clang->gT("Specify how array-filtered sub-questions should be displayed"),
- "caption"=>$clang->gT('Array filter style'));
+ "help"=>gT("Specify how array-filtered sub-questions should be displayed"),
+ "caption"=>gT('Array filter style'));
$qattributes["assessment_value"]=array(
"types"=>"MP",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>100,
'default'=>'1',
'inputtype'=>'integer',
- "help"=>$clang->gT("If one of the subquestions is marked then for each marked subquestion this value is added as assessment."),
- "caption"=>$clang->gT('Assessment value'));
+ "help"=>gT("If one of the subquestions is marked then for each marked subquestion this value is added as assessment."),
+ "caption"=>gT('Assessment value'));
$qattributes["category_separator"]=array(
"types"=>"!",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT('Category separator'),
- "caption"=>$clang->gT('Category separator'));
+ "help"=>gT('Category separator'),
+ "caption"=>gT('Category separator'));
$qattributes["code_filter"]=array(
"types"=>"WZ",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT('Filter the available answers by this value'),
- "caption"=>$clang->gT('Code filter'));
+ "help"=>gT('Filter the available answers by this value'),
+ "caption"=>gT('Code filter'));
$qattributes["commented_checkbox"]=array(
"types"=>"P",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>110,
'inputtype'=>'singleselect',
'options'=>array(
- "allways"=>$clang->gT('No control on checkbox'),
- "checked"=>$clang->gT('Checkbox is checked'),
- "unchecked"=>$clang->gT('Checkbox is unchecked'),
+ "allways"=>gT('No control on checkbox'),
+ "checked"=>gT('Checkbox is checked'),
+ "unchecked"=>gT('Checkbox is unchecked'),
),
'default' => "checked",
- 'help'=>$clang->gT('Choose when user can add a comment'),
- 'caption'=>$clang->gT('Comment only when'));
+ 'help'=>gT('Choose when user can add a comment'),
+ 'caption'=>gT('Comment only when'));
$qattributes["commented_checkbox_auto"]=array(
"types"=>"P",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>111,
'inputtype'=>'singleselect',
'options'=>array(
- "0"=>$clang->gT('No'),
- "1"=>$clang->gT('Yes'),
+ "0"=>gT('No'),
+ "1"=>gT('Yes'),
),
'default' => "1",
- 'help'=>$clang->gT('Use javascript function to remove text and uncheck checkbox (or use Expression Manager only).'),
- 'caption'=>$clang->gT('Remove text or uncheck checkbox automatically'));
+ 'help'=>gT('Use javascript function to remove text and uncheck checkbox (or use Expression Manager only).'),
+ 'caption'=>gT('Remove text or uncheck checkbox automatically'));
$qattributes["display_columns"]=array(
"types"=>"LM",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'integer',
'default'=>'1',
'min'=>'1',
'max'=>'100',
- "help"=>$clang->gT('The answer options will be distributed across the number of columns set here'),
- "caption"=>$clang->gT('Display columns'));
+ "help"=>gT('The answer options will be distributed across the number of columns set here'),
+ "caption"=>gT('Display columns'));
$qattributes["display_rows"]=array(
"types"=>"QSTU",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT('How many rows to display'),
- "caption"=>$clang->gT('Display rows'));
+ "help"=>gT('How many rows to display'),
+ "caption"=>gT('Display rows'));
$qattributes["dropdown_dates"]=array(
"types"=>"D",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Use accessible dropdown boxes instead of calendar popup'),
- "caption"=>$clang->gT('Display dropdown boxes'));
+ "help"=>gT('Use accessible dropdown boxes instead of calendar popup'),
+ "caption"=>gT('Display dropdown boxes'));
$qattributes["date_min"]=array(
"types"=>"D",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>110,
'inputtype'=>'text',
- "help"=>$clang->gT('Minimum date selectable in calendar (YYYY-MM-DD). Only the year is used if dropdown boxes are selected.'),
- "caption"=>$clang->gT('Minimum date'));
+ "help"=>gT('Minimum date selectable in calendar (YYYY-MM-DD). Only the year is used if dropdown boxes are selected.'),
+ "caption"=>gT('Minimum date'));
$qattributes["date_max"]=array(
"types"=>"D",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>111,
'inputtype'=>'text',
- "help"=>$clang->gT('Maximum date selectable in calendar (YYYY-MM-DD). Only the year is used if dropdown boxes are selected.'),
- "caption"=>$clang->gT('Maximum date'));
+ "help"=>gT('Maximum date selectable in calendar (YYYY-MM-DD). Only the year is used if dropdown boxes are selected.'),
+ "caption"=>gT('Maximum date'));
$qattributes["dropdown_prepostfix"]=array(
"types"=>"1",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>112,
'inputtype'=>'text',
'i18n'=>true,
- "help"=>$clang->gT('Prefix|Suffix for dropdown lists'),
- "caption"=>$clang->gT('Dropdown prefix/suffix'));
+ "help"=>gT('Prefix|Suffix for dropdown lists'),
+ "caption"=>gT('Dropdown prefix/suffix'));
$qattributes["dropdown_separators"]=array(
"types"=>"1",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>120,
'inputtype'=>'text',
- "help"=>$clang->gT('Text shown on each subquestion row between both scales in dropdown mode'),
- "caption"=>$clang->gT('Dropdown separator'));
+ "help"=>gT('Text shown on each subquestion row between both scales in dropdown mode'),
+ "caption"=>gT('Dropdown separator'));
$qattributes["dualscale_headerA"]=array(
"types"=>"1",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>110,
'inputtype'=>'text',
'i18n'=>true,
- "help"=>$clang->gT('Enter a header text for the first scale'),
- "caption"=>$clang->gT('Header for first scale'));
+ "help"=>gT('Enter a header text for the first scale'),
+ "caption"=>gT('Header for first scale'));
$qattributes["dualscale_headerB"]=array(
"types"=>"1",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>111,
'inputtype'=>'text',
'i18n'=>true,
- "help"=>$clang->gT('Enter a header text for the second scale'),
- "caption"=>$clang->gT('Header for second scale'));
+ "help"=>gT('Enter a header text for the second scale'),
+ "caption"=>gT('Header for second scale'));
$qattributes["equals_num_value"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT('Multiple numeric inputs sum must equal this value'),
- "caption"=>$clang->gT('Equals sum value'));
+ "help"=>gT('Multiple numeric inputs sum must equal this value'),
+ "caption"=>gT('Equals sum value'));
$qattributes["em_validation_q"]=array(
"types"=>":;ABCDEFKMNPQRSTU",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>200,
'inputtype'=>'textarea',
- "help"=>$clang->gT('Enter a boolean equation to validate the whole question.'),
- "caption"=>$clang->gT('Question validation equation'));
+ "help"=>gT('Enter a boolean equation to validate the whole question.'),
+ "caption"=>gT('Question validation equation'));
$qattributes["em_validation_q_tip"]=array(
"types"=>":;ABCDEFKMNPQRSTU",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>210,
'inputtype'=>'textarea',
- "help"=>$clang->gT('This is a hint text that will be shown to the participant describing the question validation equation.'),
- "caption"=>$clang->gT('Question validation tip'));
+ "help"=>gT('This is a hint text that will be shown to the participant describing the question validation equation.'),
+ "caption"=>gT('Question validation tip'));
$qattributes["em_validation_sq"]=array(
"types"=>";:KQSTUN",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>220,
'inputtype'=>'textarea',
- "help"=>$clang->gT('Enter a boolean equation to validate each sub-question.'),
- "caption"=>$clang->gT('Sub-question validation equation'));
+ "help"=>gT('Enter a boolean equation to validate each sub-question.'),
+ "caption"=>gT('Sub-question validation equation'));
$qattributes["em_validation_sq_tip"]=array(
"types"=>";:KQSTUN",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>230,
'inputtype'=>'textarea',
- "help"=>$clang->gT('This is a tip shown to the participant describing the sub-question validation equation.'),
- "caption"=>$clang->gT('Sub-question validation tip'));
+ "help"=>gT('This is a tip shown to the participant describing the sub-question validation equation.'),
+ "caption"=>gT('Sub-question validation tip'));
$qattributes["exclude_all_others"]=array(
"types"=>":ABCEFMPKQ",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>130,
'inputtype'=>'text',
- "help"=>$clang->gT('Excludes all other options if a certain answer is selected - just enter the answer code(s) separated with a semikolon.'),
- "caption"=>$clang->gT('Exclusive option'));
+ "help"=>gT('Excludes all other options if a certain answer is selected - just enter the answer code(s) separated with a semikolon.'),
+ "caption"=>gT('Exclusive option'));
$qattributes["exclude_all_others_auto"]=array(
"types"=>"MP",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>131,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('If the participant marks all options, uncheck all and check the option set in the "Exclusive option" setting'),
- "caption"=>$clang->gT('Auto-check exclusive option if all others are checked'));
+ "help"=>gT('If the participant marks all options, uncheck all and check the option set in the "Exclusive option" setting'),
+ "caption"=>gT('Auto-check exclusive option if all others are checked'));
// Map Options
$qattributes["location_city"]=array(
"types"=>"S",
'readonly_when_active'=>true,
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>100,
'inputtype'=>'singleselect',
'default'=>0,
- 'options'=>array(0=>$clang->gT('Yes'),
- 1=>$clang->gT('No')),
- "help"=>$clang->gT("Store the city?"),
- "caption"=>$clang->gT("Save city"));
+ 'options'=>array(0=>gT('Yes'),
+ 1=>gT('No')),
+ "help"=>gT("Store the city?"),
+ "caption"=>gT("Save city"));
$qattributes["location_state"]=array(
"types"=>"S",
'readonly_when_active'=>true,
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>100,
'default'=>0,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('Yes'),
- 1=>$clang->gT('No')),
- "help"=>$clang->gT("Store the state?"),
- "caption"=>$clang->gT("Save state"));
+ 'options'=>array(0=>gT('Yes'),
+ 1=>gT('No')),
+ "help"=>gT("Store the state?"),
+ "caption"=>gT("Save state"));
$qattributes["location_postal"]=array(
"types"=>"S",
'readonly_when_active'=>true,
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>100,
'inputtype'=>'singleselect',
'default'=>0,
- 'options'=>array(0=>$clang->gT('Yes'),
- 1=>$clang->gT('No')),
- "help"=>$clang->gT("Store the postal code?"),
- "caption"=>$clang->gT("Save postal code"));
+ 'options'=>array(0=>gT('Yes'),
+ 1=>gT('No')),
+ "help"=>gT("Store the postal code?"),
+ "caption"=>gT("Save postal code"));
$qattributes["location_country"]=array(
"types"=>"S",
'readonly_when_active'=>true,
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>100,
'inputtype'=>'singleselect',
'default'=>0,
- 'options'=>array(0=>$clang->gT('Yes'),
- 1=>$clang->gT('No')),
- "help"=>$clang->gT("Store the country?"),
- "caption"=>$clang->gT("Save country"));
+ 'options'=>array(0=>gT('Yes'),
+ 1=>gT('No')),
+ "help"=>gT("Store the country?"),
+ "caption"=>gT("Save country"));
$qattributes["statistics_showmap"]=array(
"types"=>"S",
- 'category'=>$clang->gT('Statistics'),
+ 'category'=>gT('Statistics'),
'inputtype'=>'singleselect',
'sortorder'=>100,
- 'options'=>array(1=>$clang->gT('Yes'), 0=>$clang->gT('No')),
- 'help'=>$clang->gT("Show a map in the statistics?"),
- 'caption'=>$clang->gT("Display map"),
+ 'options'=>array(1=>gT('Yes'), 0=>gT('No')),
+ 'help'=>gT("Show a map in the statistics?"),
+ 'caption'=>gT("Display map"),
'default'=>1
);
$qattributes["statistics_showgraph"]=array(
'types'=>'15ABCDEFGHIKLMNOPQRSTUWXYZ!:;|*',
- 'category'=>$clang->gT('Statistics'),
+ 'category'=>gT('Statistics'),
'inputtype'=>'singleselect',
'sortorder'=>101,
- 'options'=>array(1=>$clang->gT('Yes'), 0=>$clang->gT('No')),
- 'help'=>$clang->gT("Display a chart in the statistics?"),
- 'caption'=>$clang->gT("Display chart"),
+ 'options'=>array(1=>gT('Yes'), 0=>gT('No')),
+ 'help'=>gT("Display a chart in the statistics?"),
+ 'caption'=>gT("Display chart"),
'default'=>1
);
$qattributes["statistics_graphtype"]=array(
"types"=>'15ABCDEFGHIKLNOQRSTUWXYZ!:;|*',
- 'category'=>$clang->gT('Statistics'),
+ 'category'=>gT('Statistics'),
'inputtype'=>'singleselect',
'sortorder'=>102,
- 'options'=>array(0=>$clang->gT('Bar chart'), 1=>$clang->gT('Pie chart')),
- 'help'=>$clang->gT("Select the type of chart to be displayed"),
- 'caption'=>$clang->gT("Chart type"),
+ 'options'=>array(0=>gT('Bar chart'), 1=>gT('Pie chart')),
+ 'help'=>gT("Select the type of chart to be displayed"),
+ 'caption'=>gT("Chart type"),
'default'=>0
);
$qattributes["location_mapservice"]=array(
"types"=>"S",
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>90,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('Off'),
+ 'options'=>array(0=>gT('Off'),
100=>gT('Open Layer (OpenStreetMap via mapquest)'),
- 1=>$clang->gT('Google Maps')
+ 1=>gT('Google Maps')
),
'default' => 0,
- "help"=>$clang->gT("Activate this to show a map above the input field where the user can select a location"),
- "caption"=>$clang->gT("Use mapping service"));
+ "help"=>gT("Activate this to show a map above the input field where the user can select a location"),
+ "caption"=>gT("Use mapping service"));
$qattributes["location_mapwidth"]=array(
"types"=>"S",
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>102,
'inputtype'=>'text',
'default'=>'500',
- "help"=>$clang->gT("Width of the map in pixel"),
- "caption"=>$clang->gT("Map width"));
+ "help"=>gT("Width of the map in pixel"),
+ "caption"=>gT("Map width"));
$qattributes["location_mapheight"]=array(
"types"=>"S",
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>103,
'inputtype'=>'text',
'default'=>'300',
- "help"=>$clang->gT("Height of the map in pixel"),
- "caption"=>$clang->gT("Map height"));
+ "help"=>gT("Height of the map in pixel"),
+ "caption"=>gT("Map height"));
$qattributes["location_nodefaultfromip"]=array(
"types"=>"S",
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>91,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('Yes'),
- 1=>$clang->gT('No')),
+ 'options'=>array(0=>gT('Yes'),
+ 1=>gT('No')),
'default' => 0,
- "help"=>$clang->gT("Get the default location using the user's IP address?"),
- "caption"=>$clang->gT("IP as default location"));
+ "help"=>gT("Get the default location using the user's IP address?"),
+ "caption"=>gT("IP as default location"));
$qattributes["location_defaultcoordinates"]=array(
"types"=>"S",
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>101,
'inputtype'=>'text',
- "help"=>$clang->gT('Default coordinates of the map when the page first loads. Format: latitude [space] longtitude'),
- "caption"=>$clang->gT('Default position'));
+ "help"=>gT('Default coordinates of the map when the page first loads. Format: latitude [space] longtitude'),
+ "caption"=>gT('Default position'));
$qattributes["location_mapzoom"]=array(
"types"=>"S",
- 'category'=>$clang->gT('Location'),
+ 'category'=>gT('Location'),
'sortorder'=>101,
'inputtype'=>'text',
'default'=>'11',
- "help"=>$clang->gT("Map zoom level"),
- "caption"=>$clang->gT("Zoom level"));
+ "help"=>gT("Map zoom level"),
+ "caption"=>gT("Zoom level"));
// End Map Options
$qattributes["hide_tip"]=array(
"types"=>"15ABCDEFGHIKLMNOPQRSTUXY!:;|",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Hide the tip that is normally shown with a question'),
- "caption"=>$clang->gT('Hide tip'));
+ "help"=>gT('Hide the tip that is normally shown with a question'),
+ "caption"=>gT('Hide tip'));
$qattributes['hidden']=array(
'types'=>'15ABCDEFGHIKLMNOPQRSTUWXYZ!:;|*',
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>101,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- 'help'=>$clang->gT('Hide this question at any time. This is useful for including data using answer prefilling.'),
- 'caption'=>$clang->gT('Always hide this question'));
+ 'help'=>gT('Hide this question at any time. This is useful for including data using answer prefilling.'),
+ 'caption'=>gT('Always hide this question'));
$qattributes["max_answers"]=array(
"types"=>"MPR1:;ABCEFKQ",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>11,
'inputtype'=>'integer',
- "help"=>$clang->gT('Limit the number of possible answers'),
- "caption"=>$clang->gT('Maximum answers'));
+ "help"=>gT('Limit the number of possible answers'),
+ "caption"=>gT('Maximum answers'));
$qattributes["max_num_value"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT('Maximum sum value of multiple numeric input'),
- "caption"=>$clang->gT('Maximum sum value'));
+ "help"=>gT('Maximum sum value of multiple numeric input'),
+ "caption"=>gT('Maximum sum value'));
$qattributes["max_num_value_n"]=array(
"types"=>"NK",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>110,
'inputtype'=>'integer',
- "help"=>$clang->gT('Maximum value of the numeric input'),
- "caption"=>$clang->gT('Maximum value'));
+ "help"=>gT('Maximum value of the numeric input'),
+ "caption"=>gT('Maximum value'));
// $qattributes["max_num_value_sgqa"]=array(
// "types"=>"K",
- // 'category'=>$clang->gT('Logic'),
+ // 'category'=>gT('Logic'),
// 'sortorder'=>100,
// 'inputtype'=>'text',
- // "help"=>$clang->gT('Enter the SGQA identifier to use the total of a previous question as the maximum for this question'),
- // "caption"=>$clang->gT('Max value from SGQA'));
+ // "help"=>gT('Enter the SGQA identifier to use the total of a previous question as the maximum for this question'),
+ // "caption"=>gT('Max value from SGQA'));
$qattributes["maximum_chars"]=array(
"types"=>"STUNQK:;",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT('Maximum characters allowed'),
- "caption"=>$clang->gT('Maximum characters'));
+ "help"=>gT('Maximum characters allowed'),
+ "caption"=>gT('Maximum characters'));
$qattributes["min_answers"]=array(
"types"=>"MPR1:;ABCEFKQ",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>10,
'inputtype'=>'integer',
- "help"=>$clang->gT('Ensure a minimum number of possible answers (0=No limit)'),
- "caption"=>$clang->gT('Minimum answers'));
+ "help"=>gT('Ensure a minimum number of possible answers (0=No limit)'),
+ "caption"=>gT('Minimum answers'));
$qattributes["min_num_value"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT('The sum of the multiple numeric inputs must be greater than this value'),
- "caption"=>$clang->gT('Minimum sum value'));
+ "help"=>gT('The sum of the multiple numeric inputs must be greater than this value'),
+ "caption"=>gT('Minimum sum value'));
$qattributes["min_num_value_n"]=array(
"types"=>"NK",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
'inputtype'=>'integer',
- "help"=>$clang->gT('Minimum value of the numeric input'),
- "caption"=>$clang->gT('Minimum value'));
+ "help"=>gT('Minimum value of the numeric input'),
+ "caption"=>gT('Minimum value'));
// $qattributes["min_num_value_sgqa"]=array(
// "types"=>"K",
- // 'category'=>$clang->gT('Logic'),
+ // 'category'=>gT('Logic'),
// 'sortorder'=>100,
// 'inputtype'=>'text',
- // "help"=>$clang->gT('Enter the SGQA identifier to use the total of a previous question as the minimum for this question'),
- // "caption"=>$clang->gT('Minimum value from SGQA'));
+ // "help"=>gT('Enter the SGQA identifier to use the total of a previous question as the minimum for this question'),
+ // "caption"=>gT('Minimum value from SGQA'));
$qattributes["multiflexible_max"]=array(
"types"=>":",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>112,
'inputtype'=>'text',
- "help"=>$clang->gT('Maximum value for array(mult-flexible) question type'),
- "caption"=>$clang->gT('Maximum value'));
+ "help"=>gT('Maximum value for array(mult-flexible) question type'),
+ "caption"=>gT('Maximum value'));
$qattributes["multiflexible_min"]=array(
"types"=>":",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>110,
'inputtype'=>'text',
- "help"=>$clang->gT('Minimum value for array(multi-flexible) question type'),
- "caption"=>$clang->gT('Minimum value'));
+ "help"=>gT('Minimum value for array(multi-flexible) question type'),
+ "caption"=>gT('Minimum value'));
$qattributes["multiflexible_step"]=array(
"types"=>":",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>111,
'inputtype'=>'text',
- "help"=>$clang->gT('Step value'),
- "caption"=>$clang->gT('Step value'));
+ "help"=>gT('Step value'),
+ "caption"=>gT('Step value'));
$qattributes["multiflexible_checkbox"]=array(
"types"=>":",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Use checkbox layout'),
- "caption"=>$clang->gT('Checkbox layout'));
+ "help"=>gT('Use checkbox layout'),
+ "caption"=>gT('Checkbox layout'));
$qattributes["reverse"]=array(
"types"=>"D:",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Present answer options in reverse order'),
- "caption"=>$clang->gT('Reverse answer order'));
+ "help"=>gT('Present answer options in reverse order'),
+ "caption"=>gT('Reverse answer order'));
// $qattributes["num_value_equals_sgqa"]=array(
// "types"=>"K",
- // 'category'=>$clang->gT('Logic'),
+ // 'category'=>gT('Logic'),
// 'sortorder'=>100,
// 'inputtype'=>'text',
- // "help"=>$clang->gT('SGQA identifier to use total of previous question as total for this question'),
- // "caption"=>$clang->gT('Value equals SGQA'));
+ // "help"=>gT('SGQA identifier to use total of previous question as total for this question'),
+ // "caption"=>gT('Value equals SGQA'));
$qattributes["num_value_int_only"]=array(
"types"=>"N",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
'inputtype'=>'singleselect',
'options'=>array(
- 0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Restrict input to integer values'),
- "caption"=>$clang->gT('Integer only'));
+ "help"=>gT('Restrict input to integer values'),
+ "caption"=>gT('Integer only'));
$qattributes["numbers_only"]=array(
"types"=>"Q;S*",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>150,
'inputtype'=>'singleselect',
'options'=>array(
- 0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')
+ 0=>gT('No'),
+ 1=>gT('Yes')
),
'default'=>0,
- "help"=>$clang->gT('Allow only numerical input'),
- "caption"=>$clang->gT('Numbers only')
+ "help"=>gT('Allow only numerical input'),
+ "caption"=>gT('Numbers only')
);
$qattributes['show_totals'] = array(
'types' => ';',
- 'category' => $clang->gT('Other'),
+ 'category' => gT('Other'),
'sortorder' => 151,
'inputtype' => 'singleselect',
'options' => array(
- 'X' => $clang->gT('Off'),
- 'R' => $clang->gT('Rows'),
- 'C' => $clang->gT('Columns'),
- 'B' => $clang->gT('Both rows and columns')
+ 'X' => gT('Off'),
+ 'R' => gT('Rows'),
+ 'C' => gT('Columns'),
+ 'B' => gT('Both rows and columns')
),
'default' => 'X',
- 'help' => $clang->gT('Show totals for either rows, columns or both rows and columns'),
- 'caption' => $clang->gT('Show totals for')
+ 'help' => gT('Show totals for either rows, columns or both rows and columns'),
+ 'caption' => gT('Show totals for')
);
$qattributes['show_grand_total'] = array(
'types' => ';',
- 'category' => $clang->gT('Other'),
+ 'category' => gT('Other'),
'sortorder' => 152,
'inputtype' => 'singleselect',
'options' => array(
- 0 => $clang->gT('No'),
- 1 => $clang->gT('Yes')
+ 0 => gT('No'),
+ 1 => gT('Yes')
),
'default' => 0,
- 'help' => $clang->gT('Show grand total for either columns or rows'),
- 'caption' => $clang->gT('Show grand total')
+ 'help' => gT('Show grand total for either columns or rows'),
+ 'caption' => gT('Show grand total')
);
$qattributes["input_boxes"]=array(
"types"=>":",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT("Present as text input boxes instead of dropdown lists"),
- "caption"=>$clang->gT("Text inputs"));
+ "help"=>gT("Present as text input boxes instead of dropdown lists"),
+ "caption"=>gT("Text inputs"));
$qattributes["other_comment_mandatory"]=array(
"types"=>"PLW!Z",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT("Make the 'Other:' comment field mandatory when the 'Other:' option is active"),
- "caption"=>$clang->gT("'Other:' comment mandatory"));
+ "help"=>gT("Make the 'Other:' comment field mandatory when the 'Other:' option is active"),
+ "caption"=>gT("'Other:' comment mandatory"));
$qattributes["other_numbers_only"]=array(
"types"=>"LMP",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT("Allow only numerical input for 'Other' text"),
- "caption"=>$clang->gT("Numbers only for 'Other'"));
+ "help"=>gT("Allow only numerical input for 'Other' text"),
+ "caption"=>gT("Numbers only for 'Other'"));
$qattributes["other_replace_text"]=array(
"types"=>"LMPWZ!",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'text',
'i18n'=>true,
- "help"=>$clang->gT("Replaces the label of the 'Other:' answer option with a custom text"),
- "caption"=>$clang->gT("Label for 'Other:' option"));
+ "help"=>gT("Replaces the label of the 'Other:' answer option with a custom text"),
+ "caption"=>gT("Label for 'Other:' option"));
$qattributes["page_break"]=array(
"types"=>"15ABCDEFGHKLMNOPQRSTUWXYZ!:;|*",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Insert a page break before this question in printable view by setting this to Yes.'),
- "caption"=>$clang->gT('Insert page break in printable view'));
+ "help"=>gT('Insert a page break before this question in printable view by setting this to Yes.'),
+ "caption"=>gT('Insert page break in printable view'));
$qattributes["prefix"]=array(
"types"=>"KNQS",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>10,
'inputtype'=>'text',
'i18n'=>true,
- "help"=>$clang->gT('Add a prefix to the answer field'),
- "caption"=>$clang->gT('Answer prefix'));
+ "help"=>gT('Add a prefix to the answer field'),
+ "caption"=>gT('Answer prefix'));
$qattributes["printable_help"]=array(
"types"=>"15ABCDEFGHKLMNOPRWYZ!:*",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>201,
"inputtype"=>"text",
'i18n'=>true,
'default'=>"",
- "help"=>$clang->gT('In the printable version replace the relevance equation with this explanation text.'),
- "caption"=>$clang->gT("Relevance help for printable survey"));
-
+ "help"=>gT('In the printable version replace the relevance equation with this explanation text.'),
+ "caption"=>gT("Relevance help for printable survey"));
+
$qattributes["public_statistics"]=array(
"types"=>"15ABCEFGHKLMNOPRWYZ!:*",
- 'category'=>$clang->gT('Statistics'),
+ 'category'=>gT('Statistics'),
'sortorder'=>80,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Show statistics of this question in the public statistics page'),
- "caption"=>$clang->gT('Show in public statistics'));
+ "help"=>gT('Show statistics of this question in the public statistics page'),
+ "caption"=>gT('Show in public statistics'));
$qattributes["random_order"]=array(
"types"=>"!ABCEFHKLMOPQRWZ1:;",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('Off'),
- 1=>$clang->gT('Randomize on each page load')
- //,2=>$clang->gT('Randomize once on survey start') //Mdekker: commented out as code to handle this was removed in refactoring
+ 'options'=>array(0=>gT('Off'),
+ 1=>gT('Randomize on each page load')
+ //,2=>gT('Randomize once on survey start') //Mdekker: commented out as code to handle this was removed in refactoring
),
'default'=>0,
- "help"=>$clang->gT('Present subquestions/answer options in random order'),
- "caption"=>$clang->gT('Random order'));
+ "help"=>gT('Present subquestions/answer options in random order'),
+ "caption"=>gT('Random order'));
/*
$qattributes['relevance']=array(
'types'=>'15ABCDEFGHIKLMNOPQRSTUWXYZ!:;|*',
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>1,
'inputtype'=>'text',
'default'=>'1',
- 'help'=>$clang->gT('The relevance equation determines whether a question should be shown (if true) or hiddden and marked as Not Applicable (if false).'
+ 'help'=>gT('The relevance equation determines whether a question should be shown (if true) or hiddden and marked as Not Applicable (if false).'
. ' The relevance equation can be as complex as you like, using any combination of mathematical operators, nested parentheses,'
. ' any variable or token that has already been set, and any of more than 50 functions. It is parsed by the ExpressionManager.'),
- 'caption'=>$clang->gT('Relevance equation'));
+ 'caption'=>gT('Relevance equation'));
*/
$qattributes["showpopups"]=array(
"types"=>"R",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>110,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>1,
- "caption"=>$clang->gT('Show javascript alert'),
- "help"=>$clang->gT('Show an alert if answers exceeds the number of max answers'));
+ "caption"=>gT('Show javascript alert'),
+ "help"=>gT('Show an alert if answers exceeds the number of max answers'));
$qattributes["samechoiceheight"]=array(
"types"=>"R",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>120,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>1,
- "caption"=>$clang->gT('Same height for all answer options'),
- "help"=>$clang->gT('Force each answer option to have the same height'));
+ "caption"=>gT('Same height for all answer options'),
+ "help"=>gT('Force each answer option to have the same height'));
$qattributes["samelistheight"]=array(
"types"=>"R",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>121,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>1,
- "caption"=>$clang->gT('Same height for lists'),
- "help"=>$clang->gT('Force the choice list and the rank list to have the same height'));
+ "caption"=>gT('Same height for lists'),
+ "help"=>gT('Force the choice list and the rank list to have the same height'));
$qattributes["parent_order"]=array(
"types"=>":",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'text',
- "caption"=>$clang->gT('Get order from previous question'),
- "help"=>$clang->gT('Enter question ID to get subquestion order from a previous question'));
+ "caption"=>gT('Get order from previous question'),
+ "help"=>gT('Enter question ID to get subquestion order from a previous question'));
$qattributes["slider_layout"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>1,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Use slider layout'),
- "caption"=>$clang->gT('Use slider layout'));
+ "help"=>gT('Use slider layout'),
+ "caption"=>gT('Use slider layout'));
$qattributes["slider_min"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>10,
'inputtype'=>'text',
- "help"=>$clang->gT('Slider minimum value'),
- "caption"=>$clang->gT('Slider minimum value'));
+ "help"=>gT('Slider minimum value'),
+ "caption"=>gT('Slider minimum value'));
$qattributes["slider_max"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>11,
'inputtype'=>'text',
- "help"=>$clang->gT('Slider maximum value'),
- "caption"=>$clang->gT('Slider maximum value'));
+ "help"=>gT('Slider maximum value'),
+ "caption"=>gT('Slider maximum value'));
$qattributes["slider_accuracy"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>30,
'inputtype'=>'text',
- "help"=>$clang->gT('Slider accuracy'),
- "caption"=>$clang->gT('Slider accuracy'));
+ "help"=>gT('Slider accuracy'),
+ "caption"=>gT('Slider accuracy'));
$qattributes["slider_default"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>50,
'inputtype'=>'text',
- "help"=>$clang->gT('Slider start as this value (this will set the initial value).'),
- "caption"=>$clang->gT('Slider initial value'));
+ "help"=>gT('Slider start as this value (this will set the initial value).'),
+ "caption"=>gT('Slider initial value'));
$qattributes["slider_middlestart"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>40,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('The handle is displayed at the middle of the slider except if Slider initial value is set (this will not set the initial value).'),
- "caption"=>$clang->gT('Slider starts at the middle position'));
+ "help"=>gT('The handle is displayed at the middle of the slider except if Slider initial value is set (this will not set the initial value).'),
+ "caption"=>gT('Slider starts at the middle position'));
$qattributes["slider_rating"]=array(
"types"=>"5",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>90,
'inputtype'=>'singleselect',
'options'=>array(
- 0=>$clang->gT('No'),
- 1=>$clang->gT('Yes - stars'),
- 2=>$clang->gT('Yes - slider with emoticon'),
+ 0=>gT('No'),
+ 1=>gT('Yes - stars'),
+ 2=>gT('Yes - slider with emoticon'),
),
'default'=>0,
- "help"=>$clang->gT('Use slider layout'),
- "caption"=>$clang->gT('Use slider layout'));
+ "help"=>gT('Use slider layout'),
+ "caption"=>gT('Use slider layout'));
$qattributes["slider_reset"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>50,
'inputtype'=>'singleselect',
'options'=>array(
- 0=>$clang->gT('No'),
- 1=>$clang->gT('Yes'),
+ 0=>gT('No'),
+ 1=>gT('Yes'),
),
'default'=>0,
- "help"=>$clang->gT('Add a button to reset the slider. If you choose an start value, it reset at start value, else empty the answer.'),
- "caption"=>$clang->gT('Allow reset the slider'));
+ "help"=>gT('Add a button to reset the slider. If you choose an start value, it reset at start value, else empty the answer.'),
+ "caption"=>gT('Allow reset the slider'));
$qattributes["slider_showminmax"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Display min and max value under the slider'),
- "caption"=>$clang->gT('Display slider min and max value'));
+ "help"=>gT('Display min and max value under the slider'),
+ "caption"=>gT('Display slider min and max value'));
$qattributes["slider_separator"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Slider'),
+ 'category'=>gT('Slider'),
'sortorder'=>110,
'inputtype'=>'text',
- "help"=>$clang->gT('Answer|Left-slider-text|Right-slider-text separator character'),
- "caption"=>$clang->gT('Slider left/right text separator'));
+ "help"=>gT('Answer|Left-slider-text|Right-slider-text separator character'),
+ "caption"=>gT('Slider left/right text separator'));
$qattributes["suffix"]=array(
"types"=>"KNQS",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>11,
'inputtype'=>'text',
'i18n'=>true,
- "help"=>$clang->gT('Add a suffix to the answer field'),
- "caption"=>$clang->gT('Answer suffix'));
+ "help"=>gT('Add a suffix to the answer field'),
+ "caption"=>gT('Answer suffix'));
$qattributes["text_input_width"]=array(
"types"=>"KNSTUQ;",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
'inputtype'=>'text',
- "help"=>$clang->gT('Width of text input box'),
- "caption"=>$clang->gT('Input box width'));
+ "help"=>gT('Width of text input box'),
+ "caption"=>gT('Input box width'));
$qattributes["use_dropdown"]=array(
"types"=>"1FO",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>112,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT('Present dropdown control(s) instead of list of radio buttons'),
- "caption"=>$clang->gT('Use dropdown presentation'));
+ "help"=>gT('Present dropdown control(s) instead of list of radio buttons'),
+ "caption"=>gT('Use dropdown presentation'));
$qattributes["dropdown_size"]=array(
"types"=>"!", // TODO add these later? "1F",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>200,
'inputtype'=>'text',
'default'=>0,
- "help"=>$clang->gT('For list dropdown boxes, show up to this many rows'),
- "caption"=>$clang->gT('Height of dropdown'));
+ "help"=>gT('For list dropdown boxes, show up to this many rows'),
+ "caption"=>gT('Height of dropdown'));
$qattributes["dropdown_prefix"]=array(
"types"=>"!", // TODO add these later? "1F",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>201,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('None'),
- 1=>$clang->gT('Order - like 3)'),
+ 'options'=>array(0=>gT('None'),
+ 1=>gT('Order - like 3)'),
),
'default'=>0,
- "help"=>$clang->gT('Accelerator keys for list items'),
- "caption"=>$clang->gT('Prefix for list items'));
+ "help"=>gT('Accelerator keys for list items'),
+ "caption"=>gT('Prefix for list items'));
$qattributes["scale_export"]=array(
"types"=>"CEFGHLMOPWYZ1!:*",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>100,
'inputtype'=>'singleselect',
- 'options'=>array(0=>$clang->gT('Default'),
- 1=>$clang->gT('Nominal'),
- 2=>$clang->gT('Ordinal'),
- 3=>$clang->gT('Scale')),
+ 'options'=>array(0=>gT('Default'),
+ 1=>gT('Nominal'),
+ 2=>gT('Ordinal'),
+ 3=>gT('Scale')),
'default'=>0,
- "help"=>$clang->gT("Set a specific SPSS export scale type for this question"),
- "caption"=>$clang->gT('SPSS export scale type'));
+ "help"=>gT("Set a specific SPSS export scale type for this question"),
+ "caption"=>gT('SPSS export scale type'));
$qattributes["choice_title"]=array(
"types"=>"R",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>200,
"inputtype"=>"text",
'i18n'=>true,
'default'=>"",
- "help"=>sprintf($clang->gT("Replace choice header (default: \"%s\")",'js'),$clang->gT("Your Choices")),
- "caption"=>$clang->gT("Choice header"));
+ "help"=>sprintf(gT("Replace choice header (default: \"%s\")",'js'),gT("Your Choices")),
+ "caption"=>gT("Choice header"));
$qattributes["rank_title"]=array(
"types"=>"R",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>201,
"inputtype"=>"text",
'i18n'=>true,
'default'=>"",
- "help"=>sprintf($clang->gT("Replace rank header (default: \"%s\")",'js'),$clang->gT("Your Ranking")),
- "caption"=>$clang->gT("Rank header"));
+ "help"=>sprintf(gT("Replace rank header (default: \"%s\")",'js'),gT("Your Ranking")),
+ "caption"=>gT("Rank header"));
//Timer attributes
$qattributes["time_limit"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>90,
"inputtype"=>"integer",
- "help"=>$clang->gT("Limit time to answer question (in seconds)"),
- "caption"=>$clang->gT("Time limit"));
+ "help"=>gT("Limit time to answer question (in seconds)"),
+ "caption"=>gT("Time limit"));
$qattributes["time_limit_action"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>92,
'inputtype'=>'singleselect',
- 'options'=>array(1=>$clang->gT('Warn and move on'),
- 2=>$clang->gT('Move on without warning'),
- 3=>$clang->gT('Disable only')),
+ 'options'=>array(1=>gT('Warn and move on'),
+ 2=>gT('Move on without warning'),
+ 3=>gT('Disable only')),
"default" => 1,
- "help"=>$clang->gT("Action to perform when time limit is up"),
- "caption"=>$clang->gT("Time limit action"));
+ "help"=>gT("Action to perform when time limit is up"),
+ "caption"=>gT("Time limit action"));
$qattributes["time_limit_disable_next"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>94,
"inputtype"=>"singleselect",
'default'=>0,
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
- "help"=>$clang->gT("Disable the next button until time limit expires"),
- "caption"=>$clang->gT("Time limit disable next"));
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
+ "help"=>gT("Disable the next button until time limit expires"),
+ "caption"=>gT("Time limit disable next"));
$qattributes["time_limit_disable_prev"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>96,
"inputtype"=>"singleselect",
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>0,
- "help"=>$clang->gT("Disable the prev button until the time limit expires"),
- "caption"=>$clang->gT("Time limit disable prev"));
+ "help"=>gT("Disable the prev button until the time limit expires"),
+ "caption"=>gT("Time limit disable prev"));
$qattributes["time_limit_countdown_message"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>98,
"inputtype"=>"textarea",
'i18n'=>true,
- "help"=>$clang->gT("The text message that displays in the countdown timer during the countdown"),
- "caption"=>$clang->gT("Time limit countdown message"));
+ "help"=>gT("The text message that displays in the countdown timer during the countdown"),
+ "caption"=>gT("Time limit countdown message"));
$qattributes["time_limit_timer_style"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>100,
"inputtype"=>"textarea",
- "help"=>$clang->gT("CSS Style for the message that displays in the countdown timer during the countdown"),
- "caption"=>$clang->gT("Time limit timer CSS style"));
+ "help"=>gT("CSS Style for the message that displays in the countdown timer during the countdown"),
+ "caption"=>gT("Time limit timer CSS style"));
$qattributes["time_limit_message_delay"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>102,
"inputtype"=>"integer",
- "help"=>$clang->gT("Display the 'time limit expiry message' for this many seconds before performing the 'time limit action' (defaults to 1 second if left blank)"),
- "caption"=>$clang->gT("Time limit expiry message display time"));
+ "help"=>gT("Display the 'time limit expiry message' for this many seconds before performing the 'time limit action' (defaults to 1 second if left blank)"),
+ "caption"=>gT("Time limit expiry message display time"));
$qattributes["time_limit_message"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>104,
"inputtype"=>"textarea",
'i18n'=>true,
- "help"=>$clang->gT("The message to display when the time limit has expired (a default message will display if this setting is left blank)"),
- "caption"=>$clang->gT("Time limit expiry message"));
+ "help"=>gT("The message to display when the time limit has expired (a default message will display if this setting is left blank)"),
+ "caption"=>gT("Time limit expiry message"));
$qattributes["time_limit_message_style"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>106,
"inputtype"=>"textarea",
- "help"=>$clang->gT("CSS style for the 'time limit expiry message'"),
- "caption"=>$clang->gT("Time limit message CSS style"));
+ "help"=>gT("CSS style for the 'time limit expiry message'"),
+ "caption"=>gT("Time limit message CSS style"));
$qattributes["time_limit_warning"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>108,
"inputtype"=>"integer",
- "help"=>$clang->gT("Display a 'time limit warning' when there are this many seconds remaining in the countdown (warning will not display if left blank)"),
- "caption"=>$clang->gT("1st time limit warning message timer"));
+ "help"=>gT("Display a 'time limit warning' when there are this many seconds remaining in the countdown (warning will not display if left blank)"),
+ "caption"=>gT("1st time limit warning message timer"));
$qattributes["time_limit_warning_display_time"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>110,
"inputtype"=>"integer",
- "help"=>$clang->gT("The 'time limit warning' will stay visible for this many seconds (will not turn off if this setting is left blank)"),
- "caption"=>$clang->gT("1st time limit warning message display time"));
+ "help"=>gT("The 'time limit warning' will stay visible for this many seconds (will not turn off if this setting is left blank)"),
+ "caption"=>gT("1st time limit warning message display time"));
$qattributes["time_limit_warning_message"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>112,
"inputtype"=>"textarea",
'i18n'=>true,
- "help"=>$clang->gT("The message to display as a 'time limit warning' (a default warning will display if this is left blank)"),
- "caption"=>$clang->gT("1st time limit warning message"));
+ "help"=>gT("The message to display as a 'time limit warning' (a default warning will display if this is left blank)"),
+ "caption"=>gT("1st time limit warning message"));
$qattributes["time_limit_warning_style"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>114,
"inputtype"=>"textarea",
- "help"=>$clang->gT("CSS style used when the 'time limit warning' message is displayed"),
- "caption"=>$clang->gT("1st time limit warning CSS style"));
+ "help"=>gT("CSS style used when the 'time limit warning' message is displayed"),
+ "caption"=>gT("1st time limit warning CSS style"));
$qattributes["time_limit_warning_2"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>116,
"inputtype"=>"integer",
- "help"=>$clang->gT("Display the 2nd 'time limit warning' when there are this many seconds remaining in the countdown (warning will not display if left blank)"),
- "caption"=>$clang->gT("2nd time limit warning message timer"));
+ "help"=>gT("Display the 2nd 'time limit warning' when there are this many seconds remaining in the countdown (warning will not display if left blank)"),
+ "caption"=>gT("2nd time limit warning message timer"));
$qattributes["time_limit_warning_2_display_time"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>118,
"inputtype"=>"integer",
- "help"=>$clang->gT("The 2nd 'time limit warning' will stay visible for this many seconds (will not turn off if this setting is left blank)"),
- "caption"=>$clang->gT("2nd time limit warning message display time"));
+ "help"=>gT("The 2nd 'time limit warning' will stay visible for this many seconds (will not turn off if this setting is left blank)"),
+ "caption"=>gT("2nd time limit warning message display time"));
$qattributes["time_limit_warning_2_message"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>120,
"inputtype"=>"textarea",
'i18n'=>true,
- "help"=>$clang->gT("The 2nd message to display as a 'time limit warning' (a default warning will display if this is left blank)"),
- "caption"=>$clang->gT("2nd time limit warning message"));
+ "help"=>gT("The 2nd message to display as a 'time limit warning' (a default warning will display if this is left blank)"),
+ "caption"=>gT("2nd time limit warning message"));
$qattributes["time_limit_warning_2_style"]=array(
"types"=>"STUXL!",
- 'category'=>$clang->gT('Timer'),
+ 'category'=>gT('Timer'),
'sortorder'=>122,
"inputtype"=>"textarea",
- "help"=>$clang->gT("CSS style used when the 2nd 'time limit warning' message is displayed"),
- "caption"=>$clang->gT("2nd time limit warning CSS style"));
+ "help"=>gT("CSS style used when the 2nd 'time limit warning' message is displayed"),
+ "caption"=>gT("2nd time limit warning CSS style"));
$qattributes["date_format"]=array(
"types"=>"D",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
"inputtype"=>"text",
- "help"=>$clang->gT("Specify a custom date/time format (the d/dd m/mm yy/yyyy H/HH M/MM formats and \"-./: \" characters are allowed for day/month/year/hour/minutes without or with leading zero respectively. Defaults to survey's date format"),
- "caption"=>$clang->gT("Date/Time format"));
+ "help"=>gT("Specify a custom date/time format (the d/dd m/mm yy/yyyy H/HH M/MM formats and \"-./: \" characters are allowed for day/month/year/hour/minutes without or with leading zero respectively. Defaults to survey's date format"),
+ "caption"=>gT("Date/Time format"));
$qattributes["dropdown_dates_minute_step"]=array(
"types"=>"D",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
"inputtype"=>"integer",
'default'=>1,
- "help"=>$clang->gT("Minute step interval when using select boxes"),
- "caption"=>$clang->gT("Minute step interval"));
+ "help"=>gT("Minute step interval when using select boxes"),
+ "caption"=>gT("Minute step interval"));
$qattributes["dropdown_dates_month_style"]=array(
"types"=>"D",
- 'category'=>$clang->gT('Display'),
+ 'category'=>gT('Display'),
'sortorder'=>100,
"inputtype"=>"singleselect",
- 'options'=>array(0=>$clang->gT('Short names'),
- 1=>$clang->gT('Full names'),
- 2=>$clang->gT('Numbers')),
+ 'options'=>array(0=>gT('Short names'),
+ 1=>gT('Full names'),
+ 2=>gT('Numbers')),
'default'=>0,
- "help"=>$clang->gT("Change the display style of the month when using select boxes"),
- "caption"=>$clang->gT("Month display style"));
+ "help"=>gT("Change the display style of the month when using select boxes"),
+ "caption"=>gT("Month display style"));
$qattributes["show_title"]=array(
"types"=>"|",
- 'category'=>$clang->gT('File metadata'),
+ 'category'=>gT('File metadata'),
'sortorder'=>124,
"inputtype"=>"singleselect",
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>1,
- "help"=>$clang->gT("Is the participant required to give a title to the uploaded file?"),
- "caption"=>$clang->gT("Show title"));
+ "help"=>gT("Is the participant required to give a title to the uploaded file?"),
+ "caption"=>gT("Show title"));
$qattributes["show_comment"]=array(
"types"=>"|",
- 'category'=>$clang->gT('File metadata'),
+ 'category'=>gT('File metadata'),
'sortorder'=>126,
"inputtype"=>"singleselect",
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>1,
- "help"=>$clang->gT("Is the participant required to give a comment to the uploaded file?"),
- "caption"=>$clang->gT("Show comment"));
+ "help"=>gT("Is the participant required to give a comment to the uploaded file?"),
+ "caption"=>gT("Show comment"));
$qattributes["max_filesize"]=array(
"types"=>"|",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>128,
"inputtype"=>"integer",
'default'=>10240,
- "help"=>$clang->gT("The participant cannot upload a single file larger than this size"),
- "caption"=>$clang->gT("Maximum file size allowed (in KB)"));
+ "help"=>gT("The participant cannot upload a single file larger than this size"),
+ "caption"=>gT("Maximum file size allowed (in KB)"));
$qattributes["max_num_of_files"]=array(
"types"=>"|",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>130,
"inputtype"=>"text",
'default'=>'1',
- "help"=>$clang->gT("Maximum number of files that the participant can upload for this question"),
- "caption"=>$clang->gT("Max number of files"));
+ "help"=>gT("Maximum number of files that the participant can upload for this question"),
+ "caption"=>gT("Max number of files"));
$qattributes["min_num_of_files"]=array(
"types"=>"|",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>132,
"inputtype"=>"text",
'default'=>'0',
- "help"=>$clang->gT("Minimum number of files that the participant must upload for this question"),
- "caption"=>$clang->gT("Min number of files"));
+ "help"=>gT("Minimum number of files that the participant must upload for this question"),
+ "caption"=>gT("Min number of files"));
$qattributes["allowed_filetypes"]=array(
"types"=>"|",
- 'category'=>$clang->gT('Other'),
+ 'category'=>gT('Other'),
'sortorder'=>134,
"inputtype"=>"text",
'default'=>"png, gif, doc, odt",
- "help"=>$clang->gT("Allowed file types in comma separated format. e.g. pdf,doc,odt"),
- "caption"=>$clang->gT("Allowed file types"));
+ "help"=>gT("Allowed file types in comma separated format. e.g. pdf,doc,odt"),
+ "caption"=>gT("Allowed file types"));
$qattributes["random_group"]=array(
"types"=>"15ABCDEFGHIKLMNOPQRSTUWXYZ!:;|",
- 'category'=>$clang->gT('Logic'),
+ 'category'=>gT('Logic'),
'sortorder'=>180,
'inputtype'=>'text',
- "help"=>$clang->gT("Place questions into a specified randomization group, all questions included in the specified group will appear in a random order"),
- "caption"=>$clang->gT("Randomization group name"));
+ "help"=>gT("Place questions into a specified randomization group, all questions included in the specified group will appear in a random order"),
+ "caption"=>gT("Randomization group name"));
// This is added to support historical behavior. Early versions of 1.92 used a value of "No", so if there was a min_sum_value or equals_sum_value, the question was not valid
// unless those criteria were met. In later releases of 1.92, the default was changed so that missing values were allowed even if those attributes were set
@@ -4236,14 +4281,14 @@ function questionAttributes($returnByName=false)
// Existing surveys will use the old behavior, but if the author edits the question, the default will be the new behavior.
$qattributes["value_range_allows_missing"]=array(
"types"=>"K",
- 'category'=>$clang->gT('Input'),
+ 'category'=>gT('Input'),
'sortorder'=>100,
"inputtype"=>"singleselect",
- 'options'=>array(0=>$clang->gT('No'),
- 1=>$clang->gT('Yes')),
+ 'options'=>array(0=>gT('No'),
+ 1=>gT('Yes')),
'default'=>1,
- "help"=>$clang->gT("Is no answer (missing) allowed when either 'Equals sum value' or 'Minimum sum value' are set?"),
- "caption"=>$clang->gT("Value range allows missing"));
+ "help"=>gT("Is no answer (missing) allowed when either 'Equals sum value' or 'Minimum sum value' are set?"),
+ "caption"=>gT("Value range allows missing"));
}
//This builds a more useful array (don't modify)
if ($returnByName==false)
@@ -4387,7 +4432,7 @@ function SendEmailMessage($body, $subject, $to, $from, $sitename, $ishtml=false,
}
if (Yii::app()->getConfig('demoMode'))
{
- $maildebug=$clang->gT('Email was not sent because demo-mode is activated.');
+ $maildebug=gT('Email was not sent because demo-mode is activated.');
$maildebugbody='';
return false;
}
@@ -4507,7 +4552,7 @@ function SendEmailMessage($body, $subject, $to, $from, $sitename, $ishtml=false,
{
$mail->AddAttachment($attachment[0], $attachment[1]);
}
- else
+ else
{ // Or a string with the filename.
$mail->AddAttachment($attachment);
}
@@ -5404,52 +5449,52 @@ function getTokenFieldsAndNames($surveyid, $bOnlyAttributes = false)
$clang = Yii::app()->lang;
$aBasicTokenFields=array('firstname'=>array(
- 'description'=>$clang->gT('First name'),
+ 'description'=>gT('First name'),
'mandatory'=>'N',
'showregister'=>'Y'
),
'lastname'=>array(
- 'description'=>$clang->gT('Last name'),
+ 'description'=>gT('Last name'),
'mandatory'=>'N',
'showregister'=>'Y'
),
'email'=>array(
- 'description'=>$clang->gT('Email address'),
+ 'description'=>gT('Email address'),
'mandatory'=>'N',
'showregister'=>'Y'
),
'emailstatus'=>array(
- 'description'=>$clang->gT("Email status"),
+ 'description'=>gT("Email status"),
'mandatory'=>'N',
'showregister'=>'N'
),
'token'=>array(
- 'description'=>$clang->gT('Token'),
+ 'description'=>gT('Token'),
'mandatory'=>'N',
'showregister'=>'Y'
),
'language'=>array(
- 'description'=>$clang->gT('Language code'),
+ 'description'=>gT('Language code'),
'mandatory'=>'N',
'showregister'=>'Y'
),
'sent'=>array(
- 'description'=>$clang->gT('Invitation sent date'),
+ 'description'=>gT('Invitation sent date'),
'mandatory'=>'N',
'showregister'=>'Y'
),
'remindersent'=>array(
- 'description'=>$clang->gT('Last reminder sent date'),
+ 'description'=>gT('Last reminder sent date'),
'mandatory'=>'N',
'showregister'=>'Y'
),
'remindercount'=>array(
- 'description'=>$clang->gT('Total numbers of sent reminders'),
+ 'description'=>gT('Total numbers of sent reminders'),
'mandatory'=>'N',
'showregister'=>'Y'
),
'usesleft'=>array(
- 'description'=>$clang->gT('Uses left'),
+ 'description'=>gT('Uses left'),
'mandatory'=>'N',
'showregister'=>'Y'
),
@@ -5655,10 +5700,10 @@ function updateCheck()
$aUpdateVersions=getUpdateInfo();
$clang = Yii::app()->lang;
- if (isset($aUpdateVersions['errorcode']))
+ if (isset($aUpdateVersions['errorcode']))
{
- Yii::app()->setFlashMessage(sprintf($clang->gT("Error when checking for new version: %s"),$aUpdateVersions['errorcode']).' '.$aUpdateVersions['errorhtml'],'error');
- $aUpdateVersions=array();
+ Yii::app()->setFlashMessage(sprintf(gT("Error when checking for new version: %s"),$aUpdateVersions['errorcode']).' '.$aUpdateVersions['errorhtml'],'error');
+ $aUpdateVersions=array();
}
if (count($aUpdateVersions) && trim(Yii::app()->getConfig('buildnumber'))!='')
{
@@ -5675,28 +5720,28 @@ function updateCheck()
case 'both':
// Show first available update
- $aUpdateVersion=reset($aUpdateVersions);
+ $aUpdateVersion=reset($aUpdateVersions);
break;
-
+
default:
// Never show a notification
$aUpdateVersions=array();
break;
}
}
-
+
setGlobalSetting('updateversions',json_encode($aUpdateVersions));
-
-
+
+
if (isset($aUpdateVersion)) {
setGlobalSetting('updateavailable',1);
setGlobalSetting('updatebuild',$aUpdateVersion['build']);
setGlobalSetting('updateversion',$aUpdateVersion['versionnumber']);
} else {
- setGlobalSetting('updateavailable',0);
+ setGlobalSetting('updateavailable',0);
$aUpdateVersions = array();
}
-
+
setGlobalSetting('updatelastcheck',date('Y-m-d H:i:s'));
return $aUpdateVersions;
}
@@ -6072,7 +6117,7 @@ function getQuotaInformation($surveyid,$language,$iQuotaID='all')
}
$result = Quota::model()->with(array('languagesettings' => array('condition' => "quotals_language='$language'")))->findAllByAttributes($aAttributes);
-
+
$quota_info = array();
$x=0;
@@ -6349,7 +6394,7 @@ function translateInsertansTags($newsid,$oldsid,$fieldnames)
/**
* Replaces EM variable codes in a current survey with a new one
-*
+*
* @param mixed $iSurveyID The survey ID
* @param mixed $aCodeMap The codemap array (old_code=>new_code)
*/
@@ -6362,7 +6407,7 @@ function replaceExpressionCodes ($iSurveyID, $aCodeMap)
foreach ($aCodeMap as $sOldCode=>$sNewCode)
{
// Don't search/replace old codes that are too short or were numeric (because they would not have been usable in EM expressions anyway)
- if (strlen($sOldCode)>1 && !is_numeric($sOldCode[0]))
+ if (strlen($sOldCode)>1 && !is_numeric($sOldCode[0]))
{
$sOldCode=preg_quote($sOldCode,'/');
$arQuestion->relevance=preg_replace("/\b{$sOldCode}/",$sNewCode,$arQuestion->relevance,-1,$iCount);
@@ -6409,101 +6454,101 @@ function accessDenied($action,$sid='')
if (Yii::app()->session['loginID'])
{
$ugid = Yii::app()->getConfig('ugid');
- $accesssummary = "".$clang->gT("Access denied!")." \n";
+ $accesssummary = "
".gT("Access denied!")." \n";
$scriptname = Yii::app()->getConfig('scriptname');
//$action=returnGlobal('action');
if ( $action == "dumpdb" )
{
- $accesssummary .= "
".$clang->gT("You are not allowed dump the database!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed dump the database!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "dumplabel")
{
- $accesssummary .= "
".$clang->gT("You are not allowed export a label set!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed export a label set!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "edituser")
{
- $accesssummary .= "
".$clang->gT("You are not allowed to change user data!");
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed to change user data!");
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "newsurvey")
{
- $accesssummary .= "
".$clang->gT("You are not allowed to create new surveys!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed to create new surveys!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "deletesurvey")
{
- $accesssummary .= "
".$clang->gT("You are not allowed to delete this survey!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed to delete this survey!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "addquestion")
{
- $accesssummary .= "
".$clang->gT("You are not allowed to add new questions for this survey!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed to add new questions for this survey!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "activate")
{
- $accesssummary .= "
".$clang->gT("You are not allowed to activate this survey!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed to activate this survey!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "deactivate")
{
- $accesssummary .= "
".$clang->gT("You are not allowed to stop this survey!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed to stop this survey!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "addgroup")
{
- $accesssummary .= "
".$clang->gT("You are not allowed to add a group to this survey!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed to add a group to this survey!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "ordergroups")
{
$link = Yii::app()->getController()->createUrl("/admin/survey/sa/view/surveyid/$sid");
- $accesssummary .= "
".$clang->gT("You are not allowed to order groups in this survey!")." ";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "
".gT("You are not allowed to order groups in this survey!")." ";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "editsurvey")
{
$link = Yii::app()->getController()->createUrl("/admin/survey/sa/view/surveyid/$sid");
- $accesssummary .= "
".$clang->gT("You are not allowed to edit this survey!")."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("You are not allowed to edit this survey!")."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "editgroup")
{
- $accesssummary .= "".$clang->gT("You are not allowed to edit groups in this survey!")."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("You are not allowed to edit groups in this survey!")."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "browse_response" || $action == "listcolumn" || $action == "vvexport" || $action == "vvimport")
{
- $accesssummary .= "".$clang->gT("You are not allowed to browse responses!")."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("You are not allowed to browse responses!")."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "assessment")
{
- $accesssummary .= "".$clang->gT("You are not allowed to set assessment rules!")."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("You are not allowed to set assessment rules!")."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "delusergroup")
{
- $accesssummary .= "".$clang->gT("You are not allowed to delete this group!")."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("You are not allowed to delete this group!")."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "importsurvey")
{
- $accesssummary .= "".$clang->gT("You are not allowed to import a survey!")."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("You are not allowed to import a survey!")."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "importgroup")
{
- $accesssummary .= "".$clang->gT("You are not allowed to import a group!")."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("You are not allowed to import a group!")."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "importquestion")
{
- $accesssummary .= "".$clang->gT("You are not allowed to to import a question!")."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("You are not allowed to to import a question!")."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "CSRFwarn") //won't be used.
{
@@ -6511,28 +6556,28 @@ function accessDenied($action,$sid='')
if (isset($sid)) {
$sURLID="?sid={$sid}";
}
- $accesssummary .= "".$clang->gT("Security alert")." : ".$clang->gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").' '.$clang->gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("Security alert")." : ".gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").' '.gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
elseif($action == "FakeGET")
{
- $accesssummary .= "".$clang->gT("Security alert")." : ".$clang->gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").' '.$clang->gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."
";
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("Security alert")." : ".gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").' '.gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."
";
+ $accesssummary .= "".gT("Continue")." \n";
}
else
{
- $accesssummary .= " ".$clang->gT("You are not allowed to perform this operation!")." \n";
+ $accesssummary .= " ".gT("You are not allowed to perform this operation!")." \n";
if(!empty($sid))
{
- $accesssummary .= "".gT("Continue")." \n";
}
elseif(!empty($ugid))
{
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("Continue")." \n";
}
else
{
- $accesssummary .= "".$clang->gT("Continue")." \n";
+ $accesssummary .= "".gT("Continue")." \n";
}
}
return $accesssummary;
@@ -7165,8 +7210,8 @@ function getUserGroupList($ugid=NULL,$outputformat='optionlist')
}
}
- if (!isset($svexist)) {$selecter = "".$clang->gT("Please choose...")." \n".$selecter;}
- //else {$selecter = "".$clang->gT("None")." \n".$selecter;}
+ if (!isset($svexist)) {$selecter = "".gT("Please choose...")." \n".$selecter;}
+ //else {$selecter = "".gT("None")." \n".$selecter;}
if ($outputformat == 'simplegidarray')
{
@@ -7202,7 +7247,7 @@ function getGroupUserList($ugid)
$surveyselecter .=" value='{$sv['uid']}'>{$sv['users_name']} {$sv['full_name']}\n";
}
}
- $surveyselecter = "".$clang->gT("Please choose...")." \n".$surveyselecter;
+ $surveyselecter = "".gT("Please choose...")." \n".$surveyselecter;
return $surveyselecter;
}
@@ -7275,7 +7320,7 @@ function modifyDatabase($sqlfile='', $sqlstring='')
catch(CDbException $e)
{
$command=htmlspecialchars($command);
- $modifyoutput .=" ".sprintf($clang->gT("SQL command failed: %s"),"".$command." "," ");
+ $modifyoutput .=" ".sprintf(gT("SQL command failed: %s"),"".$command." "," ");
$success = false;
}
@@ -7471,7 +7516,7 @@ function getDBTableUsage($surveyid){
$hard_limit = 1600;
$size_limit = 0;
}
- elseif ($arrCols['dbtype'] == 'mssql' || $arrCols['dbtype'] == 'dblib'){
+ elseif ($arrCols['dbtype'] == 'mssql' || $arrCols['dbtype'] == 'dblib'){
$hard_limit = 1024;
$size_limit = 0;
}
@@ -7567,7 +7612,7 @@ function getSurveyUserList($bIncludeOwner=true, $bIncludeSuperAdmins=true,$surve
if (!$bIncludeSuperAdmins)
{
// @todo: Adjust for new permission system - not urgent since it it just display
- // $sSurveyIDQuery.='and superadmin=0 ';
+ // $sSurveyIDQuery.='and superadmin=0 ';
}
$sSurveyIDQuery.= 'ORDER BY a.users_name';
$oSurveyIDResult = Yii::app()->db->createCommand($sSurveyIDQuery)->query(); //Checked
@@ -7590,8 +7635,8 @@ function getSurveyUserList($bIncludeOwner=true, $bIncludeSuperAdmins=true,$surve
$surveyselecter .=" value='{$sv['uid']}'>{$sv['users_name']} {$sv['full_name']}\n";
}
}
- if (!isset($svexist)) {$surveyselecter = "".$clang->gT("Please choose...")." \n".$surveyselecter;}
- else {$surveyselecter = "".$clang->gT("None")." \n".$surveyselecter;}
+ if (!isset($svexist)) {$surveyselecter = "".gT("Please choose...")." \n".$surveyselecter;}
+ else {$surveyselecter = "".gT("None")." \n".$surveyselecter;}
return $surveyselecter;
}
@@ -7630,8 +7675,8 @@ function getSurveyUserGroupList($outputformat='htmloptions',$surveyid)
}
}
- if (!isset($svexist)) {$surveyselecter = "".$clang->gT("Please choose...")." \n".$surveyselecter;}
- else {$surveyselecter = "".$clang->gT("None")." \n".$surveyselecter;}
+ if (!isset($svexist)) {$surveyselecter = "".gT("Please choose...")." \n".$surveyselecter;}
+ else {$surveyselecter = "".gT("None")." \n".$surveyselecter;}
if ($outputformat == 'simpleugidarray')
{
@@ -7694,50 +7739,50 @@ function json_decode_ls($jsonString)
* Return accepted codingsArray for importing files
*
* Used in vvimport
- * TODO : use in token and
+ * TODO : use in token and
* @return array
*/
function aEncodingsArray()
{
$clang = Yii::app()->lang;
return array(
- "armscii8" => $clang->gT("ARMSCII-8 Armenian"),
- "ascii" => $clang->gT("US ASCII"),
- "auto" => $clang->gT("Automatic"),
- "big5" => $clang->gT("Big5 Traditional Chinese"),
- "binary" => $clang->gT("Binary pseudo charset"),
- "cp1250" => $clang->gT("Windows Central European (Windows-1250)"),
- "cp1251" => $clang->gT("Windows Cyrillic (Windows-1251)"),
- "cp1256" => $clang->gT("Windows Arabic (Windows-1256)"),
- "cp1257" => $clang->gT("Windows Baltic (Windows-1257)"),
- "cp850" => $clang->gT("DOS West European (cp850)"),
- "cp852" => $clang->gT("DOS Central European (cp852)"),
- "cp866" => $clang->gT("DOS Cyrillic (cp866)"),
- "cp932" => $clang->gT("Windows-31J - SJIS for Windows Japanese (cp932)"),
- "dec8" => $clang->gT("DEC West European"),
- "eucjpms" => $clang->gT("UJIS for Windows Japanese"),
- "euckr" => $clang->gT("EUC-KR Korean"),
- "gb2312" => $clang->gT("GB2312 Simplified Chinese"),
- "gbk" => $clang->gT("GBK Simplified Chinese"),
- "geostd8" => $clang->gT("GEOSTD8 Georgian"),
- "greek" => $clang->gT("ISO 8859-7 Greek"),
- "hebrew" => $clang->gT("ISO 8859-8 Hebrew"),
- "hp8" => $clang->gT("HP West European"),
- "keybcs2" => $clang->gT("DOS Kamenicky Czech-Slovak (cp895)"),
- "koi8r" => $clang->gT("KOI8-R Relcom Russian"),
- "koi8u" => $clang->gT("KOI8-U Ukrainian"),
- "latin1" => $clang->gT("ISO 8859-1 West European (latin1)"),
- "latin2" => $clang->gT("ISO 8859-2 Central European (latin2)"),
- "latin5" => $clang->gT("ISO 8859-9 Turkish (latin5)"),
- "latin7" => $clang->gT("ISO 8859-13 Baltic (latin7)"),
- "macce" => $clang->gT("Mac Central European"),
- "macroman" => $clang->gT("Mac West European"),
- "sjis" => $clang->gT("Shift-JIS Japanese"),
- "swe7" => $clang->gT("7bit Swedish"),
- "tis620" => $clang->gT("TIS620 Thai"),
- "ucs2" => $clang->gT("UCS-2 Unicode"),
- "ujis" => $clang->gT("EUC-JP Japanese"),
- "utf8" => $clang->gT("UTF-8 Unicode"),
+ "armscii8" => gT("ARMSCII-8 Armenian"),
+ "ascii" => gT("US ASCII"),
+ "auto" => gT("Automatic"),
+ "big5" => gT("Big5 Traditional Chinese"),
+ "binary" => gT("Binary pseudo charset"),
+ "cp1250" => gT("Windows Central European (Windows-1250)"),
+ "cp1251" => gT("Windows Cyrillic (Windows-1251)"),
+ "cp1256" => gT("Windows Arabic (Windows-1256)"),
+ "cp1257" => gT("Windows Baltic (Windows-1257)"),
+ "cp850" => gT("DOS West European (cp850)"),
+ "cp852" => gT("DOS Central European (cp852)"),
+ "cp866" => gT("DOS Cyrillic (cp866)"),
+ "cp932" => gT("Windows-31J - SJIS for Windows Japanese (cp932)"),
+ "dec8" => gT("DEC West European"),
+ "eucjpms" => gT("UJIS for Windows Japanese"),
+ "euckr" => gT("EUC-KR Korean"),
+ "gb2312" => gT("GB2312 Simplified Chinese"),
+ "gbk" => gT("GBK Simplified Chinese"),
+ "geostd8" => gT("GEOSTD8 Georgian"),
+ "greek" => gT("ISO 8859-7 Greek"),
+ "hebrew" => gT("ISO 8859-8 Hebrew"),
+ "hp8" => gT("HP West European"),
+ "keybcs2" => gT("DOS Kamenicky Czech-Slovak (cp895)"),
+ "koi8r" => gT("KOI8-R Relcom Russian"),
+ "koi8u" => gT("KOI8-U Ukrainian"),
+ "latin1" => gT("ISO 8859-1 West European (latin1)"),
+ "latin2" => gT("ISO 8859-2 Central European (latin2)"),
+ "latin5" => gT("ISO 8859-9 Turkish (latin5)"),
+ "latin7" => gT("ISO 8859-13 Baltic (latin7)"),
+ "macce" => gT("Mac Central European"),
+ "macroman" => gT("Mac West European"),
+ "sjis" => gT("Shift-JIS Japanese"),
+ "swe7" => gT("7bit Swedish"),
+ "tis620" => gT("TIS620 Thai"),
+ "ucs2" => gT("UCS-2 Unicode"),
+ "ujis" => gT("EUC-JP Japanese"),
+ "utf8" => gT("UTF-8 Unicode"),
);
}
/**
@@ -7866,31 +7911,31 @@ function array_diff_assoc_recursive($array1, $array2) {
}
- function convertPHPSizeToBytes($sSize)
- {
- //This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
- $sSuffix = substr($sSize, -1);
- $iValue = substr($sSize, 0, -1);
- switch(strtoupper($sSuffix)){
- case 'P':
- $iValue *= 1024;
- case 'T':
- $iValue *= 1024;
- case 'G':
- $iValue *= 1024;
- case 'M':
- $iValue *= 1024;
- case 'K':
- $iValue *= 1024;
- break;
- }
- return $iValue;
- }
-
- function getMaximumFileUploadSize()
- {
- return min(convertPHPSizeToBytes(ini_get('post_max_size')), convertPHPSizeToBytes(ini_get('upload_max_filesize')));
- }
+ function convertPHPSizeToBytes($sSize)
+ {
+ //This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
+ $sSuffix = substr($sSize, -1);
+ $iValue = substr($sSize, 0, -1);
+ switch(strtoupper($sSuffix)){
+ case 'P':
+ $iValue *= 1024;
+ case 'T':
+ $iValue *= 1024;
+ case 'G':
+ $iValue *= 1024;
+ case 'M':
+ $iValue *= 1024;
+ case 'K':
+ $iValue *= 1024;
+ break;
+ }
+ return $iValue;
+ }
+
+ function getMaximumFileUploadSize()
+ {
+ return min(convertPHPSizeToBytes(ini_get('post_max_size')), convertPHPSizeToBytes(ini_get('upload_max_filesize')));
+ }
// Closing PHP tag intentionally omitted - yes, it is okay
diff --git a/application/helpers/export_helper.php b/application/helpers/export_helper.php
index 004b51021b5..6163fe0a7de 100644
--- a/application/helpers/export_helper.php
+++ b/application/helpers/export_helper.php
@@ -280,30 +280,30 @@ function SPSSGetValues ($field = array(), $qidattributes = null, $language ) {
}
} elseif ($field['LStype'] == 'M' && substr($field['code'],-5) != 'other' && $field['size'] > 0)
{
- $answers[] = array('code'=>1, 'value'=>$clang->gT('Yes'));
- $answers[] = array('code'=>0, 'value'=>$clang->gT('Not Selected'));
+ $answers[] = array('code'=>1, 'value'=>gT('Yes'));
+ $answers[] = array('code'=>0, 'value'=>gT('Not Selected'));
} elseif ($field['LStype'] == "P" && substr($field['code'],-5) != 'other' && substr($field['code'],-7) != 'comment')
{
- $answers[] = array('code'=>1, 'value'=>$clang->gT('Yes'));
- $answers[] = array('code'=>0, 'value'=>$clang->gT('Not Selected'));
+ $answers[] = array('code'=>1, 'value'=>gT('Yes'));
+ $answers[] = array('code'=>0, 'value'=>gT('Not Selected'));
} elseif ($field['LStype'] == "G" && $field['size'] > 0)
{
- $answers[] = array('code'=>1, 'value'=>$clang->gT('Female'));
- $answers[] = array('code'=>2, 'value'=>$clang->gT('Male'));
+ $answers[] = array('code'=>1, 'value'=>gT('Female'));
+ $answers[] = array('code'=>2, 'value'=>gT('Male'));
} elseif ($field['LStype'] == "Y" && $field['size'] > 0)
{
- $answers[] = array('code'=>1, 'value'=>$clang->gT('Yes'));
- $answers[] = array('code'=>2, 'value'=>$clang->gT('No'));
+ $answers[] = array('code'=>1, 'value'=>gT('Yes'));
+ $answers[] = array('code'=>2, 'value'=>gT('No'));
} elseif ($field['LStype'] == "C" && $field['size'] > 0)
{
- $answers[] = array('code'=>1, 'value'=>$clang->gT('Yes'));
- $answers[] = array('code'=>2, 'value'=>$clang->gT('No'));
- $answers[] = array('code'=>3, 'value'=>$clang->gT('Uncertain'));
+ $answers[] = array('code'=>1, 'value'=>gT('Yes'));
+ $answers[] = array('code'=>2, 'value'=>gT('No'));
+ $answers[] = array('code'=>3, 'value'=>gT('Uncertain'));
} elseif ($field['LStype'] == "E" && $field['size'] > 0)
{
- $answers[] = array('code'=>1, 'value'=>$clang->gT('Increase'));
- $answers[] = array('code'=>2, 'value'=>$clang->gT('Same'));
- $answers[] = array('code'=>3, 'value'=>$clang->gT('Decrease'));
+ $answers[] = array('code'=>1, 'value'=>gT('Increase'));
+ $answers[] = array('code'=>2, 'value'=>gT('Same'));
+ $answers[] = array('code'=>3, 'value'=>gT('Decrease'));
}
if (count($answers)>0) {
//check the max width of the answers
diff --git a/application/helpers/expressions/em_core_helper.php b/application/helpers/expressions/em_core_helper.php
index 3848a30bd62..6d411bc4b6d 100644
--- a/application/helpers/expressions/em_core_helper.php
+++ b/application/helpers/expressions/em_core_helper.php
@@ -1161,7 +1161,7 @@ public function GetOnPageJsVarsUsed()
}
return array_unique($jsNames);
}
-
+
/**
* Return the list of all of the JavaScript variables used by the most recent expression
* @return
@@ -2011,7 +2011,7 @@ private function RDP_RunFunction($funcNameToken,$params)
$minArgs = abs($numArgsAllowed[0] + 1); // so if value is -2, means that requires at least one argument
if ($argsPassed < $minArgs)
{
- $this->RDP_AddError(sprintf(ngT("Function must have at least %s argument","Function must have at least %s arguments",$minArgs), $minArgs), $funcNameToken);
+ $this->RDP_AddError(sprintf(Yii::t("Function must have at least %s argument|Function must have at least %s arguments",$minArgs), $minArgs), $funcNameToken);
return false;
}
if (!$this->RDP_onlyparse) {
@@ -2156,10 +2156,10 @@ private function RDP_SetVariableValue($op,$name,$value)
*/
public function asSplitStringOnExpressions($src)
{
-
+
$parts = preg_split($this->RDP_ExpressionRegex,$src,-1,(PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE));
-
-
+
+
$count = count($parts);
$tokens = array();
$inSQString=false;
@@ -2378,7 +2378,7 @@ private function RDP_StackPush(array $token)
/**
* Public call of RDP_Tokenize
- *
+ *
* @param string $sSource : the string to tokenize
* @param bool $bOnEdit : on edition, actually don't remove space
* @return array
diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php
index 35b9e8c0711..a2bbe23d1a1 100644
--- a/application/helpers/expressions/em_manager_helper.php
+++ b/application/helpers/expressions/em_manager_helper.php
@@ -1300,11 +1300,11 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
}
// individual subquestion relevance
- if ($hasSubqs & $type!='|' & $type!='!' & $type !='L')
+ if ($hasSubqs & $type!='|' & $type!='!' & $type !='L')
{
$subqs = $qinfo['subqs'];
$last_rowdivid = '--';
- foreach ($subqs as $sq)
+ foreach ($subqs as $sq)
{
if ($sq['rowdivid'] == $last_rowdivid)
{
@@ -1441,7 +1441,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
if ($hasSubqs) {
$subqs = $qinfo['subqs'];
$sq_equs=array();
-
+
foreach($subqs as $sq)
{
$sq_name = ($this->sgqaNaming)?$sq['rowdivid'].".NAOK":$sq['varName'].".NAOK";
@@ -1520,7 +1520,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
break;
}
}
-
+
// date_min
// Maximum date allowed in date question
if (isset($qattr['date_min']) && trim($qattr['date_min']) != '')
@@ -1536,13 +1536,13 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
{
case 'D': //DATE QUESTION TYPE
// date_min: Determine whether we have an expression, a full date (YYYY-MM-DD) or only a year(YYYY)
- if (trim($qattr['date_min'])!='')
+ if (trim($qattr['date_min'])!='')
{
$mindate=$qattr['date_min'];
if ((strlen($mindate)==4) && ($mindate>=1900) && ($mindate<=2099))
{
- // backward compatibility: if only a year is given, add month and day
- $date_min='\''.$mindate.'-01-01'.' 00:00\'';
+ // backward compatibility: if only a year is given, add month and day
+ $date_min='\''.$mindate.'-01-01'.' 00:00\'';
}
elseif (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/",$mindate))
{
@@ -1553,9 +1553,9 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
$date_min=$date_min.'.NAOK';
}
}
-
+
$sq_name = ($this->sgqaNaming)?$sq['rowdivid'].".NAOK":$sq['varName'].".NAOK";
-
+
if(($qinfo['mandatory']=='Y')){
$sq_name = '('. $sq_name . ' >= ' . $date_min . ')';
}else{
@@ -1610,13 +1610,13 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
{
case 'D': //DATE QUESTION TYPE
// date_max: Determine whether we have an expression, a full date (YYYY-MM-DD) or only a year(YYYY)
- if (trim($qattr['date_max'])!='')
+ if (trim($qattr['date_max'])!='')
{
$maxdate=$qattr['date_max'];
if ((strlen($maxdate)==4) && ($maxdate>=1900) && ($maxdate<=2099))
{
- // backward compatibility: if only a year is given, add month and day
- $date_max='\''.$maxdate.'-12-31 23:59'.'\'';
+ // backward compatibility: if only a year is given, add month and day
+ $date_max='\''.$maxdate.'-12-31 23:59'.'\'';
}
elseif (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/",$maxdate))
{
@@ -1627,9 +1627,9 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
$date_max=$date_max.'.NAOK';
}
}
-
+
$sq_name = ($this->sgqaNaming)?$sq['rowdivid'].".NAOK":$sq['varName'].".NAOK";
-
+
if(($qinfo['mandatory']=='Y')){
$sq_name = '(is_empty(' . $date_max . ') || ('. $sq_name . ' <= ' . $date_max . '))';
}else{
@@ -1929,7 +1929,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
}else{
$input_boxes="";
}
-
+
// min_answers
// Validation:= count(sq1,...,sqN) >= value (which could be an expression).
if (isset($qattr['min_answers']) && trim($qattr['min_answers']) != '' && trim($qattr['min_answers']) != '0')
@@ -2570,7 +2570,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
{
case 'K': //MULTI NUMERICAL QUESTION TYPE (Need a attribute, not set in 131014)
$subqValidSelector = $sq['jsVarName_on'];
- case 'N': //NUMERICAL QUESTION TYPE
+ case 'N': //NUMERICAL QUESTION TYPE
$sq_name = ($this->sgqaNaming)?$sq['rowdivid'].".NAOK":$sq['varName'].".NAOK";
if(($qinfo['mandatory']=='Y')){
$sq_eqn = 'is_int('.$sq_name.')';
@@ -3087,7 +3087,7 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
// Helptext is added in qanda_help.php
/* case 'D':
$qtips['default']=$this->gT("Please complete all parts of the date.");
- break;
+ break;
*/
default:
break;
@@ -4101,7 +4101,7 @@ private function setVariableAndTokenMappingsForExpressionManager($surveyid,$forc
'jsName'=>'',
'readWrite'=>'N',
);
-
+
$token = Token::model($surveyid)->findByToken($_SESSION[$this->sessid]['token']);
foreach ($token as $key => $val)
{
@@ -4440,7 +4440,7 @@ private function _ProcessSubQRelevance($eqn,$questionNum=NULL,$rowdivid=NULL, $t
{
$result=true;
$relevanceJS=1;
- }
+ }
else
{
$relevanceJS = $this->em->GetJavaScriptEquivalentOfExpression();
@@ -5228,8 +5228,8 @@ private function _UpdateValuesInDatabase($updatedValues, $finished=false)
$sdata = array_filter($sdata);
SurveyDynamic::sid($this->sid);
$oSurvey = new SurveyDynamic;
-
- $iNewID = $oSurvey->insertRecords($sdata);
+
+ $iNewID = $oSurvey->insertRecords($sdata);
if ($iNewID) // Checked
{
$srid = $iNewID;
@@ -5243,7 +5243,7 @@ private function _UpdateValuesInDatabase($updatedValues, $finished=false)
if ($this->surveyOptions['savetimings']) {
SurveyTimingDynamic::sid($this->sid);
$oSurveyTimings = new SurveyTimingDynamic;
-
+
$tdata = array(
'id'=>$srid,
'interviewtime'=>0
@@ -8010,17 +8010,9 @@ private function gT($string, $escapemode = 'html')
}
- private function ngT($single, $plural, $number, $escapemode = 'html')
+ private function ngT($sText, $number, $escapemode = 'html')
{
- // eventually replace this with i8n
- if (isset(Yii::app()->lang))
- {
- return Yii::app()->lang->ngT($single, $plural, $number, $escapemode);
- }
- else
- {
- return $string;
- }
+ return Yii::app()->lang->ngT($sText, $number, $escapemode);
}
/**
@@ -9383,7 +9375,7 @@ static public function ShowSurveyLogicFile($sid, $gid=NULL, $qid=NULL,$LEMdebugL
//////
// FINALLY, SHOW THE QUESTION ROW(S), COLOR-CODING QUESTIONS THAT CONTAIN ERRORS
//////
- $errclass = ($errorCount > 0) ? "class='LEMerror' title='" . sprintf($LEM->ngT("This question has at least %s error.","This question has at least %s errors.",$errorCount), $errorCount) . "'" : '';
+ $errclass = ($errorCount > 0) ? "class='LEMerror' title='" . sprintf($LEM->ngT("This question has at least %s error.|This question has at least %s errors.",$errorCount), $errorCount) . "'" : '';
$questionRow = ""
. "Q-" . $q['info']['qseq'] . " "
@@ -9422,19 +9414,19 @@ static public function ShowSurveyLogicFile($sid, $gid=NULL, $qid=NULL,$LEMdebugL
}
if (count($allErrors) > 0) {
- $out = "". sprintf($LEM->ngT("%s question contains errors that need to be corrected","%s questions contain errors that need to be corrected",count($allErrors)), count($allErrors)) . "
\n" . $out;
+ $out = "". sprintf($LEM->ngT("%s question contains errors that need to be corrected.|%s questions contain errors that need to be corrected.",count($allErrors)), count($allErrors)) . "
\n" . $out;
}
else {
switch ($surveyMode)
{
case 'survey':
- $message = $LEM->gT('No syntax errors detected in this survey');
+ $message = $LEM->gT('No syntax errors detected in this survey.');
break;
case 'group':
- $message = $LEM->gT('This group, by itself, does not contain any syntax errors');
+ $message = $LEM->gT('This group, by itself, does not contain any syntax errors.');
break;
case 'question':
- $message = $LEM->gT('This question, by itself, does not contain any syntax errors');
+ $message = $LEM->gT('This question, by itself, does not contain any syntax errors.');
break;
}
$out = "$message
\n" . $out."";
@@ -9787,7 +9779,7 @@ static public function &TSVSurveyExport($sid)
$SQrelevance = (($LEM->knownVars[$sgqa]['SQrelevance'] == '') ? 1 : $LEM->knownVars[$sgqa]['SQrelevance']);
$LEM->em->ProcessBooleanExpression($SQrelevance, $gseq, $q['info']['qseq']);
$SQrelevance = trim(strip_tags($LEM->em->GetPrettyPrintString()));
-
+
switch ($q['info']['type'])
{
case '1':
@@ -9934,7 +9926,7 @@ public function loadTokenInformation($iSurveyId, $sToken = null, $bAnonymize = f
$token = Token::model($iSurveyId)->findByAttributes(array(
'token' => $sToken
));
-
+
$this->knownVars['TOKEN:TOKEN'] = array(
'code'=> $sToken,
'jsName_on'=>'',
diff --git a/application/helpers/qanda_helper.php b/application/helpers/qanda_helper.php
index 58346d8610c..f8fd7a2c0c8 100644
--- a/application/helpers/qanda_helper.php
+++ b/application/helpers/qanda_helper.php
@@ -61,11 +61,11 @@ function setNoAnswerMode($thissurvey)
elseif ($thissurvey['shownoanswer'] == 'N')
{
define('SHOW_NO_ANSWER', 0);
- }
+ }
else
{
define('SHOW_NO_ANSWER', 1);
- }
+ }
}
/**
@@ -132,8 +132,8 @@ function retrieveAnswers($ia)
case 'D': //DATE
$values = do_date($ia);
// if a drop box style date was answered incompletely (dropbox), print an error/help message
- if (($_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['step'] != $_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['maxstep']) ||
- ($_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['step'] == $_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['prevstep']))
+ if (($_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['step'] != $_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['maxstep']) ||
+ ($_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['step'] == $_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['prevstep']))
{
if (isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['qattribute_answer'.$ia[1]]))
$question_text['help'] = ''.$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['qattribute_answer'.$ia[1]].' ';
@@ -144,8 +144,8 @@ function retrieveAnswers($ia)
if ($aQuestionAttributes['hide_tip']==0)
{
$qtitle .= " \n"
- . $clang->gT('Choose one of the following answers').' ';
- $question_text['help'] = $clang->gT('Choose one of the following answers');
+ . gT('Choose one of the following answers').'';
+ $question_text['help'] = gT('Choose one of the following answers');
}
break;
case '!': //List - dropdown
@@ -153,8 +153,8 @@ function retrieveAnswers($ia)
if ($aQuestionAttributes['hide_tip']==0)
{
$qtitle .= " \n"
- . $clang->gT('Choose one of the following answers').' ';
- $question_text['help'] = $clang->gT('Choose one of the following answers');
+ . gT('Choose one of the following answers').'';
+ $question_text['help'] = gT('Choose one of the following answers');
}
break;
case 'O': //LIST WITH COMMENT drop-down/radio-button list + textarea
@@ -162,15 +162,15 @@ function retrieveAnswers($ia)
if (count($values[1]) > 1 && $aQuestionAttributes['hide_tip']==0)
{
$qtitle .= " \n"
- . $clang->gT('Choose one of the following answers').' ';
- $question_text['help'] = $clang->gT('Choose one of the following answers');
+ . gT('Choose one of the following answers').'';
+ $question_text['help'] = gT('Choose one of the following answers');
}
break;
case 'R': //RANKING STYLE
$values=do_ranking($ia);
if (count($values[1]) > 1 && $aQuestionAttributes['hide_tip']==0)
{
- $question_text['help'] = $clang->gT("Double-click or drag-and-drop items in the left list to move them to the right - your highest ranking item should be on the top right, moving through to your lowest ranking item.");
+ $question_text['help'] = gT("Double-click or drag-and-drop items in the left list to move them to the right - your highest ranking item should be on the top right, moving through to your lowest ranking item.");
}
break;
case 'M': //Multiple choice checkbox
@@ -182,28 +182,9 @@ function retrieveAnswers($ia)
if (!($maxansw || $minansw))
{
$qtitle .= " \n"
- . $clang->gT('Check any that apply').' ';
- $question_text['help'] = $clang->gT('Check any that apply');
+ . gT('Check any that apply').'';
+ $question_text['help'] = gT('Check any that apply');
}
- // else
- // {
- // if ($maxansw && $minansw)
- // {
- // $qtitle .= " \n"
- // . sprintf($clang->gT("Check between %d and %d answers"), $minansw, $maxansw)." ";
- // $question_text['help'] = sprintf($clang->gT("Check between %d and %d answers"), $minansw, $maxansw);
- // } elseif ($maxansw)
- // {
- // $qtitle .= " \n"
- // . sprintf($clang->gT("Check at most %d answers"), $maxansw)." ";
- // $question_text['help'] = sprintf($clang->gT("Check at most %d answers"), $maxansw);
- // } else
- // {
- // $qtitle .= " \n"
- // . sprintf($clang->ngT("Check at least %d answer","Check at least %d answers",$minansw),$minansw)." ";
- // $question_text['help'] = sprintf($clang->ngT("Check at least %d answer","Check at least %d answers",$minansw),$minansw);
- // }
- // }
}
break;
@@ -212,8 +193,8 @@ function retrieveAnswers($ia)
if (count($values[1]) > 1)
{
$qtitle .= " \n"
- . $clang->gT('Choose your language').' ';
- $question_text['help'] = $clang->gT('Choose your language');
+ . gT('Choose your language').'';
+ $question_text['help'] = gT('Choose your language');
}
break;
case 'P': //Multiple choice with comments checkbox + text
@@ -225,8 +206,8 @@ function retrieveAnswers($ia)
if (!($maxansw || $minansw))
{
$qtitle .= " \n"
- . $clang->gT('Check any that apply').' ';
- $question_text['help'] = $clang->gT('Check any that apply');
+ . gT('Check any that apply').'';
+ $question_text['help'] = gT('Check any that apply');
}
}
break;
@@ -298,8 +279,8 @@ function retrieveAnswers($ia)
if ($ia[6] == 'Y')
{
- $qtitle = ''.$clang->gT('*').' '.$qtitle;
- $question_text['mandatory'] = $clang->gT('*');
+ $qtitle = ''.gT('*').' '.$qtitle;
+ $question_text['mandatory'] = gT('*');
}
//If this question is mandatory but wasn't answered in the last page
//add a message HIGHLIGHTING the question
@@ -430,7 +411,7 @@ function validation_message($ia,$show)
return array($tip,$isValid);
// if (!$qinfo['valid']) {
// if (strlen($tip) == 0) {
- // $help = $clang->gT('This question must be answered correctly');
+ // $help = gT('This question must be answered correctly');
// }
// else {
// $tip =' '.$tip.' ';
@@ -456,7 +437,7 @@ function file_validation_message($ia)
foreach ($filenotvalidated as $k => $v)
{
if ($ia[1] == $k || strpos($k, "_") && $ia[1] == substr(0, strpos($k, "_") - 1));
- $qtitle .= ''.$clang->gT($filenotvalidated[$k]).' ';
+ $qtitle .= ''.gT($filenotvalidated[$k]).' ';
}
}
return $qtitle;
@@ -475,11 +456,11 @@ function mandatory_popup($ia, $notanswered=null)
//POPUP WARNING
if (!isset($mandatorypopup) && ($ia[4] == 'T' || $ia[4] == 'S' || $ia[4] == 'U'))
{
- $popup=$clang->gT("You cannot proceed until you enter some text for one or more questions.");
+ $popup=gT("You cannot proceed until you enter some text for one or more questions.");
$mandatorypopup="Y";
}else
{
- $popup=$clang->gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed.");
+ $popup=gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed.");
$mandatorypopup="Y";
}
return array($mandatorypopup, $popup);
@@ -504,7 +485,7 @@ function validation_popup($ia, $notvalidated=null)
//POPUP WARNING
if (!isset($validationpopup))
{
- $vpopup=$clang->gT("One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.");
+ $vpopup=gT("One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.");
$validationpopup="Y";
}
return array($validationpopup, $vpopup);
@@ -526,7 +507,7 @@ function file_validation_popup($ia, $filenotvalidated = null)
if (!isset($filevalidationpopup))
{
- $fpopup=$clang->gT("One or more file have either exceeded the filesize/are not in the right format or the minimum number of required files have not been uploaded. You cannot proceed until these have been completed");
+ $fpopup=gT("One or more file have either exceeded the filesize/are not in the right format or the minimum number of required files have not been uploaded. You cannot proceed until these have been completed");
$filevalidationpopup = "Y";
}
return array($filevalidationpopup, $fpopup);
@@ -572,14 +553,14 @@ function return_timer_script($aQuestionAttributes, $ia, $disable=null) {
$disable_prev=trim($aQuestionAttributes['time_limit_disable_prev']) != '' ? $aQuestionAttributes['time_limit_disable_prev'] : 0;
$time_limit_action=trim($aQuestionAttributes['time_limit_action']) != '' ? $aQuestionAttributes['time_limit_action'] : 1;
$time_limit_message_delay=trim($aQuestionAttributes['time_limit_message_delay']) != '' ? $aQuestionAttributes['time_limit_message_delay']*1000 : 1000;
- $time_limit_message=trim($aQuestionAttributes['time_limit_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']]) != '' ? htmlspecialchars($aQuestionAttributes['time_limit_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']], ENT_QUOTES) : $clang->gT("Your time to answer this question has expired");
+ $time_limit_message=trim($aQuestionAttributes['time_limit_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']]) != '' ? htmlspecialchars($aQuestionAttributes['time_limit_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']], ENT_QUOTES) : gT("Your time to answer this question has expired");
$time_limit_warning=trim($aQuestionAttributes['time_limit_warning']) != '' ? $aQuestionAttributes['time_limit_warning'] : 0;
$time_limit_warning_2=trim($aQuestionAttributes['time_limit_warning_2']) != '' ? $aQuestionAttributes['time_limit_warning_2'] : 0;
- $time_limit_countdown_message=trim($aQuestionAttributes['time_limit_countdown_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']]) != '' ? htmlspecialchars($aQuestionAttributes['time_limit_countdown_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']], ENT_QUOTES) : $clang->gT("Time remaining");
- $time_limit_warning_message=trim($aQuestionAttributes['time_limit_warning_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']]) != '' ? htmlspecialchars($aQuestionAttributes['time_limit_warning_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']], ENT_QUOTES) : $clang->gT("Your time to answer this question has nearly expired. You have {TIME} remaining.");
+ $time_limit_countdown_message=trim($aQuestionAttributes['time_limit_countdown_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']]) != '' ? htmlspecialchars($aQuestionAttributes['time_limit_countdown_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']], ENT_QUOTES) : gT("Time remaining");
+ $time_limit_warning_message=trim($aQuestionAttributes['time_limit_warning_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']]) != '' ? htmlspecialchars($aQuestionAttributes['time_limit_warning_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']], ENT_QUOTES) : gT("Your time to answer this question has nearly expired. You have {TIME} remaining.");
$time_limit_warning_message=str_replace("{TIME}", "
", $time_limit_warning_message);
$time_limit_warning_display_time=trim($aQuestionAttributes['time_limit_warning_display_time']) != '' ? $aQuestionAttributes['time_limit_warning_display_time']+1 : 0;
- $time_limit_warning_2_message=trim($aQuestionAttributes['time_limit_warning_2_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']]) != '' ? htmlspecialchars($aQuestionAttributes['time_limit_warning_2_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']], ENT_QUOTES) : $clang->gT("Your time to answer this question has nearly expired. You have {TIME} remaining.");
+ $time_limit_warning_2_message=trim($aQuestionAttributes['time_limit_warning_2_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']]) != '' ? htmlspecialchars($aQuestionAttributes['time_limit_warning_2_message'][$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']], ENT_QUOTES) : gT("Your time to answer this question has nearly expired. You have {TIME} remaining.");
$time_limit_warning_2_message=str_replace("{TIME}", "
", $time_limit_warning_2_message);
$time_limit_warning_2_display_time=trim($aQuestionAttributes['time_limit_warning_2_display_time']) != '' ? $aQuestionAttributes['time_limit_warning_2_display_time']+1 : 0;
$time_limit_message_style=trim($aQuestionAttributes['time_limit_message_style']) != '' ? $aQuestionAttributes['time_limit_message_style'] : "position: absolute;
@@ -731,9 +712,9 @@ function countdown(questionid,timer,action,warning,warning2,warninghide,warning2
var dhours='';
var dsecs='';
if (whours < 10) whours = '0' + whours;
- if (whours > 0) dhours = whours + ' ".$clang->gT('hours').", ';
- if (wmins > 0) dmins = wmins + ' ".$clang->gT('mins').", ';
- if (wsecs > 0) dsecs = wsecs + ' ".$clang->gT('seconds')."';
+ if (whours > 0) dhours = whours + ' ".gT('hours').", ';
+ if (wmins > 0) dmins = wmins + ' ".gT('mins').", ';
+ if (wsecs > 0) dsecs = wsecs + ' ".gT('seconds')."';
$('#'+warningtimedisplay).html(dhours+dmins+dsecs);
$('#'+warningdisplay).show();
if(warninghide > 0 ) {
@@ -751,9 +732,9 @@ function countdown(questionid,timer,action,warning,warning2,warninghide,warning2
var d2hours='';
var d2secs='';
if (w2hours < 10) w2hours = '0' + w2hours;
- if (w2hours > 0) d2hours = w2hours + ' ".$clang->gT('hours').", ';
- if (w2mins > 0) d2mins = w2mins + ' ".$clang->gT('mins').", ';
- if (w2secs > 0) d2secs = w2secs + ' ".$clang->gT('seconds')."';
+ if (w2hours > 0) d2hours = w2hours + ' ".gT('hours').", ';
+ if (w2mins > 0) d2mins = w2mins + ' ".gT('mins').", ';
+ if (w2secs > 0) d2secs = w2secs + ' ".gT('seconds')."';
$('#'+warning2timedisplay).html(dhours+dmins+dsecs);
$('#'+warning2display).show();
if(warning2hide > 0 ) {
@@ -770,10 +751,10 @@ function countdown(questionid,timer,action,warning,warning2,warninghide,warning2
var d2hours='';
var d2mins='';
var d2secs='';
- if (hours > 0) d2hours = hours+' ".$clang->gT('hours').": ';
- if (mins > 0) d2mins = mins+' ".$clang->gT('mins').": ';
- if (secs > 0) d2secs = secs+' ".$clang->gT('seconds')."';
- if (secs < 1) d2secs = '0 ".$clang->gT('seconds')."';
+ if (hours > 0) d2hours = hours+' ".gT('hours').": ';
+ if (mins > 0) d2mins = mins+' ".gT('mins').": ';
+ if (secs > 0) d2secs = secs+' ".gT('seconds')."';
+ if (secs < 1) d2secs = '0 ".gT('seconds')."';
$('#'+timerdisplay).html('".$time_limit_countdown_message." '+d2hours + d2mins + d2secs);
if (timeleft>0){
var text='countdown('+questionid+', '+timeleft+', '+action+', '+warning+', '+warning2+', '+warninghide+', '+warning2hide+', \"'+disable+'\")';
@@ -938,7 +919,7 @@ function do_5pointchoice($ia)
{
$answer .= CHECKED;
}
- $answer .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n".$clang->gT('No answer')." \n\t\n";
+ $answer .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n".gT('No answer')." \n\t\n";
}
$answer .= "\n getConfig('surveyID')][$ia[1]]."\" />\n";
@@ -974,8 +955,8 @@ function do_date($ia)
$aQuestionAttributes=getQuestionAttributeValues($ia[0],$ia[4]);
$sDateLangvarJS=" translt = {
- alertInvalidDate: '" . $clang->gT('Date entered is invalid!','js') . "',
- infoCompleteAll: '" . $clang->gT('Please complete all parts of the date!','js') . "'
+ alertInvalidDate: '" . gT('Date entered is invalid!','js') . "',
+ infoCompleteAll: '" . gT('Please complete all parts of the date!','js') . "'
};";
App()->getClientScript()->registerScript("sDateLangvarJS",$sDateLangvarJS,CClientScript::POS_HEAD);
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig("generalscripts").'date.js');
@@ -988,7 +969,7 @@ function do_date($ia)
$sMaxdatetailor='';
// date_min: Determine whether we have an expression, a full date (YYYY-MM-DD) or only a year(YYYY)
- if (trim($aQuestionAttributes['date_min'])!='')
+ if (trim($aQuestionAttributes['date_min'])!='')
{
$date_min=$aQuestionAttributes['date_min'];
if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/",$date_min))
@@ -997,8 +978,8 @@ function do_date($ia)
}
elseif ((strlen($date_min)==4) && ($date_min>=1900) && ($date_min<=2099))
{
- // backward compatibility: if only a year is given, add month and day
- $mindate=$date_min.'-01-01';
+ // backward compatibility: if only a year is given, add month and day
+ $mindate=$date_min.'-01-01';
}
else
{
@@ -1016,7 +997,7 @@ function do_date($ia)
}
// date_max: Determine whether we have an expression, a full date (YYYY-MM-DD) or only a year(YYYY)
- if (trim($aQuestionAttributes['date_max'])!='')
+ if (trim($aQuestionAttributes['date_max'])!='')
{
$date_max=$aQuestionAttributes['date_max'];
if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/",$date_max))
@@ -1025,8 +1006,8 @@ function do_date($ia)
}
elseif ((strlen($date_max)==4) && ($date_max>=1900) && ($date_max<=2099))
{
- // backward compatibility: if only a year is given, add month and day
- $maxdate=$date_max.'-12-31';
+ // backward compatibility: if only a year is given, add month and day
+ $maxdate=$date_max.'-12-31';
}
else
{
@@ -1069,8 +1050,8 @@ function do_date($ia)
{
// Show day select box
case 'j':
- case 'd': $answer .= ''.$clang->gT('Day').'
- '.$clang->gT('Day')." \n";
+ case 'd': $answer .= ''.gT('Day').'
+ '.gT('Day')." \n";
for ($i=1; $i<=31; $i++) {
if ($i == $currentdate)
{
@@ -1086,45 +1067,45 @@ function do_date($ia)
break;
// Show month select box
case 'n':
- case 'm': $answer .= ''.$clang->gT('Month').'
- '.$clang->gT('Month')." \n";
+ case 'm': $answer .= ''.gT('Month').'
+ '.gT('Month')." \n";
switch ((int)trim($aQuestionAttributes['dropdown_dates_month_style']))
{
- case 0:
+ case 0:
$montharray=array(
- $clang->gT('Jan'),
- $clang->gT('Feb'),
- $clang->gT('Mar'),
- $clang->gT('Apr'),
- $clang->gT('May'),
- $clang->gT('Jun'),
- $clang->gT('Jul'),
- $clang->gT('Aug'),
- $clang->gT('Sep'),
- $clang->gT('Oct'),
- $clang->gT('Nov'),
- $clang->gT('Dec'));
+ gT('Jan'),
+ gT('Feb'),
+ gT('Mar'),
+ gT('Apr'),
+ gT('May'),
+ gT('Jun'),
+ gT('Jul'),
+ gT('Aug'),
+ gT('Sep'),
+ gT('Oct'),
+ gT('Nov'),
+ gT('Dec'));
break;
- case 1:
+ case 1:
$montharray=array(
- $clang->gT('January'),
- $clang->gT('February'),
- $clang->gT('March'),
- $clang->gT('April'),
- $clang->gT('May'),
- $clang->gT('June'),
- $clang->gT('July'),
- $clang->gT('August'),
- $clang->gT('September'),
- $clang->gT('October'),
- $clang->gT('November'),
- $clang->gT('December'));
+ gT('January'),
+ gT('February'),
+ gT('March'),
+ gT('April'),
+ gT('May'),
+ gT('June'),
+ gT('July'),
+ gT('August'),
+ gT('September'),
+ gT('October'),
+ gT('November'),
+ gT('December'));
break;
- case 2:
+ case 2:
$montharray=array('01','02','03','04','05','06','07','08','09','10','11','12');
break;
}
-
+
for ($i=1; $i<=12; $i++) {
if ($i == $currentmonth)
{
@@ -1140,8 +1121,8 @@ function do_date($ia)
break;
// Show year select box
case 'y':
- case 'Y': $answer .= ''.$clang->gT('Year').'
- '.$clang->gT('Year').' ';
+ case 'Y': $answer .= ''.gT('Year').'
+ '.gT('Year').' ';
/*
* yearmin = Minimum year value for dropdown list, if not set default is 1900
@@ -1198,7 +1179,7 @@ function do_date($ia)
case 'h':
case 'g':
case 'G':
- $answer .= ''.$clang->gT('Hour').' '.$clang->gT('Hour').' ';
+ $answer .= ''.gT('Hour').' '.gT('Hour').' ';
for ($i=0; $i<24; $i++) {
if ($i === (int)$currenthour && is_numeric($currenthour))
{
@@ -1221,8 +1202,8 @@ function do_date($ia)
$answer .= ' ';
break;
- case 'i': $answer .= ''.$clang->gT('Minute').'
- '.$clang->gT('Minute').' ';
+ case 'i': $answer .= ''.gT('Minute').'
+ '.gT('Minute').' ';
for ($i=0; $i<60; $i+=$aQuestionAttributes['dropdown_dates_minute_step']) {
if ($i === (int)$currentminute && is_numeric($currentminute))
@@ -1258,7 +1239,7 @@ function do_date($ia)
$dateoutput = $datetimeobj->convert($dateformatdetails['phpdate']);
}
- $answer .= '
+ $answer .= '
';
$answer .= '
@@ -1274,7 +1255,7 @@ function do_date($ia)
{
//register timepicker extension
App()->getClientScript()->registerPackage('jqueryui-timepicker');
-
+
// Locale for datepicker and timpicker extension
if (App()->language !== 'en')
@@ -1298,15 +1279,15 @@ function do_date($ia)
// HTML for date question using datepicker
- $answer="{$clang->gT('Date picker')}
-
+ $answer="
{gT('Date picker')}
+
";
- // adds min and max date as a hidden element to the page so EM creates the needed LEM_tailor_Q_XX sections
+ // adds min and max date as a hidden element to the page so EM creates the needed LEM_tailor_Q_XX sections
$sHiddenHtml="";
if (!empty($sMindatetailor))
{
@@ -1325,34 +1306,34 @@ function do_date($ia)
// works with full dates (format: YYYY-MM-DD, js not needed), only a year, for backward compatibility (YYYY, js not needed),
// variable names which refer to another date question or expressions.
// Actual conversion of date formats is handled in LEMval()
-
-
+
+
if (!empty($sMindatetailor) || !empty($sMaxdatetailor))
{
- $answer.="";
}
-
+
if (trim($aQuestionAttributes['hide_tip'])==1) {
- $answer.="".sprintf($clang->gT('Format: %s'),$dateformatdetails['dateformat'])."
";
+ $answer.="".sprintf(gT('Format: %s'),$dateformatdetails['dateformat'])."
";
}
//App()->getClientScript()->registerScript("doPopupDate{$ia[0]}","doPopupDate({$ia[0]})",CClientScript::POS_END);// Beter if just afetre answers part
$answer .= "
-
+
";
-
+
Yii::app()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts')."map.js");
if ($aQuestionAttributes['location_mapservice']==1 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off")
Yii::app()->getClientScript()->registerScriptFile("https://maps.googleapis.com/maps/api/js?sensor=false$sGoogleMapsAPIKey");
@@ -3635,12 +3616,12 @@ class=\"mapservice\" value = \"{$aQuestionAttributes['location_mapservice']}\" >
if (isset($aQuestionAttributes['hide_tip']) && $aQuestionAttributes['hide_tip']==0)
{
$answer .= ""
- . $clang->gT('Drag and drop the pin to the desired location. You may also right click on the map to move the pin.').'
';
- $question_text['help'] = $clang->gT('Drag and drop the pin to the desired location. You may also right click on the map to move the pin.');
+ . gT('Drag and drop the pin to the desired location. You may also right click on the map to move the pin.').'';
+ $question_text['help'] = gT('Drag and drop the pin to the desired location. You may also right click on the map to move the pin.');
}
}
////----------------------------------------------------------------------------------- Leaflet Maps + geonames search
-
+
elseif((int)($aQuestionAttributes['location_mapservice'])==100){
$mapservice = $aQuestionAttributes['location_mapservice'];
$currentLocation = $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]];
@@ -3737,12 +3718,12 @@ class=\"mapservice\" value = \"{$aQuestionAttributes['location_mapservice']}\" >
";
-
+
if (isset($aQuestionAttributes['hide_tip']) && $aQuestionAttributes['hide_tip']==0)
{
$answer .= ""
- . $clang->gT('Click to set the location or drag and drop the pin. You may may also enter coordinates').'
';
- $question_text['help'] = $clang->gT('Click to set the location or drag and drop the pin. You may may also enter coordinates');
+ . gT('Click to set the location or drag and drop the pin. You may may also enter coordinates').'';
+ $question_text['help'] = gT('Click to set the location or drag and drop the pin. You may may also enter coordinates');
}
//----------------------------------------------------------------------------------- end leaflet+geonames
}
@@ -3750,7 +3731,7 @@ class=\"mapservice\" value = \"{$aQuestionAttributes['location_mapservice']}\" >
{
//no question attribute set, use common input text field
$answer = "\n"
- ."{$clang->gT('Answer')} "
+ ."{gT('Answer')} "
."$prefix\t getConfig('surveyID')][$ia[1]];
@@ -3849,8 +3830,8 @@ function do_longfreetext($ia)
// <-- END ENHANCEMENT - TEXT INPUT WIDTH
// --> START NEW FEATURE - SAVE
- $answer = "
\n";
@@ -4181,7 +4162,7 @@ function do_array_5point($ia)
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1)
{
$answer_t_content .= "\t\n"
- ."".$clang->gT('No answer')." "
+ ."".gT('No answer')." "
."\n\t getConfig('surveyID')][$myfname]) || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname] == '')
{
@@ -4215,7 +4196,7 @@ function do_array_10point($ia)
global $notanswered, $thissurvey;
$extraclass ="";
$clang = Yii::app()->lang;
- $caption=$clang->gT("An array with sub-question on each line. The answers are value from 1 to 10 and are contained in the table header. ");
+ $caption=gT("An array with sub-question on each line. The answers are value from 1 to 10 and are contained in the table header. ");
$checkconditionFunction = "checkconditions";
$qquery = "SELECT other FROM {{questions}} WHERE qid=".$ia[0]." AND language='".$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']."'";
@@ -4234,7 +4215,7 @@ function do_array_10point($ia)
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1) //Question is not mandatory
{
++$cellwidth; // add another column
- $caption.=$clang->gT("The last cell are for no answer. ");
+ $caption.=gT("The last cell are for no answer. ");
}
$cellwidth = round((( 100 - $answerwidth ) / $cellwidth) , 1); // convert number of columns to percentage of table width
@@ -4274,7 +4255,7 @@ function do_array_10point($ia)
}
if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1) //Question is not mandatory
{
- $answer .= "\t ".$clang->gT('No answer')." \n";
+ $answer .= "\t".gT('No answer')." \n";
}
$answer .= " \n";
$answer_t_content = '