\

Interfaces

IWriter
iPluginStorage
iPlugin
iQuestion

Classes

ClassFactory
SurveyRuntimeHelper
PluginSettingsHelper
Hash Library of array functions for manipulating and extracting data from arrays or 'sets' of data.
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
quotas Quotas Controller
Authentication Authentication Controller
conditionsaction Condition Controller
printablesurvey Printable Survey Controller
translate Translate Controller
remotecontrol Survey Common Action
emailtemplates emailtemplates
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
statistics Statistics Controller
surveypermission surveypermission
CheckIntegrity CheckIntegrity Controller
participantsaction Survey Common Action
export Export Action
tokens Tokens Controller
responses Responses Controller
Usergroups Usergroups
SurveyAdmin survey
templates templates
questions question
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
GridViewWidget
MenuWidget
CallbackColumn
SettingsWidget
BootstrapCode
BootstrapGenerator
JSONStorage JSONStorage.php
Bootstrap Bootstrap application component.
TbToggleAction TbToggleAction CAction Component
TbExtendedTooltipAction TbExtendedTooltipAction.php
TbSortableAction TbSortableAction CAction Component
TbButtonGroup Bootstrap button group widget.
TbDropdown Bootstrap dropdown menu.
TbColorPicker TbColorPicker widget class
TbBulkActions
TbPager Bootstrap pager.
TbCKEditor TbCKEditor.php
TbFormInputElement TbFormInputElement class file.
TbButton Bootstrap button widget.
TbAlert Bootstrap alert widget.
TbRedactorJS TbRedactorJs class
TbWizard Bootstrap Javascript tabs widget.
TbGoogleVisualizationChart TbGoogleVisualizationChart widget
TbEditableSaver EditableSaver class file.
TbScrollSpy Bootstrap scrollspy widget.
TbButtonColumn Bootstrap button column widget.
TbToggleButton TbToggleButton.php
TbEditableField EditableField class file.
TbEditableColumn
TbRelationalColumn TbRelationalColumn class
TbJsonPickerColumn TbJsonPickerColumn class
TbMarkdownEditorJS TbMarkdownEditorJs class
TbThumbnails Bootstrap thumbnails widget.
TbActiveForm Bootstrap active form widget.
TbJsonPager Bootstrap pager.
TbHighCharts TbHighCharts widget class
TbJEditableColumn Bootstrap grid data column.
TbModal Bootstrap modal widget.
TbFormButtonElement TbFormButtonElement class file.
TbNavbar Bootstrap navigation bar widget.
TbLabel Bootstrap label widget.
TbExtendedFilter
TbJsonCheckBoxColumn TbJsonCheckBoxColumn class Works in conjunction with TbJsonGridView. Renders HTML or returns JSON containing checkbox according to the request to the Grid.
TbForm
TbJsonGridColumn Bootstrap grid data column.
TbTimePicker TbTimePicker widget.
TbDataColumn Bootstrap grid data column.
TbJsonDataColumn Bootstrap grid data column.
TbSelect2 TbSelect2.php
TbDetailView Bootstrap Zii detail view.
TbCarousel Bootstrap carousel widget.
TbTabView Bootstrap Javascript tabs widget.
TbEditableDetailView
TbProgress Bootstrap progress bar widget.
TbDatePicker TbDatePicker widget class
TbTabs Bootstrap Javascript tabs widget.
TbExtendedTooltip TbExtendedTooltip class
TbInputHorizontal Bootstrap horizontal form input widget.
TbInputInline Bootstrap vertical form input widget.
TbInputSearch Bootstrap vertical form input widget.
TbInput Bootstrap input widget.
TbInputVertical Bootstrap vertical form input widget.
TbMenu Bootstrap menu.
TbGridView Bootstrap Zii grid view.
TbHtml5Editor TbHtml5Editor widget
TbCollapse Bootstrap collapse widget.
TbBaseMenu
TbBox TbBox widget class
TbDateRangePicker A simple implementation for date range picker for Twitter Bootstrap
TbJsonGridView Bootstrap Zii grid view.
TbToggleColumn
TbFileUpload
TbBadge Bootstrap badge widget.
TbJsonButtonColumn Bootstrap button column widget.
TbGroupGridView A Grid View that groups rows by any column(s)
TbTypeahead Bootstrap typeahead widget.
TbExtendedGridView TbExtendedGridView is an extended version of TbGridView.
TbOperation TbOperation class
TbSumOperation TbSumOperation class
TbCountOfTypeOperation TbCountOfTypeOperation class
TbPercentOfTypeOperation TbPercentOfTypeOperation class Renders a summary based on the percent count of specified types. For example, if a value has a type 'blue', this class will count the percentage number of times the value 'blue' has on that column.
TbPercentOfTypeGooglePieOperation TbPercentOfTypeGooglePieOperation class
TbPercentOfTypeEasyPieOperation TbPercentOfTypeEasyPieOperation class
TbHeroUnit Modest bootstrap hero unit widget.
TbListView Bootstrap Zii list view.
TbImageColumn
TbTotalSumColumn Bootstrap grid data column.
TbBreadcrumbs Bootstrap breadcrumb widget.
TbPickerColumn Bootstrap grid data column.
BootstrapFilter Filter to load Bootstrap on specific actions.
FlashMessage
LimeDebug
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
LimesurveyApi Class exposing a Limesurvey API to plugins.
PluginEventContent
PluginManager Factory for limesurvey plugin objects.
AuthPluginBase Base class for plugins.
DummyStorage
DbStorage
PluginBase Base class for plugins.
QuestionPluginBase Base class for plugins.
QuestionPluginAbstract Base class for plugins.
QuestionBase
PluginEvent
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
Limesurvey_lang
GTranslateException Exception class for GTranslated Exceptions
GTranslate
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
Participant This is the model class for table "{{participants}}".
Dynamic Dynamic model usable for multiple tables.
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
Answer
SurveyDynamic
Question
SurveyTimingDynamic
ParticipantAttribute
QuotaLanguageSetting
Permission
TokenDynamic
Quota
UserInGroup
InstallerConfigForm
SurveyURLParameter
Template
ParticipantShare This is the model class for table "{{participant_shares}}".
QuestionGroup
ExpressionError
Dynamic This class implements the basis for dynamic models.
SurveyLink
QuotaMember
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.
LSHttpRequest Description of HttpRequest
LSWebUser
ConsoleApplication
LSYii_Validators
LSYii_Controller
LSBootstrap Bootstrap application component.
LSYii_Application Implements global config
UserIdentity
Survey_Common_Action Survey Common Action
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.
STATAxmlWriter Contains functions and properties that are common to all writers.
ExportSTATAxml Base class for plugins.
Authdb Base class for plugins.
ExpressionManagerTest
WebTestCase The base class for functional test cases.
CTestCase
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

