LimeSurvey API - Master branch

Application

Table of Contents

Interfaces

IWriter
EMWarningInterface
LimeSurvey Copyright (C) 2007-2013 The LimeSurvey Project Team / Carsten Schmitz All rights reserved.
CommandInterface
RendererInterface
FormatterInterface
TransformerInterface
ValidatorInterface
InputInterface
MenuButtonInterface
Interface descriptions here: https://manual.limesurvey.org/Extra_menus_event
MenuInterface
Interface descriptions here: https://manual.limesurvey.org/Extra_menus_event
MenuItemInterface
Interface descriptions here: https://manual.limesurvey.org/Extra_menus_event
OpInterface
OpHandlerInterface
OpTypeInterface
iPlugin
iPluginStorage
PermissionInterface

Classes

AddNotificationCommand
CompileAssetsCommand
IdValidator
DbSeederCommand
DemomodeCommand
FlushAssetsCommand
ImportSurveyCommand
InstallCommand
InstallFromConfigCommand
PluginCommand
ResetPasswordCommand
TwigCommand
This class will generate all the twig cache file from command line, even if LimeSurvey is not installed.
UpdateDBCommand
ValidateExpressionCommand
LimeSurvey (tm) Copyright (C) 2011 The LimeSurvey Project Team / Carsten Schmitz All rights reserved.
WipeCommand
XmlTranslationCommand
To execute this command : php application/commands/console.php XmlTranslation index php application/commands/console.php XmlTranslation generateTranslationFiles
Expressions
Class Expressions
ExpressionValidate
Survey Common Action
HtmlEditorPop
Survey Common Action
Index
Survey Common Action
NotificationController
Mostly for Ajax actions
ParticipantsAction
This is the main controller for Participants Panel
PluginHelper
Survey Common Action
PluginManagerController
Survey Common Action
QuestionThemes
Survey Common Action
RemoteControl
Survey Common Action
SurveymenuController
Class SurveymenuController
SurveymenuEntryController
Class SurveymenuEntryController
SurveysGroupsController
Class SurveysGroupsController
TutorialEntryController
Survey Common Action
TutorialsController
This tutorial controller is the first step to have user generated tutorials.
AdminController
AjaxAlertController
Controller for rendering AlertWidget via Ajax call
AssessmentController
Class LSBaseController
EditorLinkController
FailedEmailController
Class LSBaseController
HomepageSettingsController
Class HomepageSettingsController
LimeReplacementFieldsController
Class LSBaseController
LSBaseController
Class LSBaseController
PluginsController
QuestionAdministrationController
Class QuestionAdministrationController
QuestionGroupsAdministrationController
Class LSBaseController
QuickTranslationController
Class LSBaseController
QuotasController
Class LSBaseController
ResponsesController
class ResponsesController
RestController
SmtpOAuthController
Class LSBaseController
StatisticsUserController
SurveyIndex
SurveyAdministrationController
Class SurveyAdministrationController
SurveyController
SurveyPermissionsController
Class LSBaseController
SurveysController
This class will handle survey creation and manipulation.
SurveysGroupsPermissionController
Class SurveysGroupsPermissionController
ThemeOptionsController
Class LSBaseController
UploaderController
UserGroupController
class UserGroupController
UserManagementController
Class UserManagementController
UserRoleController
Class LSBaseController
AuthPluginBase
ConsoleApplication
ConsoleHttpSession
DbConnection
MssqlSchema
MysqlSchema
PgsqlSchema
LimeMailer
WIP A SubClass of phpMailer adapted for LimeSurvey
LS_Twig_Extension
LSAuthResult
LSBootstrap
For updating from 2.06 to 2.5.
LSCActiveDataProvider
LSCaptcha
CCaptcha class file.
LSDbCriteria
LsDefaultDataSets
A collection of default data sets, like surveymenus, surveymenuentries, and tutorials
LSETwigViewRenderer
Twig view renderer, LimeSurvey overload
LSFileHelper
LSGettextMoFile
Extends CGettextMoFile to make it compatible with PHP 8.1
LSHttpRequest
Description of HttpRequest
LSMessageSource
LSMessageSource class file.
LSSodium
Class LSSodium
LSSodiumOld
Class LSSodiumOld
LSUserException
LSUserIdentity
For 2.06 most of the functionality in this class will be moved to the LSWebUser class.
LSWebUser
LSYii_Application
Implements global config
LSYii_AssetManager
LimeSurvey Copyright (C) 2007-2018 The LimeSurvey Project Team / Carsten Schmitz All rights reserved.
LSYii_CaseValidator
LSYii_ClientScript
LSYii_CompareInsensitiveValidator
LSYii_Controller
LSYii_DisableUpdateValidator
LSYii_EmailIDNAValidator
LSYii_FilterValidator
Extends CFilterValidator class to add PHP 8.1 compatibility. Based on Yii 2's FilterValidator
LSYii_HtmlPurifier
LSYii_ImageValidator
LSYii_Locale
LSYii_NonFormulaValidator
Validator class for potential CSV injection attacks.
LSYii_NoUpdateValidator
LSYii_ShortUrlValidator
Validator class for Short URLs (Survey Aliases).
LSYii_Validators
PluginBase
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
PluginEvent
PluginManager
Class PluginManagerD Dummy class for 2.05 plugins.
AuditLog
mdlAuditlog
This is the model class for table "{{plugins}}".
Authdb
AuthLDAP
Authwebserver
AzureOAuthSMTP
ComfortUpdateChecker
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
CUCMenuClass
customToken
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
dateFunctions
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
EMFunctions
ExportR
RDataWriter
Contains functions and properties that are common to all writers.
RSyntaxWriter
Contains functions and properties that are common to all writers.
ExportSPSSsav
ExportSTATAxml
AnswerOptionsFunctions
ExpressionAnswerOptions
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
expressionFixedDbVar
expressionFixedDbVar : add some fixed DB var : SEED, STARTDATE …
expressionQuestionForAll
expressionQuestionForAll : Add QCODE.question for question with subquestion for expression Manager.
expressionQuestionHelp
expressionQuestionHelp : add QCODE.help for expression Manager
FunctionStatic
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
StaticFunctions
GoogleOAuthSMTP
mailSenderToFrom
mailSenderToFrom : Set the smtp user to sender and from Needed for some smtp server, see mantis issue #10529 <https://bugs.limesurvey.org/view.php?id=10529>
oldUrlCompat
Plugin to redirect old url system (index.php?sid=surveyid) to the new url
PasswordRequirement
Core plugin for LimeSurvey : password requirement settings
countFunctions
questionCodeHelper
statFunctions
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
qrstr
QRtools
QRspec
QRimage
QRinputItem
QRinput
QRbitstream
QRsplit
QRrsItem
QRrs
QRmask
QRrsblock
QRrawcode
QRcode
FrameFiller
QRencode
QRvect
TFAHelper
Helper functionalities for 2fa plugin
TFAMenuClass
Extending the basic menu class with an icon in front of the label
TFAQrCodeGenerator
TFAPluginInstaller
Installer class for the TwoFactorAdminLogin Plugin A collecton of static helpers to install the Plugin
TFAUser
Abstracted user model for TFA admin view.
TFAUserKey
Controller model for TFA users secret keys
TwoFactorAdminLogin
UpdateCheck
Plugin to check for extension updates after a super admin logs in.
DataSetFivePointChoice
This is a base class to enable all question tpyes to extend the general settings.
RenderFivePointChoice
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArray10ChoiceQuestion
This is a base class to enable all question tpyes to extend the general settings.
RenderArray10ChoiceQuestion
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArray5ChoiceQuestion
This is a base class to enable all question tpyes to extend the general settings.
RenderArray5ChoiceQuestion
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArrayFlexibleColumn
This is a base class to enable all question tpyes to extend the general settings.
RendererArrayFlexibleColumn
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArrayFlexibleRow
This is a base class to enable all question tpyes to extend the general settings.
RenderArrayFlexibleRow
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArrayMultiFlexNumbers
This is a base class to enable all question tpyes to extend the general settings.
RenderArrayMultiFlexNumbers
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArrayMultiFlexText
This is a base class to enable all question tpyes to extend the general settings.
RenderArrayMultiFlexText
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArrayMultiscale
This is a base class to enable all question tpyes to extend the general settings.
RenderArrayMultiscale
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArrayOfIncSameDecQuestions
This is a base class to enable all question tpyes to extend the general settings.
RenderArrayOfIncSameDecQuestions
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetArrayYesUncertainNo
This is a base class to enable all question tpyes to extend the general settings.
RenderArrayYesUncertainNo
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetBoilerplate
This is a base class to enable all question tpyes to extend the general settings.
RenderBoilerplate
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetDate
This is a base class to enable all question tpyes to extend the general settings.
RenderDate
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetDummyQuestion
This is a base class to enable all question tpyes to extend the general settings.
DummyQuestionEditContainer
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetEquation
This is a base class to enable all question tpyes to extend the general settings.
RenderEquation
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetFileUpload
This is a base class to enable all question tpyes to extend the general settings.
RenderFileUpload
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetGenderDropdown
This is a base class to enable all question tpyes to extend the general settings.
RenderGenderDropdown
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetHugeFreeText
This is a base class to enable all question tpyes to extend the general settings.
RenderHugeFreeText
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetLanguage
This is a base class to enable all question tpyes to extend the general settings.
RenderLanguageSelector
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetListDropdown
This is a base class to enable all question tpyes to extend the general settings.
RenderListDropdown
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetListRadio
This is a base class to enable all question tpyes to extend the general settings.
RenderListRadio
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetListWithComment
This is a base class to enable all question tpyes to extend the general settings.
RenderListComment
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
LoadQuestionTypes
DataSetLongFreeText
This is a base class to enable all question tpyes to extend the general settings.
RenderLongFreeText
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetMultipleChoice
This is a base class to enable all question tpyes to extend the general settings.
RenderMultipleChoice
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetMultipleChoiceWithComments
This is a base class to enable all question tpyes to extend the general settings.
RenderMultipleChoiceWithComments
RenderClass for MultipleChoiceWithComments Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetMultipleNumerical
This is a base class to enable all question tpyes to extend the general settings.
RenderMultipleNumerical
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetMultipleShortText
This is a base class to enable all question tpyes to extend the general settings.
RenderMultipleShortText
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetNumerical
This is a base class to enable all question tpyes to extend the general settings.
RenderNumerical
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetRanking
This is a base class to enable all question tpyes to extend the general settings.
RenderRanking
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetShortFreeText
This is a base class to enable all question tpyes to extend the general settings.
RenderShortFreeText
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
DataSetYesNoRadio
This is a base class to enable all question tpyes to extend the general settings.
RenderYesNoRadio
RenderClass for Boilerplate Question * The ia Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
StaticModel
Class StaticModel A general class to use in case of non-db models
TopbarConfiguration
DbHttpSession
WrongTemplateVersionException
Thrown when template/theme can't be loaded and there's a mismatch between template version in db and in config.xml
EmailPluginInfo
FormElement
GeneralOption
Wrapper class for question general option.
SwitchOption
CPDBException
Used to spit out error messages if mapping attributes doesn't work.
AccordionWidget
CLSGridView
Bootstrap Zii grid view.
CLSYiiPager
GridActionsWidget
massiveActionsWidget
This widget render a drop-up button for grid massive actions, and attach modals to the actions.
PreviewModalWidget
Used for question type select, display export options.
LanguagesWidget
ListSurveysWidget
This widget display the list of surveys.
PositionWidget
This widget display a position selection for a question inside a group. It's used for now in "add new question".
TextDisplaySwitch
AdminFooter
Render the admin footer including version and build info when logged in
AdvancedSettingWidget
AlertWidget
Creates a bootstrap alert on given options to fit the admin theme design.
BreadcrumbWidget
Creates the breadcrumbs for the topbar If the text legth of the full breadcrumbs are higher than the configured threshold, some elements will be replaced with an ellipsis
ButtonGroupWidget
Creates a Buttongroup that behaves like a switch with radio input type
ButtonWidget
Creates a button based on given options to fit the admin theme design.
CallbackColumn
CaptchaExtendedAction
Yii extended captcha supporting more complex formulas and masking techniques.
CaptchaExtendedValidator
Extended captcha client validator Implements support for UTF-8 extended latin2, cyrillic etc characters
CustomFormatter
DateTimePicker
DateTimePicker widget class A simple implementation for date range picker for Twitter Bootstrap 5
FlashMessage
GeneralOptionWidget
ClearDefaultGeneralOption
Wrapper class for question general option.
EncryptionGeneralOption
Wrapper class for question general option.
GroupSelectorGeneralOption
Wrapper class for question general option.
MandatoryGeneralOption
Wrapper class for question general option.
OtherGeneralOption
Wrapper class for question general option.
QuestionThemeGeneralOption
Wrapper class for question general option.
RelevanceEquationGeneralOption
Wrapper class for question general option.
SaveAsDefaultGeneralOption
Wrapper class for question general option.
ValidationGeneralOption
Wrapper class for question general option.
GridViewWidget
InputWidget
LimeDebug
LimeScript
TopbarWidget
PanelBoxWidget
SettingsWidget
UserPermissionsWidget
JsonEditor
AjaxHelper
Ajax helper This class will help to standardize the Ajax communication between server and client.
JsonOutput
Base class for json output
JsonOutputNoPermission
Permission set to false
JsonOutputError
Set error in constructor, which will be shown as a pop-up on client.
JsonOutputSuccess
Set success message in constructor, which will be shown as a pop-up on client.
JsonOutputModal
Base class for json output
JsonOutputNotLoggedIn
Echo html for log in form modal body This is a special case of JsonOutputModal, but with fixed html Only used through JsonOutputNotLoggedIn in AdminController::run.
JsonOutputHtml
Echo HTML and put it in a <div> with id $target.
CsvWriter
Contains functions and properties that are common to all writers.
DocWriter
Contains functions and properties that are common to all writers.
ExcelWriter
Exports results in Microsoft Excel format. By default the Writer sends HTTP headers and the file contents via HTTP. For testing purposes a file name can be to the constructor which will cause the ExcelWriter to output to a file.
FormattingOptions
HtmlWriter
Contains functions and properties that are common to all writers.
JsonWriter
Contains functions and properties that are common to all writers.
PdfWriter
Contains functions and properties that are common to all writers.
SurveyDao
SurveyObj
Translator
Writer
Contains functions and properties that are common to all writers.
ExportSurveyResultsService
statistics_helper
ClassFactory
ExpressionManager
Description of ExpressionManager (1) Does safe evaluation of PHP expressions. Only registered Functions, and known Variables are allowed.
LimeExpressionManager
EmCacheException
Exception used by EmCacheHelper.
EmCacheHelper
Discussion here: https://bugs.limesurvey.org/view.php?id=14859 PR: https://github.com/LimeSurvey/LimeSurvey/pull/1273
EMWarningAssignment
LimeSurvey Copyright (C) 2007-2013 The LimeSurvey Project Team / Carsten Schmitz All rights reserved.
EMWarningBase
LimeSurvey Copyright (C) 2007-2013 The LimeSurvey Project Team / Carsten Schmitz All rights reserved.
EMWarningHTMLBaker
Small helper class to compose HTML from $warnings.
EMWarningInvalidComparison
LimeSurvey Copyright (C) 2007-2013 The LimeSurvey Project Team / Carsten Schmitz All rights reserved.
EMWarningPlusOperator
LimeSurvey Copyright (C) 2007-2013 The LimeSurvey Project Team / Carsten Schmitz All rights reserved.
LayoutHelper
Class LayoutHelper
pdfHelper
General helper class for generating pdf.
questionHelper
General helper class for question + question setting system
questionIndexHelper
remotecontrol_handle
SortHelper
SurveyRuntimeHelper
LimeSurvey Copyright (C) 2007-2011 The LimeSurvey Project Team / Carsten Schmitz All rights reserved.
SurveyThemeHelper
General helper class for survey themes
DatabaseUpdateBase
Base class for database migration, inspired by Yii.
Update_133
Base class for database migration, inspired by Yii.
Update_134
Base class for database migration, inspired by Yii.
Update_135
Base class for database migration, inspired by Yii.
Update_136
Base class for database migration, inspired by Yii.
Update_137
Base class for database migration, inspired by Yii.
Update_138
Base class for database migration, inspired by Yii.
Update_139
Base class for database migration, inspired by Yii.
Update_140
Base class for database migration, inspired by Yii.
Update_141
Base class for database migration, inspired by Yii.
Update_142
Base class for database migration, inspired by Yii.
Update_143
Base class for database migration, inspired by Yii.
Update_145
Base class for database migration, inspired by Yii.
Update_146
Base class for database migration, inspired by Yii.
Update_147
Base class for database migration, inspired by Yii.
Update_148
Base class for database migration, inspired by Yii.
Update_149
Base class for database migration, inspired by Yii.
Update_150
Base class for database migration, inspired by Yii.
Update_151
Base class for database migration, inspired by Yii.
Update_152
Base class for database migration, inspired by Yii.
Update_153
Base class for database migration, inspired by Yii.
Update_154
Base class for database migration, inspired by Yii.
Update_155
Base class for database migration, inspired by Yii.
Update_156
Base class for database migration, inspired by Yii.
Update_157
Base class for database migration, inspired by Yii.
Update_158
Base class for database migration, inspired by Yii.
Update_159
Base class for database migration, inspired by Yii.
Update_160
Base class for database migration, inspired by Yii.
Update_161
Base class for database migration, inspired by Yii.
Update_162
Base class for database migration, inspired by Yii.
Update_164
Base class for database migration, inspired by Yii.
Update_165
Base class for database migration, inspired by Yii.
Update_166
Base class for database migration, inspired by Yii.
Update_167
Base class for database migration, inspired by Yii.
Update_168
Base class for database migration, inspired by Yii.
Update_169
Base class for database migration, inspired by Yii.
Update_170
Base class for database migration, inspired by Yii.
Update_171
Base class for database migration, inspired by Yii.
Update_172
Base class for database migration, inspired by Yii.
Update_173
Base class for database migration, inspired by Yii.
Update_174
Base class for database migration, inspired by Yii.
Update_175
Base class for database migration, inspired by Yii.
Update_176
Base class for database migration, inspired by Yii.
Update_177
Base class for database migration, inspired by Yii.
Update_178
Base class for database migration, inspired by Yii.
Update_179
Base class for database migration, inspired by Yii.
Update_180
Base class for database migration, inspired by Yii.
Update_181
Base class for database migration, inspired by Yii.
Update_183
Base class for database migration, inspired by Yii.
Update_184
Base class for database migration, inspired by Yii.
Update_250
Base class for database migration, inspired by Yii.
Update_251
Base class for database migration, inspired by Yii.
Update_252
Base class for database migration, inspired by Yii.
Update_253
Base class for database migration, inspired by Yii.
Update_254
Base class for database migration, inspired by Yii.
Update_255
Base class for database migration, inspired by Yii.
Update_256
Base class for database migration, inspired by Yii.
Update_257
Base class for database migration, inspired by Yii.
Update_258
Base class for database migration, inspired by Yii.
Update_259
Base class for database migration, inspired by Yii.
Update_260
Base class for database migration, inspired by Yii.
Update_261
Base class for database migration, inspired by Yii.
Update_262
Base class for database migration, inspired by Yii.
Update_263
Base class for database migration, inspired by Yii.
Update_290
Base class for database migration, inspired by Yii.
Update_291
Base class for database migration, inspired by Yii.
Update_293
Base class for database migration, inspired by Yii.
Update_294
Base class for database migration, inspired by Yii.
Update_296
Base class for database migration, inspired by Yii.
Update_298
Base class for database migration, inspired by Yii.
Update_304
Base class for database migration, inspired by Yii.
Update_305
Base class for database migration, inspired by Yii.
Update_306
Base class for database migration, inspired by Yii.
Update_307
Base class for database migration, inspired by Yii.
Update_308
Base class for database migration, inspired by Yii.
Update_309
Base class for database migration, inspired by Yii.
Update_310
Base class for database migration, inspired by Yii.
Update_311
Base class for database migration, inspired by Yii.
Update_312
Base class for database migration, inspired by Yii.
Update_313
Base class for database migration, inspired by Yii.
Update_314
Base class for database migration, inspired by Yii.
Update_315
Base class for database migration, inspired by Yii.
Update_316
Base class for database migration, inspired by Yii.
Update_317
Base class for database migration, inspired by Yii.
Update_318
Base class for database migration, inspired by Yii.
Update_319
Base class for database migration, inspired by Yii.
Update_320
Base class for database migration, inspired by Yii.
Update_321
Base class for database migration, inspired by Yii.
Update_322
Base class for database migration, inspired by Yii.
Update_323
Base class for database migration, inspired by Yii.
Update_324
Base class for database migration, inspired by Yii.
Update_325
Base class for database migration, inspired by Yii.
Update_326
Base class for database migration, inspired by Yii.
Update_327
Base class for database migration, inspired by Yii.
Update_328
Base class for database migration, inspired by Yii.
Update_329
Base class for database migration, inspired by Yii.
Update_330
Base class for database migration, inspired by Yii.
Update_331
Base class for database migration, inspired by Yii.
Update_332
Base class for database migration, inspired by Yii.
Update_333
Base class for database migration, inspired by Yii.
Update_334
Base class for database migration, inspired by Yii.
Update_335
Base class for database migration, inspired by Yii.
Update_336
Base class for database migration, inspired by Yii.
Update_337
Base class for database migration, inspired by Yii.
Update_338
Base class for database migration, inspired by Yii.
Update_339
Base class for database migration, inspired by Yii.
Update_340
Base class for database migration, inspired by Yii.
Update_341
Base class for database migration, inspired by Yii.
Update_342
Base class for database migration, inspired by Yii.
Update_343
Base class for database migration, inspired by Yii.
Update_344
Base class for database migration, inspired by Yii.
Update_345
Base class for database migration, inspired by Yii.
Update_346
Base class for database migration, inspired by Yii.
Update_347
Base class for database migration, inspired by Yii.
Update_348
Base class for database migration, inspired by Yii.
Update_349
Base class for database migration, inspired by Yii.
Update_350
Base class for database migration, inspired by Yii.
Update_351
Base class for database migration, inspired by Yii.
Update_352
Base class for database migration, inspired by Yii.
Update_353
Base class for database migration, inspired by Yii.
Update_354
Base class for database migration, inspired by Yii.
Update_355
Base class for database migration, inspired by Yii.
Update_356
Base class for database migration, inspired by Yii.
Update_357
Base class for database migration, inspired by Yii.
Update_358
Base class for database migration, inspired by Yii.
Update_359
Base class for database migration, inspired by Yii.
Update_360
Base class for database migration, inspired by Yii.
Update_363
Base class for database migration, inspired by Yii.
Update_364
Base class for database migration, inspired by Yii.
Update_400
Base class for database migration, inspired by Yii.
Update_401
Base class for database migration, inspired by Yii.
Update_402
Base class for database migration, inspired by Yii.
Update_403
Base class for database migration, inspired by Yii.
Update_404
Base class for database migration, inspired by Yii.
Update_405
Base class for database migration, inspired by Yii.
Update_406
Base class for database migration, inspired by Yii.
Update_407
Base class for database migration, inspired by Yii.
Update_408
Base class for database migration, inspired by Yii.
Update_409
Base class for database migration, inspired by Yii.
Update_410
Base class for database migration, inspired by Yii.
Update_411
Base class for database migration, inspired by Yii.
Update_412
Base class for database migration, inspired by Yii.
Update_413
Base class for database migration, inspired by Yii.
Update_414
Base class for database migration, inspired by Yii.
Update_415
Base class for database migration, inspired by Yii.
Update_416
Base class for database migration, inspired by Yii.
Update_417
Base class for database migration, inspired by Yii.
Update_418
Base class for database migration, inspired by Yii.
Update_419
Base class for database migration, inspired by Yii.
Update_420
Base class for database migration, inspired by Yii.
Update_421
Base class for database migration, inspired by Yii.
Update_422
Base class for database migration, inspired by Yii.
Update_423
Base class for database migration, inspired by Yii.
Update_424
Base class for database migration, inspired by Yii.
Update_425
Base class for database migration, inspired by Yii.
Update_426
Base class for database migration, inspired by Yii.
Update_427
Base class for database migration, inspired by Yii.
Update_428
Base class for database migration, inspired by Yii.
Update_429
Base class for database migration, inspired by Yii.
Update_430
Base class for database migration, inspired by Yii.
Update_431
Base class for database migration, inspired by Yii.
Update_432
Base class for database migration, inspired by Yii.
Update_433
Base class for database migration, inspired by Yii.
Update_434
Base class for database migration, inspired by Yii.
Update_435
Base class for database migration, inspired by Yii.
Update_436
Base class for database migration, inspired by Yii.
Update_437
Base class for database migration, inspired by Yii.
Update_438
Base class for database migration, inspired by Yii.
Update_439
Base class for database migration, inspired by Yii.
Update_440
Base class for database migration, inspired by Yii.
Update_441
Base class for database migration, inspired by Yii.
Update_442
Base class for database migration, inspired by Yii.
Update_443
Base class for database migration, inspired by Yii.
Update_444
Base class for database migration, inspired by Yii.
Update_445
Base class for database migration, inspired by Yii.
Update_446
Base class for database migration, inspired by Yii.
Update_447
Base class for database migration, inspired by Yii.
Update_448
Base class for database migration, inspired by Yii.
Update_449
Base class for database migration, inspired by Yii.
Update_450
Base class for database migration, inspired by Yii.
Update_451
Base class for database migration, inspired by Yii.
Update_452
Base class for database migration, inspired by Yii.
Update_453
Base class for database migration, inspired by Yii.
Update_460
Base class for database migration, inspired by Yii.
Update_470
Base class for database migration, inspired by Yii.
Update_471
Base class for database migration, inspired by Yii.
Update_472
Base class for database migration, inspired by Yii.
Update_473
Base class for database migration, inspired by Yii.
Update_475
Base class for database migration, inspired by Yii.
Update_476
Base class for database migration, inspired by Yii.
Update_477
Base class for database migration, inspired by Yii.
Update_478
Base class for database migration, inspired by Yii.
Update_479
Base class for database migration, inspired by Yii.
Update_480
Base class for database migration, inspired by Yii.
Update_481
Base class for database migration, inspired by Yii.
Update_482
Base class for database migration, inspired by Yii.
Update_483
Base class for database migration, inspired by Yii.
Update_484
Base class for database migration, inspired by Yii.
Update_485
Add missing noTablesOnMobile.css to vanilla configs again. It was done on 428, but the bug on LsDefaultDataSets remained causing problems on new installations.
Update_486
Base class for database migration, inspired by Yii.
Update_487
Base class for database migration, inspired by Yii.
Update_488
Base class for database migration, inspired by Yii.
Update_489
Base class for database migration, inspired by Yii.
Update_490
Base class for database migration, inspired by Yii.
Update_491
Base class for database migration, inspired by Yii.
Update_492
Base class for database migration, inspired by Yii.
Update_493
Base class for database migration, inspired by Yii.
Update_494
Base class for database migration, inspired by Yii.
Update_495
Base class for database migration, inspired by Yii.
Update_600
Base class for database migration, inspired by Yii.
Update_601
Base class for database migration, inspired by Yii.
Update_602
Base class for database migration, inspired by Yii.
Update_603
Base class for database migration, inspired by Yii.
Update_604
Base class for database migration, inspired by Yii.
Update_607
Some of it is a copy of update 453 which has been skipped on some installations
Update_608
Base class for database migration, inspired by Yii.
Update_609
Base class for database migration, inspired by Yii.
Update_612
Base class for database migration, inspired by Yii.
Update_613
Base class for database migration, inspired by Yii.
Update_614
Base class for database migration, inspired by Yii.
Update_615
Base class for database migration, inspired by Yii.
Update_616
Base class for database migration, inspired by Yii.
Update_617
Base class for database migration, inspired by Yii.
Update_618
Base class for database migration, inspired by Yii.
Update_619
Base class for database migration, inspired by Yii.
Update_620
Base class for database migration, inspired by Yii.
Update_621
Base class for database migration, inspired by Yii.
Update_622
Base class for database migration, inspired by Yii.
Update_623
Base class for database migration, inspired by Yii.
userstatistics_helper
viewHelper
General helper class for generating views.
pdf
ProgressBar
quexmlpdf
A TCPDF based class to produce queXF compatible questionnaire PDF files and banding description XML from queXML
SettingsStorage
ApiConfig
ApiConfig
ApiException
AuthSession
ApiCommandException
Exception
Options
Request
Response
ResponseFactory
StatusError
StatusErrorBadRequest
StatusErrorForbidden
StatusErrorNotFound
StatusErrorUnauthorised
StatusSuccess
StatusSuccessCreated
StatusSuccessNoContent
Status
ResponseDataError
ExceptionInvalidUser
SessionKeyCreate
SessionKeyRelease
SiteSettings
Site Settings
SurveyDetail
SurveyGroupList
SurveyList
OpHandlerAnswer
OpHandlerAnswerDelete
OpHandlerLanguageSettingsUpdate
OpHandlerQuestionAttributeUpdate
OpHandlerQuestionCreate
OpHandlerQuestionDelete
OpHandlerQuestionGroup
OpHandlerQuestionGroupL10n
OpHandlerQuestionGroupReorder
OpHandlerQuestionGroupReorder is responsible for reordering question groups and also questions
OpHandlerQuestionL10nUpdate
OpHandlerQuestionUpdate
OpHandlerSubQuestion
Class OpHandlerSubQuestion can handle create and update of subquestions which belong to a single question.
OpHandlerSubquestionDelete
OpHandlerSurveyUpdate
PatcherSurvey
ExceptionErrorItem
ExceptionErrors
This class is responsible for organizing and return of error messages from thrown exceptions during a patch operation for the response of PatcherSurvey.
SurveyResponse
This class is responsible for preparing and building the whole response for PatcherSurvey
TempIdMapItem
TempIdMapping
This class is responsible for handling and returning tempId <-> real Id mapping of newly created entities as part of the response of PatcherSurvey.
ValidationErrorItem
ValidationErrors
This class is responsible for handling and returning transformer validation errors of an operation for the response of PatcherSurvey
SurveyPatch
TransformerInputAnswer
TransformerInputAnswerL10ns
TransformerInputAnswerL10nsCollection
TransformerInputQuestion
TransformerInputQuestionAggregate
TransformerInputQuestionAttribute
TransformerInputQuestionGroup
TransformerInputQuestionGroupAggregate
TransformerInputQuestionGroupL10ns
TransformerInputQuestionGroupReorder
TransformerInputQuestionL10ns
TransformerInputSubQuestion
TransformerInputSubQuestionAggregate
TransformerInputSubQuestionL10ns
TransformerInputSurvey
TransformerInputSurveyLanguageSettings
TransformerOutputAnswer
TransformerOutputAnswerL10ns
TransformerOutputQuestion
TransformerOutputQuestionAttribute
TransformerOutputQuestionGroup
TransformerOutputQuestionGroupL10ns
TransformerOutputQuestionL10ns
TransformerOutputSurvey
TransformerOutputSurveyDetail
TransformerOutputSurveyDetail
TransformerOutputSurveyGroup
TransformerOutputSurveyLanguageSettings
TransformerOutputSurveyOwner
UserList
EndpointFactory
Endpoint
RestEndpoint
RendererBasic
RestConfig
RestConfig
RestRendererV1
SchemaFactoryAnswer
SchemaFactoryAuthToken
SchemaFactoryError
SchemaFactoryQuestion
SchemaFactoryQuestionAttribute
SchemaFactoryQuestionAttributes
SchemaFactoryQuestionGroup
SchemaFactoryQuestionGroupL10ns
SchemaFactoryQuestionL10ns
SchemaFactorySiteSettings
SchemaFactorySurvey
SchemaFactorySurveyDetail
SchemaFactorySurveyGroup
SchemaFactorySurveyGroupList
SchemaFactorySurveyLanguageSettings
SchemaFactorySurveyList
SchemaFactorySurveyPatch
SchemaFactoryUser
SchemaFactoryUserList
Filter
Filters are applied before validation.
FormatterDateTimeToJson
Formatter DateTime to Json
FormatterIntToBool
FormatterMandatory
This class is extending the FormatterYnToBool class in revert mode to be able to translate null value to 'S'.
FormatterYnToBool
TransformerOutputActiveRecord
Registry
Handles the registering of validators and formatters
Transformer
TransformerException
ValidatorDate
Example config: 'expires' => ['date'] or 'expires' => ['date' => true]
ValidatorEmpty
Example config: 'expires' => ['empty' => false]
ValidatorLength
Example config (requires min and/or max): 'admin' => ['length' => ['min' => 1, 'max' => 50]] or 'admin' => ['length' => ['min' => 1]] or 'admin' => ['length' => ['max' => 50]]
ValidatorNull
Example config: 'expires' => ['null' => false]
ValidatorNumerical
Example config (optional min and max): 'tokenLength' => ['numerical' => true] or 'tokenLength' => ['numerical'] or 'tokenLength' => ['numerical' => ['min' => -1]] or 'tokenLength' => ['numerical' => ['max' => 50]] or 'tokenLength' => ['numerical' => ['min' => -1, 'max' => 50]]
ValidatorRange
Example config: 'showGroupInfo' => ['range' => ['B', 'N', 'D', 'X', 'I']]
ValidatorRegex
Example config: 'googleAnalyticsApiKey' => ['pattern' => '/^[a-zA-Z\-\d]*$/']
ValidatorRequired
Example config: 'expires' => ['required'] or 'expires' => ['required' => true] or required only on certain operation types 'expires' => ['required' => ['create', 'update']]
BigData
Class containing helper functions for dealing with "big data".
BigFile
Date_Time_Converter
Date and Time Converter by Elac v0.9.3 elacdude@gmail.com www.elacdude.com
DI
Dependency Injection
ExtensionInstaller
Base class for different extension installers.
ExtensionUpdater
ExtensionUpdaterServiceLocator
FileFetcher
Fetch files for the ExtensionInstaller to install.
FileFetcherUploadZip
Extension file fetcher for upload ZIP file.
GitVersionFetcher
PluginInstaller
Base class for different extension installers.
PluginUpdater
QuestionThemeInstaller
Base class for different extension installers.
RESTVersionFetcher
ThemeUpdater
VersionFetcher
VersionFetcherServiceLocator
Central Yii component to add and retrieve version fetcher strategies.
FormExtensionService
FormExtensionWidget
BaseInput
ButtonSwitchInput
CheckboxInput
Basic checkbox input.
DefaultBaseRenderer
FileInput
GlobalSettingsRenderer
RawHtmlInput
TextInput
Basic text input. No customized behaviour compared to base class.
SaveFailedException
Throw this exception from an input save-function when you want to show an alert.
jsonRPCClient
The object of this class are generic jsonRPC 1.0 clients http://json-rpc.org/wiki/specification
jsonRPCServer
This class build a json-RPC Server 1.0 http://json-rpc.org/wiki/specification
LSjsonRPCServer
This class build a json-RPC Server 1.0 http://json-rpc.org/wiki/specification
LSZend_XmlRpc_Response_Http
Menu
MenuButton
MenuItem
MersenneTwister
Custom random algorithm to get consistent behaviour between PHP versions.
ObjectPatchException
OpStandard
OpHandlerActiveRecordUpdate
OpHandlerException
OpType
OpTypeCreate
OpTypeDelete
OpTypeUpdate
Patcher
AuthPluginBase
EmailPluginBase
LimesurveyApi
Class exposing a Limesurvey API to plugins.
PluginEvent
PluginEventContent
PluginManager
Factory for limesurvey plugin objects.
PluginManagerShutdownFunction
Used as shutdown function during plugin loading, to turn off plugins that causes troubles.
SmtpOAuthPluginBase
DbStorage
DummyStorage
Save
SimpleTester
SimpleTester 1.1 CodeIgniter-library for the SimpleTest unit test library, http://simpletest.org/
ShowPasses
Display passes
SmallReporter
Displays a tiny div in upper right corner when ok
MinimalReporter
Minimal only displays on error
AppErrorHandler
Application error handling logic
Answer
Class Answer
AnswerL10n
Class SurveyLanguageSetting
ArchivedTableSettings
This is the model class for table "{{archived_table_settings}}".
Assessment
Class Assessment
AssetVersion
Class AssetVersion
PluginEventBehavior
Box
This is the model class for table "{{boxes}}".
Condition
Class Condition
DefaultValue
Class DefaultValue
DefaultValueL10n
Class DefaultValue
Dynamic
This class implements the basis for dynamic models.
ExpressionError
Class ExpressionError
ExtensionConfig
Thin wrapper class around extension config.xml file.
ExtensionUpdateInfo
Thin wrapper around extension update info.
FailedEmail
This is the model class for table "{{failed_emails}}".
FailedLoginAttempt
Class FailedLoginAttempt
InstallerConfigForm
Class InstallerConfigForm
Label
Class Label
LabelL10n
Class Label
LabelSet
Class LabelSet
LSActiveRecord
MapTutorialUsers
This is the model class for table "{{map_tutorial_users}}".
Notification
This is the model class for table "{{notifications}}".
Participant
This is the model class for table "{{participants}}".
ParticipantAttribute
Class ParticipantAttribute
ParticipantAttributeName
This is the model class for table "{{{{participant_attribute_names}}}}".
ParticipantAttributeNameLang
This is the model class for table "{{{{participant_attribute_names_lang}}}}".
ParticipantShare
This is the model class for table "{{participant_shares}}".
Permission
Class Permission
Permissiontemplates
This is the model class for table "{{permissiontemplates}}".
Plugin
This is the model class for table "{{plugins}}".
PluginDynamic
Dynamic model used by plugins to access their table(s).
PluginSetting
Class PluginSetting
Question
Class Question
QuestionAttribute
Class QuestionAttribute
QuestionBaseDataSet
This is a base class to enable all question tpyes to extend the general settings.
QuestionBaseRenderer
abstract Class QuestionTypeRoot The aFieldArray Array contains the following 0 => string qid 1 => string sgqa 2 => string questioncode 3 => string question 4 => string type 5 => string gid 6 => string mandatory, 7 => string conditionsexist, 8 => string usedinconditions 0 => string used in group.php for question count 10 => string new group id for question in randomization group (GroupbyGroup Mode)
QuestionCreate
Class used when creating new question.
QuestionGroup
Class QuestionGroup
QuestionGroupL10n
Class SurveyLanguageSetting
QuestionL10n
Class QuestionL10n
QuestionTemplate
QuestionTheme
This is the model class for table "{{question_themes}}".
QuestionType
Class QuestionType
Quota
Class Quota
QuotaLanguageSetting
QuotaMember
Class QuotaMember
Response
Relations
SavedControl
Class SavedControl
CoreQuestionAttributeProvider
Provides question attribute definitions from question types
BadRequestException
NotFoundException
PermissionDeniedException
PersistErrorException
QuestionHasConditionsException
Exception
FilterImportedResources
GroupHelper
ParticipantBlacklistHandler
PasswordManagement
This class contains all functions for the process of password reset and creating new administration users and sending email to those with a link to set the password.
PermissionManager
Service class for managing permission
PluginQuestionAttributeProvider
Provides question attribute definitions from plugins
ProxyExpressionManager
Proxy Expression Manager Service
ProxyQuestion
ProxyQuestion Service
ProxyQuestionGroup
Proxy Expression Manager Service
ProxySettingsUser
ProxySettingsUser Service
AnswersService
Question Aggregate Service
AttributesService
Question Aggregate Attributes Service
DeleteService
Question Aggregate Delete Service
L10nService
Question Aggregate L10n
QuestionService
Question Aggregate Service
SaveService
Question Aggregate Save Service
SubQuestionsService
Question Aggregate Service
QuestionAggregateService
Question Aggregate Service
QuestionAttributeFetcher
Fetches question attribute definitions from the available providers
QuestionAttributeHelper
QuestionAttributeProvider
Base class for question attribute definition providers
QuestionGroupService
QuickTranslation
This class is responsible for quick translation and all DB actions needed.
Quotas
GeneralSettings
Service GeneralSettings
LanguageConsistency
Survey Updater Service language consistency
LanguageSettings
Survey Updater Service LanguageSettings
TemplateConfiguration
Survey Updater Service template configuration
UrlParams
Survey Updater Service UrlParams
SurveyAggregateService
Survey Aggregate Service
SurveyIntegrity
Service class to fix integrity on a single survey
SurveyPermissions
This class is responsible for the relationship between permissions, users and surveys.
SurveysGroupCreator
Service class for survey group creation.
ThemeQuestionAttributeProvider
Provides question attribute definitions from question themes
UploadValidator
UserManager
Service class for managing users and their permissions
Session
Class Session Extend CActiveRecord and not LSActiveRecord to disable plugin event (session can be used a lot)
SettingGlobal
Class SettingGlobal
SettingsUser
This is the model class for table "{{settings_user}}".
Survey
Class Survey
SurveyActivator
Service class to activate survey.
SurveyDynamic
SurveyLanguageSetting
Class SurveyLanguageSetting
SurveyLight
Class SurveyLight
SurveyLink
Class SurveyLink
Surveymenu
This is the model class for table "{{surveymenu}}".
SurveymenuEntries
This is the model class for table "{{surveymenu_entries}}".
SurveymenuEntryData
SurveysGroups
This is the model class for table "{{surveys_groups}}".
SurveysGroupsettings
This is the model class for table "{{surveys_groupsettings}}".
SurveysInGroup
Class SurveysGroups
SurveyTimingDynamic
Class SurveyTimingDynamic
SurveyURLParameter
Class SurveyURLParameter
Template
Class Template
TemplateConfig
Class TemplateConfig Common methods for TemplateConfiguration and TemplateManifest
Timing
Dynamic response timing model.
Token
Class Token
TokenDynamic
Class TokenDynamic
Tutorial
This is the model class for table "{{tutorials}}".
TutorialEntry
This is the model class for table "{{tutorial_entry}}".
TutorialEntryRelation
This is the model class for table "{{tutorial_entry_groups}}".
UniqueNotification
Subclass of Notification, but with unique constraint.
User
Class User
UserGroup
Class UserGroup
UserInGroup
Class UserInGroup
UserInPermissionrole
This is the model class for table "{{user_in_permissionrole}}".
UserParser
Importing class to get users from a CSV file
CTestCase
ExpressionManagerTest
TODO: Why is it here? Move it to root tests folder!
WebTestCase
The base class for functional test cases.
GlobalSettings
GlobalSettings Controller
HelloWorld
Survey Common Action
HelloWorldController
HelloWorldModule
HelloWorldModule class file.
demoAddEmFunction
Example plugin that add a simple function
exampleFunctions
DemoDateSetting
DemoDateSetting Plugin for LimeSurvey
Example
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
noMailToExample
noMailToExample : just don't send email to example.org or example.com http://example.org/ is a great tool for demonstration and test, but sending an email to user@example.org: you receive 4 hour after a notification This plugin just disable sending email to this website, then you can use it when testing syste.
ShowResponse
NB: Deleting this class will break plugin API, since plugins then would have to extend PluginBase in the namespace instead of this class. This is especially a problem for plugins that should work on both 2.73 and 3.x, so please don't delete this class.
UnActivatable
Example plugin that can not be activated.
HelloWorld_Twig_Extension
This is an example to show you how to add custom twig extensions To add an advanced function to twig:

