\

Namespaces

ls
Codeception

Interfaces

IWriter

Classes

Psr4AutoloaderClass An example of a general-purpose implementation that includes the optional functionality of allowing multiple base directories for a single namespace prefix.
ClassFactory
SurveyRuntimeHelper
Hash Library of array functions for manipulating and extracting data from arrays or 'sets' of data.
userstatistics_helper
LimeExpressionManager
ExpressionManager Description of ExpressionManager (1) Does safe evaluation of PHP expressions. Only registered Functions, and known Variables are allowed.
remotecontrol_handle This class handles all methods of the RPCs
viewHelper General helper class for generating views.
ExportSurveyResultsService
CsvWriter Contains functions and properties that are common to all writers.
SurveyDao
DocWriter 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.
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.
HtmlWriter Contains functions and properties that are common to all writers.
SurveyObj
Writer Contains functions and properties that are common to all writers.
Translator
FormattingOptions
statistics_helper
pdfHelper General helper class for generating pdf.
SurveysController This class will handle survey creation and manipulation.
InstallerController Installer
Statistics_userController
index
OptoutController optout
RegisterController register
PluginsController
UploaderController
SurveyController
PrintanswersController printanswers
AdminController
OptinController optin
VerificationController the Verification class, this is grouped with other classes in the "limesurvey_yii" package and * is part of "controllers" subpackage
limereplacementfields Survey Common Action
PluginManager Survey Common Action
quotas Quotas Controller
Authentication Authentication Controller
conditionsaction Condition Controller
printablesurvey Printable Survey Controller
translate Translate Controller
remotecontrol Survey Common Action
emailtemplates emailtemplates
PluginHelper Survey Common Action
saved Saved controller
Expressions Survey Common Action
Dumpdb Dump Database
Assessments Assessments Controller
labels labels
Index Survey Common Action
database Database g
UserAction User Controller
questiongroups questiongroup
ExpressionValidate Survey Common Action
statistics Statistics Controller
surveypermission surveypermission
CheckIntegrity CheckIntegrity Controller
participantsaction This is the main controller for Participants Panel
export Export Action
homepagesettings Survey Common Action
tokens Tokens Controller
responses Responses Controller
Usergroups Usergroups
SurveyAdmin survey
templates templates
databaseupdate Update Database Controller
questions question
NotificationController Mostly for Ajax actions
update Update Controller
GlobalSettings GlobalSettings Controller
dataentry dataentry
htmleditor_pop Survey Common Action
AdminFooter Render the admin footer including version and build info when logged in
LimeScript
PannelBoxWidget
GridViewWidget
JsonEditor
CallbackColumn
SettingsWidget
CustomFormatter
WhPlugin WhPlugin class file.
YiiWheels YiiWheels class file.
WhMaskMoney
WhRedactor
WhDateTimePicker
WhButtonGroup WhBox.php
WhDateRangePicker
WhVisualizationChart WhVisualizationChart widget class A simple implementation for for Google
WhAceEditor
WhResponsive WhResponsive class Extends WhGridView to provide responsive Tables
WhChart WhChart class Extends WhGridView to provide chart display (on switch)
WhRelationalColumn Bootstrap grid data column.
WhImageColumn
WhPercentOfTypeEasyPieOperation WhOperation class
WhCountOfTypeOperation WhOperation class
WhOperation WhOperation class
WhSumOperation WhOperation class
WhPercentOfTypeGooglePieOperation WhOperation class
WhPercentOfTypeOperation WhOperation class
WhGridView Bootstrap Zii grid view.
WhToggleAction WhToggleAction action class
WhToggleColumn Bootstrap grid data column.
WhGroupGridView Bootstrap Zii grid view.
WhDatePicker
WhFineUploader
WhLanguages
WhTimePickerHelper
WhSelectBox
WhInputWidget
WhTimezones
WhDropDownInputWidget
WhDatePickerHelper
WhCountries
WhGoogleFonts
WhFonts
WhStates
WhFontSizes
WhPhone
WhTimePicker
WhHighCharts
WhTimeAgoFormatter WhTimeAgoFormatter class
WhTimeAgo
WhRangeSlider
WhSwitch
WhFileUpload
WhBasicFileUpload
WhSparkLines
WhTypeAhead
WhModal WhModal class file.
WhBox WhBox.php
WhSelect2
WhMaskInput
WhVideoCarousel
WhCarousel
WhGallery
WhDetailView
WhHtml5Editor
WhMultiSelect
TbWidget Bootstrap widget behavior.
BootstrapCode
BootstrapGenerator
TbFormInputElement Bootstrap form input element.
TbFormButtonElement Bootstrap form button element.
TbForm Bootstrap form object that contains form input specifications.
TbArray Array helper class.
TbHtml Bootstrap HTML helper.
TbApi Bootstrap API component.
TbArrayTest
Dummy
TbHtmlTest
CodeGuy Inherited methods
TbTestCase
TbPager Bootstrap pager widget.
TbAlert Bootstrap alert widget.
TbButtonColumn Bootstrap button column widget.
TbThumbnails Bootstrap thumbnails widget.
TbActiveForm Bootstrap active form widget.
TbModal Bootstrap modal widget.
TbNavbar Bootstrap navbar widget.
TbBreadcrumb Bootstrap breadcrumb widget.
TbNav Bootstrap navigation menu widget.
TbScrollspy Bootstrap scrollspy widget.
TbDataColumn Bootstrap grid data column.
TbDetailView Bootstrap Zii detail widget.
TbTypeAhead Bootstrap typeahead widget.
TbTabs Bootstrap tabs widget.
TbAffix Bootstrap affix widget.
TbGridView Bootstrap Zii grid view.
TbCollapse Bootstrap collapse widget.
TbHeroUnit Bootstrap hero unit widget.
TbListView Bootstrap Zii list view.
TbPanel Bootstrap panel widget. Similar to CPortlet.
FlashMessage
LimeDebug
PositionWidget This widget display a position selection for a question inside a group. It's used for now in "add new question".
ListSurveysWidget This widget display the list of surveys.
massiveActionsWidget This widget render a drop-up button for grid massive actions, and attach modals to the actions.
listRadio
jsonRPCServer This class build a json-RPC Server 1.0 http://json-rpc.org/wiki/specification
LSZend_XmlRpc_Response_Http
jsonRPCClient The object of this class are generic jsonRPC 1.0 clients http://json-rpc.org/wiki/specification
Date_Time_Converter Date and Time Converter by Elac v0.9.3 elacdude@gmail.com www.elacdude.com
LSjsonRPCServer This class build a json-RPC Server 1.0 http://json-rpc.org/wiki/specification
LS_Exception LS Base Exception Class
QuestionPluginBase Base class for plugins.
SimpleTester
ShowPasses Display passes
SmallReporter Displays a tiny div in upper right corner when ok
MinimalReporter Minimal only displays on error
Save
BigData Class containing helper functions for dealing with "big data".
BigFile
pdf
quexmlpdf A TCPDF based class to produce queXF compatible questionnaire PDF files and banding description XML from queXML
ProgressBar
SettingsStorage
httpRequestIt
Services_JSON Converts to and from JSON format.
Services_JSON_Error
Load_answers
User
PluginEventBehavior
SettingGlobal
ParticipantAttributeNameLang This is the model class for table "{{{{participant_attribute_names}}}}".
LabelSet
PluginSetting This is the model class for table "{{plugin_settings}}".
SurveyLanguageSetting
CPDBException Specific exception for our purpose Used to spit out error messages if mapping attributes doesn't work.
Participant This is the model class for table "{{participants}}".
AdminTheme Admin Theme Model
Token For code completion we add the available scenario's here Attributes
Condition
QuestionAttribute
ParticipantAttributeName This is the model class for table "{{{{participant_attribute_names}}}}".
Response Relations
PluginDynamic Dynamic model used by plugins to access their table(s).
Session
Plugin This is the model class for table "{{plugins}}".
UserGroup
Label
DefaultValue
UpdateForm Update Form Model
Answer
SurveyDynamic
Question
SurveyTimingDynamic
ParticipantAttribute
TemplateConfiguration Template Configuration Model
QuotaLanguageSetting
Permission
TokenDynamic
Quota
UserInGroup
InstallerConfigForm
SurveyURLParameter
Boxes This is the model class for table "{{boxes}}".
TemplateException
Template
ParticipantShare This is the model class for table "{{participant_shares}}".
QuestionGroup
ExpressionError
Dynamic This class implements the basis for dynamic models.
SurveyLink
QuotaMember
Notification This is the model class for table "{{notifications}}".
Assessment
Timing Dynamic response timing model.
SavedControl
Survey
LSActiveRecord
FailedLoginAttempt
LSUserIdentity For 2.06 most of the functionality in this class will be moved to the LSWebUser class.
DbHttpSession
LSHttpRequest Description of HttpRequest
LSWebUser
ConsoleApplication
PluginManager Class PluginManagerD Dummy class for 2.05 plugins.
LSYii_CompareInsensitiveValidator
LSYii_Validators
LSYii_CaseValidator
LSYii_Controller
LSYii_Locale
AuthPluginBase Base class for plugins.
MysqlSchema
DbConnection
PgsqlSchema
MssqlSchema
LSYii_EmailIDNAValidator
PluginBase Base class for plugins.
LSDbCriteria
LSBootstrap For updating from 2.06 to 2.5.
LSYii_Application Implements global config
UserIdentity
Survey_Common_Action Survey Common Action
PluginEvent
LSAuthResult
AuthLDAP Base class for plugins.
Authwebserver Base class for plugins.
RDataWriter Contains functions and properties that are common to all writers.
RSyntaxWriter Contains functions and properties that are common to all writers.
ExportR Base class for plugins.
ExtendedStartpage Extended startpage plugin to display more information about the sctive surveys on the startpage.
STATAxmlWriter Contains functions and properties that are common to all writers.
ExportSTATAxml Base class for plugins.
QuickMenu Some extra quick-menu items to ease everyday usage
QuickMenuException Local exception
QuickMenuButton Small class for buttons. Basically just an array wrapper with some default values.
Authdb Base class for plugins.
oldUrlCompat Plugin to redirect old url system (index.php?sid=surveyid) to the new url
ExpressionManagerTest
WebTestCase The base class for functional test cases.
CTestCase
WipeCommand
PluginCommand
InstallCommand
ResetPasswordCommand
Example Base class for plugins.
ShowResponse Base class for plugins.
UnActivatable Example plugin that can not be activated.
mdlAuditlog This is the model class for table "{{plugins}}".
AuditLog Base class for plugins.