PRINT_TEMPLATE_DIR

PRINT_TEMPLATE_DIR

PRINT_TEMPLATE_URL

PRINT_TEMPLATE_URL

$full_constant

$full_constant

IMAGE_ . $type . _SIZE

IMAGE_ . $type . _SIZE

K_TCPDF_EXTERNAL_CONFIG

K_TCPDF_EXTERNAL_CONFIG

PDF_PAGE_FORMAT

PDF_PAGE_FORMAT

page format

PDF_PAGE_ORIENTATION

PDF_PAGE_ORIENTATION

page orientation (P=portrait, L=landscape)

PDF_CREATOR

PDF_CREATOR

document creator

PDF_AUTHOR

PDF_AUTHOR

document author

PDF_HEADER_TITLE

PDF_HEADER_TITLE

header title

PDF_HEADER_STRING

PDF_HEADER_STRING

header description string

PDF_HEADER_LOGO_WIDTH

PDF_HEADER_LOGO_WIDTH

header logo image width [mm]

PDF_UNIT

PDF_UNIT

document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]

PDF_MARGIN_HEADER

PDF_MARGIN_HEADER

header margin

PDF_MARGIN_TOP

PDF_MARGIN_TOP

top margin

PDF_MARGIN_BOTTOM

PDF_MARGIN_BOTTOM