Traits

LSApplicationTrait
Trait for ConsoleApplication and LSYii_Application
AppTrait
QuestionGroupModelCollectionWithL10nsBySidTrait
QuestionGroupModelTrait
QuestionGroupModelWithL10nsByIdTrait
QuestionModelTrait
QuestionModelWithL10nsByIdAndLanguageTrait
SurveyModelTrait
AuthPermissionTrait
OpHandlerExceptionTrait
OpHandlerQuestionTrait
OpHandlerSurveyTrait
OpHandlerValidationTrait
ValidateTrait
Question Aggregate Validate Trait
PermissionTrait

Constants

ADODB_DATE_VERSION  = 0.33
ADOdb Date Library, part of the ADOdb abstraction library Download: http://phplens.com/phpeverywhere/
ADODB_NO_NEGATIVE_TS  = 1
ADODB_TEST_DATES  = 1
APPPATH  = \Yii::app()->getBasePath() . \DIRECTORY_SEPARATOR
APPPATH  = \BASEPATH . $application_folder . '/'
BASEPATH  = \dirname(__FILE__) . '/..'
BASEPATH  = '.'
BASEPATH  = '.'
BASEPATH  = \true
BASEPATH  = \str_replace("\\", "/", $system_path)
CHECKED  = ' checked="checked"'
EXT  = '.php'
EXT  = '.php'
FCPATH  = \str_replace(\SELF, '', __FILE__)
FLOAT  = 32
HTML  = 8
INT  = 16
K_PATH_IMAGES  = Template::getTemplatePath($aSurveyInfo['template']) . DIRECTORY_SEPARATOR
K_TCPDF_EXTERNAL_CONFIG  = \true
LDAP  = 64
LDAP_OPT_DIAGNOSTIC_MESSAGE  = 0x32
LEM_DEBUG_TIMING  = 1
LEM_DEBUG_VALIDATION_DETAIL  = 4
LEM_DEBUG_VALIDATION_SUMMARY  = 2
LEM_PRETTY_PRINT_ALL_SYNTAX  = 32
LOGO_ICON_URL  = App()->getConfig('styleurl') . '/Sea_Green/images/logo_icon.png'
LOGO_URL  = App()->getConfig('styleurl') . '/Sea_Green/images/logo.svg'
MAGIC_QUOTES  = 0
MAX_STRUCTURED_SYMBOLS  = 16
N1  = 3
N2  = 3
N3  = 40
N4  = 10
PARANOID  = 1
PCLZIP_TEMPORARY_DIR  = \Yii::app()->getConfig('tempdir') . \DIRECTORY_SEPARATOR
PRESENTATION  = gT('This is the LimeSurvey admin interface. Start to build your survey from here.')
PRINT_TEMPLATE_DIR  = $sFullTemplatePath
PRINT_TEMPLATE_URL  = $sFullTemplateUrl
QR_CACHE_DIR  = \false
QR_CACHEABLE  = \false
QR_DEFAULT_MASK  = 2
QR_ECLEVEL_H  = 3
QR_ECLEVEL_L  = 0
QR_ECLEVEL_M  = 1
QR_ECLEVEL_Q  = 2
QR_FIND_BEST_MASK  = \true
QR_FIND_FROM_RANDOM  = 2
QR_FORMAT_PNG  = 1
QR_FORMAT_TEXT  = 0
QR_IMAGE  = \true
QR_LOG_DIR  = \false
QR_MODE_8  = 2
QR_MODE_AN  = 1
QR_MODE_KANJI  = 3
QR_MODE_NUL  = -1
QR_MODE_NUM  = 0
QR_MODE_STRUCTURE  = 4
QR_PNG_MAXIMUM_SIZE  = 1024
QR_VECT  = \true
QRCAP_EC  = 3
QRCAP_REMINDER  = 2
QRCAP_WIDTH  = 0
QRCAP_WORDS  = 1
QRSPEC_VERSION_MAX  = 40
QRSPEC_WIDTH_MAX  = 177
QUESTION_START  = file_get_contents(getTemplatePath($thissurvey['template']) . '/question_start.pstpl')
ROOT  = \dirname(__FILE__)
SELECTED  = ' selected="selected"'
SELF  = \pathinfo(__FILE__, \PATHINFO_BASENAME)
SHOW_NO_ANSWER  = 1
STRUCTURE_HEADER_BITS  = 20
SYSDIR  = \trim(\strrchr(\trim(\BASEPATH, '/'), '/'), '/')
SYSTEM  = 4
TEST_BASE_URL  = 'http://localhost/testdrive/index-test.php/'
Change the following URL based on your server configuration Make sure the URL ends with a slash so that we can use relative URLs in test cases
UTF8  = 128
YII_DEBUG  = \false

Functions