Constants

SHOW_NO_ANSWER

SHOW_NO_ANSWER

QUESTION_START

QUESTION_START

CHECKED

CHECKED

SELECTED

SELECTED

PARANOID

PARANOID

SYSTEM

SYSTEM

HTML

HTML

INT

INT

FLOAT

FLOAT

LDAP

LDAP

UTF8

UTF8

MAGIC_QUOTES

MAGIC_QUOTES

LEM_DEBUG_TIMING

LEM_DEBUG_TIMING

LEM_DEBUG_VALIDATION_SUMMARY

LEM_DEBUG_VALIDATION_SUMMARY

LEM_DEBUG_VALIDATION_DETAIL

LEM_DEBUG_VALIDATION_DETAIL

LEM_PRETTY_PRINT_ALL_SYNTAX

LEM_PRETTY_PRINT_ALL_SYNTAX

LEM_DEFAULT_PRECISION

LEM_DEFAULT_PRECISION

K_PATH_IMAGES

K_PATH_IMAGES

PRINT_TEMPLATE_DIR

PRINT_TEMPLATE_DIR

PRINT_TEMPLATE_URL

PRINT_TEMPLATE_URL

$full_constant

$full_constant

IMAGE_ . $type . _SIZE

IMAGE_ . $type . _SIZE

YII_ENABLE_EXCEPTION_HANDLER

YII_ENABLE_EXCEPTION_HANDLER

YII_ENABLE_ERROR_HANDLER

YII_ENABLE_ERROR_HANDLER

YII_DEBUG

YII_DEBUG

K_TCPDF_EXTERNAL_CONFIG

K_TCPDF_EXTERNAL_CONFIG

PDF_PAGE_FORMAT

PDF_PAGE_FORMAT

PDF_PAGE_ORIENTATION

PDF_PAGE_ORIENTATION

PDF_CREATOR

PDF_CREATOR

PDF_AUTHOR

PDF_AUTHOR

PDF_HEADER_TITLE

PDF_HEADER_TITLE

PDF_HEADER_STRING

PDF_HEADER_STRING

PDF_HEADER_LOGO_WIDTH

PDF_HEADER_LOGO_WIDTH

PDF_UNIT

PDF_UNIT

PDF_MARGIN_HEADER

PDF_MARGIN_HEADER

PDF_MARGIN_TOP

PDF_MARGIN_TOP

PDF_MARGIN_BOTTOM

PDF_MARGIN_BOTTOM

PDF_MARGIN_LEFT

PDF_MARGIN_LEFT

PDF_MARGIN_RIGHT

PDF_MARGIN_RIGHT

PDF_FONT_NAME_MAIN

PDF_FONT_NAME_MAIN

PDF_FONT_SIZE_MAIN

PDF_FONT_SIZE_MAIN

PDF_FONT_NAME_DATA

PDF_FONT_NAME_DATA

PDF_FONT_SIZE_DATA

PDF_FONT_SIZE_DATA

PDF_FONT_MONOSPACED

PDF_FONT_MONOSPACED

PDF_IMAGE_SCALE_RATIO

PDF_IMAGE_SCALE_RATIO

HEAD_MAGNIFICATION

HEAD_MAGNIFICATION

K_CELL_HEIGHT_RATIO

K_CELL_HEIGHT_RATIO

K_TITLE_MAGNIFICATION

K_TITLE_MAGNIFICATION

K_SMALL_RATIO

K_SMALL_RATIO

K_THAI_TOPCHARS

K_THAI_TOPCHARS

K_TCPDF_CALLS_IN_HTML

K_TCPDF_CALLS_IN_HTML

$const

$const

SERVICES_JSON_SLICE

SERVICES_JSON_SLICE

Marker constant for Services_JSON::decode(), used to flag stack state

SERVICES_JSON_IN_STR

SERVICES_JSON_IN_STR

Marker constant for Services_JSON::decode(), used to flag stack state

SERVICES_JSON_IN_ARR

SERVICES_JSON_IN_ARR

Marker constant for Services_JSON::decode(), used to flag stack state

SERVICES_JSON_IN_OBJ

SERVICES_JSON_IN_OBJ

Marker constant for Services_JSON::decode(), used to flag stack state

SERVICES_JSON_IN_CMT

SERVICES_JSON_IN_CMT

Marker constant for Services_JSON::decode(), used to flag stack state

SERVICES_JSON_LOOSE_TYPE

SERVICES_JSON_LOOSE_TYPE

Behavior switch for Services_JSON::decode()

SERVICES_JSON_SUPPRESS_ERRORS

SERVICES_JSON_SUPPRESS_ERRORS

Behavior switch for Services_JSON::decode()

LOGO_URL

LOGO_URL

PRESENTATION

PRESENTATION

FIREBUG

FIREBUG

TEST_BASE_URL

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

BASEPATH

BASEPATH

BASEPATH

BASEPATH

STDIN

STDIN

YII_DEBUG

YII_DEBUG

APPPATH

APPPATH

BASEPATH

BASEPATH

SELF

SELF

ROOT

ROOT

EXT

EXT

BASEPATH

BASEPATH

FCPATH

FCPATH

SYSDIR

SYSDIR

APPPATH

APPPATH

YII_DEBUG

YII_DEBUG

BASEPATH

BASEPATH

Functions

setNoAnswerMode()

setNoAnswerMode( $thissurvey)

setNoAnswerMode

Parameters

$thissurvey

retrieveAnswers()

retrieveAnswers(array $ia) : array

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

Parameters

array $ia

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

Returns

array —

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( $ia)

Parameters

$ia

validation_message()

validation_message(\<type> $ia, \<type> $show) : \<type>

Parameters

\ $ia
\ $show
  • true if should initially be visible

Returns

\

file_validation_message()

file_validation_message( $ia)

Parameters

$ia

mandatory_popup()

mandatory_popup( $ia,  $notanswered)

Parameters

$ia
$notanswered

validation_popup()

validation_popup( $ia,  $notvalidated)

Parameters

$ia
$notvalidated

file_validation_popup()

file_validation_popup( $ia,  $filenotvalidated)

Parameters

$ia
$filenotvalidated

return_timer_script()

return_timer_script( $aQuestionAttributes,  $ia,  $disable)

Parameters

$aQuestionAttributes
$ia
$disable

return_display_style()

return_display_style( $ia,  $aQuestionAttributes,  $thissurvey,  $rowname)

Parameters

$ia
$aQuestionAttributes
$thissurvey
$rowname

return_array_filter_strings()

return_array_filter_strings( $ia,  $aQuestionAttributes,  $thissurvey,  $ansrow,  $rowname,  $trbc,  $valuename,  $method,  $class)

Parameters

$ia
$aQuestionAttributes
$thissurvey
$ansrow
$rowname
$trbc
$valuename
$method
$class

do_boilerplate()

do_boilerplate( $ia)

Parameters

$ia

do_equation()

do_equation( $ia)

Parameters

$ia

do_5pointchoice()

do_5pointchoice( $ia)

Parameters

$ia

do_date()

do_date( $ia)

Parameters

$ia

do_language()

do_language( $ia)

Parameters

$ia

do_list_dropdown()

do_list_dropdown( $ia)

Parameters

$ia

do_list_radio()

do_list_radio( $ia)

Parameters

$ia

do_listwithcomment()

do_listwithcomment( $ia)

Parameters

$ia

do_ranking()

do_ranking( $ia)

Parameters

$ia

testKeypad()

testKeypad( $sUseKeyPad)

Parameters

$sUseKeyPad

do_multiplechoice()

do_multiplechoice( $ia)

Parameters

$ia

do_multiplechoice_withcomments()

do_multiplechoice_withcomments( $ia)

Parameters

$ia

do_file_upload()

do_file_upload( $ia)

Parameters

$ia

do_multipleshorttext()

do_multipleshorttext( $ia)

Parameters

$ia

do_multiplenumeric()

do_multiplenumeric( $ia)

Parameters

$ia

do_numerical()

do_numerical( $ia)

Parameters

$ia

do_shortfreetext()

do_shortfreetext( $ia)

Parameters

$ia

getLatLongFromIp()

getLatLongFromIp( $sIPAddress)

Parameters

$sIPAddress

do_longfreetext()

do_longfreetext( $ia)

Parameters

$ia

do_hugefreetext()

do_hugefreetext( $ia)

Parameters

$ia

do_yesno()

do_yesno( $ia)

Parameters

$ia

do_gender()

do_gender( $ia)

Parameters

$ia

do_array_5point()

do_array_5point(mixed $ia) : \unknown_type

Construct answer part array_5point

Parameters

mixed $ia

Returns

\unknown_type

do_array_10point()

do_array_10point( $ia)

Parameters

$ia

do_array_yesnouncertain()

do_array_yesnouncertain( $ia)

Parameters

$ia

do_array_increasesamedecrease()

do_array_increasesamedecrease( $ia)

Parameters

$ia

do_array()

do_array( $ia)

Parameters

$ia

do_array_texts()

do_array_texts( $ia)