bottom margin

PDF_MARGIN_LEFT

PDF_MARGIN_LEFT

left margin

PDF_MARGIN_RIGHT

PDF_MARGIN_RIGHT

right margin

PDF_FONT_NAME_MAIN

PDF_FONT_NAME_MAIN

default main font name

PDF_FONT_SIZE_MAIN

PDF_FONT_SIZE_MAIN

default main font size

PDF_FONT_NAME_DATA

PDF_FONT_NAME_DATA

default data font name

PDF_FONT_SIZE_DATA

PDF_FONT_SIZE_DATA

default data font size

PDF_FONT_MONOSPACED

PDF_FONT_MONOSPACED

default monospaced font name

PDF_IMAGE_SCALE_RATIO

PDF_IMAGE_SCALE_RATIO

ratio used to adjust the conversion of pixels to user units

HEAD_MAGNIFICATION

HEAD_MAGNIFICATION

magnification factor for titles

K_CELL_HEIGHT_RATIO

K_CELL_HEIGHT_RATIO

height of cell repect font height

K_TITLE_MAGNIFICATION

K_TITLE_MAGNIFICATION

title magnification respect main font size

K_SMALL_RATIO

K_SMALL_RATIO

reduction factor for small font

K_THAI_TOPCHARS

K_THAI_TOPCHARS

set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language

K_TCPDF_CALLS_IN_HTML

K_TCPDF_CALLS_IN_HTML

if true allows to call TCPDF methods using HTML syntax IMPORTANT: For security reason, disable this feature if you are printing user HTML content.

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

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

dirReport()

dirReport( $dir,  $write,  $clang)

Parameters

$dir
$write
$clang

rsdsl()

rsdsl( $mur)

Parameters

$mur

_showSpeaker()

_showSpeaker( $hinttext)

Parameters

$hinttext

setNoAnswerMode()

setNoAnswerMode( $thissurvey)

setNoAnswerMode

Parameters

$thissurvey

retrieveAnswers()

retrieveAnswers(mixed $ia) : mixed

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

Parameters

mixed $ia

Returns

mixed

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_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

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

Parameters

$ip

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

Parameters

$ia

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_multitext()

do_array_multitext( $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

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

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

submitfailed : used in em_manager_helper.php

Parameters

$errormsg

buildsurveysession()

buildsurveysession( $surveyid,  $preview)

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

$surveyid
$preview

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

checkQuota()

checkQuota(string $checkaction, string $surveyid) : array

checkQuota() returns quota information for the current survey

Parameters

string $checkaction
  • action the function must take after completing: enforce: Enforce the Quota action return: Return the updated quota array from getQuotaAnswers()
string $surveyid
  • Survey identification number

Returns

array —
  • nested array, Quotas->Members->Fields, includes quota status and which members 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, string $language)

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
string $language

getMove()

getMove()

getMove get move button clicked

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_paranoid_string()

sanitize_paranoid_string( $string,  $min,  $max)

Parameters

$string
$min
$max

sanitize_cquestions()

sanitize_cquestions( $string,  $min,  $max)

Parameters

$string
$min
$max

sanitize_email()

sanitize_email( $email)

Parameters

$email

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

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

doHtmlSaveAll()

doHtmlSaveAll( $move)

doHtmlSaveAll return HTML part of saveall button in survey

Parameters

$move

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 $string, string $escapemode)

Translation helper function.

Parameters

string $string
string $escapemode

eT()

eT( $string,  $escapemode)

Parameters

$string
$escapemode

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

getAdminThemeList()

getAdminThemeList()

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(mixed $surveyid)

getMaxGroupOrder($surveyid) queries the database for the maximum sortorder of a group and returns the next higher one.

Parameters