SureRemoveDir()  : mixed
SureRemoveDir()  : mixed
subval_sort()  : array<string|int, mixed>
pluginExtractFilter()  : int
PCLZip callback for plugin ZIP install.
outputDatabase()  : mixed
Outputs a full dump of the current LimeSurvey database
_outputDBDescription()  : mixed
_outputDBData()  : mixed
_outputTableDescription()  : mixed
Outputs the table structure in sql format
_outputTableData()  : mixed
Outputs the table data in sql format
_outputRecords()  : mixed
_countNumberOfEntries()  : mixed
_getMaxNbRecords()  : mixed
_getDbName()  : mixed
Get the database name
initKcfinder()  : mixed
sTranslateLangCode2CK()  : mixed
PrepareEditorScript()  : mixed
getEditor()  : string
Returns Editor.
getPopupEditor()  : string
getModalEditor()  : string
getInlineEditor()  : mixed
getLoaderHTML()  : mixed
XMLImportGroup()  : mixed
This function imports a LimeSurvey .lsg question group XML file
XMLImportQuestion()  : array<string|int, mixed>
This function imports a LimeSurvey .lsq question XML file
XMLImportLabelsets()  : array<string|int, mixed>
XMLImportLabelsets() Function resp[onsible to import a labelset from XML format.
importSurveyFile()  : mixed
XMLImportSurvey()  : mixed
This function imports a LimeSurvey .lss survey XML file
checkWrongQuestionAttributes()  : mixed
This function checks if there are set wrong values ('Y' or 'N') into table question_attributes. These are set to 1 and 0 if needed.
XMLImportTokens()  : mixed
XMLImportResponses()  : mixed
CSVImportResponses()  : mixed
This function imports a CSV file into the response table CSV file is deleted during process
XMLImportTimings()  : mixed
TSVImportSurvey()  : string
Import survey from an TSV file template that does not require assigning of GID or QID values.
createXMLfromData()  : mixed
importDefaultValues()  : void
Import default values inside $xml, record process in $results Also imports defaultvalue_l10ns.
fileCsvToUtf8()  : resource
Read a csv file and return a tmp resources to same file in utf8 CSV file is deleted during process
updateset()  : mixed
insertlabelset()  : LabelSet
modlabelsetanswers()  : mixed
fixorder()  : mixed
Function rewrites the sortorder for a label set
permissionsAsArray()  : array<string|int, mixed>
Checks Permission for the current user and returns an array with Permissions
createChart()  : mixed
Generate a chart for a question
getQuestionMapData()  : array<string|int, mixed>
Return data to populate a Google Map
buildSelects()  : mixed
Builds the list of addon SQL select statements that builds the query result set
square()  : mixed
Simple function to square a value
getEncryptedCondition()  : mixed
getSurveyDefaultSettings()  : mixed
doreplacement()  : mixed
getListOfFiles()  : mixed
mkdir_p()  : mixed
themeoptions()  : mixed
multiarray_search()  : mixed
recursive_in_array()  : mixed
is_template_editable()  : mixed
This function checks if a certain template may be by modified, copied, deleted according to the settings in config.php
templateExtractFilter()  : int
This is a PCLZip callback function that ensures only files are extracted that have a valid extension
emailTokens()  : array<string|int, mixed>
Sends email to tokens - invitations, reminders, registers, and confirmations Seems used only in remote_control : maybe move it to ?
adodb_date_test_date()  : mixed
adodb_date_test_strftime()  : mixed
adodb_date_test()  : mixed
Test Suite
adodb_dow()  : mixed
Returns day of week, 0 = Sunday,... 6=Saturday.
_adodb_is_leap_year()  : mixed
Checks for leap year, returns true if it is. No 2-digit year check. Also handles julian calendar correctly.
adodb_is_leap_year()  : mixed
checks for leap year, returns true if it is. Has 2-digit year check
adodb_year_digit_check()  : mixed
Fix 2-digit years. Works for any century.
adodb_get_gmt_diff_ts()  : mixed
adodb_get_gmt_diff()  : mixed
get local time zone offset from GMT. Does not handle historical timezones before 1970.
adodb_getdate()  : mixed
Returns an array with date info.
adodb_validdate()  : mixed
_adodb_getdate()  : mixed
Low-level function that returns the getdate() array. We have a special $fast flag, which if set to true, will return fewer array values, and is much faster as it does not calculate dow, etc.
adodb_tz_offset()  : mixed
adodb_gmdate()  : mixed
adodb_date2()  : mixed
adodb_date()  : string
Return formatted date based on timestamp $d
adodb_gmmktime()  : mixed
Returns a timestamp given a GMT/UTC time.
adodb_mktime()  : mixed
Return a timestamp given a local time. Originally by jackbbs.
adodb_gmstrftime()  : mixed
adodb_strftime()  : mixed
gT()  : string
Returns $sToTranslate translated to $sLanguage (defaults to lang set in session) escaped with $sEscapeMode
eT()  : void
As gT(), but echoes directly
ngT()  : string
Translation helper function for plural forms
neT()  : mixed
Translation helper function for plural forms which outputs right away
quoteText()  : mixed|string
Quotes a translation according to purpose if sEscapeMode is null, we use HTML method because probably we had to specify null as sEscapeMode upstream
getSurveyList()  : string|array<string|int, mixed>
getSurveyList() Queries the database (survey table) for a list of existing surveys
getGidPrevious()  : int|string
getGidPrevious() returns the Gid of the group prior to the current active group
getGidNext()  : int|string
getGidNext() returns the Gid of the group next to the current active group
convertGETtoPOST()  : string
convertGETtoPOST a function to create a post Request from get parameters !!! This functions result has to be wrappen in singlequotes!
calculateTotalFileUploadUsage()  : mixed
This function calculates how much space is actually used by all files uploaded using the File Upload question type
getDirectorySize()  : int
getMaxGroupOrder()  : int
Queries the database for the maximum sortorder of a group and returns the next higher one.
getGroupOrder()  : int
Queries the database for the sortorder of a group.
getMaxQuestionOrder()  : int
Queries the database for the maximum sort order of questions inside question group.
setupColumns()  : array<string|int, mixed>
setupColumns() defines all the html tags to be wrapped around various list type answers.
alternation()  : mixed
longestString()  : int
longestString() returns the length of the longest string past to it.
getGroupList3()  : mixed
getGroupListLang()  : string
put your comment there.
getUserList()  : array<string|int, mixed>
Returns a user list. If 'usercontrolSameGroupPolicy' is set and set to true, only users which are in the same group as me (--> logged in user) will be returned. Superadmin always gets the full list of users.
getSurveyInfo()  : array<string|int, mixed>|bool
Gets all survey infos in one big array including the language specific settings
templateDefaultTexts()  : array<string|int, mixed>
Returns the default email template texts as array
groupOrderThenQuestionOrder()  : int
Compares two elements from an array (passed by the usort function) and returns -1, 0 or 1 depending on the result of the comparison of the sort order of the group_order and question_order field Used by : - remotecontrol_handle->export_statistics with merging group and question attributes (all in same array) - checkQuestions() in activate_helper function with ?
fixMovedQuestionConditions()  : mixed
returnGlobal()  : array<string|int, mixed>|bool|mixed|int|null
This function returns POST/REQUEST vars, for some vars like SID and others they are also sanitized TODO: extends Yii:getParam
sendCacheHeaders()  : mixed
getExtendedAnswer()  : string
validateEmailAddress()  : mixed
Validate an email address - also supports IDN email addresses
validateEmailAddresses()  : string
Validate an list of email addresses - either as array or as semicolon-limited text
createCompleteSGQA()  : array<string|int, mixed>
This functions generates a a summary containing the SGQA for questions of a survey, enriched with options per question It can be used for the generation of statistics. Derived from StatisticsUserController
createFieldMap()  : array<string|int, mixed>
This function generates an array containing the fieldcode, and matching data in the same order as the activate script
hasFileUploadQuestion()  : bool
Returns true if the given survey has a File Upload Question Type
createTimingsFieldMap()  : array<string|int, mixed>
This function generates an array containing the fieldcode, and matching data in the same order as the activate script
arraySearchByKey()  : array<string|int, mixed>
buildLabelSetCheckSumArray()  : mixed
getQuestionAttributeValue()  : string
Returns the questionAttribtue value set or '' if not set
questionTitleSort()  : mixed
HTMLEscape()  : mixed
make a string safe to include in an HTML 'value' attribute.
stripCtrlChars()  : string
This function strips UTF-8 control characters from strings, except tabs, CR and LF - it is intended to be used before any response data is saved to the response table
javascriptEscape()  : mixed
jsonEscape()  : mixed
SendEmailMessage()  : bool
This function mails a text $body to the recipient $to.
flattenText()  : string
This functions removes all HTML tags, Javascript, CRs, linefeeds and other strange chars from a given text
getArrayFilterExcludesCascadesForGroup()  : array<string|int, mixed>
getArrayFilterExcludesCascadesForGroup() queries the database and produces a list of array_filter_exclude questions and targets with in the same group
createPassword()  : mixed
languageDropdown()  : mixed
languageDropdownClean()  : string
Creates a <select> HTML element for language selection for this survey
rmdirr()  : bool
This function removes a directory recursively
CSVUnquote()  : mixed
This function removes surrounding and masking quotes from the CSV field
incompleteAnsFilterState()  : string|bool
This function return actual completion state
isCaptchaEnabled()  : bool|null
isCaptchaEnabled($screen, $usecaptchamode)
tableExists()  : bool
Check if a table does exist in the database
isTokenCompletedDatestamped()  : mixed
dateShift()  : string
example usage $date = "2006-12-31 21:00"; $shift "+6 hours"; // could be days, weeks... see function strtotime() for usage
getBounceEmail()  : mixed
getEmailFormat()  : mixed
hasTemplateManageRights()  : mixed
translateLinks()  : string
Translate links which are in any answer/question/survey/email template/label set to their new counterpart
checkOldLinks()  : bool
Returns true if there are old links in answer/question/survey/email template/label set texts.
reverseTranslateFieldNames()  : array<string|int, mixed>|bool
This function creates the old fieldnames for survey import
hasResources()  : bool
put your comment there.
randomChars()  : string
Creates a random sequence of characters
conditionalNewlineToBreak()  : mixed
used to translate simple text to html (replacing \n with <br />
breakToNewline()  : mixed
safeDie()  : void
Provides a safe way to end the application
fixCKeditorText()  : mixed
filterForAttributes()  : bool
This is a helper function for getAttributeFieldNames
getAttributeFieldNames()  : array<string|int, mixed>
Retrieves the attribute field names from the related survey participants table
getParticipantAttributes()  : array<string|int, mixed>
Returns the full list of attribute token fields including the properties for each field Use this instead of plain Survey::model()->findByPk($iSurveyID)->tokenAttributes calls because Survey::model()->findByPk($iSurveyID)->tokenAttributes may contain old descriptions where the fields does not physically exist
getTokenFieldsAndNames()  : array<string|int, mixed>
Retrieves the attribute names from the related survey participants table
stripJavaScript()  : string
This function strips any content between and including <javascript> tags
showJavaScript()  : string
This function converts emebedded Javascript to Text
cleanTempDirectory()  : mixed
This function cleans files from the temporary directory being older than 1 day
useFirebug()  : mixed
convertDateTimeFormat()  : string
This is a convenience function for the coversion of datetime values
convertToGlobalSettingFormat()  : string
This is a convenience function to convert any date, in any date format, to the global setting date format Check if the time shoul be rendered also
removeBOM()  : string
This function removes the UTF-8 Byte Order Mark from a string
getTemplatePath()  : string
This function returns the complete directory path to a given template name
getTemplateURL()  : string
This function returns the complete URL path to a given template name
getSubQuestions()  : array<string|int, mixed>
Return an array of subquestions for a given sid/qid
getXMLWriter()  : mixed
Wrapper function to retrieve an xmlwriter object and do error handling if it is not compiled into PHP
SSLRedirect()  : mixed
SSLRedirect() generates a redirect URL for the appropriate SSL mode then applies it.
enforceSSLMode()  : mixed
enforceSSLMode() $force_ssl is on or off, it checks if the current request is to HTTPS (or not). If $force_ssl is on, and the request is not to HTTPS, it redirects the request to the HTTPS version of the URL, if the request is to HTTPS, it rewrites all the URL variables so they also point to HTTPS.
getFullResponseTable()  : array<string|int, mixed>
Creates an array with details on a particular response for display purposes Used in Print answers, Detailed response view and Detailed admin notification email
isNumericInt()  : bool|int
Check if $str is an integer, or string representation of an integer
short_implode()  : string
Implode and sort content array for very long arrays
includeKeypad()  : mixed
Include Keypad headers
translateInsertansTags()  : mixed
This function replaces the old insertans tags with new ones across a survey
replaceExpressionCodes()  : mixed
Replaces EM variable codes in a current survey with a new one
cleanLanguagesFromSurvey()  : void
cleanLanguagesFromSurvey() removes any languages from survey tables that are not in the passed list
fixLanguageConsistency()  : bool
fixLanguageConsistency() fixes missing groups, questions, answers, quotas & assessments for languages on a survey
getLastInsertID()  : string
Retrieves the last Insert ID realiable for cross-DB applications
getGroupDepsForConditions()  : array<string|int, mixed>
getGroupDepsForConditions() get Dependencies between groups caused by conditions
getQuestDepsForConditions()  : array<string|int, mixed>
getQuestDepsForConditions() get Dependencies between groups caused by conditions
dbQuoteAll()  : string
Escapes a text value for db
checkMoveQuestionConstraintsForConditions()  : array<string|int, mixed>
checkMoveQuestionConstraintsForConditions()
shouldFilterUserGroupList()  : mixed
Determines whether the list of user groups will need filtering before viewing.
getUserGroupList()  : mixed
Get a list of all user groups All user group or filtered according to usercontrolSameGroupPolicy
modifyDatabase()  : bool
Run an arbitrary sequence of semicolon-delimited SQL commands
getLabelSets()  : array<string|int, mixed>
Returns labelsets for given language(s), or for all if null
getHeader()  : string
get the header
doHeader()  : mixed
getPrintableHeader()  : string
This function returns the header for the printable survey
getFooter()  : string
This function returns the Footer as result string If you want to echo the Footer use doFooter()!
doFooter()  : mixed
fixSubquestions()  : mixed
This function fixes the group ID and type on all subquestions, or removes the subquestions if the parent question's type doesn't allow them.
ls_json_encode()  : mixed
Must use ls_json_encode to json_encode content, otherwise LimeExpressionManager will think that the associative arrays are expressions and try to parse them.
json_decode_ls()  : mixed
Decode a json string, sometimes needs stripslashes
aEncodingsArray()  : array<string|int, mixed>
Return accepted codingsArray for importing files
ellipsize()  : string
Ellipsize String
getIPAddress()  : string
This function tries to returns the 'real' IP address under all configurations Do not rely security-wise on the detected IP address as except for REMOTE_ADDR all fields could be manipulated by the web client
getRealIPAddress()  : string
This function returns the real IP address and should mainly be used for security sensitive purposes If you want to use the IP address for language detection or similar, use getIPAddress() instead
getBrowserLanguage()  : mixed
This function tries to find out a valid language code for the language of the browser used If it cannot find it it will return the default language from global settings
array_diff_assoc_recursive()  : mixed
folderSize()  : int
Calculate folder size NB: If this function is changed, please notify LimeSurvey GmbH.
humanFilesize()  : string
Format size in human readable format.
convertPHPSizeToBytes()  : int
This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
getMaximumFileUploadSize()  : mixed
decodeTokenAttributes()  : array<string|int, mixed>|mixed
Decodes token attribute data because due to bugs in the past it can be written in JSON or be serialized - future format should be JSON as serialized data can be exploited
getSerialClass()  : string|null
regenerateCSRFToken()  : mixed
Force Yii to create a new CSRF token by removing the old one
get_absolute_path()  : string
A function to remove ../ or ./ from paths to prevent directory traversal
isJson()  : bool
Check if string is JSON array
isAssociativeArray()  : bool
Check if array is associative
createRandomTempDir()  : string
Create a directory in tmp dir using a random string
getRandomString()  : string
Generate a random string, using openssl if available, else using md5
crypto_rand_secure()  : string
Get a random number between two values using openssl_random_pseudo_bytes
isZipBomb()  : int
Test if a given zip file is Zip Bomb see comment here : http://php.net/manual/en/function.zip-entry-filesize.php
get_zip_originalsize()  : int
Get the original size of a zip archive to prevent Zip Bombing see comment here : http://php.net/manual/en/function.zip-entry-filesize.php
safecount()  : int
PHP7 has created a little nasty bomb with count throwing erroros on uncountables This is to "fix" this problem
switchMSSQLIdentityInsert()  : void
This function switches identity insert on/off for the MSSQL database
resourceExtractFilter()  : mixed
Helper to filter the contents of a .zip file uploaded into the file manager
recursive_preg_replace()  : string|array<string|int, mixed>
Applies preg_replace recursively until $recursion_limit is exceeded or no more replacements are done.
standardDeviation()  : float
Returns the standard deviation of supplied $numbers
isAbsolutePath()  : bool
Checks if the specified path is absolute.
csvEscape()  : string
Escapes a string for use in a CSV file
dbExecuteAssoc()  : bool|CDbDataReader
dbRandom()  : string
Return the database-specific random function to use in ORDER BY sql statements
dbSelectTablesLike()  : string
Return a sql statement for finding LIKE named tables Be aware that you have to escape underscore chars by using a backslash otherwise you might get table names returned you don't want
dbGetTablesLike()  : array<string|int, mixed>
Gets the table names. Do not prefix.
stripTagsFull()  : string
Strips html tags and replaces new lines
isNumericExtended()  : bool
Returns true if passed $value is numeric
strSplitUnicode()  : string
Returns splitted unicode string correctly source: http://www.php.net/manual/en/function.str-split.php#107658
quoteSPSS()  : mixed
Quotes a string with surrounding quotes and masking inside quotes by doubling them
SPSSExportData()  : mixed
Exports CSV response data for SPSS and R
SPSSGetValues()  : array<string|int, mixed>|bool
Check it the gives field has a labelset and return it as an array if true
SPSSFieldMap()  : array<string|int, mixed>
Creates a fieldmap with all information necessary to output the fields
SPSSGetQuery()  : CDbCommand
Creates a query string with all fields for the export
buildXMLFromQuery()  : mixed
buildXMLFromQuery() creates a datadump of a table in XML using XMLWriter
surveyGetXMLStructure()  : mixed
from export_structure_xml.php
surveyGetXMLData()  : mixed
from export_structure_xml.php
getXMLDataSingleTable()  : string|bool
Exports a single table to XML
QueXMLCleanup()  : string
from export_structure_quexml.php
QueXMLCreateFree()  : mixed
from export_structure_quexml.php
QueXMLFixedArray()  : mixed
from export_structure_quexml.php
QueXMLSkipTo()  : bool|string
Calculate if this item should have a QueXMLSkipTo element attached to it
QueXMLCreateFixed()  : mixed
from export_structure_quexml.php
quexml_get_lengthth()  : mixed
from export_structure_quexml.php
quexml_create_multi()  : mixed
from export_structure_quexml.php
quexml_create_subQuestions()  : mixed
from export_structure_quexml.php
quexml_set_default_value_rank()  : mixed
Set defaultValue attribute of provided element from response table
quexml_set_default_value()  : mixed
Set defaultValue attribute of provided element from response table
quexml_reformat_date()  : void
Format defaultValue of Date/Time questions according to question date format
quexml_create_question()  : mixed
Create a queXML question element
quexml_export()  : mixed
Export quexml survey.
group_export()  : mixed
groupGetXMLStructure()  : mixed
questionExport()  : mixed
questionGetXMLStructure()  : mixed
tokensExport()  : mixed
CPDBExport()  : mixed
stringSize()  : int
Find the string size according DB size for existing question Column name must be SGQA currently
numericSize()  : string
Find the numeric size according DB size for existing question for SPSS export Column name must be SGQA currently
tsvSurveyExport()  : string
Export survey to TSV format It is using existing XML function to get the same source data as lss format
sortArrayByColumn()  : mixed
Sort array by column name
writeXmlFromArray()  : mixed
Write XML from Associative Array, recursive function
surveyGetThemeConfiguration()  : mixed
Write XML structure for themes
MaskFormula()  : mixed
buildXMLFromArray()  : mixed
buildXMLFromArray() dumps an array to XML using XMLWriter, in the same format as buildXMLFromQuery()
cmpErrorTokens()  : int
Used by usort() to order Error tokens by their position within the string This must be outside of the class in order to work in PHP 5.2
cmpWarningTokens()  : int
exprmgr_count()  : int
Count the number of answered questions (non-empty)
exprmgr_countif()  : int
Count the number of answered questions (non-empty) which match the first argument
exprmgr_countifop()  : int
Count the number of answered questions (non-empty) which meet the criteria (arg op value)
exprmgr_stripos()  : int|false
Find position of first occurrence of unicode string in a unicode string, case insensitive
exprmgr_stristr()  : string|false
Finds first occurrence of a unicode string within another, case-insensitive
exprmgr_strlen()  : int
Get unicode string length
exprmgr_strpos()  : int|false
Find position of first occurrence of unicode string in a unicode string
exprmgr_strstr()  : string|false
Finds first occurrence of a unicode string within another
exprmgr_strtolower()  : string
Make an unicode string lowercase
exprmgr_strtoupper()  : string
Make an unicode string uppercase
exprmgr_substr()  : string
Get part of unicode string
exprmgr_sumifop()  : int
Sum of values of answered questions which meet the criteria (arg op value)
exprmgr_checkdate()  : bool
Validate a Gregorian date
exprmgr_convert_value()  : int|null
Find the closest matching Numerical input values in a list an replace it by the corresponding value within another list
exprmgr_date()  : string|false
Return format a local time/date Need to test if timestamp is numeric (else E_WARNING with debug>0)
exprmgr_abs()  : mixed
exprmgr_if()  : mixed
If $test is true, return $iftrue, else return $iffalse
exprmgr_int()  : int
Return true if the variable is an integer for LimeSurvey Allow usage of numeric answercode as int Can not use is_int due to SQL DECIMAL system.
exprmgr_list()  : string
Join together $args[0-N] with ', '
exprmgr_listifop()  : string
Implementation of listifop( $cmpAttr, $op, $value, $retAttr, $glue, $sgqa1, ..., sgqaN ) Return a list of retAttr from sgqa1...sgqaN which pass the critiera (cmpAttr op value)
exprmgr_log()  : float
return log($arg[0],$arg[1]=e)
exprmgr_mktime()  : int|bool
Get Unix timestamp for a date : false if parameters is invalid.
exprmgr_join()  : string
Join together $args[N]
exprmgr_implode()  : string
Join together $args[1-N] with $arg[0]
exprmgr_empty()  : bool
Return true if the variable is NULL or blank.
exprmgr_stddev()  : float
Compute the Sample Standard Deviation of a set of numbers ($args[0-N])
expr_mgr_htmlspecialchars()  : string
Javascript equivalent does not cope well with ENT_QUOTES and related PHP constants, so set default to ENT_QUOTES
expr_mgr_htmlspecialchars_decode()  : string
Javascript equivalent does not cope well with ENT_QUOTES and related PHP constants, so set default to ENT_QUOTES
exprmgr_regexMatch()  : bool
Return true if $input matches the regular expression $pattern
geterrors_exprmgr_regexMatch()  : string|null
Return error information from pattern of regular expression $pattern
exprmgr_fixnum()  : string
Display number with comma as radix separator, if needed
exprmgr_unique()  : bool
Returns true if all non-empty values are unique
cmpQuestionSeq()  : int
Used by usort() to order $this->questionSeq2relevance in proper order
loadanswers()  : mixed
getLanguageChangerDatas()  : array<string|int, mixed>|false
This function creates the language selector for a particular survey
getLanguageChangerDatasPublicList()  : array<string|int, mixed>|bool
This function creates the language selector for the public survey index page
makeFlashMessage()  : string
Construct flash message container Used in templatereplace to replace {FLASHMESSAGE} in startpage.tstpl
checkUploadedFileValidity()  : mixed
checkUploadedFileValidity used in SurveyRuntimeHelper
addtoarray_single()  : mixed
Takes two single element arrays and adds second to end of first if value exists Why not use array_merge($array1,array_filter($array2);
submittokens()  : mixed
Marks a tokens as completed and sends a confirmation email to the participiant.
sendSubmitNotifications()  : mixed
Send a submit notification to the email address specified in the notifications tab in the survey settings
getResponseTableReplacement()  : string
create ANSWERTABLE replacement field content
saveFailedEmail()  : bool
Saves a failed email whenever processing and sensing an email fails or overwrites a found entry with updated values
failedEmailSuccess()  : mixed
submitfailed()  : string
submitfailed : used in em_manager_helper.php
buildsurveysession()  : void
This function builds all the required session variables when a survey is first started and it loads any answer defaults from command line or from the table defaultvalues It is called from the related format script (group.php, question.php, survey.php) if the survey has just started.
checkPassthruLabel()  : void
Check if a passthru label and value have been included in the query url
prefillFromCommandLine()  : void
Prefill startvalues from command line param
initFieldArray()  : void
randomizationGroupsAndQuestions()  : void
Apply randomizationGroup and randomizationQuestion to session fieldmap
randomizationGroup()  : array<string|int, mixed>
Randomization group for groups
randomizationQuestion()  : array<string|int, mixed>
Randomization group for questions
finalizeRandomization()  : array<string|int, mixed>
Stuff?
testIfTokenIsValid()  : array<string|int, string>
Test if token is valid
getRenderWay()  : string
Returns which way should be rendered
renderRenderWayForm()  : void
Render token, captcha or register form
resetAllSessionVariables()  : void
Resets all session variables for this survey
setTotalSteps()  : void
The number of "pages" that will be presented in this survey The number of pages to be presented will differ depending on the survey format Set totalsteps in session
breakOutAndCrash()  : void
renderError()  : mixed
getNavigatorDatas()  : mixed
TODO: call this function from surveyRuntimeHelper TODO: remove surveymover()
doAssessment()  : array<string|int, mixed>
Caculate assessement scores
UpdateGroupList()  : mixed
Update SESSION VARIABLE: grouplist A list of groups in this survey, ordered by group name.
updateFieldArray()  : mixed
FieldArray contains all necessary information regarding the questions This function is needed to update it in case the survey is switched to another language
checkCompletedQuota()  : array<string|int, mixed>|void
checkCompletedQuota() returns matched quotas information for the current response
encodeEmail()  : mixed|string
encodeEmail : encode admin email in public part
getReferringUrl()  : string
GetReferringUrl() returns the referring URL
display_first_page()  : mixed
Shows the welcome page, used in group by group and question by question mode
killSurveySession()  : mixed
killSurveySession : reset $_SESSION part for the survey
resetTimers()  : mixed
Resets all question timers by expiring the related cookie - this needs to be called before any output is done
resetQuestionTimers()  : void
Removes all question timers for this survey from local storage
SetSurveyLanguage()  : mixed
Set the public survey language Control if language exist in this survey, else set to survey default language if $surveyid <= 0 : set the language to default site language
getMove()  : string
getMove get move button clicked
getSideBodyClass()  : string
Get the margin class for side-body div depending on side-menu behaviour config and page (edit or not etc).
cookieConsentLocalization()  : array<string|int, string>
For later use, don't remove.
getForwardParameters()  : array<string, mixed>
Returns an array of URL parameters that can be forwarded
App()  : LSYii_Application
Helper function to replace calls to Yii::app() and enable correct code completion.
traceVar()  : mixed
If debug = 2 in application/config.php this will produce output in the console / firebug similar to var_dump. It will also include the filename and line that called this method.
getGlobalSetting()  : string
Returns a global setting
ldap_getCnx()  : mixed
ldap_bindCnx()  : mixed
ldap_readattr()  : mixed
ldap_search_withScope()  : mixed
ldap_doTokenSearch()  : mixed
prepareLDAPQuery()  : mixed
setNoAnswerMode()  : mixed
setNoAnswerMode
retrieveAnswers()  : array<string|int, mixed>
This function returns an array containing the "question/answer" html display and a list of the question/answer fieldnames associated. It is called from question.php, group.php, survey.php or preview.php
mandatory_message()  : mixed
validation_message()  : array<string|int, mixed>
file_validation_message()  : mixed
mandatory_popup()  : mixed
validation_popup()  : mixed
file_validation_popup()  : mixed
return_timer_script()  : string
currentRelevecanceClass()  : string
Return class of a specific row (hidden by relevance)
return_display_style()  : mixed
return_array_filter_strings()  : mixed
testKeypad()  : string
do_language()  : mixed
do_list_dropdown()  : mixed
do_list_radio()  : mixed
do_listwithcomment()  : mixed
do_ranking()  : mixed
do_multiplechoice()  : mixed
do_multiplechoice_withcomments()  : mixed
do_file_upload()  : mixed
do_multipleshorttext()  : mixed
do_numerical()  : mixed
do_shortfreetext()  : mixed
getLatLongFromIp()  : mixed
do_longfreetext()  : mixed
do_hugefreetext()  : mixed
do_yesno()  : array<string|int, mixed>
Renders Yes/No Question Type.
do_gender()  : array<string|int, mixed>
Renders Gender Question Types.
do_array_5point()  : array<string|int, mixed>
Construct answer part array_5point
do_array_10point()  : array<string|int, mixed>
Construct answer part array_10point
do_array_yesnouncertain()  : mixed
do_array_increasesamedecrease()  : mixed
do_array()  : mixed
do_array_texts()  : mixed
do_array_multiflexi()  : mixed
do_arraycolumns()  : array<string|int, mixed>
Renders array by column question type.
do_array_dual()  : mixed
getLabelInputWidth()  : array<string|int, mixed>
Find the label / input width
fillDate()  : string
Take a date string and fill out missing parts, like day, hour, minutes (not seconds).
doRender()  : mixed
Render the question view.
templatereplace()  : string
This function replaces keywords in a text and is mainly intended for templates If you use this functions put your replacement strings into the $replacements variable instead of using global variables NOTE - Don't do any embedded replacements in this function. Create the array of replacement values and they will be done in batch at the end
getStandardsReplacementFields()  : mixed
ReplaceFields()  : mixed
PassthruReplace()  : string
passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables which it then substitutes for parameter data sent in the initial URL and stored in the session array containing responses
nice_addslashes()  : mixed
sanitize_filename()  : mixed
Function: sanitize_filename Returns a sanitized string, typically for URLs.
beautify_filename()  : mixed
sanitize_dirname()  : mixed
Function: sanitize_dirname sanitizes a string that will be used as a directory name
sanitize_paranoid_string()  : mixed
sanitize_cquestions()  : mixed
sanitize_system_string()  : mixed
sanitize_xss_string()  : mixed
sanitize_sql_db_tablename()  : mixed
sanitize_ldap_string()  : mixed
sanitize_html_string()  : mixed
sanitize_int()  : mixed
sanitize_user()  : mixed
sanitize_userfullname()  : mixed
sanitize_labelname()  : mixed
sanitize_float()  : mixed
sanitize()  : mixed
check_paranoid_string()  : mixed
check_int()  : mixed
check_float()  : mixed
check_html_string()  : mixed
check_system_string()  : mixed
check()  : bool
sanitize_languagecode()  : mixed
sanitize_languagecodeS()  : mixed
sanitize_signedint()  : mixed
check_ip_address()  : bool
Checks the validity of IP address $ip
check_absolute_url()  : bool
Returns true if the argument is an absolute URL (either starting with schema+domain or just "/").
sanitize_alphanumeric()  : string
Remove all chars from $value that are not alphanumeric or dash or underscore
getDateFormatData()  : mixed
Returns all available dateformats in a structured aray If $iDateFormat is given only the particual dateformat will be returned
getLanguageData()  : mixed
getRadixPointData()  : int|array<string|int, mixed>
Returns avaliable formats for Radix Points (Decimal Separators) or returns radix point info about a specific format.
getPHPDateFromDateFormat()  : mixed
Convert a 'dateformat' format string to a 'phpdate' format.
getJSDateFromDateFormat()  : mixed
Convert a 'dateformat' format string to a 'jsdate' format.
getDateFormatDataForQID()  : mixed
Get the date format details for a specific question.
getDateFormatForSID()  : mixed
Get the date format for a specified survey
canShowDatePicker()  : mixed
Check whether we can show the JS date picker with the current format
getLanguageCodefromLanguage()  : int|string
Returns a language code from the name
getLanguageNameFromCode()  : string|array<string|int, mixed>
Returns a language name from the code
getLanguageRTL()  : mixed
getLanguageDetails()  : array<string|int, mixed>
Returns the locale settings for a certain language code
convertLStoDateTimePickerLocale()  : mixed
This functions translates LimeSurvey specific locale code to a matching datetimepicker locale
getLanguageDataRestricted()  : mixed
userSort()  : mixed
userSortNative()  : mixed
UTF8Strrev()  : string
This function support the ability NOT to reverse numbers (for example when you output a phrase as a parameter for a SWF file that can't handle RTL languages itself, but obviously any numbers should remain the same as in the original phrase).
dummy_twig_translation_helper()  : void
Dummy helper intended to facilitate "twig only" strings to be picked by Translations Bot.
CheckForDBUpgrades()  : mixed
This functions checks if the databaseversion in the settings table is the same one as required If not then the necessary upgrade procedures are run
ShowDBUpgradeNotice()  : string
getDBConnectionStringProperty()  : mixed
db_upgrade_all()  : mixed
updateEncryptedValues450()  : mixed
Update previous encrpted values to new encryption
decryptCPDBTable450()  : void
Update encryption for CPDB participants
decryptParticipantTables450()  : void
Update encryption for survey participants
decryptResponseTables450()  : void
Update encryption for survey responses
decryptArchivedTables450()  : void
Update Encryption for archived tables
createFieldMap450()  : array<string|int, mixed>
Returns the fieldmap for responses
upgradeArchivedTableSettings446()  : void
Import previously archived tables to ArchivedTableSettings
extendDatafields429()  : mixed
upgradeSurveyTables402()  : mixed
upgradeTokenTables402()  : mixed
extendDatafields364()  : mixed
upgradeSurveyTimings350()  : mixed
resetTutorials337()  : void
upgrade333()  : void
upgrade331()  : void
upgrade330()  : void
upgrade328()  : void
upgrade327()  : void
transferPasswordFieldToText()  : mixed
createSurveyMenuTable()  : void
createSurveysGroupSettingsTable()  : void
createSurveyGroupTables306()  : void
upgradeTemplateTables304()  : void
upgradeTemplateTables298()  : void
upgradeTokenTables256()  : mixed
upgradeSurveyTables255()  : mixed
upgradeSurveyTables254()  : mixed
upgradeSurveyTables253()  : mixed
upgradeBoxesTable251()  : mixed
createBoxes250()  : mixed
Create boxes table
fixKCFinder184()  : mixed
upgradeSurveyTables183()  : mixed
upgradeSurveyTables181()  : mixed
upgradeTokenTables181()  : mixed
upgradeTokenTables179()  : mixed
upgradeSurveys177()  : mixed
upgradeTokens176()  : mixed
This function removes the old CPDB fields in token tables replaces them with standard attribute fields and records the mapping information in the attributedescription field in the survey table instead
upgradeCPDBAttributeDefaultNames173()  : mixed
upgradePermissions166()  : mixed
Converts global permissions from users table to the new permission system, and converts template permissions from template_rights to new permission table
upgradeSurveyTables164()  : string|null
Make sure all active tables have the right sized token field
upgradeSurveys156()  : mixed
upgradeTokens148()  : mixed
upgradeQuestionAttributes148()  : mixed
upgradeSurveyTimings146()  : mixed
upgradeTokens145()  : mixed
upgradeSurveys145()  : mixed
upgradeSurveyPermissions145()  : mixed
upgradeTables143()  : mixed
upgradeQuestionAttributes142()  : mixed
upgradeSurveyTables139()  : mixed
upgradeTokenTables134()  : mixed
alterColumn()  : mixed
addColumn()  : mixed
setTransactionBookmark()  : mixed
Set a transaction bookmark - this is critical for Postgres because a transaction in Postgres cannot be continued unless you roll back to the transaction bookmark first
rollBackToTransactionBookmark()  : mixed
Roll back to a transaction bookmark
dropDefaultValueMSSQL()  : mixed
Drop a default value in MSSQL
dropUniqueKeyMSSQL()  : mixed
This function drops a unique Key of an MSSQL database field by using the field name and the table name
dropSecondaryKeyMSSQL()  : mixed
This function drops a secondary key of an MSSQL database field by using the field name and the table name
dropPrimaryKey()  : mixed
Drops the primary key of a table
addPrimaryKey()  : mixed
modifyPrimaryKey()  : mixed
Modifies a primary key in one command - this is only tested on MySQL
fixMySQLCollations()  : mixed
dropColumn()  : mixed
Drops a column, automatically removes blocking default value on MSSQL
alterLanguageCode()  : mixed
Renames a language code in the whole LimeSurvey database
fixLanguageConsistencyAllSurveys()  : mixed
fixPostgresSequence()  : void
This function fixes Postgres sequences for one/all tables in a database This is necessary if a table is renamed. If tablename is given then only that table is fixed
runAddPrimaryKeyonAnswersTable400()  : mixed
regenerateLabelCodes400()  : void
Regenerate codes for problematic label sets Helper function (TODO: Put in separate class) Fails silently
removeMysqlZeroDate()  : void
Remove all zero-dates in $tableName by checking datetime columns from $tableSchema Zero-dates are replaced with null where possible; otherwise 1970-01-01
getRelevantUpdates()  : array<string|int, DatabaseUpdateBase>
Returns a sorted array of update objects with version higher than $iOldDBVersion
createChart()  : mixed
Generate a chart for a question
getQuestionMapData()  : array<string|int, mixed>
Return data to populate a Google Map
buildSelects()  : mixed
Builds the list of addon SQL select statements that builds the query result set
square()  : mixed
Simple function to square a value
setSeed()  : void
Set seed for this response If there is no seed, create a new one Also inits the twister.
shuffle()  : array<string|int, mixed>
Shuffle an array using MersenneTwister Argument NOT called by reference!
scanFile()  : mixed
populateDatabase()  : mixed

Constants

ADODB_DATE_VERSION

ADOdb Date Library, part of the ADOdb abstraction library Download: http://phplens.com/phpeverywhere/

public mixed ADODB_DATE_VERSION = 0.33

PHP native date functions use integer timestamps for computations. Because of this, dates are restricted to the years 1901-2038 on Unix and 1970-2038 on Windows due to integer overflow for dates beyond those years. This library overcomes these limitations by replacing the native function's signed integers (normally 32-bits) with PHP floating point numbers (normally 64-bits).

Dates from 100 A.D. to 3000 A.D. and later have been tested. The minimum is 100 A.D. as <100 will invoke the 2 => 4 digit year conversion. The maximum is billions of years in the future, but this is a theoretical limit as the computation of that year would take too long with the current implementation of adodb_mktime().

This library replaces native functions as follows:

getdate()  with  adodb_getdate()
date()     with  adodb_date()
gmdate()   with  adodb_gmdate()
mktime()   with  adodb_mktime()
gmmktime() with  adodb_gmmktime()
strftime() with  adodb_strftime()
strftime() with  adodb_gmstrftime()

The parameters are identical, except that adodb_date() accepts a subset of date()'s field formats. Mktime() will convert from local time to GMT, and date() will convert from GMT to local time, but daylight savings is not handled currently.

This library is independant of the rest of ADOdb, and can be used as standalone code.

PERFORMANCE

For high speed, this library uses the native date functions where possible, and only switches to PHP code when the dates fall outside the 32-bit signed integer range.

GREGORIAN CORRECTION

Pope Gregory shortened October of A.D. 1582 by ten days. Thursday, October 4, 1582 (Julian) was followed immediately by Friday, October 15, 1582 (Gregorian).

Since 0.06, we handle this correctly, so:

adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582) == 24 * 3600 (1 day)

=============================================================================

COPYRIGHT

(c) 2003-2005 John Lim and released under BSD-style license except for code by jackbbs, which includes adodb_mktime, adodb_get_gmt_diff, adodb_is_leap_year and originally found at http://www.php.net/manual/en/function.mktime.php

=============================================================================

BUG REPORTS

These should be posted to the ADOdb forums at

http://phplens.com/lens/lensforum/topics.php?id=4

=============================================================================

FUNCTION DESCRIPTIONS

  • FUNCTION adodb_getdate($date=false)

Returns an array containing date information, as getdate(), but supports dates greater than 1901 to 2038. The local date/time format is derived from a heuristic the first time adodb_getdate is called.

  • FUNCTION adodb_date($fmt, $timestamp = false)

Convert a timestamp to a formatted local date. If $timestamp is not defined, the current timestamp is used. Unlike the function date(), it supports dates outside the 1901 to 2038 range.

The format fields that adodb_date supports:

a - "am" or "pm"
A - "AM" or "PM"
d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"
D - day of the week, textual, 3 letters; e.g. "Fri"
F - month, textual, long; e.g. "January"
g - hour, 12-hour format without leading zeros; i.e. "1" to "12"
G - hour, 24-hour format without leading zeros; i.e. "0" to "23"
h - hour, 12-hour format; i.e. "01" to "12"
H - hour, 24-hour format; i.e. "00" to "23"
i - minutes; i.e. "00" to "59"
j - day of the month without leading zeros; i.e. "1" to "31"
l (lowercase 'L') - day of the week, textual, long; e.g. "Friday"
L - boolean for whether it is a leap year; i.e. "0" or "1"
m - month; i.e. "01" to "12"
M - month, textual, 3 letters; e.g. "Jan"
n - month without leading zeros; i.e. "1" to "12"
O - Difference to Greenwich time in hours; e.g. "+0200"
Q - Quarter, as in 1, 2, 3, 4
r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200"
s - seconds; i.e. "00" to "59"
S - English ordinal suffix for the day of the month, 2 characters;
i.e. "st", "nd", "rd" or "th"
t - number of days in the given month; i.e. "28" to "31"
T - Timezone setting of this machine; e.g. "EST" or "MDT"
U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
Y - year, 4 digits; e.g. "1999"
y - year, 2 digits; e.g. "99"
z - day of the year; i.e. "0" to "365"
Z - timezone offset in seconds (i.e. "-43200" to "43200").
The offset for timezones west of UTC is always negative,
and for those east of UTC is always positive.

Unsupported:

B - Swatch Internet time
I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
W - ISO-8601 week number of year, weeks starting on Monday

  • FUNCTION adodb_date2($fmt, $isoDateString = false) Same as adodb_date, but 2nd parameter accepts iso date, eg.

adodb_date2('d-M-Y H:i','2003-12-25 13:01:34');

  • FUNCTION adodb_gmdate($fmt, $timestamp = false)

Convert a timestamp to a formatted GMT date. If $timestamp is not defined, the current timestamp is used. Unlike the function date(), it supports dates outside the 1901 to 2038 range.

  • FUNCTION adodb_mktime($hr, $min, $sec[, $month, $day, $year])

Converts a local date to a unix timestamp. Unlike the function mktime(), it supports dates outside the 1901 to 2038 range. All parameters are optional.

  • FUNCTION adodb_gmmktime($hr, $min, $sec [, $month, $day, $year])

Converts a gmt date to a unix timestamp. Unlike the function gmmktime(), it supports dates outside the 1901 to 2038 range. Differs from gmmktime() in that all parameters are currently compulsory.

  • FUNCTION adodb_gmstrftime($fmt, $timestamp = false) Convert a timestamp to a formatted GMT date.
  • FUNCTION adodb_strftime($fmt, $timestamp = false)

Convert a timestamp to a formatted local date. Internally converts $fmt into adodb_date format, then echo result.

For best results, you can define the local date format yourself. Define a global variable $ADODB_DATE_LOCALE which is an array, 1st element is date format using adodb_date syntax, and 2nd element is the time format, also in adodb_date syntax.

eg. $ADODB_DATE_LOCALE = array('d/m/Y','H:i:s');

Supported format codes:

%a - abbreviated weekday name according to the current locale
%A - full weekday name according to the current locale
%b - abbreviated month name according to the current locale
%B - full month name according to the current locale
%c - preferred date and time representation for the current locale
%d - day of the month as a decimal number (range 01 to 31)
%D - same as %m/%d/%y
%e - day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')
%h - same as %b
%H - hour as a decimal number using a 24-hour clock (range 00 to 23)
%I - hour as a decimal number using a 12-hour clock (range 01 to 12)
%m - month as a decimal number (range 01 to 12)
%M - minute as a decimal number
%n - newline character
%p - either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
%r - time in a.m. and p.m. notation
%R - time in 24 hour notation
%S - second as a decimal number
%t - tab character
%T - current time, equal to %H:%M:%S
%x - preferred date representation for the current locale without the time
%X - preferred time representation for the current locale without the date
%y - year as a decimal number without a century (range 00 to 99)
%Y - year as a decimal number including the century
%Z - time zone or name or abbreviation
%% - a literal `%' character

Unsupported codes:

%C - century number (the year divided by 100 and truncated to an integer, range 00 to 99)
%g - like %G, but without the century.
%G - The 4-digit year corresponding to the ISO week number (see %V).
This has the same format and value as %Y, except that if the ISO week number belongs
to the previous or next year, that year is used instead.
%j - day of the year as a decimal number (range 001 to 366)
%u - weekday as a decimal number [1,7], with 1 representing Monday
%U - week number of the current year as a decimal number, starting
with the first Sunday as the first day of the first week
%V - The ISO 8601:1988 week number of the current year as a decimal number,
range 01 to 53, where week 1 is the first week that has at least 4 days in the
current year, and with Monday as the first day of the week. (Use %G or %g for
the year component that corresponds to the week number for the specified timestamp.)
%w - day of the week as a decimal, Sunday being 0
%W - week number of the current year as a decimal number, starting with the
first Monday as the first day of the first week

=============================================================================

NOTES

Useful url for generating test timestamps: http://www.4webhelp.net/us/timestamp.php

Possible future optimizations include

a. Using an algorithm similar to Plauger's in "The Standard C Library" (page 428, xttotm.c _Ttotm() function). Plauger's algorithm will not work outside 32-bit signed range, so i decided not to implement it.

b. Implement daylight savings, which looks awfully complicated, see http://webexhibits.org/daylightsaving/

CHANGELOG

  • 11 Feb 2008 0.33 Bug in 0.32 fix for hour handling. Fixed.

  • 1 Feb 2008 0.32 Now adodb_mktime(0,0,0,12+$m,20,2040) works properly.

  • 10 Jan 2008 0.31 Now adodb_mktime(0,0,0,24,1,2037) works correctly.

  • 15 July 2007 0.30 Added PHP 5.2.0 compatability fixes. gmtime behaviour for 1970 has changed. We use the actual date if it is between 1970 to 2038 to get the timezone, otherwise we use the current year as the baseline to retrieve the timezone. Also the timezone's in php 5.2.* support historical data better, eg. if timezone today was +8, but in 1970 it was +7:30, then php 5.2 return +7:30, while this library will use +8.

  • 19 March 2006 0.24 Changed strftime() locale detection, because some locales prepend the day of week to the date when %c is used.

  • 10 Feb 2006 0.23 PHP5 compat: when we detect PHP5, the RFC2822 format for gmt 0000hrs is changed from -0000 to +0000. In PHP4, we will still use -0000 for 100% compat with PHP4.

  • 08 Sept 2005 0.22 In adodb_date2(), $is_gmt not supported properly. Fixed.

  • 18 July 2005 0.21 In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat. Added support for negative months in adodb_mktime().

  • 24 Feb 2005 0.20 Added limited strftime/gmstrftime support. x10 improvement in performance of adodb_date().

  • 21 Dec 2004 0.17 In adodb_getdate(), the timestamp was accidentally converted to gmt when $is_gmt is false. Also adodb_mktime(0,0,0) did not work properly. Both fixed thx Mauro.

  • 17 Nov 2004 0.16 Removed intval typecast in adodb_mktime() for secs, allowing: adodb_mktime(0,0,0 + 2236672153,1,1,1934); Suggested by Ryan.

  • 18 July 2004 0.15 All params in adodb_mktime were formerly compulsory. Now only the hour, min, secs is compulsory. This brings it more in line with mktime (still not identical).

  • 23 June 2004 0.14

Allow you to define your own daylights savings function, adodb_daylight_sv. If the function is defined (somewhere in an include), then you can correct for daylights savings.

In this example, we apply daylights savings in June or July, adding one hour. This is extremely unrealistic as it does not take into account time-zone, geographic location, current year.

function adodb_daylight_sv(&$arr, $is_gmt) { if ($is_gmt) return; $m = $arr['mon']; if ($m == 6 || $m == 7) $arr['hours'] += 1; }

This is only called by adodb_date() and not by adodb_mktime().

The format of $arr is Array ( [seconds] => 0 [minutes] => 0 [hours] => 0 [mday] => 1 # day of month, eg 1st day of the month [mon] => 2 # month (eg. Feb) [year] => 2102 [yday] => 31 # days in current year [leap] => # true if leap year [ndays] => 28 # no of days in current month )

  • 28 Apr 2004 0.13 Fixed adodb_date to properly support $is_gmt. Thx to Dimitar Angelov.

  • 20 Mar 2004 0.12 Fixed month calculation error in adodb_date. 2102-June-01 appeared as 2102-May-32.

  • 26 Oct 2003 0.11 Because of daylight savings problems (some systems apply daylight savings to January!!!), changed adodb_get_gmt_diff() to ignore daylight savings.

  • 9 Aug 2003 0.10 Fixed bug with dates after 2038. See http://phplens.com/lens/lensforum/msgs.php?id=6980

  • 1 July 2003 0.09 Added support for Q (Quarter). Added adodb_date2(), which accepts ISO date in 2nd param

  • 3 March 2003 0.08 Added support for 'S' adodb_date() format char. Added constant ADODB_ALLOW_NEGATIVE_TS if you want PHP to handle negative timestamps between 1901 to 1969.

  • 27 Feb 2003 0.07 All negative numbers handled by adodb now because of RH 7.3+ problems. See http://bugs.php.net/bug.php?id=20048&edit=2

  • 4 Feb 2003 0.06 Fixed a typo, 1852 changed to 1582! This means that pre-1852 dates are now correctly handled.

  • 29 Jan 2003 0.05

Leap year checking differs under Julian calendar (pre 1582). Also leap year code optimized by checking for most common case first.

We also handle month overflow correctly in mktime (eg month set to 13).

Day overflow for less than one month's days is supported.

  • 28 Jan 2003 0.04

Gregorian correction handled. In PHP5, we might throw an error if mktime uses invalid dates around 5-14 Oct 1582. Released with ADOdb 3.10. Added limbo 5-14 Oct 1582 check, when we set to 15 Oct 1582.

  • 27 Jan 2003 0.03

Fixed some more month problems due to gmt issues. Added constant ADODB_DATE_VERSION. Fixed calculation of days since start of year for <1970.

  • 27 Jan 2003 0.02

Changed _adodb_getdate() to inline leap year checking for better performance. Fixed problem with time-zones west of GMT +0000.

  • 24 Jan 2003 0.01

First implementation.

APPPATH

public mixed APPPATH = \Yii::app()->getBasePath() . \DIRECTORY_SEPARATOR

APPPATH

public mixed APPPATH = \BASEPATH . $application_folder . '/'

BASEPATH

public mixed BASEPATH = \dirname(__FILE__) . '/..'

BASEPATH

public mixed BASEPATH = '.'

BASEPATH

public mixed BASEPATH = '.'

BASEPATH

public mixed BASEPATH = \str_replace("\\", "/", $system_path)

EXT

public mixed EXT = '.php'

FCPATH

public mixed FCPATH = \str_replace(\SELF, '', __FILE__)

K_PATH_IMAGES

public mixed K_PATH_IMAGES = Template::getTemplatePath($aSurveyInfo['template']) . DIRECTORY_SEPARATOR

K_TCPDF_EXTERNAL_CONFIG

public mixed K_TCPDF_EXTERNAL_CONFIG = \true

LDAP_OPT_DIAGNOSTIC_MESSAGE

public mixed LDAP_OPT_DIAGNOSTIC_MESSAGE = 0x32

LOGO_ICON_URL

public mixed LOGO_ICON_URL = App()->getConfig('styleurl') . '/Sea_Green/images/logo_icon.png'

LOGO_URL

public mixed LOGO_URL = App()->getConfig('styleurl') . '/Sea_Green/images/logo.svg'

MAX_STRUCTURED_SYMBOLS

public mixed MAX_STRUCTURED_SYMBOLS = 16

PCLZIP_TEMPORARY_DIR

public mixed PCLZIP_TEMPORARY_DIR = \Yii::app()->getConfig('tempdir') . \DIRECTORY_SEPARATOR

PRESENTATION

public mixed PRESENTATION = gT('This is the LimeSurvey admin interface. Start to build your survey from here.')

PRINT_TEMPLATE_DIR

public mixed PRINT_TEMPLATE_DIR = $sFullTemplatePath

PRINT_TEMPLATE_URL

public mixed PRINT_TEMPLATE_URL = $sFullTemplateUrl

QR_CACHE_DIR

public mixed QR_CACHE_DIR = \false

QR_CACHEABLE

public mixed QR_CACHEABLE = \false

QR_DEFAULT_MASK

public mixed QR_DEFAULT_MASK = 2

QR_FIND_BEST_MASK

public mixed QR_FIND_BEST_MASK = \true

QR_FIND_FROM_RANDOM

public mixed QR_FIND_FROM_RANDOM = 2

QR_FORMAT_PNG

public mixed QR_FORMAT_PNG = 1

QR_FORMAT_TEXT

public mixed QR_FORMAT_TEXT = 0

QR_LOG_DIR

public mixed QR_LOG_DIR = \false

QR_MODE_KANJI

public mixed QR_MODE_KANJI = 3

QR_MODE_STRUCTURE

public mixed QR_MODE_STRUCTURE = 4

QR_PNG_MAXIMUM_SIZE

public mixed QR_PNG_MAXIMUM_SIZE = 1024

QRCAP_REMINDER

public mixed QRCAP_REMINDER = 2

QRSPEC_VERSION_MAX

public mixed QRSPEC_VERSION_MAX = 40

QRSPEC_WIDTH_MAX

public mixed QRSPEC_WIDTH_MAX = 177

QUESTION_START

public mixed QUESTION_START = file_get_contents(getTemplatePath($thissurvey['template']) . '/question_start.pstpl')

ROOT

public mixed ROOT = \dirname(__FILE__)

SELF

public mixed SELF = \pathinfo(__FILE__, \PATHINFO_BASENAME)

STRUCTURE_HEADER_BITS

public mixed STRUCTURE_HEADER_BITS = 20

SYSDIR

public mixed SYSDIR = \trim(\strrchr(\trim(\BASEPATH, '/'), '/'), '/')

TEST_BASE_URL

Change the following URL based on your server configuration Make sure the URL ends with a slash so that we can use relative URLs in test cases

public mixed TEST_BASE_URL = 'http://localhost/testdrive/index-test.php/'

YII_DEBUG

public mixed YII_DEBUG = \false

Functions

SureRemoveDir()

SureRemoveDir(mixed $dir, mixed $DeleteMe[, mixed $excludes = [] ]) : mixed
Parameters
$dir : mixed
$DeleteMe : mixed
$excludes : mixed = []

SureRemoveDir()

SureRemoveDir(mixed $dir, mixed $DeleteMe) : mixed
Parameters
$dir : mixed
$DeleteMe : mixed

subval_sort()

subval_sort(array<string|int, mixed> $a, string $subkey, string $order) : array<string|int, mixed>
Parameters
$a : array<string|int, mixed>
$subkey : string
$order : string
Return values
array<string|int, mixed>

pluginExtractFilter()

PCLZip callback for plugin ZIP install.

pluginExtractFilter(mixed $p_event, mixed &$p_header) : int
Parameters
$p_event : mixed
$p_header : mixed
Return values
int

Return 1 for yes (file can be extracted), 0 for no

outputDatabase()

Outputs a full dump of the current LimeSurvey database

outputDatabase([string $sDbName = '' ][, mixed $bEchoOutput = true ][, mixed $sFileName = null ]) : mixed
Parameters
$sDbName : string = ''

Database Name

$bEchoOutput : mixed = true
$sFileName : mixed = null

_outputDBDescription()

_outputDBDescription(mixed $sDbName, mixed $bAllowExportAllDb) : mixed
Parameters
$sDbName : mixed
$bAllowExportAllDb : mixed

_outputDBData()

_outputDBData(mixed $bAllowExportAllDb, mixed $bEchoOutput, mixed $sFileName, mixed $oFile) : mixed
Parameters
$bAllowExportAllDb : mixed
$bEchoOutput : mixed
$sFileName : mixed
$oFile : mixed

_outputTableDescription()

Outputs the table structure in sql format

_outputTableDescription(mixed $sTableName) : mixed
Parameters
$sTableName : mixed

_outputTableData()

Outputs the table data in sql format

_outputTableData(mixed $sTableName, mixed $oTableData, mixed $bEchoOutput, mixed $sFileName, mixed $oFile) : mixed
Parameters
$sTableName : mixed
$oTableData : mixed
$bEchoOutput : mixed
$sFileName : mixed
$oFile : mixed

_outputRecords()

_outputRecords(mixed $sTableName, mixed $aFieldNames, mixed $aRecords) : mixed
Parameters
$sTableName : mixed
$aFieldNames : mixed
$aRecords : mixed

_countNumberOfEntries()

_countNumberOfEntries(mixed $sTableName) : mixed
Parameters
$sTableName : mixed

sTranslateLangCode2CK()

sTranslateLangCode2CK(mixed $sLanguageCode) : mixed
Parameters
$sLanguageCode : mixed

PrepareEditorScript()

PrepareEditorScript([mixed $load = false ][, CController $controller = null ]) : mixed
Parameters
$load : mixed = false
$controller : CController = null

TODO: Allow to be called automatically (and only load once) from getEditor, or from a widget.

getEditor()

Returns Editor.

getEditor(string $fieldtype, string $fieldname, mixed $fieldtext[, int|null $surveyID = null ][, int|null $gID = null ][, int|null $qID = null ][, string $action = null ]) : string

PrepareEditorScript function must be called first. If getting a JS error about missing CKEditor files, please review if PrepareEditorScript was called.

Parameters
$fieldtype : string

Field Type

$fieldname : string

Field Name, the id attribute of the textarea

$fieldtext : mixed
$surveyID : int|null = null

Survey ID

$gID : int|null = null

Group ID

$qID : int|null = null

Question ID

$action : string = null

Action

Return values
string

getPopupEditor()

getPopupEditor( $fieldtype,  $fieldname,  $fieldtext[,  $surveyID = null ][,  $gID = null ][,  $qID = null ][,  $action = null ]) : string
Parameters
$fieldtype :
$fieldname :
$fieldtext :
$surveyID : = null
$gID : = null
$qID : = null
$action : = null
Return values
string

getModalEditor()

getModalEditor( $fieldtype,  $fieldname,  $fieldtext[,  $surveyID = null ][,  $gID = null ][,  $qID = null ][,  $action = null ]) : string
Parameters
$fieldtype :
$fieldname :
$fieldtext :
$surveyID : = null
$gID : = null
$qID : = null
$action : = null
Return values
string

getInlineEditor()

getInlineEditor(mixed $fieldtype, mixed $fieldname, mixed $fieldtext[, mixed $surveyID = null ][, mixed $gID = null ][, mixed $qID = null ][, mixed $action = null ]) : mixed
Parameters
$fieldtype : mixed
$fieldname : mixed
$fieldtext : mixed
$surveyID : mixed = null
$gID : mixed = null
$qID : mixed = null
$action : mixed = null

getLoaderHTML()

getLoaderHTML(mixed $fieldname) : mixed
Parameters
$fieldname : mixed

XMLImportGroup()

This function imports a LimeSurvey .lsg question group XML file

XMLImportGroup(string $sFullFilePath, int $iNewSID, bool $bTranslateLinksFields) : mixed
Parameters
$sFullFilePath : string

The full filepath of the uploaded file

$iNewSID : int

The new survey ID - the page will always be added after the last page in the survey

$bTranslateLinksFields : bool

XMLImportQuestion()

This function imports a LimeSurvey .lsq question XML file

XMLImportQuestion(string $sFullFilePath, int $iNewSID,  $iNewGID[, array<string|int, bool> $options = array('autorename' => false, 'translinkfields' => true) ]) : array<string|int, mixed>
Parameters
$sFullFilePath : string

The full filepath of the uploaded file

$iNewSID : int

The new survey ID

$iNewGID :
$options : array<string|int, bool> = array('autorename' => false, 'translinkfields' => true)
Tags
throws
CException
Return values
array<string|int, mixed>

XMLImportLabelsets()

XMLImportLabelsets() Function resp[onsible to import a labelset from XML format.

XMLImportLabelsets(string $sFullFilePath, mixed $options) : array<string|int, mixed>
Parameters
$sFullFilePath : string
$options : mixed
Return values
array<string|int, mixed>

Array with count of imported labelsets, labels, warning, etc.

importSurveyFile()

importSurveyFile(string $sFullFilePath, bool $bTranslateLinksFields[, string $sNewSurveyName = null ][, int $DestSurveyID = null ]) : mixed
Parameters
$sFullFilePath : string
$bTranslateLinksFields : bool
$sNewSurveyName : string = null
$DestSurveyID : int = null

XMLImportSurvey()

This function imports a LimeSurvey .lss survey XML file

XMLImportSurvey(string $sFullFilePath[, string $sXMLdata = null ][, mixed $sNewSurveyName = null ][, mixed $iDesiredSurveyId = null ][, mixed $bTranslateInsertansTags = true ][, mixed $bConvertInvalidQuestionCodes = true ]) : mixed
Parameters
$sFullFilePath : string

The full filepath of the uploaded file

$sXMLdata : string = null
$sNewSurveyName : mixed = null
$iDesiredSurveyId : mixed = null
$bTranslateInsertansTags : mixed = true
$bConvertInvalidQuestionCodes : mixed = true
Tags
todo

Use transactions to prevent orphaned data and clean rollback on errors

checkWrongQuestionAttributes()

This function checks if there are set wrong values ('Y' or 'N') into table question_attributes. These are set to 1 and 0 if needed.

checkWrongQuestionAttributes( $questionId) : mixed
Parameters
$questionId :

XMLImportTokens()

XMLImportTokens(string $sFullFilePath, mixed $iSurveyID[, mixed $sCreateMissingAttributeFields = true ]) : mixed
Parameters
$sFullFilePath : string
$iSurveyID : mixed
$sCreateMissingAttributeFields : mixed = true

XMLImportResponses()

XMLImportResponses(string $sFullFilePath, mixed $iSurveyID[, mixed $aFieldReMap = array() ]) : mixed
Parameters
$sFullFilePath : string
$iSurveyID : mixed
$aFieldReMap : mixed = array()

CSVImportResponses()

This function imports a CSV file into the response table CSV file is deleted during process

CSVImportResponses(string $sFullFilePath, int $iSurveyId[, array<string|int, mixed> $aOptions = array() ]) : mixed
Parameters
$sFullFilePath : string
$iSurveyId : int
$aOptions : array<string|int, mixed> = array()

Return array $result ("errors","warnings","success")

XMLImportTimings()

XMLImportTimings(string $sFullFilePath, mixed $iSurveyID[, mixed $aFieldReMap = array() ]) : mixed
Parameters
$sFullFilePath : string
$iSurveyID : mixed
$aFieldReMap : mixed = array()

TSVImportSurvey()

Import survey from an TSV file template that does not require assigning of GID or QID values.

TSVImportSurvey(string $sFullFilePath) : string

If ID's are presented, they would be respected and used Multilanguage imports are supported Original function is changed to allow generating of XML instead of creating database objects directly Generated XML code is send to existing lss import function

Parameters
$sFullFilePath : string
Tags
author

TMSWhite

Return values
string

XML data

createXMLfromData()

createXMLfromData([mixed $aData = array() ]) : mixed
Parameters
$aData : mixed = array()

importDefaultValues()

Import default values inside $xml, record process in $results Also imports defaultvalue_l10ns.

importDefaultValues(SimpleXMLElement $xml, array<string|int, mixed> $aLanguagesSupported, mixed $aQIDReplacements, array<string|int, mixed> &$results) : void
Parameters
$xml : SimpleXMLElement
$aLanguagesSupported : array<string|int, mixed>
$aQIDReplacements : mixed
$results : array<string|int, mixed>

fileCsvToUtf8()

Read a csv file and return a tmp resources to same file in utf8 CSV file is deleted during process

fileCsvToUtf8(string $fullfilepath[, string $encoding = 'auto' ]) : resource
Parameters
$fullfilepath : string
$encoding : string = 'auto'

from

Return values
resource

updateset()

updateset(int $lid) : mixed
Parameters
$lid : int

modlabelsetanswers()

modlabelsetanswers(null|int $lid) : mixed
Parameters
$lid : null|int

fixorder()

Function rewrites the sortorder for a label set

fixorder(mixed $lid) : mixed
Parameters
$lid : mixed

Label set ID

permissionsAsArray()

Checks Permission for the current user and returns an array with Permissions

permissionsAsArray(array<string|int, mixed> $globalPermissions[, array<string|int, mixed> $customPermissions = [] ]) : array<string|int, mixed>
Parameters
$globalPermissions : array<string|int, mixed>
$customPermissions : array<string|int, mixed> = []
Return values
array<string|int, mixed>

createChart()

Generate a chart for a question

createChart(mixed $iQuestionID, int $iSurveyID, mixed $type, mixed $lbl, mixed $gdata, mixed $grawdata, mixed $cache, mixed $sLanguageCode, mixed $sQuestionType) : mixed

@param int $iQuestionID ID of the question

Parameters
$iQuestionID : mixed
$iSurveyID : int

ID of the survey @param mixed $type Type of the chart to be created - null produces bar chart, any other value produces pie chart @param array $lbl An array containing the labels for the chart items @param mixed $gdata An array containing the percentages for the chart items @param mixed $grawdata An array containing the raw count for the chart items @param pCache $cache An object containing [Hashkey] and [CacheFolder] @param mixed $sLanguageCode Language Code @param string $sQuestionType The question type @return false|string

$type : mixed
$lbl : mixed
$gdata : mixed
$grawdata : mixed
$cache : mixed
$sLanguageCode : mixed
$sQuestionType : mixed

getQuestionMapData()

Return data to populate a Google Map

getQuestionMapData(string $sField,  $qsid) : array<string|int, mixed>
Parameters
$sField : string
$qsid :

Survey id

Return values
array<string|int, mixed>

buildSelects()

Builds the list of addon SQL select statements that builds the query result set

buildSelects(mixed $allfields, int $surveyid, mixed $language) : mixed

@param array $allfields An array containing the names of the fields/answers we want to display in the statistics summary

Parameters
$allfields : mixed
$surveyid : int

@param string $language The language to use

@return array $selects array of individual select statements that can be added/appended to the 'where' portion of a SQL statement to restrict the result set ie: array("FIELDNAME='Y'", "FIELDNAME2='Hello'");

$language : mixed

square()

Simple function to square a value

square(mixed $number) : mixed
Parameters
$number : mixed

Value to square

getEncryptedCondition()

getEncryptedCondition(mixed $responseModel, mixed $attribute, mixed $value) : mixed
Parameters
$responseModel : mixed
$attribute : mixed
$value : mixed

getSurveyDefaultSettings()

getSurveyDefaultSettings() : mixed

doreplacement()

doreplacement(string $file, mixed $data[, mixed $oTemplate = '' ]) : mixed
Parameters
$file : string
$data : mixed
$oTemplate : mixed = ''

getListOfFiles()

getListOfFiles(mixed $wh) : mixed
Parameters
$wh : mixed

mkdir_p()

mkdir_p(string $target) : mixed
Parameters
$target : string

themeoptions()

themeoptions(mixed $optionarray, mixed $selectedvalue) : mixed
Parameters
$optionarray : mixed
$selectedvalue : mixed
multiarray_search(mixed $arrayVet, mixed $campo, mixed $valor) : mixed
Parameters
$arrayVet : mixed
$campo : mixed
$valor : mixed

recursive_in_array()

recursive_in_array(mixed $needle, mixed $haystack) : mixed
Parameters
$needle : mixed
$haystack : mixed

is_template_editable()

This function checks if a certain template may be by modified, copied, deleted according to the settings in config.php

is_template_editable(mixed $templatename) : mixed
Parameters
$templatename : mixed

templateExtractFilter()

This is a PCLZip callback function that ensures only files are extracted that have a valid extension

templateExtractFilter(mixed $p_event, mixed &$p_header) : int
Parameters
$p_event : mixed
$p_header : mixed
Return values
int

Return 1 for yes (file can be extracted), 0 for no

emailTokens()

Sends email to tokens - invitations, reminders, registers, and confirmations Seems used only in remote_control : maybe move it to ?

emailTokens(int $iSurveyID, array<string|int, CActiveRecord$aResultTokens, string $sType[, bool $continueOnError = false ]) : array<string|int, mixed>
Parameters
$iSurveyID : int
$aResultTokens : array<string|int, CActiveRecord>
$sType : string

type of notification invite|register|remind|confirm

$continueOnError : bool = false

Don't stop on first invalid participant

Return values
array<string|int, mixed>

of results

adodb_date_test_date()

adodb_date_test_date(int $y1, int $m[, mixed $d = 13 ]) : mixed
Parameters
$y1 : int
$m : int
$d : mixed = 13

adodb_date_test_strftime()

adodb_date_test_strftime(string $fmt) : mixed
Parameters
$fmt : string

adodb_dow()

Returns day of week, 0 = Sunday,... 6=Saturday.

adodb_dow(mixed $year, mixed $month, mixed $day) : mixed

Algorithm from PEAR::Date_Calc

Parameters
$year : mixed
$month : mixed
$day : mixed

_adodb_is_leap_year()

Checks for leap year, returns true if it is. No 2-digit year check. Also handles julian calendar correctly.

_adodb_is_leap_year(mixed $year) : mixed
Parameters
$year : mixed

adodb_is_leap_year()

checks for leap year, returns true if it is. Has 2-digit year check

adodb_is_leap_year(mixed $year) : mixed
Parameters
$year : mixed

adodb_year_digit_check()

Fix 2-digit years. Works for any century.

adodb_year_digit_check(mixed $y) : mixed

Assumes that if 2-digit is more than 30 years in future, then previous century.

Parameters
$y : mixed

adodb_get_gmt_diff()

get local time zone offset from GMT. Does not handle historical timezones before 1970.

adodb_get_gmt_diff(mixed $y, mixed $m, mixed $d) : mixed
Parameters
$y : mixed
$m : mixed
$d : mixed

adodb_getdate()

Returns an array with date info.

adodb_getdate([mixed $d = false ][, mixed $fast = false ]) : mixed
Parameters
$d : mixed = false
$fast : mixed = false

adodb_validdate()

adodb_validdate(mixed $y, mixed $m, mixed $d) : mixed
Parameters
$y : mixed
$m : mixed
$d : mixed

_adodb_getdate()

Low-level function that returns the getdate() array. We have a special $fast flag, which if set to true, will return fewer array values, and is much faster as it does not calculate dow, etc.

_adodb_getdate([mixed $origd = false ][, mixed $fast = false ][, mixed $is_gmt = false ]) : mixed
Parameters
$origd : mixed = false
$fast : mixed = false
$is_gmt : mixed = false

adodb_tz_offset()

adodb_tz_offset(mixed $gmt, bool $isphp5) : mixed
Parameters
$gmt : mixed
$isphp5 : bool

adodb_gmdate()

adodb_gmdate(mixed $fmt[, mixed $d = false ]) : mixed
Parameters
$fmt : mixed
$d : mixed = false

adodb_date2()

adodb_date2(mixed $fmt[, mixed $d = false ][, mixed $is_gmt = false ]) : mixed
Parameters
$fmt : mixed
$d : mixed = false
$is_gmt : mixed = false

adodb_date()

Return formatted date based on timestamp $d

adodb_date(mixed $fmt[, mixed $d = false ][, mixed $is_gmt = false ]) : string
Parameters
$fmt : mixed
$d : mixed = false
$is_gmt : mixed = false
Return values
string

adodb_gmmktime()

Returns a timestamp given a GMT/UTC time.

adodb_gmmktime(mixed $hr, mixed $min, mixed $sec[, mixed $mon = false ][, mixed $day = false ][, mixed $year = false ][, mixed $is_dst = false ]) : mixed

Note that $is_dst is not implemented and is ignored.

Parameters
$hr : mixed
$min : mixed
$sec : mixed
$mon : mixed = false
$day : mixed = false
$year : mixed = false
$is_dst : mixed = false

adodb_mktime()

Return a timestamp given a local time. Originally by jackbbs.

adodb_mktime(mixed $hr, mixed $min, mixed $sec[, mixed $mon = false ][, mixed $day = false ][, mixed $year = false ][, mixed $is_dst = false ][, mixed $is_gmt = false ]) : mixed

Note that $is_dst is not implemented and is ignored.

Not a very fast algorithm - O(n) operation. Could be optimized to O(1).

Parameters
$hr : mixed
$min : mixed
$sec : mixed
$mon : mixed = false
$day : mixed = false
$year : mixed = false
$is_dst : mixed = false
$is_gmt : mixed = false

adodb_gmstrftime()

adodb_gmstrftime(mixed $fmt[, mixed $ts = false ]) : mixed
Parameters
$fmt : mixed
$ts : mixed = false

adodb_strftime()

adodb_strftime(mixed $fmt[, mixed $ts = false ][, mixed $is_gmt = false ]) : mixed
Parameters
$fmt : mixed
$ts : mixed = false
$is_gmt : mixed = false

gT()

Returns $sToTranslate translated to $sLanguage (defaults to lang set in session) escaped with $sEscapeMode

gT(string $sToTranslate[, string $sEscapeMode = 'html' ][, string $sLanguage = null ]) : string
Parameters
$sToTranslate : string
$sEscapeMode : string = 'html'

Valid values are html (this is the default, js and unescaped)

$sLanguage : string = null
Return values
string

eT()

As gT(), but echoes directly

eT(string $sToTranslate[, string $sEscapeMode = 'html' ]) : void
Parameters
$sToTranslate : string
$sEscapeMode : string = 'html'

ngT()

Translation helper function for plural forms

ngT(string $sTextToTranslate, int $iCount[, string $sEscapeMode = 'html' ]) : string
Parameters
$sTextToTranslate : string
$iCount : int
$sEscapeMode : string = 'html'
Return values
string

neT()

Translation helper function for plural forms which outputs right away

neT(string $sToTranslate, int $iCount[, string $sEscapeMode = 'html' ]) : mixed
Parameters
$sToTranslate : string
$iCount : int
$sEscapeMode : string = 'html'

quoteText()

Quotes a translation according to purpose if sEscapeMode is null, we use HTML method because probably we had to specify null as sEscapeMode upstream

quoteText(mixed $sText[, string $sEscapeMode = 'html' ]) : mixed|string
Parameters
$sText : mixed

Text to quote

$sEscapeMode : string = 'html'

Optional - One of the values 'html','js' or 'unescaped' - defaults to 'html'

Return values
mixed|string

getSurveyList()

getSurveyList() Queries the database (survey table) for a list of existing surveys

getSurveyList([bool $bReturnArray = false ]) : string|array<string|int, mixed>
Parameters
$bReturnArray : bool = false

If set to true an array instead of an HTML option list is given back (unused by core (2023-04-12))

Return values
string|array<string|int, mixed>

This string is returned containing formatted list of existing surveys

getGidPrevious()

getGidPrevious() returns the Gid of the group prior to the current active group

getGidPrevious(int $surveyid, int $gid) : int|string
Parameters
$surveyid : int
$gid : int
Return values
int|string

The GID of the previous group or blank string if no group

getGidNext()

getGidNext() returns the Gid of the group next to the current active group

getGidNext(int $surveyid, int $gid) : int|string
Parameters
$surveyid : int
$gid : int
Return values
int|string

The Gid of the next group or blank string if no group

convertGETtoPOST()

convertGETtoPOST a function to create a post Request from get parameters !!! This functions result has to be wrappen in singlequotes!

convertGETtoPOST(string $url) : string
Parameters
$url : string

| The complete url with all parameters

Return values
string

| The onclick action for the element

calculateTotalFileUploadUsage()

This function calculates how much space is actually used by all files uploaded using the File Upload question type

calculateTotalFileUploadUsage() : mixed
Tags
returns

integer Actual space used in MB

getDirectorySize()

getDirectorySize(string $directory) : int
Parameters
$directory : string
Return values
int

getMaxGroupOrder()

Queries the database for the maximum sortorder of a group and returns the next higher one.

getMaxGroupOrder(int $surveyid) : int
Parameters
$surveyid : int

The survey ID

Return values
int

Next free sortorder digit

getGroupOrder()

Queries the database for the sortorder of a group.

getGroupOrder(mixed $gid) : int
Parameters
$gid : mixed

The groups ID

Return values
int

The sortorder digit

getMaxQuestionOrder()

Queries the database for the maximum sort order of questions inside question group.

getMaxQuestionOrder(int $gid) : int
Parameters
$gid : int
Return values
int

setupColumns()

setupColumns() defines all the html tags to be wrapped around various list type answers.

setupColumns(int $columns, int $answer_count[, string $wrapperclass = "" ][, string $itemclass = "" ]) : array<string|int, mixed>
Parameters
$columns : int
  • the number of columns, usually supplied by $dcols
$answer_count : int
  • the number of answers to a question, usually supplied by $anscount
$wrapperclass : string = ""
  • a global class for the wrapper
$itemclass : string = ""
  • a class for the item
Tags
deprecated

Don't use anymore. Only usage left in printabel survey where it needs to be replaced

It returns an array with the following items: $wrapper['whole-start'] = Opening wrapper for the whole list $wrapper['whole-end'] = closing wrapper for the whole list $wrapper['col-devide'] = normal column devider $wrapper['col-devide-last'] = the last column devider (to allow for different styling of the last column $wrapper['item-start'] = opening wrapper tag for individual option $wrapper['item-start-other'] = opening wrapper tag for other option $wrapper['item-start-noanswer'] = opening wrapper tag for no answer option $wrapper['item-end'] = closing wrapper tag for individual option $wrapper['maxrows'] = maximum number of rows in each column $wrapper['cols'] = Number of columns to be inserted (and checked against)


Columns are a problem. Really there is no perfect solution to columns at the moment.

  • Using Tables is problematic semanticly.
  • Using inline or float to create columns, causes the answers flows horizontally, not vertically which is not ideal visually.
  • Using CSS3 columns is also a problem because of browser support and also because if you have answeres split across two or more lines, and those answeres happen to fall at the bottom of a column, the answer might be split across columns as well as lines.
  • Using nested unordered list with the first level of <LI>s floated is the same as using tables and so is bad semantically for the same reason tables are bad.
  • Breaking the unordered lists into consecutive floated unordered lists is not great semantically but probably not as bad as using tables.

Because I haven't been able to decide which option is the least bad, I have handed over that responsibility to the admin who sets LimeSurvey up on their server.

There are four options: 'css' using one of the various CSS only methods for rendering columns. (Check the CSS file for your chosen template to see how columns are defined.) 'ul' using multiple floated unordered lists. (DEFAULT) 'table' using conventional tables based layout. NULL blocks the use of columns

'ul' is the default because it's the best possible compromise between semantic markup and visual layout.

Return values
array<string|int, mixed>

with all the various opening and closing tags to generate a set of columns.

alternation()

alternation([mixed $alternate = '' ][, mixed $type = 'col' ]) : mixed
Parameters
$alternate : mixed = ''
$type : mixed = 'col'

longestString()

longestString() returns the length of the longest string past to it.

longestString(mixed $new_string, int $longest_length) : int
Parameters
$new_string : mixed
$longest_length : int
Tags
peram

string $new_string

peram

integer $longest_length length of the (previously) longest string passed to it.

Return values
int

representing the length of the longest string passed (updated if $new_string was longer than $longest_length)

usage should look like this: $longest_length = longestString( $new_string , $longest_length );

getGroupList3()

getGroupList3(mixed $gid, mixed $surveyid) : mixed
Parameters
$gid : mixed
$surveyid : mixed

getGroupListLang()

put your comment there.

getGroupListLang(mixed $gid, mixed $language, mixed $surveyid) : string

..

Parameters
$gid : mixed
$language : mixed
$surveyid : mixed
Return values
string

getUserList()

Returns a user list. If 'usercontrolSameGroupPolicy' is set and set to true, only users which are in the same group as me (--> logged in user) will be returned. Superadmin always gets the full list of users.

getUserList([ $outputformat = 'fullinfoarray' ]) : array<string|int, mixed>
Parameters
$outputformat : = 'fullinfoarray'

string could be 'onlyuidarray' which only returns array with userids, default is 'fullinfoarray'

Return values
array<string|int, mixed>

returns a list of user ids (param='onlyuidarray') or a list with full user details (e.g. uid, name, full_name etc.)

getSurveyInfo()

Gets all survey infos in one big array including the language specific settings

getSurveyInfo(int $surveyid[, string $languagecode = '' ][, bool $force = false ]) : array<string|int, mixed>|bool
Parameters
$surveyid : int

The survey ID

$languagecode : string = ''

The language code - if not given the base language of the particular survey is used

$force : bool = false

If true, don't use memoization

Return values
array<string|int, mixed>|bool

Returns array with survey info or false, if survey does not exist

templateDefaultTexts()

Returns the default email template texts as array

templateDefaultTexts(mixed $sLanguage[, string $mode = 'html' ][, mixed $sNewlines = 'text' ]) : array<string|int, mixed>
Parameters
$sLanguage : mixed

Required language translationb object

$mode : string = 'html'

Escape mode for the translation function

$sNewlines : mixed = 'text'
Tags
todo

Move to defaulttexts helper

Return values
array<string|int, mixed>

groupOrderThenQuestionOrder()

Compares two elements from an array (passed by the usort function) and returns -1, 0 or 1 depending on the result of the comparison of the sort order of the group_order and question_order field Used by : - remotecontrol_handle->export_statistics with merging group and question attributes (all in same array) - checkQuestions() in activate_helper function with ?

groupOrderThenQuestionOrder(mixed $a, mixed $b) : int
Parameters
$a : mixed
$b : mixed
Return values
int

fixMovedQuestionConditions()

fixMovedQuestionConditions(int $qid, mixed $oldgid, int $newgid[, int $iSurveyID = null ]) : mixed
Parameters
$qid : int
$oldgid : mixed
$newgid : int
$iSurveyID : int = null

returnGlobal()

This function returns POST/REQUEST vars, for some vars like SID and others they are also sanitized TODO: extends Yii:getParam

returnGlobal(string $stringname[, bool $bRestrictToString = false ]) : array<string|int, mixed>|bool|mixed|int|null
Parameters
$stringname : string
$bRestrictToString : bool = false
Return values
array<string|int, mixed>|bool|mixed|int|null

getExtendedAnswer()

getExtendedAnswer(int $iSurveyID, string $sFieldCode, string $sValue, string $sLanguage) : string
Parameters
$iSurveyID : int

The Survey ID

$sFieldCode : string

Field code of the particular field

$sValue : string

The stored response value

$sLanguage : string

Initialized limesurvey_lang object for the resulting response data

Return values
string

validateEmailAddress()

Validate an email address - also supports IDN email addresses

validateEmailAddress(mixed $sEmailAddress) : mixed
Parameters
$sEmailAddress : mixed

Email address to check

Tags
deprecated

: use LimeMailer::validateAddress($sEmailAddress);

returns

True/false for valid/invalid

validateEmailAddresses()

Validate an list of email addresses - either as array or as semicolon-limited text

validateEmailAddresses(string $aEmailAddressList) : string
Parameters
$aEmailAddressList : string

Email address to check

Tags
deprecated

: use LimeMailer::validateAddresses($aEmailAddressList);

returns

array

Return values
string

List with valid email addresses - invalid email addresses are filtered - false if none of the email addresses are valid

createCompleteSGQA()

This functions generates a a summary containing the SGQA for questions of a survey, enriched with options per question It can be used for the generation of statistics. Derived from StatisticsUserController

createCompleteSGQA(int $iSurveyID, array<string|int, mixed> $aFilters, string $sLanguage) : array<string|int, mixed>
Parameters
$iSurveyID : int

Id of the Survey in question

$aFilters : array<string|int, mixed>

an array which is the result of a query in Questions model

$sLanguage : string
Return values
array<string|int, mixed>

The summary

createFieldMap()

This function generates an array containing the fieldcode, and matching data in the same order as the activate script

createFieldMap(Survey $survey[, string $style = 'short' ][, bool|null $force_refresh = false ][, bool|int $questionid = false ][, string $sLanguage = '' ][, array<string|int, mixed> &$aDuplicateQIDs = array() ]) : array<string|int, mixed>
Parameters
$survey : Survey

Survey ActiveRecord model

$style : string = 'short'

'short' (default) or 'full' - full creates extra information like default values

$force_refresh : bool|null = false
  • Forces to really refresh the array, not just take the session copy
$questionid : bool|int = false

Limit to a certain qid only (for question preview) - default is false

$sLanguage : string = ''

The language to use

$aDuplicateQIDs : array<string|int, mixed> = array()
Return values
array<string|int, mixed>

hasFileUploadQuestion()

Returns true if the given survey has a File Upload Question Type

hasFileUploadQuestion(int $iSurveyID) : bool
Parameters
$iSurveyID : int
Return values
bool

createTimingsFieldMap()

This function generates an array containing the fieldcode, and matching data in the same order as the activate script

createTimingsFieldMap(string $surveyid[, string $style = 'full' ][, bool $force_refresh = false ][, int $questionid = false ][, string $sQuestionLanguage = null ]) : array<string|int, mixed>
Parameters
$surveyid : string

The Survey ID

$style : string = 'full'

'short' (default) or 'full' - full creates extra information like default values

$force_refresh : bool = false
  • Forces to really refresh the array, not just take the session copy
$questionid : int = false

Limit to a certain qid only (for question preview) - default is false

$sQuestionLanguage : string = null

The language to use

Return values
array<string|int, mixed>

arraySearchByKey()

arraySearchByKey(mixed $needle, mixed $haystack, string $keyname[, int $maxanswers = "" ]) : array<string|int, mixed>
Parameters
$needle : mixed
$haystack : mixed
$keyname : string
$maxanswers : int = ""
Return values
array<string|int, mixed>

buildLabelSetCheckSumArray()

buildLabelSetCheckSumArray() : mixed

getQuestionAttributeValue()

Returns the questionAttribtue value set or '' if not set

getQuestionAttributeValue( $questionAttributeArray, string $attributeName[,  $language = '' ]) : string
Parameters
$questionAttributeArray :
$attributeName : string
$language : = ''

string Optional: The language if the particualr attributes is localizable

Tags
author:

lemeur

Return values
string

questionTitleSort()

questionTitleSort(mixed $a, mixed $b) : mixed
Parameters
$a : mixed
$b : mixed

HTMLEscape()

make a string safe to include in an HTML 'value' attribute.

HTMLEscape(mixed $str) : mixed
Parameters
$str : mixed
Tags
deprecated

If you need this you are doing something wrong. Use CHTML functions instead.

stripCtrlChars()

This function strips UTF-8 control characters from strings, except tabs, CR and LF - it is intended to be used before any response data is saved to the response table

stripCtrlChars(mixed $sValue) : string
Parameters
$sValue : mixed

A string to be sanitized

Return values
string

A sanitized string, otherwise the unmodified original variable

javascriptEscape()

javascriptEscape(string $str[, mixed $strip_tags = false ][, mixed $htmldecode = false ]) : mixed
Parameters
$str : string
$strip_tags : mixed = false
$htmldecode : mixed = false

jsonEscape()

jsonEscape(string $str[, mixed $strip_tags = false ][, mixed $htmldecode = false ]) : mixed
Parameters
$str : string
$strip_tags : mixed = false
$htmldecode : mixed = false

SendEmailMessage()

This function mails a text $body to the recipient $to.

SendEmailMessage(string $body, mixed $subject, mixed $to, string $from, mixed $sitename[, bool $ishtml = false ][, mixed $bouncemail = null ][, mixed $attachments = null ][, mixed $customheaders = "" ]) : bool

You can use more than one recipient when using a semicolon separated string with recipients.

Parameters
$body : string

Body text of the email in plain text or HTML

$subject : mixed

Email subject

$to : mixed

Array with several email addresses or single string with one email address

$from : string
$sitename : mixed
$ishtml : bool = false
$bouncemail : mixed = null
$attachments : mixed = null
$customheaders : mixed = ""
Tags
deprecated

: leave it in 4.0 for plugins ? Must remove in 5.0 at minima.

Return values
bool

If successful returns true

flattenText()

This functions removes all HTML tags, Javascript, CRs, linefeeds and other strange chars from a given text

flattenText(string $sTextToFlatten[, bool $bKeepSpan = false ][, bool $bDecodeHTMLEntities = false ][, string $sCharset = 'UTF-8' ][, bool $bStripNewLines = true ]) : string
Parameters
$sTextToFlatten : string

Text you want to clean

$bKeepSpan : bool = false

set to true for keep span, used for expression manager. Default: false

$bDecodeHTMLEntities : bool = false

If set to true then all HTML entities will be decoded to the specified charset. Default: false

$sCharset : string = 'UTF-8'

Charset to decode to if $decodeHTMLEntities is set to true. Default: UTF-8

$bStripNewLines : bool = true

strip new lines if true, if false replace all new line by \r\n. Default: true

Return values
string

Cleaned text

getArrayFilterExcludesCascadesForGroup()

getArrayFilterExcludesCascadesForGroup() queries the database and produces a list of array_filter_exclude questions and targets with in the same group

getArrayFilterExcludesCascadesForGroup(mixed $surveyid[, mixed $gid = "" ][, mixed $output = "qid" ]) : array<string|int, mixed>
Parameters
$surveyid : mixed
$gid : mixed = ""
$output : mixed = "qid"
Return values
array<string|int, mixed>

a keyed nested array, keyed by the qid of the question, containing cascade information

createPassword()

createPassword([mixed $iPasswordLength = 12 ]) : mixed
Parameters
$iPasswordLength : mixed = 12

languageDropdown()

languageDropdown(mixed $surveyid, mixed $selected) : mixed
Parameters
$surveyid : mixed
$selected : mixed

languageDropdownClean()

Creates a <select> HTML element for language selection for this survey

languageDropdownClean(int $surveyid, string $selected) : string
Parameters
$surveyid : int
$selected : string

The selected language

Return values
string

rmdirr()

This function removes a directory recursively

rmdirr(string $dirname) : bool
Parameters
$dirname : string
Return values
bool

CSVUnquote()

This function removes surrounding and masking quotes from the CSV field

CSVUnquote(mixed $field) : mixed
Parameters
$field : mixed

incompleteAnsFilterState()

This function return actual completion state

incompleteAnsFilterState() : string|bool
Return values
string|bool

(complete|incomplete|all) or false

isCaptchaEnabled()

isCaptchaEnabled($screen, $usecaptchamode)

isCaptchaEnabled(string $screen[, mixed $captchamode = '' ]) : bool|null
Parameters
$screen : string
  • the screen name for which to test captcha activation
$captchamode : mixed = ''
Return values
bool|null
  • returns true if captcha must be enabled

tableExists()

Check if a table does exist in the database

tableExists(string $sTableName) : bool
Parameters
$sTableName : string

Table name to check for (without dbprefix!))

Return values
bool

True or false if table exists or not

isTokenCompletedDatestamped()

isTokenCompletedDatestamped(mixed $thesurvey) : mixed
Parameters
$thesurvey : mixed

dateShift()

example usage $date = "2006-12-31 21:00"; $shift "+6 hours"; // could be days, weeks... see function strtotime() for usage

dateShift(string $date, string $dformat, string $shift) : string

echo sql_date_shift($date, "Y-m-d H:i:s", $shift);

will output: 2007-01-01 03:00:00

Parameters
$date : string
$dformat : string
$shift : string
Return values
string

getBounceEmail()

getBounceEmail(mixed $surveyid) : mixed
Parameters
$surveyid : mixed

getEmailFormat()

getEmailFormat(mixed $surveyid) : mixed
Parameters
$surveyid : mixed

hasTemplateManageRights()

hasTemplateManageRights(mixed $userid, mixed $sThemeFolder) : mixed
Parameters
$userid : mixed
$sThemeFolder : mixed

Translate links which are in any answer/question/survey/email template/label set to their new counterpart

translateLinks(string $sType, mixed $iOldSurveyID, mixed $iNewSurveyID, string $sString[, bool $isLocalPath = false ]) : string
Parameters
$sType : string

'survey' or 'label'

$iOldSurveyID : mixed

Source SurveyId to be replaced

$iNewSurveyID : mixed

New SurveyId to be used

$sString : string

Link (url or local path) to be translated

$isLocalPath : bool = false

Indicates if the link ($sString) is a local path or a url.

Return values
string

Returns true if there are old links in answer/question/survey/email template/label set texts.

checkOldLinks(string $type, mixed $oldSurveyId, mixed $string) : bool
Parameters
$type : string

'survey' or 'label'

$oldSurveyId : mixed
$string : mixed
Return values
bool

True if the provided string includes links to the old survey. If the type is not 'survey' or 'label', it returns false.

reverseTranslateFieldNames()

This function creates the old fieldnames for survey import

reverseTranslateFieldNames(mixed $iOldSID, int $iNewSID, array<string|int, mixed> $aGIDReplacements, array<string|int, mixed> $aQIDReplacements) : array<string|int, mixed>|bool
Parameters
$iOldSID : mixed

The old survey ID

$iNewSID : int

The new survey ID

$aGIDReplacements : array<string|int, mixed>

An array with group ids (oldgid=>newgid)

$aQIDReplacements : array<string|int, mixed>

An array with question ids (oldqid=>newqid)

Return values
array<string|int, mixed>|bool

hasResources()

put your comment there.

hasResources(int $id[, string $type = 'survey' ]) : bool

..

Parameters
$id : int
$type : string = 'survey'
Return values
bool

randomChars()

Creates a random sequence of characters

randomChars(int $length[, string $pattern = "23456789abcdefghijkmnpqrstuvwxyz" ]) : string
Parameters
$length : int

Length of resulting string

$pattern : string = "23456789abcdefghijkmnpqrstuvwxyz"

To define which characters should be in the resulting string

Return values
string

conditionalNewlineToBreak()

used to translate simple text to html (replacing \n with <br />

conditionalNewlineToBreak(string $mytext, mixed $ishtml[, mixed $encoded = '' ]) : mixed
Parameters
$mytext : string
$ishtml : mixed
$encoded : mixed = ''

breakToNewline()

breakToNewline(string $data) : mixed
Parameters
$data : string

safeDie()

Provides a safe way to end the application

safeDie(string $sText) : void
Parameters
$sText : string
Tags
todo

This should probably never be used, since it returns 0 from CLI and makes PHPUnit think all is fine :(

fixCKeditorText()

fixCKeditorText(string $str) : mixed
Parameters
$str : string

filterForAttributes()

This is a helper function for getAttributeFieldNames

filterForAttributes(string $fieldname) : bool
Parameters
$fieldname : string
Return values
bool

getAttributeFieldNames()

Retrieves the attribute field names from the related survey participants table

getAttributeFieldNames(mixed $iSurveyID) : array<string|int, mixed>
Parameters
$iSurveyID : mixed

The survey ID

Return values
array<string|int, mixed>

The fieldnames

getParticipantAttributes()

Returns the full list of attribute token fields including the properties for each field Use this instead of plain Survey::model()->findByPk($iSurveyID)->tokenAttributes calls because Survey::model()->findByPk($iSurveyID)->tokenAttributes may contain old descriptions where the fields does not physically exist

getParticipantAttributes(int $iSurveyID) : array<string|int, mixed>
Parameters
$iSurveyID : int

The Survey ID

Return values
array<string|int, mixed>

getTokenFieldsAndNames()

Retrieves the attribute names from the related survey participants table

getTokenFieldsAndNames(mixed $surveyid[, bool $bOnlyAttributes = false ]) : array<string|int, mixed>
Parameters
$surveyid : mixed

The survey ID

$bOnlyAttributes : bool = false

Set this to true if you only want the fieldnames of the additional attribue fields - defaults to false

Return values
array<string|int, mixed>

The fieldnames as key and names as value in an Array

stripJavaScript()

This function strips any content between and including <javascript> tags

stripJavaScript(string|null $sContent) : string
Parameters
$sContent : string|null

String to clean

Return values
string

Cleaned string

showJavaScript()

This function converts emebedded Javascript to Text

showJavaScript(string $sContent) : string
Parameters
$sContent : string

String to clean

Return values
string

Cleaned string

cleanTempDirectory()

This function cleans files from the temporary directory being older than 1 day

cleanTempDirectory() : mixed
Tags
todo

Make the days configurable

convertDateTimeFormat()

This is a convenience function for the coversion of datetime values

convertDateTimeFormat(mixed $value, string $fromdateformat, mixed $todateformat) : string
Parameters
$value : mixed
$fromdateformat : string
$todateformat : mixed
Return values
string

convertToGlobalSettingFormat()

This is a convenience function to convert any date, in any date format, to the global setting date format Check if the time shoul be rendered also

convertToGlobalSettingFormat(string $sDate[, bool $withTime = false ]) : string
Parameters
$sDate : string
$withTime : bool = false
Return values
string

removeBOM()

This function removes the UTF-8 Byte Order Mark from a string

removeBOM([string $str = "" ]) : string
Parameters
$str : string = ""
Return values
string

getTemplatePath()

This function returns the complete directory path to a given template name

getTemplatePath([mixed $sTemplateName = '' ]) : string
Parameters
$sTemplateName : mixed = ''
Return values
string

getTemplateURL()

This function returns the complete URL path to a given template name

getTemplateURL(mixed $sTemplateName) : string
Parameters
$sTemplateName : mixed
Return values
string

getSubQuestions()

Return an array of subquestions for a given sid/qid

getSubQuestions(int $sid, int $qid, string $sLanguage) : array<string|int, mixed>
Parameters
$sid : int
$qid : int
$sLanguage : string

Language of the subquestion text

Return values
array<string|int, mixed>

getXMLWriter()

Wrapper function to retrieve an xmlwriter object and do error handling if it is not compiled into PHP

getXMLWriter() : mixed

SSLRedirect()

SSLRedirect() generates a redirect URL for the appropriate SSL mode then applies it.

SSLRedirect(string $enforceSSLMode) : mixed

(Was redirect() before CodeIgniter port.)

Parameters
$enforceSSLMode : string

string 's' or '' (empty).

enforceSSLMode()

enforceSSLMode() $force_ssl is on or off, it checks if the current request is to HTTPS (or not). If $force_ssl is on, and the request is not to HTTPS, it redirects the request to the HTTPS version of the URL, if the request is to HTTPS, it rewrites all the URL variables so they also point to HTTPS.

enforceSSLMode() : mixed

getFullResponseTable()

Creates an array with details on a particular response for display purposes Used in Print answers, Detailed response view and Detailed admin notification email

getFullResponseTable(mixed $iSurveyID, mixed $iResponseID, mixed $sLanguageCode[, bool $bHonorConditions = true ]) : array<string|int, mixed>
Parameters
$iSurveyID : mixed
$iResponseID : mixed
$sLanguageCode : mixed
$bHonorConditions : bool = true

Apply conditions

Return values
array<string|int, mixed>

isNumericInt()

Check if $str is an integer, or string representation of an integer

isNumericInt(string $mStr) : bool|int
Parameters
$mStr : string
Return values
bool|int

short_implode()

Implode and sort content array for very long arrays

short_implode(string $sDelimeter, mixed $sHyphen, array<string|int, mixed> $aArray) : string
Parameters
$sDelimeter : string
$sHyphen : mixed
$aArray : array<string|int, mixed>
Return values
string

String showing array content

includeKeypad()

Include Keypad headers

includeKeypad() : mixed

translateInsertansTags()

This function replaces the old insertans tags with new ones across a survey

translateInsertansTags(string $newsid, string $oldsid, mixed $fieldnames) : mixed
Parameters
$newsid : string

Old SID

$oldsid : string

New SID

$fieldnames : mixed

Array array('oldfieldname'=>'newfieldname')

replaceExpressionCodes()

Replaces EM variable codes in a current survey with a new one

replaceExpressionCodes(int $iSurveyID, mixed $aCodeMap) : mixed
Parameters
$iSurveyID : int

The survey ID

$aCodeMap : mixed

The codemap array (old_code=>new_code)

cleanLanguagesFromSurvey()

cleanLanguagesFromSurvey() removes any languages from survey tables that are not in the passed list

cleanLanguagesFromSurvey(mixed $iSurveyID, string $availlangs[, mixed $baselang = null ]) : void
Parameters
$iSurveyID : mixed
$availlangs : string
  • space separated list of additional languages in survey
$baselang : mixed = null

fixLanguageConsistency()

fixLanguageConsistency() fixes missing groups, questions, answers, quotas & assessments for languages on a survey

fixLanguageConsistency(int $sid[, string $availlangs = '' ][, string $baselang = '' ]) : bool
Parameters
$sid : int
  • the currently selected survey
$availlangs : string = ''
  • space separated list of additional languages in survey - if empty all additional languages of a survey are checked against the base language
$baselang : string = ''
  • language to use as base (useful when changing the base language) - if empty, it will be picked from the survey
Return values
bool
  • always returns true

getLastInsertID()

Retrieves the last Insert ID realiable for cross-DB applications

getLastInsertID(string $sTableName) : string
Parameters
$sTableName : string

Needed for Postgres and MSSQL

Return values
string

getGroupDepsForConditions()

getGroupDepsForConditions() get Dependencies between groups caused by conditions

getGroupDepsForConditions(string $sid[, string $depgid = "all" ][, string $targgid = "all" ][, string $indexby = "by-depgid" ]) : array<string|int, mixed>
Parameters
$sid : string
  • the currently selected survey
$depgid : string = "all"
  • (optional) get only the dependencies applying to the group with gid depgid
$targgid : string = "all"
  • (optional) get only the dependencies for groups dependents on group targgid
$indexby : string = "by-depgid"
  • (optional) "by-depgid" for result indexed with $res[$depgid][$targgid] "by-targgid" for result indexed with $res[$targgid][$depgid]
Return values
array<string|int, mixed>
  • returns an array describing the conditions or NULL if no dependecy is found

Example outupt assumin $index-by="by-depgid": Array ( [125] => Array // Group Id 125 is dependent on ( [123] => Array // Group Id 123 ( [depgpname] => G3 // GID-125 has name G3 [targetgpname] => G1 // GID-123 has name G1 [conditions] => Array ( [189] => Array // Because Question Id 189 ( [0] => 9 // Have condition 9 set [1] => 10 // and condition 10 set [2] => 14 // and condition 14 set )

                   )

           )

       [124] => Array         // GID 125 is also dependent on GID 124
           (
               [depgpname] => G3
               [targetgpname] => G2
               [conditions] => Array
                   (
                       [189] => Array // Because Question Id 189 have conditions set
                           (
                               [0] => 11
                           )

                       [215] => Array // And because Question Id 215 have conditions set
                           (
                               [0] => 12
                           )

                   )

           )

   )

)

Usage example:

  • Get all group dependencies for SID $sid indexed by depgid: $result=getGroupDepsForConditions($sid);
  • Get all group dependencies for GID $gid in survey $sid indexed by depgid: $result=getGroupDepsForConditions($sid,$gid);
  • Get all group dependents on group $gid in survey $sid indexed by targgid: $result=getGroupDepsForConditions($sid,"all",$gid,"by-targgid");

getQuestDepsForConditions()

getQuestDepsForConditions() get Dependencies between groups caused by conditions

getQuestDepsForConditions(string $sid[, string $gid = "all" ][, string $depqid = "all" ][, string $targqid = "all" ][, string $indexby = "by-depqid" ][, mixed $searchscope = "samegroup" ]) : array<string|int, mixed>
Parameters
$sid : string
  • the currently selected survey
$gid : string = "all"
  • (optional) only search dependecies inside the Group Id $gid
$depqid : string = "all"
  • (optional) get only the dependencies applying to the question with qid depqid
$targqid : string = "all"
  • (optional) get only the dependencies for questions dependents on question Id targqid
$indexby : string = "by-depqid"
  • (optional) "by-depqid" for result indexed with $res[$depqid][$targqid] "by-targqid" for result indexed with $res[$targqid][$depqid]
$searchscope : mixed = "samegroup"
Return values
array<string|int, mixed>
  • returns an array describing the conditions or NULL if no dependecy is found

Example outupt assumin $index-by="by-depqid": Array ( [184] => Array // Question Id 184 ( [183] => Array // Depends on Question Id 183 ( [0] => 5 // Because of condition Id 5 )

   )

)

Usage example:

  • Get all questions dependencies for Survey $sid and group $gid indexed by depqid: $result=getQuestDepsForConditions($sid,$gid);
  • Get all questions dependencies for question $qid in survey/group $sid/$gid indexed by depqid: $result=getGroupDepsForConditions($sid,$gid,$qid);
  • Get all questions dependents on question $qid in survey/group $sid/$gid indexed by targqid: $result=getGroupDepsForConditions($sid,$gid,"all",$qid,"by-targgid");

dbQuoteAll()

Escapes a text value for db

dbQuoteAll(string $value) : string
Parameters
$value : string
Return values
string

checkMoveQuestionConstraintsForConditions()

checkMoveQuestionConstraintsForConditions()

checkMoveQuestionConstraintsForConditions(string $sid, string $qid[, string $newgid = "all" ]) : array<string|int, mixed>
Parameters
$sid : string
  • the currently selected survey
$qid : string
  • qid of the question you want to check possible moves
$newgid : string = "all"
  • (optional) get only constraints when trying to move to this particular GroupId otherwise, get all moves constraints for this question
Return values
array<string|int, mixed>
  • returns an array describing the conditions Array ( ['notAbove'] = null | Array ( Array ( gid1, group_order1, qid1, cid1 ) ) ['notBelow'] = null | Array ( Array ( gid2, group_order2, qid2, cid2 ) ) )

This should be read as:

  • this question can't be move above group gid1 in position group_order1 because of the condition cid1 on question qid1
  • this question can't be move below group gid2 in position group_order2 because of the condition cid2 on question qid2

shouldFilterUserGroupList()

Determines whether the list of user groups will need filtering before viewing.

shouldFilterUserGroupList() : mixed
Tags
returns

bool

getUserGroupList()

Get a list of all user groups All user group or filtered according to usercontrolSameGroupPolicy

getUserGroupList() : mixed
Tags
returns

array

modifyDatabase()

Run an arbitrary sequence of semicolon-delimited SQL commands

modifyDatabase([string $sqlfile = '' ][, string $sqlstring = '' ]) : bool

Assumes that the input text (file or string) consists of a number of SQL statements ENDING WITH SEMICOLONS. The semicolons MUST be the last character in a line. Lines that are blank or that start with "#" or "--" (postgres) are ignored. Only tested with mysql dump files (mysqldump -p -d limesurvey) Function kindly borrowed by Moodle

Parameters
$sqlfile : string = ''

The path where a file with sql commands can be found on the server.

$sqlstring : string = ''

If no path is supplied then a string with semicolon delimited sql commands can be supplied in this argument.

Return values
bool

Returns true if database was modified successfully.

getLabelSets()

Returns labelsets for given language(s), or for all if null

getLabelSets([string $languages = null ]) : array<string|int, mixed>
Parameters
$languages : string = null
Return values
array<string|int, mixed>

getHeader()

get the header

getHeader([bool $meta = false ]) : string
Parameters
$meta : bool = false

: not used in any call (2016-10-18)

Return values
string

getPrintableHeader()

This function returns the header for the printable survey

getPrintableHeader() : string
Return values
string

getFooter()

This function returns the Footer as result string If you want to echo the Footer use doFooter()!

getFooter() : string
Return values
string

fixSubquestions()

This function fixes the group ID and type on all subquestions, or removes the subquestions if the parent question's type doesn't allow them.

fixSubquestions() : mixed

Optimized for minimum memory usage even on huge databases

ls_json_encode()

Must use ls_json_encode to json_encode content, otherwise LimeExpressionManager will think that the associative arrays are expressions and try to parse them.

ls_json_encode(mixed $content) : mixed
Parameters
$content : mixed

json_decode_ls()

Decode a json string, sometimes needs stripslashes

json_decode_ls(string $jsonString) : mixed
Parameters
$jsonString : string

aEncodingsArray()

Return accepted codingsArray for importing files

aEncodingsArray() : array<string|int, mixed>

Used in vvimport TODO : use in token and

Return values
array<string|int, mixed>

ellipsize()

Ellipsize String

ellipsize(string $sString, int $iMaxLength[, int $fPosition = 1 ][, string $sEllipsis = '&hellip;' ]) : string

This public static function will strip tags from a string, split it at its max_length and ellipsize

Parameters
$sString : string

string to ellipsize

$iMaxLength : int

max length of string

$fPosition : int = 1

int (1|0) or float, .5, .2, etc for position to split

$sEllipsis : string = '&hellip;'

ellipsis ; Default '...'

Return values
string

ellipsized string

getIPAddress()

This function tries to returns the 'real' IP address under all configurations Do not rely security-wise on the detected IP address as except for REMOTE_ADDR all fields could be manipulated by the web client

getIPAddress() : string
Return values
string

Client's IP Address

getRealIPAddress()

This function returns the real IP address and should mainly be used for security sensitive purposes If you want to use the IP address for language detection or similar, use getIPAddress() instead

getRealIPAddress() : string
Return values
string

Client IP Address

getBrowserLanguage()

This function tries to find out a valid language code for the language of the browser used If it cannot find it it will return the default language from global settings

getBrowserLanguage() : mixed

array_diff_assoc_recursive()

array_diff_assoc_recursive(mixed $array1, mixed $array2) : mixed
Parameters
$array1 : mixed
$array2 : mixed

folderSize()

Calculate folder size NB: If this function is changed, please notify LimeSurvey GmbH.

folderSize(string $dir) : int

An exact copy of this function is used to calculate storage limit on LimeSurvey Pro hosting.

Parameters
$dir : string

Folder

Return values
int

Size in bytes.

humanFilesize()

Format size in human readable format.

humanFilesize(int $bytes[, int $decimals = 2 ]) : string
Parameters
$bytes : int
$decimals : int = 2
Return values
string

convertPHPSizeToBytes()

This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)

convertPHPSizeToBytes(string $sSize) : int
Parameters
$sSize : string
Return values
int

The value in bytes

getMaximumFileUploadSize()

getMaximumFileUploadSize() : mixed

decodeTokenAttributes()

Decodes token attribute data because due to bugs in the past it can be written in JSON or be serialized - future format should be JSON as serialized data can be exploited

decodeTokenAttributes(string $tokenAttributeData) : array<string|int, mixed>|mixed
Parameters
$tokenAttributeData : string

The original token attributes as stored in the database

Return values
array<string|int, mixed>|mixed

getSerialClass()

getSerialClass(string $sSerial) : string|null
Parameters
$sSerial : string
Return values
string|null

regenerateCSRFToken()

Force Yii to create a new CSRF token by removing the old one

regenerateCSRFToken() : mixed

get_absolute_path()

A function to remove ../ or ./ from paths to prevent directory traversal

get_absolute_path(string $path) : string
Parameters
$path : string
Return values
string

isJson()

Check if string is JSON array

isJson(string $str) : bool
Parameters
$str : string
Return values
bool

isAssociativeArray()

Check if array is associative

isAssociativeArray(array<string|int, mixed> $array) : bool
Parameters
$array : array<string|int, mixed>
Return values
bool

createRandomTempDir()

Create a directory in tmp dir using a random string

createRandomTempDir([string $dir = null ][, string $prefix = '' ][, int $mode = 0700 ]) : string
Parameters
$dir : string = null

the temp directory (if empty will use the one from configuration)

$prefix : string = ''

wanted prefix for the directory

$mode : int = 0700

wanted file mode for this directory

Return values
string

the path of the created directory

getRandomString()

Generate a random string, using openssl if available, else using md5

getRandomString([int $length = 32 ]) : string
Parameters
$length : int = 32

wanted lenght of the random string (only for openssl mode)

Return values
string

crypto_rand_secure()

Get a random number between two values using openssl_random_pseudo_bytes

crypto_rand_secure(int $min, int $max) : string
Parameters
$min : int
$max : int
Return values
string

isZipBomb()

Test if a given zip file is Zip Bomb see comment here : http://php.net/manual/en/function.zip-entry-filesize.php

isZipBomb(string $zip_filename) : int
Parameters
$zip_filename : string
Return values
int

get_zip_originalsize()

Get the original size of a zip archive to prevent Zip Bombing see comment here : http://php.net/manual/en/function.zip-entry-filesize.php

get_zip_originalsize(string $filename) : int
Parameters
$filename : string
Return values
int

safecount()

PHP7 has created a little nasty bomb with count throwing erroros on uncountables This is to "fix" this problem

safecount(mixed $element) : int
Parameters
$element : mixed
Tags
author
Return values
int

counted element

switchMSSQLIdentityInsert()

This function switches identity insert on/off for the MSSQL database

switchMSSQLIdentityInsert(string $table, bool $state) : void
Parameters
$table : string

table name (without prefix)

$state : bool

Set to true to activate ID insert, or false to deactivate

resourceExtractFilter()

Helper to filter the contents of a .zip file uploaded into the file manager

resourceExtractFilter(mixed $p_event, mixed &$p_header) : mixed
Parameters
$p_event : mixed
$p_header : mixed

recursive_preg_replace()

Applies preg_replace recursively until $recursion_limit is exceeded or no more replacements are done.

recursive_preg_replace(array<string|int, mixed>|string $pattern, array<string|int, mixed>|string $replacement, array<string|int, mixed>|string $subject[, int $limit = -1 ][, int &$count = 0 ][, int $recursion_limit = 50 ]) : string|array<string|int, mixed>
Parameters
$pattern : array<string|int, mixed>|string
$replacement : array<string|int, mixed>|string
$subject : array<string|int, mixed>|string
$limit : int = -1
$count : int = 0

If specified, this variable will be filled with the total number of replacements done (including all iterations)

$recursion_limit : int = 50

Max number of iterations allowed

Return values
string|array<string|int, mixed>

standardDeviation()

Returns the standard deviation of supplied $numbers

standardDeviation(array<string|int, mixed> $numbers) : float
Parameters
$numbers : array<string|int, mixed>

The numbers to calculate the standard deviation for

Return values
float

isAbsolutePath()

Checks if the specified path is absolute.

isAbsolutePath(string $path) : bool

It handles both Unix and Windows paths.

Parameters
$path : string

the path to be checked

Return values
bool

whether the path is absolute

csvEscape()

Escapes a string for use in a CSV file

csvEscape(string|null $string) : string
Parameters
$string : string|null
Return values
string

dbExecuteAssoc()

dbExecuteAssoc(string $sql[, array<string|int, mixed>|bool $inputarr = false ][, bool $silent = true ]) : bool|CDbDataReader
Parameters
$sql : string
$inputarr : array<string|int, mixed>|bool = false
$silent : bool = true
Tags
throws
Exception
deprecated

Do not use anymore. If you see this replace it with a proper ActiveRecord Model query

Return values
bool|CDbDataReader

dbRandom()

Return the database-specific random function to use in ORDER BY sql statements

dbRandom() : string
Return values
string

dbSelectTablesLike()

Return a sql statement for finding LIKE named tables Be aware that you have to escape underscore chars by using a backslash otherwise you might get table names returned you don't want

dbSelectTablesLike(mixed $table) : string
Parameters
$table : mixed
Return values
string

dbGetTablesLike()

Gets the table names. Do not prefix.

dbGetTablesLike(string $table) : array<string|int, mixed>
Parameters
$table : string

String to match

Tags
uses
dbSelectTablesLike()

To get the tables like sql query

Return values
array<string|int, mixed>

Array of matched table names

stripTagsFull()

Strips html tags and replaces new lines

stripTagsFull(string $string[, bool $removeOther = true ]) : string
Parameters
$string : string
$removeOther : bool = true

if 'true', removes '-oth-' from the string.

Return values
string

isNumericExtended()

Returns true if passed $value is numeric

isNumericExtended( $value) : bool
Parameters
$value :
Return values
bool

strSplitUnicode()

Returns splitted unicode string correctly source: http://www.php.net/manual/en/function.str-split.php#107658

strSplitUnicode(string $str[,  $l = 0 ]) : string
Parameters
$str : string
$l : = 0
Return values
string

quoteSPSS()

Quotes a string with surrounding quotes and masking inside quotes by doubling them

quoteSPSS(string $sText, string $sQuoteChar, string $aField) : mixed
Parameters
$sText : string

Text to quote

$sQuoteChar : string

The quote character (Use ' for SPSS and " for R)

$aField : string

General field information from SPSSFieldmap

SPSSExportData()

Exports CSV response data for SPSS and R

SPSSExportData(mixed $iSurveyID, string $iLength[, string $na = '' ][, string $sEmptyAnswerValue = '' ][, string $q = ''' ][, bool $header = false ][, string $sLanguage = '' ]) : mixed
Parameters
$iSurveyID : mixed

The survey ID

$iLength : string

Maximum text lenght data, usually 255 for SPSS <v16 and 16384 for SPSS 16 and later

$na : string = ''

Value for N/A data

$sEmptyAnswerValue : string = ''

Value for empty data ('')

$q : string = '''

sep Quote separator. Use ' for SPSS, " for R

$header : bool = false

logical $header If TRUE, adds SQGA code as column headings (used by export to R)

$sLanguage : string = ''

SPSSGetValues()

Check it the gives field has a labelset and return it as an array if true

SPSSGetValues( $field, mixed $qidattributes, string $language) : array<string|int, mixed>|bool
Parameters
$field :

array field from SPSSFieldMap

$qidattributes : mixed
$language : string
Return values
array<string|int, mixed>|bool

SPSSFieldMap()

Creates a fieldmap with all information necessary to output the fields

SPSSFieldMap(mixed $iSurveyID[,  $prefix = 'V' ][, mixed $sLanguage = '' ]) : array<string|int, mixed>
Parameters
$iSurveyID : mixed
$prefix : = 'V'

string prefix for the variable ID

$sLanguage : mixed = ''
Return values
array<string|int, mixed>

SPSSGetQuery()

Creates a query string with all fields for the export

SPSSGetQuery(mixed $iSurveyID[, mixed $limit = null ][, mixed $offset = null ]) : CDbCommand
Parameters
$iSurveyID : mixed
$limit : mixed = null
$offset : mixed = null
Return values
CDbCommand

buildXMLFromQuery()

buildXMLFromQuery() creates a datadump of a table in XML using XMLWriter

buildXMLFromQuery(mixed $xmlwriter, mixed $Query[, string $tagname = '' ][, array<string|int, string> $excludes = array() ][, mixed $iSurveyID = 0 ]) : mixed
Parameters
$xmlwriter : mixed

The existing XMLWriter object

$Query : mixed

The table query to build from

$tagname : string = ''

If the XML tag of the resulting question should be named differently than the table name set it here

$excludes : array<string|int, string> = array()

array of columnames not to include in export

$iSurveyID : mixed = 0

surveyGetXMLStructure()

from export_structure_xml.php

surveyGetXMLStructure(mixed $iSurveyID, mixed $xmlwriter[, mixed $exclude = array() ]) : mixed
Parameters
$iSurveyID : mixed
$xmlwriter : mixed
$exclude : mixed = array()

surveyGetXMLData()

from export_structure_xml.php

surveyGetXMLData(mixed $iSurveyID[, mixed $exclude = array() ]) : mixed
Parameters
$iSurveyID : mixed
$exclude : mixed = array()

getXMLDataSingleTable()

Exports a single table to XML

getXMLDataSingleTable(int $iSurveyID, string $sTableName, string $sDocType[, string $sXMLTableTagName = '' ][, mixed $sFileName = '' ][, mixed $bSetIndent = true ]) : string|bool
Parameters
$iSurveyID : int

The survey ID

$sTableName : string

The database table name of the table to be export

$sDocType : string

What doctype should be written

$sXMLTableTagName : string = ''

Name of the tag table name in the XML file

$sFileName : mixed = ''
$bSetIndent : mixed = true
Return values
string|bool

XMLWriter object

QueXMLCleanup()

from export_structure_quexml.php

QueXMLCleanup(string|null $string[, string|null $allow = '<p><b><u><i><em>' ]) : string
Parameters
$string : string|null
$allow : string|null = '<p><b><u><i><em>'
Return values
string

QueXMLCreateFree()

from export_structure_quexml.php

QueXMLCreateFree(mixed $f, mixed $len[, mixed $lab = "" ]) : mixed
Parameters
$f : mixed
$len : mixed
$lab : mixed = ""

QueXMLFixedArray()

from export_structure_quexml.php

QueXMLFixedArray(mixed $array) : mixed
Parameters
$array : mixed

QueXMLSkipTo()

Calculate if this item should have a QueXMLSkipTo element attached to it

QueXMLSkipTo(mixed $qid, mixed $value[, mixed $cfieldname = "" ]) : bool|string

from export_structure_quexml.php

Parameters
$qid : mixed
$value : mixed
$cfieldname : mixed = ""
Tags
author

Adam Zammit adam.zammit@acspri.org.au

since
2010-10-28
TODO

Correctly handle conditions in a database agnostic way

Return values
bool|string

Text of item to skip to otherwise false if nothing to skip to

QueXMLCreateFixed()

from export_structure_quexml.php

QueXMLCreateFixed(mixed $qid, mixed $iResponseID, mixed $fieldmap[, mixed $rotate = false ][, mixed $labels = true ][, mixed $scale = 0 ][, mixed $other = false ][, mixed $varname = "" ]) : mixed
Parameters
$qid : mixed
$iResponseID : mixed
$fieldmap : mixed
$rotate : mixed = false
$labels : mixed = true
$scale : mixed = 0
$other : mixed = false
$varname : mixed = ""

quexml_get_lengthth()

from export_structure_quexml.php

quexml_get_lengthth(mixed $qid, mixed $attribute, mixed $default[, mixed $quexmllang = false ]) : mixed
Parameters
$qid : mixed
$attribute : mixed
$default : mixed
$quexmllang : mixed = false

quexml_create_multi()

from export_structure_quexml.php

quexml_create_multi(mixed &$question, mixed $qid, mixed $varname, mixed $iResponseID, mixed $fieldmap[, mixed $scale_id = false ][, mixed $free = false ][, mixed $other = false ][, mixed $yesvalue = "1" ][, mixed $comment = false ]) : mixed
Parameters
$question : mixed
$qid : mixed
$varname : mixed
$iResponseID : mixed
$fieldmap : mixed
$scale_id : mixed = false
$free : mixed = false
$other : mixed = false
$yesvalue : mixed = "1"
$comment : mixed = false

quexml_create_subQuestions()

from export_structure_quexml.php

quexml_create_subQuestions(mixed &$question, mixed $qid, mixed $varname, mixed $iResponseID, mixed $fieldmap[, mixed $use_answers = false ][, mixed $aid = false ][, mixed $scale = false ]) : mixed
Parameters
$question : mixed
$qid : mixed
$varname : mixed
$iResponseID : mixed
$fieldmap : mixed
$use_answers : mixed = false
$aid : mixed = false
$scale : mixed = false

quexml_set_default_value_rank()

Set defaultValue attribute of provided element from response table

quexml_set_default_value_rank(mixed &$element, int $iResponseID, int $qid, int $iSurveyID, array<string|int, mixed> $fieldmap, string $acode) : mixed
Parameters
$element : mixed

DOM element to add attribute to

$iResponseID : int

The response id

$qid : int

The qid of the question

$iSurveyID : int

The survey ID

$fieldmap : array<string|int, mixed>

A mapping of fields to qid

$acode : string

The answer code to search for

quexml_set_default_value()

Set defaultValue attribute of provided element from response table

quexml_set_default_value(mixed &$element, int $iResponseID, int $qid, int $iSurveyID, array<string|int, mixed> $fieldmap[, bool|string $fieldadd = false ][, bool|string $usesqid = false ][, bool|string $usesaid = false ][, mixed $usesscale = false ]) : mixed
Parameters
$element : mixed

DOM element to add attribute to

$iResponseID : int

The response id

$qid : int

The qid of the question

$iSurveyID : int

The survey ID

$fieldmap : array<string|int, mixed>

A mapping of fields to qid

$fieldadd : bool|string = false

Anything additional to search for in the field name

$usesqid : bool|string = false

Search using sqid instead of qid

$usesaid : bool|string = false

Search using aid

$usesscale : mixed = false

quexml_reformat_date()

Format defaultValue of Date/Time questions according to question date format

quexml_reformat_date(mixed $element, int $qid, int $iSurveyID) : void
Parameters
$element : mixed

DOM element with the date to change

$qid : int

The qid of the question

$iSurveyID : int

The survey ID

quexml_create_question()

Create a queXML question element

quexml_create_question(CActiveRecord $RowQ[, bool|string $additional = false ]) : mixed
Parameters
$RowQ : CActiveRecord

Question details in array

$additional : bool|string = false

Any additional question text to append

quexml_export()

Export quexml survey.

quexml_export(mixed $surveyi, mixed $quexmllan[, mixed $iResponseID = false ]) : mixed
Parameters
$surveyi : mixed
$quexmllan : mixed
$iResponseID : mixed = false

group_export()

group_export(string $action, mixed $iSurveyID, mixed $gid) : mixed
Parameters
$action : string
$iSurveyID : mixed
$gid : mixed

groupGetXMLStructure()

groupGetXMLStructure(XMLWriter $xml, mixed $gid) : mixed
Parameters
$xml : XMLWriter
$gid : mixed

questionExport()

questionExport(string $action, mixed $iSurveyID, mixed $gid, mixed $qid) : mixed
Parameters
$action : string
$iSurveyID : mixed
$gid : mixed
$qid : mixed

questionGetXMLStructure()

questionGetXMLStructure(XMLWriter $xml, mixed $gid, mixed $qid) : mixed
Parameters
$xml : XMLWriter
$gid : mixed
$qid : mixed

tokensExport()

tokensExport(int $iSurveyID) : mixed
Parameters
$iSurveyID : int

CPDBExport()

CPDBExport(mixed $data, string $filename) : mixed
Parameters
$data : mixed
$filename : string

stringSize()

Find the string size according DB size for existing question Column name must be SGQA currently

stringSize(string $sColumn) : int
Parameters
$sColumn : string
Return values
int

numericSize()

Find the numeric size according DB size for existing question for SPSS export Column name must be SGQA currently

numericSize(string $sColumn[, bool $decimal = false ]) : string
Parameters
$sColumn : string
$decimal : bool = false

db type as decimal(30,10)

Return values
string

integersize.decimalsize

tsvSurveyExport()

Export survey to TSV format It is using existing XML function to get the same source data as lss format

tsvSurveyExport(mixed $surveyid) : string
Parameters
$surveyid : mixed
Return values
string

sortArrayByColumn()

Sort array by column name

sortArrayByColumn(array<string|int, mixed> $array, string $column_name) : mixed
Parameters
$array : array<string|int, mixed>
$column_name : string

writeXmlFromArray()

Write XML from Associative Array, recursive function

writeXmlFromArray(object $xml, array<string|int, mixed> $aData[, int $sParentKey = '' ]) : mixed
Parameters
$xml : object

XMLWriter Object

$aData : array<string|int, mixed>

Associative Data Array

$sParentKey : int = ''

parent key

surveyGetThemeConfiguration()

Write XML structure for themes

surveyGetThemeConfiguration([int $iSurveyId = null ][, object $oXml = null ][, bool $bInherit = false ][, string $sElementName = 'themes' ]) : mixed
Parameters
$iSurveyId : int = null

Survey ID

$oXml : object = null

XMLWriter Object

$bInherit : bool = false

should theme configuration be inherited?

$sElementName : string = 'themes'

name for XML element

MaskFormula()

MaskFormula(mixed $sValue) : mixed
Parameters
$sValue : mixed

buildXMLFromArray()

buildXMLFromArray() dumps an array to XML using XMLWriter, in the same format as buildXMLFromQuery()

buildXMLFromArray(mixed $xmlwriter, array<string|int, array<string, mixed>> $data, string $tagname[, array<string|int, string> $excludes = [] ]) : mixed
Parameters
$xmlwriter : mixed

The existing XMLWriter object

$data : array<string|int, array<string, mixed>>

The data to dump. Each element of the array must be a key-value pair.

$tagname : string

The name of the XML tag to generate

$excludes : array<string|int, string> = []

array of columnames not to include in export

cmpErrorTokens()

Used by usort() to order Error tokens by their position within the string This must be outside of the class in order to work in PHP 5.2

cmpErrorTokens(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>
$b : array<string|int, mixed>
Return values
int

exprmgr_count()

Count the number of answered questions (non-empty)

exprmgr_count(array<string|int, mixed> $args) : int
Parameters
$args : array<string|int, mixed>
Return values
int

exprmgr_countif()

Count the number of answered questions (non-empty) which match the first argument

exprmgr_countif(array<string|int, mixed> $args) : int
Parameters
$args : array<string|int, mixed>
Return values
int

exprmgr_countifop()

Count the number of answered questions (non-empty) which meet the criteria (arg op value)

exprmgr_countifop(array<string|int, mixed> $args) : int
Parameters
$args : array<string|int, mixed>
Return values
int

exprmgr_stripos()

Find position of first occurrence of unicode string in a unicode string, case insensitive

exprmgr_stripos(string $haystack, string $needle[,  $offset = 0 ]) : int|false
Parameters
$haystack : string

: checked string

$needle : string

: string to find

$offset : = 0

: offset

Return values
int|false

: position or false if not found

exprmgr_stristr()

Finds first occurrence of a unicode string within another, case-insensitive

exprmgr_stristr(string $haystack, string $needle[, bool $before_needle = false ]) : string|false
Parameters
$haystack : string

: checked string

$needle : string

: string to find

$before_needle : bool = false

: portion to return

Return values
string|false

exprmgr_strlen()

Get unicode string length

exprmgr_strlen(string $string) : int
Parameters
$string : string
Return values
int

exprmgr_strpos()

Find position of first occurrence of unicode string in a unicode string

exprmgr_strpos(string $haystack, string $needle[, int $offset = 0 ]) : int|false
Parameters
$haystack : string

: checked string

$needle : string

: string to find

$offset : int = 0

: offset

Return values
int|false

: position or false if not found

exprmgr_strstr()

Finds first occurrence of a unicode string within another

exprmgr_strstr(string $haystack, string $needle[, bool $before_needle = false ]) : string|false
Parameters
$haystack : string

: checked string

$needle : string

: string to find

$before_needle : bool = false

: portion to return

Return values
string|false

exprmgr_strtolower()

Make an unicode string lowercase

exprmgr_strtolower(string $string) : string
Parameters
$string : string
Return values
string

exprmgr_strtoupper()

Make an unicode string uppercase

exprmgr_strtoupper(string $string) : string
Parameters
$string : string
Return values
string

exprmgr_substr()

Get part of unicode string

exprmgr_substr(string $string, int $start[, int $end = null ]) : string
Parameters
$string : string
$start : int
$end : int = null
Return values
string

exprmgr_sumifop()

Sum of values of answered questions which meet the criteria (arg op value)

exprmgr_sumifop(array<string|int, mixed> $args) : int
Parameters
$args : array<string|int, mixed>
Return values
int

exprmgr_checkdate()

Validate a Gregorian date

exprmgr_checkdate(mixed $month, mixed $day, mixed $year) : bool
Parameters
$month : mixed
$day : mixed
$year : mixed
Tags
see
https://www.php.net/checkdate

Check if all params are valid before send it to PHP checkdate to avoid PHP Warning

Return values
bool

exprmgr_convert_value()

Find the closest matching Numerical input values in a list an replace it by the corresponding value within another list

exprmgr_convert_value(float $fValueToReplace, int $iStrict, string $sTranslateFromList, string $sTranslateToList) : int|null
Parameters
$fValueToReplace : float
$iStrict : int
  • 1 for exact matches only otherwise interpolation the closest value should be returned
$sTranslateFromList : string
  • comma seperated list of numeric values to translate from
$sTranslateToList : string
  • comma seperated list of numeric values to translate to
Tags
author

Johannes Weberhofer, 2013

Return values
int|null

exprmgr_date()

Return format a local time/date Need to test if timestamp is numeric (else E_WARNING with debug>0)

exprmgr_date(string $format[, int $timestamp = null ]) : string|false
Parameters
$format : string
$timestamp : int = null
Tags
link
http://php.net/function.date.php
Return values
string|false

exprmgr_abs()

exprmgr_abs(mixed $num) : mixed
Parameters
$num : mixed

exprmgr_if()

If $test is true, return $iftrue, else return $iffalse

exprmgr_if(mixed $testDone, mixed $iftrue[, mixed $iffalse = '' ]) : mixed
Parameters
$testDone : mixed
$iftrue : mixed
$iffalse : mixed = ''

exprmgr_int()

Return true if the variable is an integer for LimeSurvey Allow usage of numeric answercode as int Can not use is_int due to SQL DECIMAL system.

exprmgr_int(string $arg) : int
Parameters
$arg : string
Tags
link
http://php.net/is_int#82857
Return values
int

exprmgr_list()

Join together $args[0-N] with ', '

exprmgr_list(array<string|int, mixed> $args) : string
Parameters
$args : array<string|int, mixed>
Return values
string

exprmgr_listifop()

Implementation of listifop( $cmpAttr, $op, $value, $retAttr, $glue, $sgqa1, ..., sgqaN ) Return a list of retAttr from sgqa1...sgqaN which pass the critiera (cmpAttr op value)

exprmgr_listifop(array<string|int, mixed> $args) : string
Parameters
$args : array<string|int, mixed>
Return values
string

exprmgr_log()

return log($arg[0],$arg[1]=e)

exprmgr_log(array<string|int, mixed> $args) : float
Parameters
$args : array<string|int, mixed>
Return values
float

exprmgr_mktime()

Get Unix timestamp for a date : false if parameters is invalid.

exprmgr_mktime([int $hour = null ][, int $minute = null ][, int $second = null ][, int $month = null ][, int $day = null ][, int $year = null ]) : int|bool

Get default value for unset (or null) value E_NOTICE if arguments are not numeric (debug>0), then test it before

Parameters
$hour : int = null
$minute : int = null
$second : int = null
$month : int = null
$day : int = null
$year : int = null
Return values
int|bool

exprmgr_join()

Join together $args[N]

exprmgr_join(array<string|int, mixed> $args) : string
Parameters
$args : array<string|int, mixed>
Return values
string

exprmgr_implode()

Join together $args[1-N] with $arg[0]

exprmgr_implode(array<string|int, mixed> $args) : string
Parameters
$args : array<string|int, mixed>
Return values
string

exprmgr_empty()

Return true if the variable is NULL or blank.

exprmgr_empty(null|string|bool $arg) : bool
Parameters
$arg : null|string|bool
Return values
bool

exprmgr_stddev()

Compute the Sample Standard Deviation of a set of numbers ($args[0-N])

exprmgr_stddev(array<string|int, mixed> $args) : float
Parameters
$args : array<string|int, mixed>
Return values
float

expr_mgr_htmlspecialchars()

Javascript equivalent does not cope well with ENT_QUOTES and related PHP constants, so set default to ENT_QUOTES

expr_mgr_htmlspecialchars(string $string) : string
Parameters
$string : string
Return values
string

expr_mgr_htmlspecialchars_decode()

Javascript equivalent does not cope well with ENT_QUOTES and related PHP constants, so set default to ENT_QUOTES

expr_mgr_htmlspecialchars_decode(string $string) : string
Parameters
$string : string
Return values
string

exprmgr_regexMatch()

Return true if $input matches the regular expression $pattern

exprmgr_regexMatch(string $pattern, string $input) : bool
Parameters
$pattern : string
$input : string
Return values
bool

geterrors_exprmgr_regexMatch()

Return error information from pattern of regular expression $pattern

geterrors_exprmgr_regexMatch(string $pattern, string $input) : string|null
Parameters
$pattern : string
$input : string
Return values
string|null

exprmgr_fixnum()

Display number with comma as radix separator, if needed

exprmgr_fixnum(string $value) : string
Parameters
$value : string
Return values
string

exprmgr_unique()

Returns true if all non-empty values are unique

exprmgr_unique(array<string|int, mixed> $args) : bool
Parameters
$args : array<string|int, mixed>
Return values
bool

cmpQuestionSeq()

Used by usort() to order $this->questionSeq2relevance in proper order

cmpQuestionSeq(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>
$b : array<string|int, mixed>
Return values
int

getLanguageChangerDatas()

This function creates the language selector for a particular survey

getLanguageChangerDatas([string $sSelectedLanguage = "" ]) : array<string|int, mixed>|false
Parameters
$sSelectedLanguage : string = ""

: lang to be selected (forced)

Return values
array<string|int, mixed>|false

: array of data if more than one language, else false

getLanguageChangerDatasPublicList()

This function creates the language selector for the public survey index page

getLanguageChangerDatasPublicList(string $sSelectedLanguage) : array<string|int, mixed>|bool
Parameters
$sSelectedLanguage : string

The language in which all information is shown

Return values
array<string|int, mixed>|bool

makeFlashMessage()

Construct flash message container Used in templatereplace to replace {FLASHMESSAGE} in startpage.tstpl

makeFlashMessage() : string
Return values
string

checkUploadedFileValidity()

checkUploadedFileValidity used in SurveyRuntimeHelper

checkUploadedFileValidity(mixed $surveyid, mixed $move[, mixed $backok = null ]) : mixed
Parameters
$surveyid : mixed
$move : mixed
$backok : mixed = null

addtoarray_single()

Takes two single element arrays and adds second to end of first if value exists Why not use array_merge($array1,array_filter($array2);

addtoarray_single(mixed $array1, mixed $array2) : mixed
Parameters
$array1 : mixed
$array2 : mixed

submittokens()

Marks a tokens as completed and sends a confirmation email to the participiant.

submittokens([bool $quotaexit = false ]) : mixed

If $quotaexit is set to true then the user exited the survey due to a quota restriction and the according token is only marked as 'Q'

Parameters
$quotaexit : bool = false

sendSubmitNotifications()

Send a submit notification to the email address specified in the notifications tab in the survey settings

sendSubmitNotifications(int $surveyid[, array<string|int, mixed> $emails = [] ][, bool $return = false ]) : mixed
Parameters
$surveyid : int

survey ID of currently used survey

$emails : array<string|int, mixed> = []

Emailnotifications that should be sent ['responseTo' => [['failedEmailId' => 'failedEmailId1', 'responseid' => 'responseid1', 'recipient' => 'recipient1', 'language' => 'language1'], [...]], 'notificationTo' => [[..., ..., ...][...]]]

$return : bool = false

whether the function should return values

Tags
throws
Exception
throws
CException

getResponseTableReplacement()

create ANSWERTABLE replacement field content

getResponseTableReplacement( $surveyid,  $responseId,  $emailLanguage,  $bIsHTML) : string
Parameters
$surveyid :
$responseId :
$emailLanguage :
$bIsHTML :
Tags
throws
CException
Return values
string

saveFailedEmail()

Saves a failed email whenever processing and sensing an email fails or overwrites a found entry with updated values

saveFailedEmail(int|null $id, string|null $recipient, int $surveyId, int $responseId, string|null $emailType, string|null $language, LimeMailer $mailer) : bool
Parameters
$id : int|null

Id of failed email

$recipient : string|null
$surveyId : int
$responseId : int
$emailType : string|null
$language : string|null
$mailer : LimeMailer
Return values
bool

failedEmailSuccess()

failedEmailSuccess(mixed $id) : mixed
Parameters
$id : mixed

submitfailed()

submitfailed : used in em_manager_helper.php

submitfailed([string $errormsg = '' ][, string $query = null ]) : string

"Unexpected error"

Will send e-mail to adminemail if defined.

Parameters
$errormsg : string = ''
$query : string = null

Will be included in sent email

Return values
string

Error message

buildsurveysession()

This function builds all the required session variables when a survey is first started and it loads any answer defaults from command line or from the table defaultvalues It is called from the related format script (group.php, question.php, survey.php) if the survey has just started.

buildsurveysession(int $surveyid[, bool $preview = false ]) : void
Parameters
$surveyid : int
$preview : bool = false

Defaults to false

checkPassthruLabel()

Check if a passthru label and value have been included in the query url

checkPassthruLabel(int $surveyid, bool $preview, mixed $fieldmap) : void
Parameters
$surveyid : int
$preview : bool
$fieldmap : mixed

prefillFromCommandLine()

Prefill startvalues from command line param

prefillFromCommandLine(int $surveyid) : void
Parameters
$surveyid : int

initFieldArray()

initFieldArray(int $surveyid, array<string|int, mixed> $fieldmap) : void
Parameters
$surveyid : int
$fieldmap : array<string|int, mixed>

randomizationGroupsAndQuestions()

Apply randomizationGroup and randomizationQuestion to session fieldmap

randomizationGroupsAndQuestions(int $surveyid[, bool $preview = false ][, mixed $fieldmap = array() ]) : void
Parameters
$surveyid : int
$preview : bool = false
$fieldmap : mixed = array()

randomizationGroup()

Randomization group for groups

randomizationGroup(int $surveyid, array<string|int, mixed> $fieldmap, bool $preview) : array<string|int, mixed>
Parameters
$surveyid : int
$fieldmap : array<string|int, mixed>
$preview : bool
Return values
array<string|int, mixed>

($fieldmap, $randomized)

randomizationQuestion()

Randomization group for questions

randomizationQuestion(int $surveyid, array<string|int, mixed> $fieldmap, bool $preview) : array<string|int, mixed>
Parameters
$surveyid : int
$fieldmap : array<string|int, mixed>
$preview : bool
Return values
array<string|int, mixed>

($fieldmap, $randomized)

finalizeRandomization()

Stuff?

finalizeRandomization(array<string|int, mixed> $fieldmap) : array<string|int, mixed>
Parameters
$fieldmap : array<string|int, mixed>
Return values
array<string|int, mixed>

Fieldmap

testIfTokenIsValid()

Test if token is valid

testIfTokenIsValid(array<string|int, mixed> $subscenarios, array<string|int, mixed> $thissurvey, array<string|int, mixed> $aEnterTokenData, string $clienttoken) : array<string|int, string>
Parameters
$subscenarios : array<string|int, mixed>
$thissurvey : array<string|int, mixed>
$aEnterTokenData : array<string|int, mixed>
$clienttoken : string
Return values
array<string|int, string>

($renderToken, $FlashError)

getRenderWay()

Returns which way should be rendered

getRenderWay(string $renderToken, string $renderCaptcha) : string
Parameters
$renderToken : string
$renderCaptcha : string
Return values
string

renderRenderWayForm()

Render token, captcha or register form

renderRenderWayForm(string $renderWay, array<string|int, mixed> $scenarios, string $sTemplateViewPath, array<string|int, mixed> $aEnterTokenData, int $surveyid[, mixed $aSurveyInfo = null ]) : void
Parameters
$renderWay : string
$scenarios : array<string|int, mixed>
$sTemplateViewPath : string
$aEnterTokenData : array<string|int, mixed>
$surveyid : int
$aSurveyInfo : mixed = null

resetAllSessionVariables()

Resets all session variables for this survey

resetAllSessionVariables(int $surveyid) : void
Parameters
$surveyid : int

setTotalSteps()

The number of "pages" that will be presented in this survey The number of pages to be presented will differ depending on the survey format Set totalsteps in session

setTotalSteps(int $surveyid, array<string|int, mixed> $thissurvey, int $totalquestions) : void
Parameters
$surveyid : int
$thissurvey : array<string|int, mixed>
$totalquestions : int

breakOutAndCrash()

breakOutAndCrash(string $sTemplateViewPath, int $totalquestions, int $iTotalGroupsWithoutQuestions, array<string|int, mixed> $thissurvey) : void
Parameters
$sTemplateViewPath : string
$totalquestions : int
$iTotalGroupsWithoutQuestions : int
$thissurvey : array<string|int, mixed>
Tags
todo

Rename

todo

Move HTML to view

renderError()

renderError(mixed $sTitle, mixed $sMessage, mixed $thissurvey, string $sTemplateViewPath) : mixed
Parameters
$sTitle : mixed
$sMessage : mixed
$thissurvey : mixed
$sTemplateViewPath : string

getNavigatorDatas()

TODO: call this function from surveyRuntimeHelper TODO: remove surveymover()

getNavigatorDatas() : mixed

doAssessment()

Caculate assessement scores

doAssessment(int $surveyid[, bool $onlyCurrent = true ]) : array<string|int, mixed>
Parameters
$surveyid : int
$onlyCurrent : bool = true

: only current ( ASSESSMENT_CURRENT_TOTAL )

Return values
array<string|int, mixed>

UpdateGroupList()

Update SESSION VARIABLE: grouplist A list of groups in this survey, ordered by group name.

UpdateGroupList(int $surveyid, string $language) : mixed
Parameters
$surveyid : int
$language : string

updateFieldArray()

FieldArray contains all necessary information regarding the questions This function is needed to update it in case the survey is switched to another language

updateFieldArray() : mixed
Tags
todo:

Make 'fieldarray' obsolete by replacing with EM session info

checkCompletedQuota()

checkCompletedQuota() returns matched quotas information for the current response

checkCompletedQuota(int $surveyid[, bool $return = false ]) : array<string|int, mixed>|void
Parameters
$surveyid : int
  • Survey identification number
$return : bool = false
  • set to true to return information, false do the quota
Return values
array<string|int, mixed>|void
  • nested array, Quotas->Members->Fields, includes quota information matched in session.

encodeEmail()

encodeEmail : encode admin email in public part

encodeEmail(mixed $mail[, mixed $text = "" ][, mixed $class = "" ][, mixed $params = array() ]) : mixed|string
Parameters
$mail : mixed
$text : mixed = ""
$class : mixed = ""
$params : mixed = array()
Return values
mixed|string

getReferringUrl()

GetReferringUrl() returns the referring URL

getReferringUrl() : string
Return values
string

display_first_page()

Shows the welcome page, used in group by group and question by question mode

display_first_page(mixed $thissurvey, mixed $aSurveyInfo) : mixed
Parameters
$thissurvey : mixed
$aSurveyInfo : mixed

killSurveySession()

killSurveySession : reset $_SESSION part for the survey

killSurveySession(int $iSurveyID) : mixed
Parameters
$iSurveyID : int

resetTimers()

Resets all question timers by expiring the related cookie - this needs to be called before any output is done

resetTimers() : mixed
Tags
todo

Deprecated - Question timers no longer use cookies

resetQuestionTimers()

Removes all question timers for this survey from local storage

resetQuestionTimers(mixed $surveyid) : void
Parameters
$surveyid : mixed

SetSurveyLanguage()

Set the public survey language Control if language exist in this survey, else set to survey default language if $surveyid <= 0 : set the language to default site language

SetSurveyLanguage(int $surveyid, string $sLanguage) : mixed
Parameters
$surveyid : int
$sLanguage : string

getMove()

getMove get move button clicked

getMove() : string
Return values
string

getSideBodyClass()

Get the margin class for side-body div depending on side-menu behaviour config and page (edit or not etc).

getSideBodyClass([bool $sideMenustate = false ]) : string
Parameters
$sideMenustate : bool = false
  • False for pages with collapsed side-menu
Tags
throws
CException
Return values
string

cookieConsentLocalization()

For later use, don't remove.

cookieConsentLocalization() : array<string|int, string>
Return values
array<string|int, string>

getForwardParameters()

Returns an array of URL parameters that can be forwarded

getForwardParameters(LSHttpRequest $request) : array<string, mixed>
Parameters
$request : LSHttpRequest

the HTTP request

Return values
array<string, mixed>

traceVar()

If debug = 2 in application/config.php this will produce output in the console / firebug similar to var_dump. It will also include the filename and line that called this method.

traceVar(mixed $variable[, int $depth = 10 ]) : mixed
Parameters
$variable : mixed

The variable to be dumped

$depth : int = 10

Maximum depth to go into the variable, default is 10

getGlobalSetting()

Returns a global setting

getGlobalSetting(string $settingname) : string
Parameters
$settingname : string
Tags
deprecated

: use App()->getConfig('settingname') since all config are set at start of App : no need to read and test again

Return values
string

ldap_getCnx()

ldap_getCnx([mixed $server_id = null ]) : mixed
Parameters
$server_id : mixed = null

ldap_bindCnx()

ldap_bindCnx(mixed $ds[, mixed $server_id = null ]) : mixed
Parameters
$ds : mixed
$server_id : mixed = null

ldap_readattr()

ldap_readattr(mixed $attr) : mixed
Parameters
$attr : mixed

ldap_search_withScope()

ldap_search_withScope(mixed $ds, mixed $basedn, mixed $filter, mixed $attrlist, mixed $scope) : mixed
Parameters
$ds : mixed
$basedn : mixed
$filter : mixed
$attrlist : mixed
$scope : mixed

ldap_doTokenSearch()

ldap_doTokenSearch(mixed $ds, mixed $ldapq, mixed &$ResArray, int $surveyid) : mixed
Parameters
$ds : mixed
$ldapq : mixed
$ResArray : mixed
$surveyid : int

prepareLDAPQuery()

prepareLDAPQuery(mixed $queryId) : mixed
Parameters
$queryId : mixed

setNoAnswerMode()

setNoAnswerMode

setNoAnswerMode(mixed $thissurvey) : mixed
Parameters
$thissurvey : mixed

retrieveAnswers()

This function returns an array containing the "question/answer" html display and a list of the question/answer fieldnames associated. It is called from question.php, group.php, survey.php or preview.php

retrieveAnswers(array<string|int, mixed> $ia) : array<string|int, mixed>
Parameters
$ia : array<string|int, mixed>

Details of $ia can be found at top of this file

Return values
array<string|int, mixed>

Array like [array $qanda, array $inputnames] where $qanda has elements [ $qtitle (question_text) : array [ all : string; complete HTML?; all has been added for backwards compatibility with templates that use question_start.pstpl (now redundant) 'text' => $qtitle, question?? $ia[3]? 'code' => $ia[2] or title?? 'number' => $number 'help' => '' 'mandatory' => '' man_message : string; message when mandatory is not answered 'valid_message' => '' file_valid_message : string; only relevant for file upload 'class' => '' 'man_class' => '' 'input_error_class' => '' // provides a class. 'essentials' => '' ] $answer ? 'help' : string $display : ? $qid : integer $ia[2] = title; $ia[5] = group id : int $ia[1] = fieldname : string ] and $inputnames is ? used for hiddenfieldnames and upload file?

mandatory_message()

mandatory_message(mixed $ia) : mixed
Parameters
$ia : mixed

validation_message()

validation_message(array<string|int, mixed> $ia, bool $show) : array<string|int, mixed>
Parameters
$ia : array<string|int, mixed>
$show : bool
  • true if should initially be visible
Return values
array<string|int, mixed>

file_validation_message()

file_validation_message(mixed $ia) : mixed
Parameters
$ia : mixed

mandatory_popup()

mandatory_popup(mixed $ia[, mixed $notanswered = null ]) : mixed
Parameters
$ia : mixed
$notanswered : mixed = null

validation_popup()

validation_popup(mixed $ia[, mixed $notvalidated = null ]) : mixed
Parameters
$ia : mixed
$notvalidated : mixed = null

file_validation_popup()

file_validation_popup(mixed $ia[, bool $filenotvalidated = null ]) : mixed
Parameters
$ia : mixed
$filenotvalidated : bool = null

return_timer_script()

return_timer_script(mixed $aQuestionAttributes, mixed $ia[, string $disable = null ]) : string
Parameters
$aQuestionAttributes : mixed
$ia : mixed
$disable : string = null
Return values
string

currentRelevecanceClass()

Return class of a specific row (hidden by relevance)

currentRelevecanceClass(int $surveyId, string $baseName, string $name, array<string|int, mixed> $aQuestionAttributes) : string
Parameters
$surveyId : int

actual survey ID

$baseName : string

the base name of the question

$name : string

The name of the question/row to test

$aQuestionAttributes : array<string|int, mixed>

the question attributes

Return values
string

return_display_style()

return_display_style(mixed $ia, mixed $aQuestionAttributes, mixed $thissurvey, string $rowname) : mixed
Parameters
$ia : mixed
$aQuestionAttributes : mixed
$thissurvey : mixed
$rowname : string

return_array_filter_strings()

return_array_filter_strings(mixed $ia, mixed $aQuestionAttributes, mixed $thissurvey, mixed $ansrow, string $rowname, mixed $trbc, string $valuename[, mixed $method = "tbody" ][, mixed $class = null ]) : mixed
Parameters
$ia : mixed
$aQuestionAttributes : mixed
$thissurvey : mixed
$ansrow : mixed
$rowname : string
$trbc : mixed
$valuename : string
$method : mixed = "tbody"
$class : mixed = null

testKeypad()

testKeypad(string $sUseKeyPad) : string
Parameters
$sUseKeyPad : string
Return values
string

do_language()

do_language(mixed $ia) : mixed
Parameters
$ia : mixed

do_list_dropdown()

do_list_dropdown(mixed $ia) : mixed
Parameters
$ia : mixed

do_list_radio()

do_list_radio(mixed $ia) : mixed
Parameters
$ia : mixed

do_listwithcomment()

do_listwithcomment(mixed $ia) : mixed
Parameters
$ia : mixed

do_ranking()

do_ranking(mixed $ia) : mixed
Parameters
$ia : mixed
Tags
deprecated
4.0

Replaced by core\QuestionTypes\RankingStyle

do_multiplechoice()

do_multiplechoice(mixed $ia) : mixed
Parameters
$ia : mixed

do_multiplechoice_withcomments()

do_multiplechoice_withcomments(mixed $ia) : mixed
Parameters
$ia : mixed

do_file_upload()

do_file_upload(mixed $ia) : mixed
Parameters
$ia : mixed

do_multipleshorttext()

do_multipleshorttext(mixed $ia) : mixed
Parameters
$ia : mixed

do_numerical()

do_numerical(mixed $ia) : mixed
Parameters
$ia : mixed

do_shortfreetext()

do_shortfreetext(mixed $ia) : mixed
Parameters
$ia : mixed

getLatLongFromIp()

getLatLongFromIp(mixed $sIPAddress) : mixed
Parameters
$sIPAddress : mixed

do_longfreetext()

do_longfreetext(mixed $ia) : mixed
Parameters
$ia : mixed

do_hugefreetext()

do_hugefreetext(mixed $ia) : mixed
Parameters
$ia : mixed

do_yesno()

Renders Yes/No Question Type.

do_yesno(array<string|int, mixed> $ia) : array<string|int, mixed>
Parameters
$ia : array<string|int, mixed>
Return values
array<string|int, mixed>

do_gender()

Renders Gender Question Types.

do_gender(array<string|int, mixed> $ia) : array<string|int, mixed>
Parameters
$ia : array<string|int, mixed>
Return values
array<string|int, mixed>

do_array_5point()

Construct answer part array_5point

do_array_5point(array<string|int, mixed> $ia) : array<string|int, mixed>
Parameters
$ia : array<string|int, mixed>
Return values
array<string|int, mixed>

do_array_10point()

Construct answer part array_10point

do_array_10point(array<string|int, mixed> $ia) : array<string|int, mixed>
Parameters
$ia : array<string|int, mixed>
Return values
array<string|int, mixed>

do_array_yesnouncertain()

do_array_yesnouncertain(mixed $ia) : mixed
Parameters
$ia : mixed

do_array_increasesamedecrease()

do_array_increasesamedecrease(mixed $ia) : mixed
Parameters
$ia : mixed

do_array()

do_array(mixed $ia) : mixed
Parameters
$ia : mixed
Tags
deprecated
4.0

Replaced by core\QuestionTypes\RenderArrayFlexibleRow

do_array_texts()

do_array_texts(mixed $ia) : mixed
Parameters
$ia : mixed

do_array_multiflexi()

do_array_multiflexi(mixed $ia) : mixed
Parameters
$ia : mixed

do_arraycolumns()

Renders array by column question type.

do_arraycolumns(array<string|int, mixed> $ia) : array<string|int, mixed>
Parameters
$ia : array<string|int, mixed>
Tags
throws
CException
Return values
array<string|int, mixed>

do_array_dual()

do_array_dual(mixed $ia) : mixed
Parameters
$ia : mixed
Tags
deprecated
4.0

Replaced by core\QuestionTypes\ArrayMultiscale

getLabelInputWidth()

Find the label / input width

getLabelInputWidth(string|int $labelAttributeWidth, string|int $inputAttributeWidth) : array<string|int, mixed>
Parameters
$labelAttributeWidth : string|int

label width from attribute

$inputAttributeWidth : string|int

input width from attribute

Return values
array<string|int, mixed>

labelWidth as integer,inputWidth as integer,defaultWidth as boolean

fillDate()

Take a date string and fill out missing parts, like day, hour, minutes (not seconds).

fillDate(string $dateString) : string

If string is NOT in standard date format (Y-m-d H:i), this methods makes no sense. Used when fetching answer for do_date, where answer can come from a default answer expression like date('Y'). Will also truncate date('c') to format Y-m-d H:i.

Parameters
$dateString : string
Return values
string

doRender()

Render the question view.

doRender(string $sView, array<string|int, mixed> $aData[, bool $bReturn = true ]) : mixed

By default, it just renders the required core view from application/views/survey/... If user added a question template in the upload dirctory, add applied it to the question in its display settings, then the function will check if the required view exist in this directory and then will use this one to render the question.

Rem: all the logic has been moved to LSETwigViewRenderer::renderQuestion() We keep the function doRender here for convenience (it will probably be removed in further cycles of dev). *

Parameters
$sView : string

name of the view to be rendered.

$aData : array<string|int, mixed>

data to be extracted into PHP variables and made available to the view script

$bReturn : bool = true

whether the rendering result should be returned instead of being displayed to end users (should be always true)

templatereplace()

This function replaces keywords in a text and is mainly intended for templates If you use this functions put your replacement strings into the $replacements variable instead of using global variables NOTE - Don't do any embedded replacements in this function. Create the array of replacement values and they will be done in batch at the end

templatereplace(string $line[, array<string|int, string> $replacements = array() ][, array<string|int, mixed> &$redata = array() ][, null $debugSrc = null ][, null $anonymized = null ][, int|null $questionNum = null ][, void $registerdata = array() ][, mixed $bStaticReplacement = false ][, mixed $oTemplate = '' ]) : string
Parameters
$line : string

Text to search in

$replacements : array<string|int, string> = array()

Array of replacements: Array( =>

$redata : array<string|int, mixed> = array()

: array of global var used in the function

$debugSrc : null = null

unused

$anonymized : null = null

unused (all done in EM now)

$questionNum : int|null = null
  • needed to support dynamic JavaScript-based tailoring within questions
$registerdata : void = array()
  • deprecated
$bStaticReplacement : mixed = false
$oTemplate : mixed = ''
Tags
psalm-suppress

UndefinedVariable

Return values
string

Text with replaced strings

getStandardsReplacementFields()

getStandardsReplacementFields(mixed $thissurvey) : mixed
Parameters
$thissurvey : mixed
Tags
psalm-suppress

UndefinedVariable TODO

ReplaceFields()

ReplaceFields(mixed $text, mixed $fieldsarray[, mixed $bReplaceInsertans = true ][, mixed $staticReplace = true ]) : mixed
Parameters
$text : mixed
$fieldsarray : mixed
$bReplaceInsertans : mixed = true
$staticReplace : mixed = true

PassthruReplace()

passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables which it then substitutes for parameter data sent in the initial URL and stored in the session array containing responses

PassthruReplace(mixed $line, mixed $thissurvey) : string
Parameters
$line : mixed

string - the string to iterate, and then return

$thissurvey : mixed

string - the string containing the surveyinformation

Return values
string

This string is returned containing the substituted responses

nice_addslashes()

nice_addslashes(mixed $string) : mixed
Parameters
$string : mixed

sanitize_filename()

Function: sanitize_filename Returns a sanitized string, typically for URLs.

sanitize_filename(mixed $filename[, mixed $force_lowercase = true ][, mixed $alphanumeric = false ][, mixed $beautify = true ][, mixed $directory = false ]) : mixed

Parameters: $string - The string to sanitize. $force_lowercase - Force the string to lowercase? $alphanumeric - If set to true, will remove all non-alphanumeric characters.

Parameters
$filename : mixed
$force_lowercase : mixed = true
$alphanumeric : mixed = false
$beautify : mixed = true
$directory : mixed = false

beautify_filename()

beautify_filename(string $filename) : mixed
Parameters
$filename : string

sanitize_dirname()

Function: sanitize_dirname sanitizes a string that will be used as a directory name

sanitize_dirname(mixed $string[, mixed $force_lowercase = false ][, mixed $alphanumeric = false ]) : mixed

Parameters: $string - The string to sanitize. $force_lowercase - Force the string to lowercase? $alphanumeric - If set to true, will remove all non-alphanumeric characters.

Parameters
$string : mixed
$force_lowercase : mixed = false
$alphanumeric : mixed = false

sanitize_paranoid_string()

sanitize_paranoid_string(mixed $string[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$string : mixed
$min : mixed = ''
$max : mixed = ''

sanitize_cquestions()

sanitize_cquestions(mixed $string[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$string : mixed
$min : mixed = ''
$max : mixed = ''

sanitize_system_string()

sanitize_system_string(mixed $string[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$string : mixed
$min : mixed = ''
$max : mixed = ''

sanitize_xss_string()

sanitize_xss_string(mixed $string) : mixed
Parameters
$string : mixed

sanitize_sql_db_tablename()

sanitize_sql_db_tablename(mixed $string) : mixed
Parameters
$string : mixed

sanitize_ldap_string()

sanitize_ldap_string(mixed $string[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$string : mixed
$min : mixed = ''
$max : mixed = ''

sanitize_html_string()

sanitize_html_string(mixed $string) : mixed
Parameters
$string : mixed

sanitize_int()

sanitize_int(mixed $integer[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$integer : mixed
$min : mixed = ''
$max : mixed = ''

sanitize_user()

sanitize_user(string $string) : mixed
Parameters
$string : string

sanitize_userfullname()

sanitize_userfullname(mixed $string) : mixed
Parameters
$string : mixed

sanitize_labelname()

sanitize_labelname(mixed $string) : mixed
Parameters
$string : mixed

sanitize_float()

sanitize_float(mixed $float[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$float : mixed
$min : mixed = ''
$max : mixed = ''

sanitize()

sanitize(mixed $input, mixed $flags[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$input : mixed
$flags : mixed
$min : mixed = ''
$max : mixed = ''

check_paranoid_string()

check_paranoid_string(mixed $input[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$input : mixed
$min : mixed = ''
$max : mixed = ''

check_int()

check_int(mixed $input[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$input : mixed
$min : mixed = ''
$max : mixed = ''

check_float()

check_float(mixed $input[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$input : mixed
$min : mixed = ''
$max : mixed = ''

check_html_string()

check_html_string(mixed $input[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$input : mixed
$min : mixed = ''
$max : mixed = ''

check_system_string()

check_system_string(mixed $input[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$input : mixed
$min : mixed = ''
$max : mixed = ''

check()

check( $input,  $flags[, string $min = '' ][, string $max = '' ]) : bool
Parameters
$input :
$flags :
$min : string = ''
$max : string = ''
Tags
throws
Exception
Return values
bool

sanitize_languagecode()

sanitize_languagecode(mixed $codetosanitize) : mixed
Parameters
$codetosanitize : mixed

sanitize_languagecodeS()

sanitize_languagecodeS(string $codestringtosanitize) : mixed
Parameters
$codestringtosanitize : string

sanitize_signedint()

sanitize_signedint(mixed $integer[, mixed $min = '' ][, mixed $max = '' ]) : mixed
Parameters
$integer : mixed
$min : mixed = ''
$max : mixed = ''

check_ip_address()

Checks the validity of IP address $ip

check_ip_address(string $ip) : bool
Parameters
$ip : string

to check

Return values
bool

true if the $ip is a valid IP address

check_absolute_url()

Returns true if the argument is an absolute URL (either starting with schema+domain or just "/").

check_absolute_url(string $string) : bool
Parameters
$string : string
Return values
bool

sanitize_alphanumeric()

Remove all chars from $value that are not alphanumeric or dash or underscore

sanitize_alphanumeric(string $value) : string
Parameters
$value : string
Return values
string

getDateFormatData()

Returns all available dateformats in a structured aray If $iDateFormat is given only the particual dateformat will be returned

getDateFormatData([ $iDateFormat = 0 ][,  $sLanguageCode = 'en' ]) : mixed
Parameters
$iDateFormat : = 0

integer

$sLanguageCode : = 'en'

string

Tags
returns

array

getLanguageData()

getLanguageData([bool $bOrderByNative = false ][, string $sLanguageCode = 'en' ]) : mixed
Parameters
$bOrderByNative : bool = false
$sLanguageCode : string = 'en'

getRadixPointData()

Returns avaliable formats for Radix Points (Decimal Separators) or returns radix point info about a specific format.

getRadixPointData([mixed $format = -1 ]) : int|array<string|int, mixed>

@param int $format Format ID/Number [optional]

Parameters
$format : mixed = -1
Return values
int|array<string|int, mixed>

getPHPDateFromDateFormat()

Convert a 'dateformat' format string to a 'phpdate' format.

getPHPDateFromDateFormat(string $sDateformat) : mixed
Parameters
$sDateformat : string

string

Tags
returns

string

getJSDateFromDateFormat()

Convert a 'dateformat' format string to a 'jsdate' format.

getJSDateFromDateFormat( $sDateformat) : mixed

For Bootstrap, that means using capital letters, e.g. MM/DD/YYYY instead of mm/dd/yyyy and mm instead of MM for minutes.

Parameters
$sDateformat :

string

Tags
returns

string

getDateFormatDataForQID()

Get the date format details for a specific question.

getDateFormatDataForQID( $aQidAttributes,  $mThisSurvey[, mixed $language = '' ]) : mixed
Parameters
$aQidAttributes :

array Question attributes

$mThisSurvey :

mixed Array of Survey attributes or surveyid

$language : mixed = ''
Tags
returns

array

getDateFormatForSID()

Get the date format for a specified survey

getDateFormatForSID( $surveyid[,  $languagecode = '' ]) : mixed
Parameters
$surveyid :

integer Survey id

$languagecode : = ''

string Survey language code (optional)

Tags
returns

integer

canShowDatePicker()

Check whether we can show the JS date picker with the current format

canShowDatePicker( $dateformatdetails[,  $dateformats = null ]) : mixed
Parameters
$dateformatdetails :

array Date format details for the question

$dateformats : = null

array Available date formats

Tags
returns

integer

getLanguageCodefromLanguage()

Returns a language code from the name

getLanguageCodefromLanguage(string $languagetosearch) : int|string
Parameters
$languagetosearch : string

this is the name of the language (e.g. 'English' see array in getLanguageData())

Return values
int|string

getLanguageNameFromCode()

Returns a language name from the code

getLanguageNameFromCode(string $codetosearch[, bool $withnative = true ][, string $sTranslationLanguage = null ]) : string|array<string|int, mixed>
Parameters
$codetosearch : string
$withnative : bool = true
$sTranslationLanguage : string = null
Tags
todo

Should not give back different data types

Return values
string|array<string|int, mixed>

getLanguageDetails()

Returns the locale settings for a certain language code

getLanguageDetails(string $codetosearch) : array<string|int, mixed>
Parameters
$codetosearch : string
Return values
array<string|int, mixed>

Array with locale details

convertLStoDateTimePickerLocale()

This functions translates LimeSurvey specific locale code to a matching datetimepicker locale

convertLStoDateTimePickerLocale(string $sLocale) : mixed
Parameters
$sLocale : string

LimeSurvey locale code

getLanguageDataRestricted()

getLanguageDataRestricted([mixed $bOrderByNative = false ][, mixed $sDetail = 'full' ]) : mixed
Parameters
$bOrderByNative : mixed = false
$sDetail : mixed = 'full'

UTF8Strrev()

This function support the ability NOT to reverse numbers (for example when you output a phrase as a parameter for a SWF file that can't handle RTL languages itself, but obviously any numbers should remain the same as in the original phrase).

UTF8Strrev(string $str[, bool $reverse_numbers = false ]) : string

Note that it can be used just as well for UTF-8 usages if you want the numbers to remain intact

Parameters
$str : string
$reverse_numbers : bool = false
Return values
string

dummy_twig_translation_helper()

Dummy helper intended to facilitate "twig only" strings to be picked by Translations Bot.

dummy_twig_translation_helper() : void

Since twig files are not scanned by the bot, translatable strings that only appear in twig files can be placed here in order to be scanned.

CheckForDBUpgrades()

This functions checks if the databaseversion in the settings table is the same one as required If not then the necessary upgrade procedures are run

CheckForDBUpgrades([mixed $subaction = null ]) : mixed
Parameters
$subaction : mixed = null

ShowDBUpgradeNotice()

ShowDBUpgradeNotice() : string
Return values
string

html

getDBConnectionStringProperty()

getDBConnectionStringProperty(string $sProperty) : mixed
Parameters
$sProperty : string

db_upgrade_all()

db_upgrade_all(int $iOldDBVersion[, bool $bSilent = false ]) : mixed
Parameters
$iOldDBVersion : int

The previous database version

$bSilent : bool = false

Run update silently with no output - this checks if the update can be run silently at all. If not it will not run any updates at all.

updateEncryptedValues450()

Update previous encrpted values to new encryption

updateEncryptedValues450(CDbConnection $oDB) : mixed
Parameters
$oDB : CDbConnection
Tags
throws
CException

decryptCPDBTable450()

Update encryption for CPDB participants

decryptCPDBTable450(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection
Tags
throws
CException

decryptParticipantTables450()

Update encryption for survey participants

decryptParticipantTables450(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

decryptResponseTables450()

Update encryption for survey responses

decryptResponseTables450(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection
Tags
throws
CException

decryptArchivedTables450()

Update Encryption for archived tables

decryptArchivedTables450(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection
Tags
throws
CDbException
throws
CException

createFieldMap450()

Returns the fieldmap for responses

createFieldMap450( $survey) : array<string|int, mixed>
Parameters
$survey :
Tags
throws
CException
psalm-suppress

RedundantCondition

Return values
array<string|int, mixed>

upgradeArchivedTableSettings446()

Import previously archived tables to ArchivedTableSettings

upgradeArchivedTableSettings446() : void
Tags
throws
CException

extendDatafields429()

extendDatafields429(mixed $oDB) : mixed
Parameters
$oDB : mixed

upgradeSurveyTables402()

upgradeSurveyTables402(string $sMySQLCollation) : mixed
Parameters
$sMySQLCollation : string

upgradeTokenTables402()

upgradeTokenTables402(string $sMySQLCollation) : mixed
Parameters
$sMySQLCollation : string

extendDatafields364()

extendDatafields364(mixed $oDB) : mixed
Parameters
$oDB : mixed

resetTutorials337()

resetTutorials337(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

upgrade333()

upgrade333(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

upgrade331()

upgrade331(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

upgrade330()

upgrade330(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

upgrade328()

upgrade328(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

upgrade327()

upgrade327(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

transferPasswordFieldToText()

transferPasswordFieldToText(CDbConnection $oDB) : mixed
Parameters
$oDB : CDbConnection

createSurveyMenuTable()

createSurveyMenuTable(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

createSurveysGroupSettingsTable()

createSurveysGroupSettingsTable(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

createSurveyGroupTables306()

createSurveyGroupTables306(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

upgradeTemplateTables304()

upgradeTemplateTables304(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

upgradeTemplateTables298()

upgradeTemplateTables298(CDbConnection $oDB) : void
Parameters
$oDB : CDbConnection

upgradeSurveyTables181()

upgradeSurveyTables181(string $sMySQLCollation) : mixed
Parameters
$sMySQLCollation : string

upgradeTokenTables181()

upgradeTokenTables181(string $sMySQLCollation) : mixed
Parameters
$sMySQLCollation : string

upgradeTokens176()

This function removes the old CPDB fields in token tables replaces them with standard attribute fields and records the mapping information in the attributedescription field in the survey table instead

upgradeTokens176() : mixed

upgradeCPDBAttributeDefaultNames173()

upgradeCPDBAttributeDefaultNames173() : mixed

upgradePermissions166()

Converts global permissions from users table to the new permission system, and converts template permissions from template_rights to new permission table

upgradePermissions166() : mixed

upgradeSurveyTables164()

Make sure all active tables have the right sized token field

upgradeSurveyTables164() : string|null

During a small period in the 2.0 cycle some survey tables got no token field or a token field that was too small. This patch makes sure all surveys that are not anonymous have a token field with the right size

Return values
string|null

upgradeQuestionAttributes148()

upgradeQuestionAttributes148() : mixed

upgradeSurveyPermissions145()

upgradeSurveyPermissions145() : mixed

upgradeQuestionAttributes142()

upgradeQuestionAttributes142() : mixed

alterColumn()

alterColumn(mixed $sTable, string $sColumn, string $sFieldType[, mixed $bAllowNull = true ][, mixed $sDefault = 'NULL' ]) : mixed
Parameters
$sTable : mixed
$sColumn : string
$sFieldType : string
$bAllowNull : mixed = true
$sDefault : mixed = 'NULL'

addColumn()

addColumn(mixed $sTableName, mixed $sColumn, string $sType) : mixed
Parameters
$sTableName : mixed
$sColumn : mixed
$sType : string

setTransactionBookmark()

Set a transaction bookmark - this is critical for Postgres because a transaction in Postgres cannot be continued unless you roll back to the transaction bookmark first

setTransactionBookmark([mixed $sBookmark = 'limesurvey' ]) : mixed
Parameters
$sBookmark : mixed = 'limesurvey'

Name of the bookmark

rollBackToTransactionBookmark()

Roll back to a transaction bookmark

rollBackToTransactionBookmark([mixed $sBookmark = 'limesurvey' ]) : mixed
Parameters
$sBookmark : mixed = 'limesurvey'

Name of the bookmark

dropDefaultValueMSSQL()

Drop a default value in MSSQL

dropDefaultValueMSSQL(string $fieldname, mixed $tablename) : mixed
Parameters
$fieldname : string
$tablename : mixed

dropUniqueKeyMSSQL()

This function drops a unique Key of an MSSQL database field by using the field name and the table name

dropUniqueKeyMSSQL(string $sFieldName, string $sTableName) : mixed
Parameters
$sFieldName : string
$sTableName : string

dropSecondaryKeyMSSQL()

This function drops a secondary key of an MSSQL database field by using the field name and the table name

dropSecondaryKeyMSSQL(string $sFieldName, mixed $sTableName) : mixed
Parameters
$sFieldName : string
$sTableName : mixed

dropPrimaryKey()

Drops the primary key of a table

dropPrimaryKey(string $sTablename[, string $oldPrimaryKeyColumn = null ]) : mixed
Parameters
$sTablename : string
$oldPrimaryKeyColumn : string = null

addPrimaryKey()

addPrimaryKey(string $sTablename, mixed $aColumns) : mixed
Parameters
$sTablename : string
$aColumns : mixed

modifyPrimaryKey()

Modifies a primary key in one command - this is only tested on MySQL

modifyPrimaryKey(string $sTablename, array<string|int, string> $aColumns) : mixed
Parameters
$sTablename : string

The table name

$aColumns : array<string|int, string>

Column names to be in the new key

fixMySQLCollations()

fixMySQLCollations(string $sEncoding, string $sCollation) : mixed
Parameters
$sEncoding : string
$sCollation : string

dropColumn()

Drops a column, automatically removes blocking default value on MSSQL

dropColumn(string $sTableName, string $sColumnName) : mixed
Parameters
$sTableName : string
$sColumnName : string

alterLanguageCode()

Renames a language code in the whole LimeSurvey database

alterLanguageCode(string $sOldLanguageCode, string $sNewLanguageCode) : mixed
Parameters
$sOldLanguageCode : string
$sNewLanguageCode : string

fixLanguageConsistencyAllSurveys()

fixLanguageConsistencyAllSurveys() : mixed

fixPostgresSequence()

This function fixes Postgres sequences for one/all tables in a database This is necessary if a table is renamed. If tablename is given then only that table is fixed

fixPostgresSequence([string $tableName = null ]) : void
Parameters
$tableName : string = null

Table name without prefix

runAddPrimaryKeyonAnswersTable400()

runAddPrimaryKeyonAnswersTable400(mixed &$oDB) : mixed
Parameters
$oDB : mixed

regenerateLabelCodes400()

Regenerate codes for problematic label sets Helper function (TODO: Put in separate class) Fails silently

regenerateLabelCodes400(int $lid[, bool $hasLanguageColumn = true ]) : void
Parameters
$lid : int

Label set id

$hasLanguageColumn : bool = true

Should be true before dbversion 400 is finished, false after

removeMysqlZeroDate()

Remove all zero-dates in $tableName by checking datetime columns from $tableSchema Zero-dates are replaced with null where possible; otherwise 1970-01-01

removeMysqlZeroDate(string $tableName, CDbTableSchema $tableSchema, CDbConnection $oDB) : void
Parameters
$tableName : string
$tableSchema : CDbTableSchema
$oDB : CDbConnection

getRelevantUpdates()

Returns a sorted array of update objects with version higher than $iOldDBVersion

getRelevantUpdates(int $iOldDBVersion, CDbConnection $db, string $options) : array<string|int, DatabaseUpdateBase>
Parameters
$iOldDBVersion : int
$db : CDbConnection
$options : string
Tags
todo

Move to class?

Return values
array<string|int, DatabaseUpdateBase>

createChart()

Generate a chart for a question

createChart(mixed $iQuestionID, int $iSurveyID, mixed $type, mixed $lbl, mixed $gdata, mixed $grawdata, mixed $cache, mixed $sLanguageCode, mixed $sQuestionType) : mixed

@param int $iQuestionID ID of the question

Parameters
$iQuestionID : mixed
$iSurveyID : int

ID of the survey @param mixed $type Type of the chart to be created - null produces bar chart, any other value produces pie chart @param array $lbl An array containing the labels for the chart items @param mixed $gdata An array containing the percentages for the chart items @param mixed $grawdata An array containing the raw count for the chart items @param pCache $cache An object containing [Hashkey] and [CacheFolder] @param mixed $sLanguageCode Language Code @param string $sQuestionType The question type @return false|string

$type : mixed
$lbl : mixed
$gdata : mixed
$grawdata : mixed
$cache : mixed
$sLanguageCode : mixed
$sQuestionType : mixed

getQuestionMapData()

Return data to populate a Google Map

getQuestionMapData(string $sField,  $qsid) : array<string|int, mixed>
Parameters
$sField : string
$qsid :

Survey id

Return values
array<string|int, mixed>

buildSelects()

Builds the list of addon SQL select statements that builds the query result set

buildSelects(mixed $allfields, int $surveyid, mixed $language) : mixed

@param array $allfields An array containing the names of the fields/answers we want to display in the statistics summary

Parameters
$allfields : mixed
$surveyid : int

@param string $language The language to use

@return array $selects array of individual select statements that can be added/appended to the 'where' portion of a SQL statement to restrict the result set ie: array("FIELDNAME='Y'", "FIELDNAME2='Hello'");

$language : mixed

square()

Simple function to square a value

square(mixed $number) : mixed
Parameters
$number : mixed

Value to square

setSeed()

Set seed for this response If there is no seed, create a new one Also inits the twister.

setSeed(int $surveyid) : void
Parameters
$surveyid : int

shuffle()

Shuffle an array using MersenneTwister Argument NOT called by reference!

shuffle(array<string|int, mixed> $arr) : array<string|int, mixed>
Parameters
$arr : array<string|int, mixed>
Return values
array<string|int, mixed>

scanFile()

scanFile(mixed $fileName) : mixed
Parameters
$fileName : mixed

populateDatabase()

populateDatabase( $oDB) : mixed
Parameters
$oDB :

DbConnection

Tags
throws
CHttpException
throws
CException

        
On this page

Search results