Parameters

$ia

do_array_multiflexi()

do_array_multiflexi( $ia)

Parameters

$ia

do_arraycolumns()

do_arraycolumns( $ia)

Parameters

$ia

do_array_dual()

do_array_dual( $ia)

Parameters

$ia

decide_sm_col()

decide_sm_col(string $prefix, string $suffix) : int

Depending on prefix and suffix, the center col will vary on sm screens (xs is always 12).

Parameters

string $prefix
string $suffix

Returns

int

doRender()

doRender(string $sView, array $aData, boolean $bReturn)

Render the question view.

By default, it just renders the required core view from application/views/survey/... If the Survey template is configured to overwrite the question views, then the function will check if the required view exist in the template directory and then will use this one to render the question.

Parameters

string $sView

name of the view to be rendered.

array $aData

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

boolean $bReturn

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

ldap_getCnx()

ldap_getCnx( $server_id)

Parameters

$server_id

ldap_bindCnx()

ldap_bindCnx( $ds,  $server_id)

Parameters

$ds
$server_id

ldap_readattr()

ldap_readattr( $attr)

Parameters

$attr

ldap_search_withScope()

ldap_search_withScope( $ds,  $basedn,  $filter,  $attrlist,  $scope)

Parameters

$ds
$basedn
$filter
$attrlist
$scope

ldap_doTokenSearch()

ldap_doTokenSearch( $ds,  $ldapq,  $ResArray,  $surveyid)

Parameters

$ds
$ldapq
$ResArray
$surveyid

prepareLdapQuery()

prepareLdapQuery( $queryId)

Parameters

$queryId

loadanswers()

loadanswers()

makegraph()

makegraph( $currentstep,  $total)

Parameters

$currentstep
$total

makeLanguageChangerSurvey()

makeLanguageChangerSurvey(mixed $sSelectedLanguage)

This function creates the language selector for a particular survey

Parameters

mixed $sSelectedLanguage

The language in which all information is shown

makeLanguageChanger()

makeLanguageChanger(mixed $sSelectedLanguage)

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

Parameters

mixed $sSelectedLanguage

The language in which all information is shown

makeFlashMessage()

makeFlashMessage() : string

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

Returns

string

checkUploadedFileValidity()

checkUploadedFileValidity( $surveyid,  $move,  $backok)

checkUploadedFileValidity used in SurveyRuntimeHelper

Parameters

$surveyid
$move
$backok

addtoarray_single()

addtoarray_single( $array1,  $array2)

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

Parameters

$array1
$array2

submittokens()

submittokens(mixed $quotaexit)

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

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

mixed $quotaexit

sendSubmitNotifications()

sendSubmitNotifications( $surveyid)

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

Parameters

$surveyid

submitfailed()

submitfailed(string $errormsg, string $query) : string

submitfailed : used in em_manager_helper.php

"Unexpected error"

Will send e-mail to adminemail if defined.

Parameters

string $errormsg
string $query

Will be included in sent email

Returns

string —

Error message

buildsurveysession()

buildsurveysession(int $surveyid, boolean $preview) : 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.

Parameters

int $surveyid
boolean $preview

Defaults to false

checkPassthruLabel()

checkPassthruLabel(int $surveyid, boolean $preview,  $fieldmap) : void

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

Parameters

int $surveyid
boolean $preview
$fieldmap

prefillFromCommandLine()

prefillFromCommandLine( $surveyid) : void

Prefill startvalues from command line param

Parameters

$surveyid

initFieldArray()

initFieldArray( $surveyid, array $fieldmap) : void

Parameters

$surveyid
array $fieldmap

testCaptcha()

testCaptcha(array $aEnterTokenData, array $subscenarios, int $surveyid, boolean $loadsecurity) : array

Parameters

array $aEnterTokenData
array $subscenarios
int $surveyid
boolean $loadsecurity

Returns

array —

($renderCaptcha, $FlashError)

randomizationGroup()

randomizationGroup(int $surveyid, array $fieldmap, boolean $preview) : array

Randomization group for groups

Parameters

int $surveyid
array $fieldmap
boolean $preview

Returns

array —

($fieldmap, $randomized)

randomizationQuestion()

randomizationQuestion(int $surveyid, array $fieldmap, boolean $preview) : array

Randomization group for questions

Parameters

int $surveyid
array $fieldmap
boolean $preview

Returns

array —

($fieldmap, $randomized)

finalizeRandomization()

finalizeRandomization(array $fieldmap) : array

Stuff?

Parameters

array $fieldmap

Returns

array —

Fieldmap

testIfTokenIsValid()

testIfTokenIsValid(array $subscenarios, array $thissurvey, array $aEnterTokenData, string $clienttoken) : array

Test if token is valid

Parameters

array $subscenarios
array $thissurvey
array $aEnterTokenData
string $clienttoken

Returns

array —

($renderToken, $FlashError)

getRenderWay()

getRenderWay(string $renderToken, string $renderCaptcha) : string

Returns which way should be rendered

Parameters

string $renderToken
string $renderCaptcha

Returns

string

renderRenderWayForm()

renderRenderWayForm(string $renderWay, array $redata, array $scenarios, string $sTemplateViewPath, array $aEnterTokenData, int $surveyid) : void

Render token, captcha or register form

Parameters

string $renderWay
array $redata
array $scenarios
string $sTemplateViewPath
array $aEnterTokenData
int $surveyid

resetAllSessionVariables()

resetAllSessionVariables(int $surveyid) : void

Resets all session variables for this survey

Parameters

int $surveyid

setTotalSteps()

setTotalSteps(int $surveyid, array $thissurvey,  $totalquestions) : 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

Parameters

int $surveyid
array $thissurvey
$totalquestions

breakOutAndCrash()

breakOutAndCrash(array $redata, string $sTemplateViewPath, int $totalquestions, int $iTotalGroupsWithoutQuestions, array $thissurvey) : void

Parameters

array $redata
string $sTemplateViewPath
int $totalquestions
int $iTotalGroupsWithoutQuestions
array $thissurvey

surveymover()

surveymover()

This function creates the form elements in the survey navigation bar Adding a hidden input for default behaviour without javascript Use button name="move" for real browser (with or without javascript) and IE6/7/8 with javascript

doAssessment()

doAssessment(mixed $surveyid, mixed $returndataonly)

Caculate assessement scores

Parameters

mixed $surveyid
mixed $returndataonly
  • only returns an array with data

UpdateGroupList()

UpdateGroupList( $surveyid,  $language)

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

Parameters

$surveyid
$language

UpdateFieldArray()

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

checkCompletedQuota()

checkCompletedQuota(integer $surveyid, bool $return) : array|void

checkCompletedQuota() returns matched quotas information for the current response

Parameters

integer $surveyid
  • Survey identification number
bool $return
  • set to true to return information, false do the quota

Returns

array|void —
  • nested array, Quotas->Members->Fields, includes quota information matched in session.

encodeEmail()

encodeEmail(mixed $mail, mixed $text, mixed $class, mixed $params)

encodeEmail : encode admin email in public part

Parameters

mixed $mail
mixed $text
mixed $class
mixed $params

GetReferringUrl()

GetReferringUrl() : string

GetReferringUrl() returns the referring URL

Returns

string

display_first_page()

display_first_page()

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

killSurveySession()

killSurveySession(int $iSurveyID)

killSurveySession : reset $_SESSION part for the survey

Parameters

int $iSurveyID

resetTimers()

resetTimers()

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

SetSurveyLanguage()

SetSurveyLanguage(int $surveyid,  $sLanguage)

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

Parameters

int $surveyid
$sLanguage

getMove()

getMove()

getMove get move button clicked

getSideBodyClass()

getSideBodyClass(boolean $sideMenustate) : string

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

Parameters

boolean $sideMenustate
  • False for pages with collapsed side-menu

Returns

string

App()

App() : \LSYii_Application

Helper function to replace calls to Yii::app() and enable correct code completion.

Returns

\LSYii_Application

traceVar()

traceVar(mixed $variable, int $depth)

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.

Parameters

mixed $variable

The variable to be dumped

int $depth

Maximum depth to go into the variable, default is 10

nice_addslashes()

nice_addslashes( $string)

Parameters

$string

sanitize_filename()

sanitize_filename( $string,  $force_lowercase,  $alphanumeric)

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

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
$force_lowercase
$alphanumeric

sanitize_dirname()

sanitize_dirname( $string,  $force_lowercase,  $alphanumeric)

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

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
$force_lowercase
$alphanumeric

sanitize_paranoid_string()

sanitize_paranoid_string( $string,  $min,  $max)

Parameters

$string
$min
$max

sanitize_cquestions()

sanitize_cquestions( $string,  $min,  $max)

Parameters

$string
$min
$max

sanitize_system_string()

sanitize_system_string( $string,  $min,  $max)

Parameters

$string
$min
$max

sanitize_xss_string()

sanitize_xss_string( $string)

Parameters

$string

sanitize_sql_db_tablename()

sanitize_sql_db_tablename( $string)

Parameters

$string

sanitize_ldap_string()

sanitize_ldap_string( $string,  $min,  $max)

Parameters

$string
$min
$max

sanitize_html_string()

sanitize_html_string( $string)

Parameters

$string

sanitize_int()

sanitize_int( $integer,  $min,  $max)

Parameters

$integer
$min
$max

sanitize_user()

sanitize_user( $string)

Parameters

$string

sanitize_userfullname()

sanitize_userfullname( $string)

Parameters

$string

sanitize_labelname()

sanitize_labelname( $string)

Parameters

$string

sanitize_float()

sanitize_float( $float,  $min,  $max)

Parameters

$float
$min
$max

sanitize()

sanitize( $input,  $flags,  $min,  $max)

Parameters

$input
$flags
$min
$max

check_paranoid_string()