mixed $surveyid

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(mixed $oLanguage, string $mode,  $sNewlines) : array

    Returns the default email template texts as array

    Parameters

    mixed $oLanguage

    Required language translationb object

    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)

    Parameters

    $qid
    $oldgid
    $newgid

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

    getSIDGIDQIDAIDType()

    getSIDGIDQIDAIDType( $fieldcode)

    Parameters

    $fieldcode

    getExtendedAnswer()

    getExtendedAnswer(\type $iSurveyID, \type $sFieldCode, \type $sValue, object $oLanguage) : string

    Parameters

    \type $iSurveyID

    The Survey ID

    \type $sFieldCode

    Field code of the particular field

    \type $sValue

    The stored response value

    object $oLanguage

    Initialized limesurvey_lang object for the resulting response data

    Returns

    string

    validateEmailAddress()

    validateEmailAddress( $email)

    Parameters

    $email

    stripComments()

    stripComments( $comment,  $email,  $replace)

    Parameters

    $comment
    $email
    $replace

    validateTemplateDir()

    validateTemplateDir( $sTemplateName)

    Parameters

    $sTemplateName

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

    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

    questionAttributes()

    questionAttributes(mixed $returnByName)

    Returns array of question type chars with attributes

    Parameters

    mixed $returnByName

    If set to true the array will be by attribute name

    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

    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, \boolan $keepSpan, \boolan $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

    \boolan $keepSpan

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

    \boolan $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( $surveyid,  $selected)

    Parameters

    $surveyid
    $selected

    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

    removeBOM()

    removeBOM(string $str) : string

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

    Parameters

    string $str

    Returns

    string

    getUpdateInfo()

    getUpdateInfo()

    updateCheck()

    updateCheck() : Array

    This function updates the actual global variables if an update is available after using getUpdateInfo

    Returns

    Array —

    with update or error information

    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 —
    • Integer of matching entries in the result DB or 'N/A'

    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

    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->Fields

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

    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

    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( $str,  $max_length,  $position,  $ellipsis) : string

    Ellipsize String

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

    Parameters

    $str
    $max_length
    $position
    $ellipsis

    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

    dbExecuteAssoc()

    dbExecuteAssoc(\type $sql, \type $inputarr, \type $silent) : \CDbDataReader

    Parameters

    \type $sql
    \type $inputarr
    \type $silent

    Returns

    \CDbDataReader

    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

    createTable()

    createTable(mixed $sTableName, mixed $aColumns, mixed $sOptions)

    Creates a table using the YII DB Schema function but properly handles custom field types for the various DB types

    Parameters

    mixed $sTableName
    mixed $aColumns
    mixed $sOptions

    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_sumifop()

    exprmgr_sumifop(\<type> $args) : int

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

    Parameters

    \ $args

    Returns

    int

    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

    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_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(\<type> $pattern, \<type> $input) : \<type>

    Return true of $input matches the regular expression $pattern

    Parameters

    \ $pattern
    \ $input

    Returns

    \

    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)

    Returns true if all non-empty values are unique

    Parameters

    \type $args

    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.

    Parameters

    mixed $sDateformat

    string

    getDateFormatDataForQID()

    getDateFormatDataForQID(mixed $aQidAttributes, mixed $mThisSurvey)

    Get the date format details for a specific question.

    Parameters

    mixed $aQidAttributes

    array Question attributes

    mixed $mThisSurvey

    mixed Array of Survey attributes or surveyid

    getDateFormatForSID()

    getDateFormatForSID(mixed $surveyid, mixed $languagecode)

    Get the date format for a specified survey

    Parameters

    mixed $surveyid

    integer Survey id

    mixed $languagecode

    string Survey language code (optional)

    canShowDatePicker()

    canShowDatePicker(mixed $dateformatdetails, mixed $dateformats)

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

    Parameters

    mixed $dateformatdetails

    array Date format details for the question

    mixed $dateformats

    array Available date formats

    getLanguageCodefromLanguage()

    getLanguageCodefromLanguage( $languagetosearch)

    Parameters

    $languagetosearch

    getLanguageNameFromCode()

    getLanguageNameFromCode( $codetosearch,  $withnative,  $sTranslationLanguage)

    Parameters

    $codetosearch
    $withnative
    $sTranslationLanguage

    getLanguageRTL()

    getLanguageRTL( $sLanguageCode)

    Parameters

    $sLanguageCode

    getLanguageDetails()

    getLanguageDetails(string $codetosearch) : array

    Returns the locale settings for a certain language code

    Parameters

    string $codetosearch

    Returns

    array —

    Array with locale details

    getLanguageDataRestricted()

    getLanguageDataRestricted( $bOrderByNative,  $sLanguageCode)

    Parameters

    $bOrderByNative
    $sLanguageCode

    userSort()

    userSort( $a,  $b)

    Parameters

    $a
    $b

    userSortNative()

    userSortNative( $a,  $b)

    Parameters

    $a
    $b

    UTF8Strrev()

    UTF8Strrev(string $str, boolean $reverse_numbers) : string

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

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

    Parameters

    string $str
    boolean $reverse_numbers

    Returns

    string

    db_upgrade_all()

    db_upgrade_all( $iOldDBVersion)

    Parameters

    $iOldDBVersion

    upgradeCPDBAttributeDefaultNames173()

    upgradeCPDBAttributeDefaultNames173()

    upgradePermissions166()

    upgradePermissions166()

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

    upgradeSurveys156()

    upgradeSurveys156()

    upgradeTokens148()

    upgradeTokens148()

    upgradeQuestionAttributes148()

    upgradeQuestionAttributes148()

    upgradeSurveyTimings146()

    upgradeSurveyTimings146()

    upgradeTokens145()

    upgradeTokens145()

    upgradeSurveys145()

    upgradeSurveys145()

    upgradeSurveyPermissions145()

    upgradeSurveyPermissions145()

    upgradeTables143()

    upgradeTables143()

    upgradeQuestionAttributes142()

    upgradeQuestionAttributes142()

    upgradeSurveyTables139()

    upgradeSurveyTables139()

    upgradeTokenTables134()

    upgradeTokenTables134()

    upgradeTokens128()

    upgradeTokens128()

    fixMySQLCollations()

    fixMySQLCollations()

    upgradeSurveyTables126()

    upgradeSurveyTables126()

    upgradeTokenTables126()

    upgradeTokenTables126()

    alterLanguageCode()

    alterLanguageCode( $sOldLanguageCode,  $sNewLanguageCode)

    Parameters

    $sOldLanguageCode
    $sNewLanguageCode

    addPrimaryKey()

    addPrimaryKey( $sTablename,  $aColumns)

    Parameters

    $sTablename
    $aColumns

    dropPrimaryKey()

    dropPrimaryKey( $sTablename)

    Parameters

    $sTablename

    fixLanguageConsistencyAllSurveys()

    fixLanguageConsistencyAllSurveys()

    alterColumn()

    alterColumn( $sTable,  $sColumn,  $sFieldType,  $bAllowNull,  $sDefault)

    Parameters

    $sTable
    $sColumn
    $sFieldType
    $bAllowNull
    $sDefault

    dropColumn()

    dropColumn( $sTableName,  $sColumnName)

    Parameters

    $sTableName
    $sColumnName

    addColumn()

    addColumn( $sTableName,  $sColumn,  $sType)

    Parameters

    $sTableName
    $sColumn
    $sType

    setTransactionBookmark()

    setTransactionBookmark( $sBookmark)

    Parameters

    $sBookmark

    rollBackToTransactionBookmark()

    rollBackToTransactionBookmark( $sBookmark)

    Parameters

    $sBookmark

    dropDefaultValueMSSQL()

    dropDefaultValueMSSQL( $fieldname,  $tablename)

    Parameters

    $fieldname
    $tablename

    setsDBDriverName()

    setsDBDriverName()

    Returns the name of the DB Driver - used for other functions that make db specific calls

    setVarchar()

    setVarchar(mixed $sDBDriverName)

    Special customisation because Yii is limited in its ability to handle varchar fields of lenghts other than 255 in a cross-db compatible way. see http://www.yiiframework.com/forum/index.php/topic/32289-cross-db-compatible-varchar-field-length-definitions/ and http://github.com/yiisoft/yii/issues/765

    Note that it sets values for the config files for use later, and does not return any values. Access the set values using Yii::app()->getConfig('varchar') or Yii::app()->getConfigu('autoincrement');

    Parameters

    mixed $sDBDriverName

    The name of the db driver being used. If the parameter is forgotten, the function is capable of retrieving it itself.

    replaceTemplateJS()

    replaceTemplateJS()

    upgradeSurveyTables164()

    upgradeSurveyTables164() : void

    Make sure all active tables have the right sized token field

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

    CheckForDBUpgrades()

    CheckForDBUpgrades( $subaction)

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

    Parameters

    $subaction

    ShowDBUpgradeNotice()

    ShowDBUpgradeNotice()

    getDBConnectionStringProperty()

    getDBConnectionStringProperty( $sProperty)

    Parameters

    $sProperty

    outputDatabase()

    outputDatabase(string $sDbName,  $bEchoOutput,  $sFileName)

    Outputs a full dump of the current LimeSurvey database

    Parameters

    string $sDbName

    Database Name

    $bEchoOutput
    $sFileName

    _outputDBDescription()

    _outputDBDescription( $sDbName,  $bAllowExportAllDb)

    Parameters

    $sDbName
    $bAllowExportAllDb

    _outputDBData()

    _outputDBData( $bAllowExportAllDb,  $bEchoOutput,  $sFileName,  $oFile)

    Parameters

    $bAllowExportAllDb
    $bEchoOutput
    $sFileName
    $oFile

    _outputTableDescription()

    _outputTableDescription( $sTableName)

    Outputs the table structure in sql format

    Parameters

    $sTableName

    _outputTableData()

    _outputTableData( $sTableName,  $oTableData,  $bEchoOutput,  $sFileName,  $oFile)

    Outputs the table data in sql format

    Parameters

    $sTableName
    $oTableData
    $bEchoOutput
    $sFileName
    $oFile

    _outputRecords()

    _outputRecords( $sTableName,  $aFieldNames,  $aRecords)

    Parameters

    $sTableName
    $aFieldNames
    $aRecords

    _countNumberOfEntries()

    _countNumberOfEntries( $sTableName)

    Parameters

    $sTableName

    _getMaxNbRecords()

    _getMaxNbRecords()

    _getDbName()

    _getDbName()

    Get the database name

    createTokenTable()

    createTokenTable(mixed $iSurveyID, mixed $aAttributeFields) : False

    Creates the basic token table for a survey

    Parameters

    mixed $iSurveyID
    mixed $aAttributeFields

    Returns

    False —

    if failed , else DB object

    emailTokens()

    emailTokens(mixed $iSurveyID, array $aResultTokens, string $sType) : array

    Sends email to tokens - invitation and reminders

    Parameters

    mixed $iSurveyID
    array $aResultTokens
    string $sType

    type of notification invite|remind

    Returns

    array —

    of results

    doreplacement()

    doreplacement( $file,  $data)

    Parameters

    $file
    $data

    getListOfFiles()

    getListOfFiles( $wh)

    Parameters

    $wh

    textarea_encode()

    textarea_encode( $html_code)

    Parameters

    $html_code

    filetext()

    filetext( $templatename,  $templatefile,  $templates)

    Parameters

    $templatename
    $templatefile
    $templates

    mkdir_p()

    mkdir_p( $target)

    Parameters

    $target

    makeoptions()

    makeoptions( $array,  $value,  $text,  $selectedvalue)

    Parameters

    $array
    $value
    $text
    $selectedvalue

    templateoptions()

    templateoptions( $optionarray,  $selectedvalue)

    Parameters

    $optionarray
    $selectedvalue

    multiarray_search()

    multiarray_search( $arrayVet,  $campo,  $valor)

    Parameters

    $arrayVet
    $campo
    $valor

    recursive_in_array()

    recursive_in_array( $needle,  $haystack)

    Parameters

    $needle
    $haystack

    is_template_editable()

    is_template_editable(mixed <