check_paranoid_string( $input,  $min,  $max)

Parameters

$input
$min
$max

check_int()

check_int( $input,  $min,  $max)

Parameters

$input
$min
$max

check_float()

check_float( $input,  $min,  $max)

Parameters

$input
$min
$max

check_html_string()

check_html_string( $input,  $min,  $max)

Parameters

$input
$min
$max

check_ldap_string()

check_ldap_string( $input,  $min,  $max)

Parameters

$input
$min
$max

check_system_string()

check_system_string( $input,  $min,  $max)

Parameters

$input
$min
$max

check()

check( $input,  $flags,  $min,  $max)

Parameters

$input
$flags
$min
$max

sanitize_languagecode()

sanitize_languagecode( $codetosanitize)

Parameters

$codetosanitize

sanitize_languagecodeS()

sanitize_languagecodeS( $codestringtosanitize)

Parameters

$codestringtosanitize

sanitize_token()

sanitize_token( $codetosanitize)

Parameters

$codetosanitize

sanitize_signedint()

sanitize_signedint( $integer,  $min,  $max)

Parameters

$integer
$min
$max

injectglobalsettings()

injectglobalsettings()

getGlobalSetting()

getGlobalSetting( $settingname)

Parameters

$settingname

setGlobalSetting()

setGlobalSetting( $settingname,  $settingvalue)

Parameters

$settingname
$settingvalue

templatereplace()

templatereplace(mixed $line, mixed $replacements,  $redata,  $debugSrc, boolean $anonymized,  $questionNum,  $registerdata,  $bStaticReplacement,  $oTemplate) : 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

Parameters

mixed $line

Text to search in

mixed $replacements

Array of replacements: Array( =>

$redata
$debugSrc
boolean $anonymized

Determines if token data is being used or just replaced with blanks

$questionNum
$registerdata
$bStaticReplacement
$oTemplate

Returns

string —

Text with replaced strings

ReplaceFields()

ReplaceFields( $text,  $fieldsarray,  $bReplaceInsertans,  $staticReplace)

Parameters

$text
$fieldsarray
$bReplaceInsertans
$staticReplace

PassthruReplace()

PassthruReplace(mixed $line, mixed $thissurvey) : 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

Parameters

mixed $line

string - the string to iterate, and then return

mixed $thissurvey

string - the string containing the surveyinformation

Returns

string —

This string is returned containing the substituted responses

doHtmlSaveLinks()

doHtmlSaveLinks(string $move) : string

"Calculate" HTML for save links?

Parameters

string $move

?

Returns

string —

?

doHtmlSaveAll()

doHtmlSaveAll(string $move) : string

doHtmlSaveAll return HTML part of saveall button in survey

Parameters

string $move

:

Returns

string

comparePermission()

comparePermission(mixed $aPermissionA, mixed $aPermissionB)

Simple function to sort the permissions by title

Parameters

mixed $aPermissionA

Permission A to compare

mixed $aPermissionB

Permission B to compare

gT()

gT(string $sToTranslate, string $sEscapeMode, string $sLanguage)

Translation helper function

Parameters

string $sToTranslate
string $sEscapeMode

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

string $sLanguage

eT()

eT(string $sToTranslate, string $sEscapeMode, string $sLanguage)

Translation helper function which outputs right away.

Parameters

string $sToTranslate
string $sEscapeMode
string $sLanguage

ngT()

ngT( $sTextToTranslate, integer $iCount, string $sEscapeMode)

Translation helper function for plural forms

Parameters

$sTextToTranslate
integer $iCount
string $sEscapeMode

neT()

neT(string $sToTranslate, integer $iCount, string $sEscapeMode)

Translation helper function for plural forms which outputs right away

Parameters

string $sToTranslate
integer $iCount
string $sEscapeMode

quoteText()

quoteText(mixed $sText, string $sEscapeMode)

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

Parameters

mixed $sText

Text to quote

string $sEscapeMode

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

getQuestionTypeList()

getQuestionTypeList(string $SelectedCode, string $ReturnType) : \depending

getQuestionTypeList() Returns list of question types available in LimeSurvey. Edit this if you are adding a new question type

Parameters

string $SelectedCode

Value of the Question Type (defaults to "T")

string $ReturnType

Type of output from this function (defaults to selector)

Returns

\depending —

on $ReturnType param, returns a straight "array" of question types, or an list Explanation of questiontype array: description : Question description subquestions : 0= Does not support subquestions x=Number of subquestion scales answerscales : 0= Does not need answers x=Number of answer scales (usually 1, but e.g. for dual scale question set to 2) assessable : 0=Does not support assessment values when editing answerd 1=Support assessment values

isStandardTemplate()

isStandardTemplate(mixed $sTemplateName) : bool

isStandardTemplate returns true if a template is a standard template This function does not check if a template actually exists

Parameters

mixed $sTemplateName

template name to look for

Returns

bool —

True if standard template, otherwise false

getSurveyList()

getSurveyList(boolean $returnarray,  $surveyid) : string

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

Parameters

boolean $returnarray

if set to true an array instead of an HTML option list is given back

$surveyid

Returns

string —

This string is returned containing formatted list of existing surveys

getTemplateList()

getTemplateList()

getTemplateListWithPreviews()

getTemplateListWithPreviews()

getQuestions()

getQuestions( $surveyid,  $gid,  $selectedqid) : \This

getQuestions() queries the database for an list of all questions matching the current survey and group id

Parameters

$surveyid
$gid
$selectedqid

Returns

\This —

string is returned containing formatted list of questions in the current survey and group

getGidPrevious()

getGidPrevious(string $surveyid, string $gid) : \The

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

Parameters

string $surveyid
string $gid

Returns

\The —

Gid of the previous group

getQidPrevious()

getQidPrevious(string $surveyid, string $gid, string $qid) : \This

getQidPrevious() returns the Qid of the question prior to the current active question

Parameters

string $surveyid
string $gid
string $qid

Returns

\This —

Qid of the previous question

getGidNext()

getGidNext(string $surveyid, string $gid) : \The

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

Parameters

string $surveyid
string $gid

Returns

\The —

Gid of the next group

getQidNext()

getQidNext(string $surveyid, string $gid, string $qid) : \This

getQidNext() returns the Qid of the question prior to the current active question

Parameters

string $surveyid
string $gid
string $qid

Returns

\This —

Qid of the previous question

convertGETtoPOST()

convertGETtoPOST( $url)

Parameters

$url

calculateTotalFileUploadUsage()

calculateTotalFileUploadUsage()

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

getDirectorySize()

getDirectorySize( $directory)

Parameters

$directory

getGroupSum()

getGroupSum(string $surveyid, mixed $lang)

Gets number of groups inside a particular survey

Parameters

string $surveyid
mixed $lang

getMaxGroupOrder()

getMaxGroupOrder(string|int $surveyid) : int

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

Parameters

string|int $surveyid

Returns

int

getGroupOrder()

getGroupOrder(mixed $surveyid, mixed $gid) : mixed

getGroupOrder($surveyid,$gid) queries the database for the sortorder of a group.

Parameters

mixed $surveyid
mixed $gid

Returns

mixed

getMaxQuestionOrder()

getMaxQuestionOrder( $gid,  $surveyid)

getMaxQuestionOrder($gid) queries the database for the maximum sortorder of a question.

Parameters

$gid
$surveyid

getQuestionClass()

getQuestionClass(string $input) : string

getQuestionClass() returns a class name for a given question type to allow custom styling for each question type.

Parameters

string $input

containing unique character representing each question type.

Returns

string —

containing the class name for a given question type.

setupColumns()

setupColumns(integer $columns, integer $answer_count, string $wrapperclass, string $itemclass) : array

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

Parameters

integer $columns
  • the number of columns, usually supplied by $dcols
integer $answer_count
  • the number of answers to a question, usually supplied by $anscount
string $wrapperclass
  • a global class for the wrapper
string $itemclass
  • a class for the item

Returns

array —

with all the various opening and closing tags to generate a set of columns. 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

  • 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.

  • alternation()

    alternation( $alternate,  $type)

    Parameters

    $alternate
    $type

    longestString()

    longestString( $new_string,  $longest_length) : integer

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

    Parameters

    $new_string
    $longest_length

    Returns

    integer —

    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 );

    getNotificationList()

    getNotificationList(string $notificationcode) : \This

    getNotificationList() returns different options for notifications

    Parameters

    string $notificationcode
    • the currently selected one

    Returns

    \This —

    string is returned containing formatted list of notification methods for current survey

    getGroupList()

    getGroupList(string $gid,  $surveyid) : \This

    getGroupList() queries the database for a list of all groups matching the current survey sid

    Parameters

    string $gid
    • the currently selected gid/group
    $surveyid

    Returns

    \This —

    string is returned containing formatted list of groups to current survey

    getGroupList3()

    getGroupList3( $gid,  $surveyid)

    Parameters

    $gid
    $surveyid

    getGroupListLang()

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

    put your comment there.

    ..

    Parameters

    mixed $gid
    mixed $language
    $surveyid

    getUserList()

    getUserList( $outputformat)

    Parameters

    $outputformat

    getSurveyInfo()

    getSurveyInfo(string $surveyid, string $languagecode) : array

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

    Parameters

    string $surveyid

    The survey ID

    string $languagecode

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

    Returns

    array —

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

    templateDefaultTexts()

    templateDefaultTexts( $sLanguage, string $mode,  $sNewlines) : array

    Returns the default email template texts as array

    Parameters

    $sLanguage
    string $mode

    Escape mode for the translation function

    $sNewlines

    Returns

    array

    groupOrderThenQuestionOrder()

    groupOrderThenQuestionOrder(mixed $a, mixed $b) : 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

    Parameters

    mixed $a
    mixed $b

    Returns

    int

    fixSortOrderAnswers()

    fixSortOrderAnswers( $qid,  $surveyid)

    Parameters

    $qid
    $surveyid

    shiftOrderQuestions()

    shiftOrderQuestions( $sid,  $gid,  $shiftvalue)

    function fixSortOrderQuestions($groupid, $surveyid) //Function rewrites the sortorder for questions { $gid = sanitize_int($groupid); $surveyid = sanitize_int($surveyid); $baselang = Survey::model()->findByPk($surveyid)->language;

    $questions = Question::model()->findAllByAttributes(array('gid' => $gid, 'sid' => $surveyid, 'language' => $baselang)); $p = 0; foreach ($questions as $question) { $question->question_order = $p; $question->save(); $p++; } }

    Parameters

    $sid
    $gid
    $shiftvalue

    fixSortOrderGroups()

    fixSortOrderGroups( $surveyid)

    Parameters

    $surveyid

    fixMovedQuestionConditions()

    fixMovedQuestionConditions( $qid,  $oldgid,  $newgid,  $iSurveyID)

    Parameters

    $qid
    $oldgid
    $newgid
    $iSurveyID

    returnGlobal()

    returnGlobal(string $stringname, boolean $bRestrictToString)

    This function returns POST/REQUEST vars, for some vars like SID and others they are also sanitized

    Parameters

    string $stringname
    boolean $bRestrictToString

    sendCacheHeaders()

    sendCacheHeaders()

    getExtendedAnswer()

    getExtendedAnswer(integer $iSurveyID, string $sFieldCode, string $sValue, string $sLanguage) : string

    Parameters

    integer $iSurveyID

    The Survey ID

    string $sFieldCode

    Field code of the particular field

    string $sValue

    The stored response value

    string $sLanguage

    Initialized limesurvey_lang object for the resulting response data

    Returns

    string

    validateEmailAddress()

    validateEmailAddress(mixed $sEmailAddress)

    Validate an email address - also supports IDN email addresses

    Parameters

    mixed $sEmailAddress

    Email address to check

    validateEmailAddresses()

    validateEmailAddresses( $aEmailAddressList)

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

    Parameters

    $aEmailAddressList

    createCompleteSGQA()

    createCompleteSGQA(int $iSurveyID, array $aFilters, string $sLanguage) : array

    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 Statistics_userController

    Parameters

    int $iSurveyID

    Id of the Survey in question

    array $aFilters

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

    string $sLanguage

    Returns

    array —

    The summary

    createFieldMap()

    createFieldMap(string $surveyid, mixed $style, mixed $force_refresh, int $questionid,  $sLanguage,  $aDuplicateQIDs) : array

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

    Parameters

    string $surveyid

    The Survey ID

    mixed $style

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

    mixed $force_refresh
    • Forces to really refresh the array, not just take the session copy
    int $questionid

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

    $sLanguage
    $aDuplicateQIDs

    Returns

    array

    hasFileUploadQuestion()

    hasFileUploadQuestion( $iSurveyID) : bool

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

    Parameters

    $iSurveyID

    Returns

    bool

    createTimingsFieldMap()

    createTimingsFieldMap(string $surveyid, mixed $style, mixed $force_refresh, int $questionid, string $sQuestionLanguage) : array

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

    Parameters

    string $surveyid

    The Survey ID

    mixed $style

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

    mixed $force_refresh
    • Forces to really refresh the array, not just take the session copy
    int $questionid

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

    string $sQuestionLanguage

    The language to use

    Returns

    array

    arraySearchByKey()

    arraySearchByKey(mixed $needle, mixed $haystack, mixed $keyname, mixed $maxanswers)

    put your comment there.

    ..

    Parameters

    mixed $needle
    mixed $haystack
    mixed $keyname
    mixed $maxanswers

    setuserpermissions()

    setuserpermissions(int $uid, mixed $rights)

    set the rights of a user and his children

    Parameters

    int $uid

    the user id

    mixed $rights

    rights array

    getSavedCount()

    getSavedCount(mixed $surveyid)

    This function returns a count of the number of saved responses to a survey

    Parameters

    mixed $surveyid

    Survey ID

    getBaseLanguageFromSurveyID()

    getBaseLanguageFromSurveyID(int $surveyid) : string

    Returns the base language from a survey id

    Parameters

    int $surveyid

    Returns

    string

    buildLabelSetCheckSumArray()

    buildLabelSetCheckSumArray()

    getQuestionAttributeValues()

    getQuestionAttributeValues(mixed $iQID) : \array$bOrderByNative=>value,

    Returns a flat array with all question attributes for the question only (and the qid we gave it)!

    Parameters

    mixed $iQID

    The question ID

    Returns

    \array$bOrderByNative=>value, —

    attribute=>value} or false if the question ID does not exist (anymore)

    getQuestionAttributeValue()

    getQuestionAttributeValue(mixed $questionAttributeArray, mixed $attributeName, mixed $language) : string

    Returns the questionAttribtue value set or '' if not set

    Parameters

    mixed $questionAttributeArray
    mixed $attributeName
    mixed $language

    string Optional: The language if the particualr attributes is localizable

    Returns

    string

    categorySort()

    categorySort( $a,  $b)

    Parameters

    $a
    $b

    autoEscape()

    autoEscape( $str)

    Parameters

    $str

    autoUnescape()

    autoUnescape( $str)

    Parameters

    $str

    HTMLEscape()

    HTMLEscape( $str)

    Parameters

    $str

    dbQuoteAll()

    dbQuoteAll(string $value) : string

    Escapes a text value for db

    Parameters

    string $value

    Returns

    string

    stripCtrlChars()

    stripCtrlChars(mixed $sValue) : \A

    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

    Parameters

    mixed $sValue

    A string to be sanitized

    Returns

    \A —

    sanitized string, otherwise the unmodified original variable

    javascriptEscape()

    javascriptEscape( $str,  $strip_tags,  $htmldecode)

    Parameters

    $str
    $strip_tags
    $htmldecode

    SendEmailMessage()

    SendEmailMessage(string $body, mixed $subject, mixed $to, mixed $from, mixed $sitename, mixed $ishtml, mixed $bouncemail,  $attachments,  $customheaders) : bool

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

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

    Parameters

    string $body

    Body text of the email in plain text or HTML

    mixed $subject

    Email subject

    mixed $to

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

    mixed $from
    mixed $sitename
    mixed $ishtml
    mixed $bouncemail
    $attachments
    $customheaders

    Returns

    bool —

    If successful returns true

    flattenText()

    flattenText(string $sTextToFlatten,  $bKeepSpan, boolean $bDecodeHTMLEntities, string $sCharset, string $bStripNewLines) : string

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

    Parameters

    string $sTextToFlatten

    Text you want to clean

    $bKeepSpan
    boolean $bDecodeHTMLEntities

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

    string $sCharset

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

    string $bStripNewLines

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

    Returns

    string —

    Cleaned text

    getArrayFilterExcludesCascadesForGroup()

    getArrayFilterExcludesCascadesForGroup( $surveyid,  $gid,  $output) : \returns

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

    Parameters

    $surveyid
    $gid
    $output

    Returns

    \returns —

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

    getArrayFiltersForQuestion()

    getArrayFiltersForQuestion( $qid) : \returns

    getArrayFiltersForQuestion($qid) finds out if a question has an array_filter attribute and what codes where selected on target question

    Parameters

    $qid

    Returns

    \returns —

    an array of codes that were selected else returns false

    getGroupsByQuestion()

    getGroupsByQuestion( $surveyid) : \returns

    getGroupsByQuestion($surveyid)

    Parameters

    $surveyid

    Returns

    \returns —

    a keyed array of groups to questions ie: array([1]=>[2]) question qid 1, is in group gid 2.

    getArrayFilterExcludesForQuestion()

    getArrayFilterExcludesForQuestion( $qid) : \returns

    getArrayFilterExcludesForQuestion($qid) finds out if a question has an array_filter_exclude attribute and what codes where selected on target question

    Parameters

    $qid

    Returns

    \returns —

    an array of codes that were selected else returns false

    CSVEscape()

    CSVEscape( $sString)

    Parameters

    $sString

    convertCSVRowToArray()

    convertCSVRowToArray( $string,  $separator,  $quotechar)

    Parameters

    $string
    $separator
    $quotechar

    createPassword()

    createPassword()

    languageDropdown()

    languageDropdown( $surveyid,  $selected)

    Parameters

    $surveyid
    $selected

    languageDropdownClean()

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

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

    Parameters

    int $surveyid
    string $selected

    The selected language

    Returns

    string

    rmdirr()

    rmdirr(mixed $dirname) : bool

    This function removes a directory recursively

    Parameters

    mixed $dirname

    Returns

    bool

    CSVUnquote()

    CSVUnquote(mixed $field) : mixed

    This function removes surrounding and masking quotes from the CSV field

    Parameters

    mixed $field

    Returns

    mixed

    incompleteAnsFilterState()

    incompleteAnsFilterState() : string

    This function return actual completion state

    Returns

    string —

    (complete|incomplete|all) or false

    isCaptchaEnabled()

    isCaptchaEnabled(string $screen,  $captchamode) : boolean

    isCaptchaEnabled($screen, $usecaptchamode)

    Parameters

    string $screen
    • the screen name for which to test captcha activation
    $captchamode

    Returns

    boolean —
    • returns true if captcha must be enabled

    convertCSVReturnToReturn()

    convertCSVReturnToReturn(mixed $string) : mixed

    used for import[survey|questions|groups]

    Parameters

    mixed $string

    Returns

    mixed

    tableExists()

    tableExists(string $sTableName) : boolean

    Check if a table does exist in the database

    Parameters

    string $sTableName

    Table name to check for (without dbprefix!))

    Returns

    boolean —

    True or false if table exists or not

    isTokenCompletedDatestamped()

    isTokenCompletedDatestamped( $thesurvey)

    Parameters

    $thesurvey

    dateShift()

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

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

    .. see function strtotime() for usage

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

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

    Parameters

    mixed $date
    mixed $dformat
    mixed $shift

    Returns

    string

    getBounceEmail()

    getBounceEmail( $surveyid)

    Parameters

    $surveyid

    getEmailFormat()

    getEmailFormat( $surveyid)

    Parameters

    $surveyid

    hasTemplateManageRights()

    hasTemplateManageRights( $userid,  $templatefolder)

    Parameters

    $userid
    $templatefolder

    getNextCode()

    getNextCode(mixed $sourcecode)

    This function creates an incrementing answer code based on the previous source-code

    Parameters

    mixed $sourcecode

    The previous answer code

    translateLinks()

    translateLinks(mixed $sType, mixed $iOldSurveyID, mixed $iNewSurveyID, mixed $sString) : string

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

    Parameters

    mixed $sType

    'survey' or 'label'

    mixed $iOldSurveyID
    mixed $iNewSurveyID
    mixed $sString

    Returns

    string

    reverseTranslateFieldNames()

    reverseTranslateFieldNames(mixed $iOldSID, mixed $iNewSID, array $aGIDReplacements, array $aQIDReplacements)

    This function creates the old fieldnames for survey import

    Parameters

    mixed $iOldSID

    The old survey id

    mixed $iNewSID

    The new survey id

    array $aGIDReplacements

    An array with group ids (oldgid=>newgid)

    array $aQIDReplacements

    An array with question ids (oldqid=>newqid)

    hasResources()

    hasResources(mixed $id, mixed $type)

    put your comment there.

    ..

    Parameters

    mixed $id
    mixed $type

    randomChars()

    randomChars(mixed $length, string $pattern)

    Creates a random sequence of characters

    Parameters

    mixed $length

    Length of resulting string

    string $pattern

    To define which characters should be in the resulting string

    conditionalNewlineToBreak()

    conditionalNewlineToBreak(mixed $mytext, mixed $ishtml,  $encoded) : mixed

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

    Parameters

    mixed $mytext
    mixed $ishtml
    $encoded

    Returns

    mixed

    breakToNewline()

    breakToNewline( $data)

    Parameters

    $data

    safeDie()

    safeDie( $text)

    Parameters

    $text

    fixCKeditorText()

    fixCKeditorText( $str)

    Parameters

    $str

    filterForAttributes()

    filterForAttributes(mixed $fieldname)

    This is a helper function for getAttributeFieldNames

    Parameters

    mixed $fieldname

    GetAttributeFieldNames()

    GetAttributeFieldNames(mixed $iSurveyID) : array

    Retrieves the attribute field names from the related token table

    Parameters

    mixed $iSurveyID

    The survey ID

    Returns

    array —

    The fieldnames

    GetParticipantAttributes()

    GetParticipantAttributes(integer $iSurveyID)

    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

    Parameters

    integer $iSurveyID

    The Survey ID

    getTokenConditionsFieldNames()

    getTokenConditionsFieldNames(mixed $surveyid) : array

    Retrieves the token field names usable for conditions from the related token table

    Parameters

    mixed $surveyid

    The survey ID

    Returns

    array —

    The fieldnames

    getTokenFieldsAndNames()

    getTokenFieldsAndNames(mixed $surveyid, boolean $bOnlyAttributes) : array

    Retrieves the attribute names from the related token table

    Parameters

    mixed $surveyid

    The survey ID

    boolean $bOnlyAttributes

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

    Returns

    array —

    The fieldnames as key and names as value in an Array

    getAttributeValue()

    getAttributeValue(mixed $surveyid, mixed $attrName, mixed $token) : string

    Retrieves the token attribute value from the related token table

    Parameters

    mixed $surveyid

    The survey ID

    mixed $attrName

    The token-attribute field name

    mixed $token

    The token code

    Returns

    string —

    The token attribute value (or null on error)

    stripJavaScript()

    stripJavaScript(string $sContent) : string

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

    Parameters

    string $sContent

    String to clean

    Returns

    string —

    Cleaned string

    showJavaScript()

    showJavaScript(string $sContent) : string

    This function converts emebedded Javascript to Text

    Parameters

    string $sContent

    String to clean

    Returns

    string —

    Cleaned string

    cleanTempDirectory()

    cleanTempDirectory()

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

    useFirebug()

    useFirebug()

    convertDateTimeFormat()

    convertDateTimeFormat(mixed $value, mixed $fromdateformat, mixed $todateformat) : string

    This is a convenience function for the coversion of datetime values

    Parameters

    mixed $value
    mixed $fromdateformat
    mixed $todateformat

    Returns

    string

    convertToGlobalSettingFormat()

    convertToGlobalSettingFormat(string $sDate,  $withTime) : 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

    Parameters

    string $sDate
    $withTime

    Returns

    string

    removeBOM()

    removeBOM(string $str) : string

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

    Parameters

    string $str

    Returns

    string

    getUpdateInfo()

    getUpdateInfo()

    getNumericalFormat()

    getNumericalFormat(mixed $lang, mixed $integer, mixed $negative)

    Return the goodchars to be used when filtering input for numbers.

    Parameters

    mixed $lang

    string language used, for localisation

    mixed $integer

    bool use only integer

    mixed $negative

    bool allow negative values

    getTemplatePath()

    getTemplatePath(mixed $sTemplateName)

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

    Parameters

    mixed $sTemplateName

    getTemplateURL()

    getTemplateURL(mixed $sTemplateName)

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

    Parameters

    mixed $sTemplateName

    getSubQuestions()

    getSubQuestions(int $sid, int $qid, mixed $sLanguage)

    Return an array of subquestions for a given sid/qid

    Parameters

    int $sid
    int $qid
    mixed $sLanguage

    Language of the subquestion text

    getXMLWriter()

    getXMLWriter()

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

    SSLRedirect()

    SSLRedirect(mixed $enforceSSLMode)

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

    (Was redirect() before CodeIgniter port.)

    Parameters

    mixed $enforceSSLMode

    string 's' or '' (empty).

    enforceSSLMode()

    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.

    getQuotaCompletedCount()

    getQuotaCompletedCount(int $iSurveyId, int $quotaid) : mixed

    Returns the number of answers matching the quota

    Parameters

    int $iSurveyId
    • Survey identification number
    int $quotaid
    • quota id for which you want to compute the completed field

    Returns

    mixed —
    • value of matching entries in the result DB or null

    getFullResponseTable()

    getFullResponseTable(mixed $iSurveyID, mixed $iResponseID, mixed $sLanguageCode, boolean $bHonorConditions)

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

    Parameters

    mixed $iSurveyID
    mixed $iResponseID
    mixed $sLanguageCode
    boolean $bHonorConditions

    Apply conditions

    isNumericInt()

    isNumericInt(mixed $mStr)

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

    Parameters

    mixed $mStr

    short_implode()

    short_implode(string $sDelimeter,  $sHyphen, array $aArray) : string

    Implode and sort content array for very long arrays

    Parameters

    string $sDelimeter
    $sHyphen
    array $aArray

    Returns

    string —

    String showing array content

    includeKeypad()

    includeKeypad()

    Include Keypad headers

    getQuotaInformation()

    getQuotaInformation(string $surveyid, string $language,  $iQuotaID) : array

    getQuotaInformation() returns quota information for the current survey

    Parameters

    string $surveyid
    • Survey identification number
    string $language
    • Language of the quota
    $iQuotaID

    Returns

    array —
    • nested array, Quotas->Members

    translateInsertansTags()

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

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

    Parameters

    string $newsid

    Old SID

    string $oldsid

    New SID

    mixed $fieldnames

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

    replaceExpressionCodes()

    replaceExpressionCodes(mixed $iSurveyID, mixed $aCodeMap)

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

    Parameters

    mixed $iSurveyID

    The survey ID

    mixed $aCodeMap

    The codemap array (old_code=>new_code)

    accessDenied()

    accessDenied( $action,  $sid) : \$accesssummary

    This function is a replacement of accessDenied.php which return appropriate error message which is then displayed.

    Parameters

    $action
    $sid

    Returns

    \$accesssummary —
    • proper access denied error message

    cleanLanguagesFromSurvey()

    cleanLanguagesFromSurvey(string $sid, string $availlangs) : bool

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

    Parameters

    string $sid
    • the currently selected survey
    string $availlangs
    • space separated list of additional languages in survey

    Returns

    bool —
    • always returns true

    fixLanguageConsistency()

    fixLanguageConsistency(string $sid, string $availlangs) : bool

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

    Parameters

    string $sid
    • the currently selected survey
    string $availlangs
    • space separated list of additional languages in survey - if empty all additional languages of a survey are checked against the base language

    Returns

    bool —
    • always returns true

    switchMSSQLIdentityInsert()

    switchMSSQLIdentityInsert(string $table, mixed $state)

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

    Parameters

    string $table

    table name (without prefix)

    mixed $state

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

    getLastInsertID()

    getLastInsertID(string $sTableName)

    Retrieves the last Insert ID realiable for cross-DB applications

    Parameters

    string $sTableName

    Needed for Postgres and MSSQL

    getGroupDepsForConditions()

    getGroupDepsForConditions(string $sid, string $depgid, string $targgid,  $indexby) : array

    getGroupDepsForConditions() get Dependencies between groups caused by conditions

    Parameters

    string $sid
    • the currently selected survey
    string $depgid
    • (optionnal) get only the dependencies applying to the group with gid depgid
    string $targgid
    • (optionnal) get only the dependencies for groups dependents on group targgid
    $indexby

    Returns

    array —
    • 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(string $sid, string $gid, string $depqid, string $targqid,  $indexby,  $searchscope) : array

    getQuestDepsForConditions() get Dependencies between groups caused by conditions

    Parameters

    string $sid
    • the currently selected survey
    string $gid
    • (optionnal) only search dependecies inside the Group Id $gid
    string $depqid
    • (optionnal) get only the dependencies applying to the question with qid depqid
    string $targqid
    • (optionnal) get only the dependencies for questions dependents on question Id targqid
    $indexby
    $searchscope

    Returns

    array —
    • 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");

    checkMoveQuestionConstraintsForConditions()

    checkMoveQuestionConstraintsForConditions(string $sid, string $qid, string $newgid) : array

    checkMoveQuestionConstraintsForConditions()

    Parameters

    string $sid
    • the currently selected survey
    string $qid
    • qid of the question you want to check possible moves
    string $newgid
    • (optionnal) get only constraints when trying to move to this particular GroupId otherwise, get all moves constraints for this question

    Returns

    array —
    • 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

    getUserGroupList()

    getUserGroupList( $ugid,  $outputformat)

    Parameters

    $ugid
    $outputformat

    getGroupUserList()

    getGroupUserList( $ugid)

    Parameters

    $ugid

    modifyDatabase()

    modifyDatabase(string $sqlfile, string $sqlstring) : bool

    Run an arbitrary sequence of semicolon-delimited SQL commands

    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

    string $sqlfile

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

    string $sqlstring

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

    Returns

    bool —

    Returns true if database was modified successfully.

    getLabelSets()

    getLabelSets(string $languages) : array

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

    Parameters

    string $languages

    Returns

    array

    getHeader()

    getHeader( $meta)

    Parameters

    $meta

    doHeader()

    doHeader()

    getPrintableHeader()

    getPrintableHeader() : String

    This function returns the header for the printable survey

    Returns

    String

    getFooter()

    getFooter()

    doFooter()

    doFooter()

    getDBTableUsage()

    getDBTableUsage( $surveyid)

    Parameters

    $surveyid

    doesImportArraySupportLanguage()

    doesImportArraySupportLanguage(mixed $csvarray, mixed $idkeysarray, mixed $langfieldnum, mixed $langcode, mixed $hasheader)

    Checks that each object from an array of CSV data [question-rows,answer-rows,labelsets-row] supports at least a given language

    Parameters

    mixed $csvarray

    array with a line of csv data per row

    mixed $idkeysarray

    array of integers giving the csv-row numbers of the object keys

    mixed $langfieldnum

    integer giving the csv-row number of the language(s) filed ==> the language field can be a single language code or a space separated language code list

    mixed $langcode

    the language code to be tested

    mixed $hasheader

    if we should strip off the first line (if it contains headers)

    getSurveyUserList()

    getSurveyUserList(mixed $bIncludeOwner, mixed $bIncludeSuperAdmins,  $surveyid) : string

    Retrieve a HTML <OPTION> list of survey admin users

    Parameters

    mixed $bIncludeOwner

    If the survey owner should be included

    mixed $bIncludeSuperAdmins

    If Super admins should be included

    $surveyid

    Returns

    string

    getSurveyUserGroupList()

    getSurveyUserGroupList( $outputformat,  $surveyid)

    Parameters

    $outputformat
    $surveyid

    fixSubquestions()

    fixSubquestions()

    This function fixes the group ID and type on all subquestions Optimized for minimum memory usage even on huge databases

    ls_json_encode()

    ls_json_encode( $content)

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

    Parameters

    $content

    json_decode_ls()

    json_decode_ls(\type $jsonString) : \type

    Decode a json string, sometimes needs stripslashes

    Parameters

    \type $jsonString

    Returns

    \type

    aEncodingsArray()

    aEncodingsArray() : array

    Return accepted codingsArray for importing files

    Used in vvimport TODO : use in token and

    Returns

    array

    arraySwapAssoc()

    arraySwapAssoc(mixed $key1, mixed $key2, mixed $array)

    Swaps two positions in an array

    Parameters

    mixed $key1
    mixed $key2
    mixed $array

    ellipsize()

    ellipsize( $sString,  $iMaxLength,  $fPosition,  $sEllipsis) : string

    Ellipsize String

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

    Parameters

    $sString
    $iMaxLength
    $fPosition
    $sEllipsis

    Returns

    string —

    ellipsized string

    getIPAddress()

    getIPAddress()

    This function returns the real IP address under all configurations

    getBrowserLanguage()

    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

    array_diff_assoc_recursive()

    array_diff_assoc_recursive( $array1,  $array2)

    Parameters

    $array1
    $array2

    convertPHPSizeToBytes()

    convertPHPSizeToBytes( $sSize)

    Parameters

    $sSize

    getMaximumFileUploadSize()

    getMaximumFileUploadSize()

    decodeTokenAttributes()

    decodeTokenAttributes(string $oTokenAttributeData)

    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

    Parameters

    string $oTokenAttributeData

    The original token attributes as stored in the database

    getSerialClass()

    getSerialClass( $sSerial)

    Parameters

    $sSerial

    isMd5()

    isMd5( $sMD5)

    Checks if a string looks like it is a MD5 hash

    Parameters

    $sMD5

    dbExecuteAssoc()

    dbExecuteAssoc(string $sql, array $inputarr, boolean $silent) : \CDbDataReader|boolean

    Parameters

    string $sql
    array $inputarr
    boolean $silent

    Returns

    \CDbDataReader|boolean

    dbQueryOrFalse()

    dbQueryOrFalse( $sql)

    Parameters

    $sql

    dbSelectLimitAssoc()

    dbSelectLimitAssoc( $sql,  $numrows,  $offset,  $inputarr,  $dieonerror)

    Parameters

    $sql
    $numrows
    $offset
    $inputarr
    $dieonerror

    dbQuoteID()

    dbQuoteID(mixed $id)

    This functions quotes fieldnames accordingly

    Parameters

    mixed $id

    Fieldname to be quoted

    dbRandom()

    dbRandom() : string

    Return the random function to use in ORDER BY sql statements

    Returns

    string

    dbSelectTablesLike()

    dbSelectTablesLike(mixed $table)

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

    Parameters

    mixed $table

    dbGetTablesLike()

    dbGetTablesLike(string $table) : array

    Gets the table names. Do not prefix.

    Parameters

    string $table

    String to match

    Returns

    array —

    Array of matched table names

    createChart()

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

    Generate a chart for a question

    @param int $iQuestionID ID of the question

    Parameters

    $iQuestionID
    int $iSurveyID

    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 mixed $cache An object containing [Hashkey] and [CacheFolder] @param mixed $sLanguageCode Language Code @param string $sQuestionType The question type @return Name

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

    getQuestionMapData()

    getQuestionMapData( $sField, mixed $qsid) : array

    Return data to populate a Google Map

    Parameters

    $sField
    mixed $qsid

    Survey id

    Returns

    array

    buildSelects()

    buildSelects( $allfields,  $surveyid,  $language)

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

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

    Parameters

    $allfields
    $surveyid
    $language

    square()

    square(mixed $number)

    Simple function to square a value

    Parameters

    mixed $number

    Value to square

    cmpQuestionSeq()

    cmpQuestionSeq(\<type> $a, \<type> $b) : \<type>

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

    Parameters

    \ $a
    \ $b

    Returns

    \

    cmpErrorTokens()

    cmpErrorTokens(\<type> $a, \<type> $b) : \<type>

    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

    Parameters

    \ $a
    \ $b

    Returns

    \

    exprmgr_count()

    exprmgr_count(\<type> $args) : int

    Count the number of answered questions (non-empty)

    Parameters

    \ $args

    Returns

    int

    exprmgr_countif()

    exprmgr_countif(\<type> $args) : int

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

    Parameters

    \ $args

    Returns

    int

    exprmgr_countifop()

    exprmgr_countifop(\<type> $args) : int

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

    Parameters

    \ $args

    Returns

    int

    exprmgr_stripos()

    exprmgr_stripos(string $haystack, string $needle, mixed $offset) : int|false

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

    Parameters

    string $haystack

    : checked string

    string $needle

    : string to find

    mixed $offset

    : offset

    Returns

    int|false —

    : position or false if not found

    exprmgr_stristr()

    exprmgr_stristr(string $haystack, string $needle, boolean $before_needle) : string|false

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

    Parameters

    string $haystack

    : checked string

    string $needle

    : string to find

    boolean $before_needle

    : portion to return

    Returns

    string|false

    exprmgr_strlen()

    exprmgr_strlen(string $string) : int

    Get unicode string length

    Parameters

    string $string

    Returns

    int

    exprmgr_strpos()

    exprmgr_strpos(string $haystack, string $needle, mixed $offset) : int|false

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

    Parameters

    string $haystack

    : checked string

    string $needle

    : string to find

    mixed $offset

    : offset

    Returns

    int|false —

    : position or false if not found

    exprmgr_strstr()

    exprmgr_strstr(string $haystack, string $needle, boolean $before_needle) : string|false

    Finds first occurrence of a unicode string within another

    Parameters

    string $haystack

    : checked string

    string $needle

    : string to find

    boolean $before_needle

    : portion to return

    Returns

    string|false

    exprmgr_strtolower()

    exprmgr_strtolower(string $string) : string

    Make an unicode string lowercase

    Parameters

    string $string

    Returns

    string

    exprmgr_strtoupper()

    exprmgr_strtoupper(string $string) : string

    Make an unicode string uppercase

    Parameters

    string $string

    Returns

    string

    exprmgr_substr()

    exprmgr_substr(string $string, int $start, int $end) : string

    Get part of unicode string

    Parameters

    string $string
    int $start
    int $end

    Returns

    string

    exprmgr_sumifop()

    exprmgr_sumifop(\<type> $args) : int

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

    Parameters

    \ $args

    Returns

    int

    exprmgr_convert_value()

    exprmgr_convert_value(\numeric $fValueToReplace, \numeric $iStrict, string $sTranslateFromList, string $sTranslateToList) : \numeric

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

    Parameters

    \numeric $fValueToReplace
    \numeric $iStrict
    • 1 for exact matches only otherwise interpolation the closest value should be returned
    string $sTranslateFromList
    • comma seperated list of numeric values to translate from
    string $sTranslateToList
    • comma seperated list of numeric values to translate to

    Returns

    \numeric

    exprmgr_if()

    exprmgr_if(\<type> $test, \<type> $ok, \<type> $error) : \<type>

    If $test is true, return $ok, else return $error

    Parameters

    \ $test
    \ $ok
    \ $error

    Returns

    \

    exprmgr_int()

    exprmgr_int(string $arg) : boolean

    Return true if the variable is an integer for LimeSurvey Can not really use is_int due to SQL DECIMAL system. This function can surely be improved

    Parameters

    string $arg

    Returns

    boolean

    exprmgr_list()

    exprmgr_list(\<type> $args) : \<type>

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

    Parameters

    \ $args

    Returns

    \

    exprmgr_log()

    exprmgr_log(\<type> $args) : float

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

    Parameters

    \ $args

    Returns

    float

    exprmgr_mktime()

    exprmgr_mktime(int $hour, int $minute, int $second, int $month, int $day, int $year) : int|boolean

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

    PHP 5.3.3 send E_STRICT notice without param, then replace by time if needed

    Parameters

    int $hour
    int $minute
    int $second
    int $month
    int $day
    int $year

    Returns

    int|boolean

    exprmgr_join()

    exprmgr_join(\<type> $args) : \<type>

    Join together $args[N]

    Parameters

    \ $args

    Returns

    \

    exprmgr_implode()

    exprmgr_implode(\<type> $args) : \<type>

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

    Parameters

    \ $args

    Returns

    \

    exprmgr_empty()

    exprmgr_empty(\<type> $arg) : \<type>

    Return true if the variable is NULL or blank.

    Parameters

    \ $arg

    Returns

    \

    exprmgr_stddev()

    exprmgr_stddev(\<type> $args) : \<type>

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

    Parameters

    \ $args

    Returns

    \

    expr_mgr_htmlspecialchars()

    expr_mgr_htmlspecialchars(\<type> $string) : \<type>

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

    Parameters

    \ $string

    Returns

    \

    expr_mgr_htmlspecialchars_decode()

    expr_mgr_htmlspecialchars_decode(\<type> $string) : \<type>

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

    Parameters

    \ $string

    Returns

    \

    exprmgr_regexMatch()

    exprmgr_regexMatch(string $pattern, string $input) : boolean

    Return true if $input matches the regular expression $pattern

    Parameters

    string $pattern
    string $input

    Returns

    boolean

    geterrors_exprmgr_regexMatch()

    geterrors_exprmgr_regexMatch(string $pattern, string $input) : string|null

    Return error information from pattern of regular expression $pattern

    Parameters

    string $pattern
    string $input

    Returns

    string|null

    exprmgr_fixnum()

    exprmgr_fixnum(\type $value) : \type

    Display number with comma as radix separator, if needed

    Parameters

    \type $value

    Returns

    \type

    exprmgr_unique()

    exprmgr_unique(\type $args) : boolean

    Returns true if all non-empty values are unique

    Parameters

    \type $args

    Returns

    boolean

    stripTagsFull()

    stripTagsFull(mixed $string) : \$string

    Strips html tags and replaces new lines

    Parameters

    mixed $string

    Returns

    \$string

    isNumericExtended()

    isNumericExtended(mixed $value) : bool

    Returns true if passed $value is numeric

    Parameters

    mixed $value

    Returns

    bool

    strSplitUnicode()

    strSplitUnicode(mixed $str, mixed $l) : string

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

    Parameters

    mixed $str
    mixed $l

    Returns

    string

    SPSSExportData()

    SPSSExportData(mixed $iSurveyID, mixed $iLength, mixed $na,  $q, \logical $header)

    Exports CSV response data for SPSS and R

    Parameters

    mixed $iSurveyID

    The survey ID

    mixed $iLength

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

    mixed $na

    Value for N/A data

    $q
    \logical $header

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

    SPSSGetValues()

    SPSSGetValues(mixed $field,  $qidattributes,  $language) : array

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

    Parameters

    mixed $field

    array field from SPSSFieldMap

    $qidattributes
    $language

    Returns

    array —

    or false

    SPSSFieldMap()

    SPSSFieldMap( $iSurveyID, mixed $prefix) : array

    Creates a fieldmap with all information necessary to output the fields

    Parameters

    $iSurveyID
    mixed $prefix

    string prefix for the variable ID

    Returns

    array

    SPSSGetQuery()

    SPSSGetQuery( $iSurveyID,  $limit,  $offset) : \CDbCommand

    Creates a query string with all fields for the export

    Parameters

    $iSurveyID
    $limit
    $offset

    Returns

    \CDbCommand

    buildXMLFromQuery()

    buildXMLFromQuery(mixed $xmlwriter, mixed $Query, mixed $tagname, array $excludes)

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

    Parameters

    mixed $xmlwriter

    The existing XMLWriter object

    mixed $Query

    The table query to build from

    mixed $tagname

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

    array $excludes

    array of columnames not to include in export

    surveyGetXMLStructure()

    surveyGetXMLStructure( $iSurveyID,  $xmlwriter,  $exclude)

    from export_structure_xml.php

    Parameters

    $iSurveyID
    $xmlwriter
    $exclude

    surveyGetXMLData()

    surveyGetXMLData( $iSurveyID,  $exclude)

    from export_structure_xml.php

    Parameters

    $iSurveyID
    $exclude

    getXMLDataSingleTable()

    getXMLDataSingleTable(\inetger $iSurveyID, string $sTableName, string $sDocType,  $sXMLTableTagName,  $sFileName,  $bSetIndent) : object

    Exports a single table to XML

    Parameters

    \inetger $iSurveyID

    The survey ID

    string $sTableName

    The database table name of the table to be export

    string $sDocType

    What doctype should be written

    $sXMLTableTagName
    $sFileName
    $bSetIndent

    Returns

    object —

    XMLWriter object

    QueXMLCleanup()

    QueXMLCleanup( $string,  $allow)

    from export_structure_quexml.php

    Parameters

    $string
    $allow

    QueXMLCreateFree()

    QueXMLCreateFree( $f,  $len,  $lab)

    from export_structure_quexml.php

    Parameters

    $f
    $len
    $lab

    QueXMLFixedArray()

    QueXMLFixedArray( $array)

    from export_structure_quexml.php

    Parameters

    $array

    QueXMLSkipTo()

    QueXMLSkipTo(mixed $qid, mixed $value,  $cfieldname) : bool|string

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

    from export_structure_quexml.php

    Parameters

    mixed $qid
    mixed $value
    $cfieldname

    Returns

    bool|string —

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

    QueXMLCreateFixed()

    QueXMLCreateFixed( $qid,  $rotate,  $labels,  $scale,  $other,  $varname)

    from export_structure_quexml.php

    Parameters

    $qid
    $rotate
    $labels
    $scale
    $other
    $varname

    quexml_get_lengthth()

    quexml_get_lengthth( $qid,  $attribute,  $default,  $quexmllang)

    from export_structure_quexml.php

    Parameters

    $qid
    $attribute
    $default
    $quexmllang

    quexml_create_multi()

    quexml_create_multi( $question,  $qid,  $varname,  $scale_id,  $free,  $other)

    from export_structure_quexml.php

    Parameters

    $question
    $qid
    $varname
    $scale_id
    $free
    $other

    quexml_create_subQuestions()

    quexml_create_subQuestions( $question,  $qid,  $varname,  $use_answers)

    from export_structure_quexml.php

    Parameters

    $question
    $qid
    $varname
    $use_answers

    quexml_export()

    quexml_export( $surveyi,  $quexmllan)

    Export quexml survey.

    Parameters

    $surveyi
    $quexmllan

    concat()

    concat() : \concatenated

    From adodb

    Different SQL databases used different methods to combine strings together. This function provides a wrapper.

    param s variable number of string parameters

    Usage: $db->Concat($str1,$str2);

    Returns

    \concatenated —

    string

    group_export()

    group_export( $action,  $iSurveyID,  $gid)

    Parameters

    $action
    $iSurveyID
    $gid

    groupGetXMLStructure()

    groupGetXMLStructure( $xml,  $gid)

    Parameters

    $xml
    $gid

    questionExport()

    questionExport( $action,  $iSurveyID,  $gid,  $qid)

    Parameters

    $action
    $iSurveyID
    $gid
    $qid

    questionGetXMLStructure()

    questionGetXMLStructure( $xml,  $gid,  $qid)

    Parameters

    $xml
    $gid
    $qid

    tokensExport()

    tokensExport( $iSurveyID)

    Parameters

    $iSurveyID

    CPDBExport()

    CPDBExport( $data,  $filename)

    Parameters

    $data
    $filename

    getDateFormatData()

    getDateFormatData(mixed $iDateFormat, mixed $sLanguageCode)

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

    Parameters

    mixed $iDateFormat

    integer

    mixed $sLanguageCode

    string

    getLanguageData()

    getLanguageData( $bOrderByNative,  $sLanguageCode)

    Parameters

    $bOrderByNative
    $sLanguageCode

    getRadixPointData()

    getRadixPointData( $format)

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

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

    Parameters

    $format

    getPHPDateFromDateFormat()

    getPHPDateFromDateFormat(mixed $sDateformat)

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

    Parameters

    mixed $sDateformat

    string

    getJSDateFromDateFormat()

    getJSDateFromDateFormat(mixed $sDateformat)

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

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

    Parameters

    mixed $sDateformat <