To execute this command :
php application/commands/console.php XmlTranslation index
php application/commands/console.php XmlTranslation generateTranslationFiles
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
mailSenderToFrom : Set the smtp user to sender and from
Needed for some smtp server, see mantis issue #10529 <https://bugs.limesurvey.org/view.php?id=10529>
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for MultipleChoiceWithComments Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
RenderClass for Boilerplate Question
* The ia Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
Creates the breadcrumbs for the topbar
If the text legth of the full breadcrumbs are higher than the configured threshold,
some elements will be replaced with an ellipsis
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.
abstract Class QuestionTypeRoot
The aFieldArray Array contains the following
0 => string qid
1 => string sgqa
2 => string questioncode
3 => string question
4 => string type
5 => string gid
6 => string mandatory,
7 => string conditionsexist,
8 => string usedinconditions
0 => string used in group.php for question count
10 => string new group id for question in randomization group (GroupbyGroup Mode)
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
noMailToExample : just don't send email to example.org or example.com
http://example.org/ is a great tool for demonstration and test, but sending an email to user@example.org: you receive 4 hour after a notification
This plugin just disable sending email to this website, then you can use it when testing syste.
NB: Deleting this class will break plugin API, since
plugins then would have to extend PluginBase in the
namespace instead of this class. This is especially
a problem for plugins that should work on both
2.73 and 3.x, so please don't delete this class.
Low-level function that returns the getdate() array. We have a special
$fast flag, which if set to true, will return fewer array values,
and is much faster as it does not calculate dow, etc.
Returns a user list. If 'usercontrolSameGroupPolicy' is set and set to true, only users which are in the same
group as me (--> logged in user) will be returned. Superadmin always gets the full list of users.
Compares two elements from an array (passed by the usort function)
and returns -1, 0 or 1 depending on the result of the comparison of
the sort order of the group_order and question_order field
Used by :
- remotecontrol_handle->export_statistics with merging group and question attributes (all in same array)
- checkQuestions() in activate_helper function with ?
This functions generates a a summary containing the SGQA for questions of a survey, enriched with options per question
It can be used for the generation of statistics. Derived from StatisticsUserController
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
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
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.
Creates an array with details on a particular response for display purposes
Used in Print answers, Detailed response view and Detailed admin notification email
Must use ls_json_encode to json_encode content, otherwise LimeExpressionManager will think that the associative arrays are expressions and try to parse them.
This function tries to returns the 'real' IP address under all configurations
Do not rely security-wise on the detected IP address as except for REMOTE_ADDR all fields could be manipulated by the web client
This function returns the real IP address and should mainly be used for security sensitive purposes
If you want to use the IP address for language detection or similar, use getIPAddress() instead
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
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
Return a sql statement for finding LIKE named tables
Be aware that you have to escape underscore chars by using a backslash
otherwise you might get table names returned you don't want
Implementation of listifop( $cmpAttr, $op, $value, $retAttr, $glue, $sgqa1, ..., sgqaN )
Return a list of retAttr from sgqa1...sgqaN which pass the critiera (cmpAttr op value)
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.
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
FieldArray contains all necessary information regarding the questions
This function is needed to update it in case the survey is switched to another 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
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.
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
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
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
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).
This function removes the old CPDB fields in token tables
replaces them with standard attribute fields
and records the mapping information in the attributedescription field in the survey table instead
Converts global permissions from users table to the new permission system,
and converts template permissions from template_rights to new permission table
Set a transaction bookmark - this is critical for Postgres because a transaction in Postgres cannot be continued unless you roll back to the transaction bookmark first
This function fixes Postgres sequences for one/all tables in a database
This is necessary if a table is renamed. If tablename is given then only that table is fixed
Remove all zero-dates in $tableName by checking datetime columns from $tableSchema
Zero-dates are replaced with null where possible; otherwise 1970-01-01
ADOdb Date Library, part of the ADOdb abstraction library
Download: http://phplens.com/phpeverywhere/
publicmixedADODB_DATE_VERSION
= 0.33
PHP native date functions use integer timestamps for computations.
Because of this, dates are restricted to the years 1901-2038 on Unix
and 1970-2038 on Windows due to integer overflow for dates beyond
those years. This library overcomes these limitations by replacing the
native function's signed integers (normally 32-bits) with PHP floating
point numbers (normally 64-bits).
Dates from 100 A.D. to 3000 A.D. and later
have been tested. The minimum is 100 A.D. as <100 will invoke the
2 => 4 digit year conversion. The maximum is billions of years in the
future, but this is a theoretical limit as the computation of that year
would take too long with the current implementation of adodb_mktime().
This library replaces native functions as follows:
getdate() with adodb_getdate()
date() with adodb_date()
gmdate() with adodb_gmdate()
mktime() with adodb_mktime()
gmmktime() with adodb_gmmktime()
strftime() with adodb_strftime()
strftime() with adodb_gmstrftime()
The parameters are identical, except that adodb_date() accepts a subset
of date()'s field formats. Mktime() will convert from local time to GMT,
and date() will convert from GMT to local time, but daylight savings is
not handled currently.
This library is independant of the rest of ADOdb, and can be used
as standalone code.
PERFORMANCE
For high speed, this library uses the native date functions where
possible, and only switches to PHP code when the dates fall outside
the 32-bit signed integer range.
GREGORIAN CORRECTION
Pope Gregory shortened October of A.D. 1582 by ten days. Thursday,
October 4, 1582 (Julian) was followed immediately by Friday, October 15,
1582 (Gregorian).
(c) 2003-2005 John Lim and released under BSD-style license except for code by
jackbbs, which includes adodb_mktime, adodb_get_gmt_diff, adodb_is_leap_year
and originally found at http://www.php.net/manual/en/function.mktime.php
Returns an array containing date information, as getdate(), but supports
dates greater than 1901 to 2038. The local date/time format is derived from a
heuristic the first time adodb_getdate is called.
FUNCTION adodb_date($fmt, $timestamp = false)
Convert a timestamp to a formatted local date. If $timestamp is not defined, the
current timestamp is used. Unlike the function date(), it supports dates
outside the 1901 to 2038 range.
The format fields that adodb_date supports:
a - "am" or "pm"
A - "AM" or "PM"
d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"
D - day of the week, textual, 3 letters; e.g. "Fri"
F - month, textual, long; e.g. "January"
g - hour, 12-hour format without leading zeros; i.e. "1" to "12"
G - hour, 24-hour format without leading zeros; i.e. "0" to "23"
h - hour, 12-hour format; i.e. "01" to "12"
H - hour, 24-hour format; i.e. "00" to "23"
i - minutes; i.e. "00" to "59"
j - day of the month without leading zeros; i.e. "1" to "31"
l (lowercase 'L') - day of the week, textual, long; e.g. "Friday"
L - boolean for whether it is a leap year; i.e. "0" or "1"
m - month; i.e. "01" to "12"
M - month, textual, 3 letters; e.g. "Jan"
n - month without leading zeros; i.e. "1" to "12"
O - Difference to Greenwich time in hours; e.g. "+0200"
Q - Quarter, as in 1, 2, 3, 4
r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200"
s - seconds; i.e. "00" to "59"
S - English ordinal suffix for the day of the month, 2 characters;
i.e. "st", "nd", "rd" or "th"
t - number of days in the given month; i.e. "28" to "31"
T - Timezone setting of this machine; e.g. "EST" or "MDT"
U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
Y - year, 4 digits; e.g. "1999"
y - year, 2 digits; e.g. "99"
z - day of the year; i.e. "0" to "365"
Z - timezone offset in seconds (i.e. "-43200" to "43200").
The offset for timezones west of UTC is always negative,
and for those east of UTC is always positive.
Unsupported:
B - Swatch Internet time
I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
W - ISO-8601 week number of year, weeks starting on Monday
FUNCTION adodb_date2($fmt, $isoDateString = false)
Same as adodb_date, but 2nd parameter accepts iso date, eg.
adodb_date2('d-M-Y H:i','2003-12-25 13:01:34');
FUNCTION adodb_gmdate($fmt, $timestamp = false)
Convert a timestamp to a formatted GMT date. If $timestamp is not defined, the
current timestamp is used. Unlike the function date(), it supports dates
outside the 1901 to 2038 range.
FUNCTION adodb_mktime($hr, $min, $sec[, $month, $day, $year])
Converts a local date to a unix timestamp. Unlike the function mktime(), it supports
dates outside the 1901 to 2038 range. All parameters are optional.
FUNCTION adodb_gmmktime($hr, $min, $sec [, $month, $day, $year])
Converts a gmt date to a unix timestamp. Unlike the function gmmktime(), it supports
dates outside the 1901 to 2038 range. Differs from gmmktime() in that all parameters
are currently compulsory.
FUNCTION adodb_gmstrftime($fmt, $timestamp = false)
Convert a timestamp to a formatted GMT date.
FUNCTION adodb_strftime($fmt, $timestamp = false)
Convert a timestamp to a formatted local date. Internally converts $fmt into
adodb_date format, then echo result.
For best results, you can define the local date format yourself. Define a global
variable $ADODB_DATE_LOCALE which is an array, 1st element is date format using
adodb_date syntax, and 2nd element is the time format, also in adodb_date syntax.
eg. $ADODB_DATE_LOCALE = array('d/m/Y','H:i:s');
Supported format codes:
%a - abbreviated weekday name according to the current locale
%A - full weekday name according to the current locale
%b - abbreviated month name according to the current locale
%B - full month name according to the current locale
%c - preferred date and time representation for the current locale
%d - day of the month as a decimal number (range 01 to 31)
%D - same as %m/%d/%y
%e - day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')
%h - same as %b
%H - hour as a decimal number using a 24-hour clock (range 00 to 23)
%I - hour as a decimal number using a 12-hour clock (range 01 to 12)
%m - month as a decimal number (range 01 to 12)
%M - minute as a decimal number
%n - newline character
%p - either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
%r - time in a.m. and p.m. notation
%R - time in 24 hour notation
%S - second as a decimal number
%t - tab character
%T - current time, equal to %H:%M:%S
%x - preferred date representation for the current locale without the time
%X - preferred time representation for the current locale without the date
%y - year as a decimal number without a century (range 00 to 99)
%Y - year as a decimal number including the century
%Z - time zone or name or abbreviation
%% - a literal `%' character
Unsupported codes:
%C - century number (the year divided by 100 and truncated to an integer, range 00 to 99)
%g - like %G, but without the century.
%G - The 4-digit year corresponding to the ISO week number (see %V).
This has the same format and value as %Y, except that if the ISO week number belongs
to the previous or next year, that year is used instead.
%j - day of the year as a decimal number (range 001 to 366)
%u - weekday as a decimal number [1,7], with 1 representing Monday
%U - week number of the current year as a decimal number, starting
with the first Sunday as the first day of the first week
%V - The ISO 8601:1988 week number of the current year as a decimal number,
range 01 to 53, where week 1 is the first week that has at least 4 days in the
current year, and with Monday as the first day of the week. (Use %G or %g for
the year component that corresponds to the week number for the specified timestamp.)
%w - day of the week as a decimal, Sunday being 0
%W - week number of the current year as a decimal number, starting with the
first Monday as the first day of the first week
Useful url for generating test timestamps:
http://www.4webhelp.net/us/timestamp.php
Possible future optimizations include
a. Using an algorithm similar to Plauger's in "The Standard C Library"
(page 428, xttotm.c _Ttotm() function). Plauger's algorithm will not
work outside 32-bit signed range, so i decided not to implement it.
b. Implement daylight savings, which looks awfully complicated, see
http://webexhibits.org/daylightsaving/
CHANGELOG
11 Feb 2008 0.33
Bug in 0.32 fix for hour handling. Fixed.
1 Feb 2008 0.32
Now adodb_mktime(0,0,0,12+$m,20,2040) works properly.
10 Jan 2008 0.31
Now adodb_mktime(0,0,0,24,1,2037) works correctly.
15 July 2007 0.30
Added PHP 5.2.0 compatability fixes.
gmtime behaviour for 1970 has changed. We use the actual date if it is between 1970 to 2038 to get the
timezone, otherwise we use the current year as the baseline to retrieve the timezone.
Also the timezone's in php 5.2.* support historical data better, eg. if timezone today was +8, but
in 1970 it was +7:30, then php 5.2 return +7:30, while this library will use +8.
19 March 2006 0.24
Changed strftime() locale detection, because some locales prepend the day of week to the date when %c is used.
10 Feb 2006 0.23
PHP5 compat: when we detect PHP5, the RFC2822 format for gmt 0000hrs is changed from -0000 to +0000.
In PHP4, we will still use -0000 for 100% compat with PHP4.
08 Sept 2005 0.22
In adodb_date2(), $is_gmt not supported properly. Fixed.
18 July 2005 0.21
In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat.
Added support for negative months in adodb_mktime().
24 Feb 2005 0.20
Added limited strftime/gmstrftime support. x10 improvement in performance of adodb_date().
21 Dec 2004 0.17
In adodb_getdate(), the timestamp was accidentally converted to gmt when $is_gmt is false.
Also adodb_mktime(0,0,0) did not work properly. Both fixed thx Mauro.
17 Nov 2004 0.16
Removed intval typecast in adodb_mktime() for secs, allowing:
adodb_mktime(0,0,0 + 2236672153,1,1,1934);
Suggested by Ryan.
18 July 2004 0.15
All params in adodb_mktime were formerly compulsory. Now only the hour, min, secs is compulsory.
This brings it more in line with mktime (still not identical).
23 June 2004 0.14
Allow you to define your own daylights savings function, adodb_daylight_sv.
If the function is defined (somewhere in an include), then you can correct for daylights savings.
In this example, we apply daylights savings in June or July, adding one hour. This is extremely
unrealistic as it does not take into account time-zone, geographic location, current year.
function adodb_daylight_sv(&$arr, $is_gmt)
{
if ($is_gmt) return;
$m = $arr['mon'];
if ($m == 6 || $m == 7) $arr['hours'] += 1;
}
This is only called by adodb_date() and not by adodb_mktime().
The format of $arr is
Array (
[seconds] => 0
[minutes] => 0
[hours] => 0
[mday] => 1 # day of month, eg 1st day of the month
[mon] => 2 # month (eg. Feb)
[year] => 2102
[yday] => 31 # days in current year
[leap] => # true if leap year
[ndays] => 28 # no of days in current month
)
28 Apr 2004 0.13
Fixed adodb_date to properly support $is_gmt. Thx to Dimitar Angelov.
20 Mar 2004 0.12
Fixed month calculation error in adodb_date. 2102-June-01 appeared as 2102-May-32.
26 Oct 2003 0.11
Because of daylight savings problems (some systems apply daylight savings to
January!!!), changed adodb_get_gmt_diff() to ignore daylight savings.
9 Aug 2003 0.10
Fixed bug with dates after 2038.
See http://phplens.com/lens/lensforum/msgs.php?id=6980
1 July 2003 0.09
Added support for Q (Quarter).
Added adodb_date2(), which accepts ISO date in 2nd param
3 March 2003 0.08
Added support for 'S' adodb_date() format char. Added constant ADODB_ALLOW_NEGATIVE_TS
if you want PHP to handle negative timestamps between 1901 to 1969.
27 Feb 2003 0.07
All negative numbers handled by adodb now because of RH 7.3+ problems.
See http://bugs.php.net/bug.php?id=20048&edit=2
4 Feb 2003 0.06
Fixed a typo, 1852 changed to 1582! This means that pre-1852 dates
are now correctly handled.
29 Jan 2003 0.05
Leap year checking differs under Julian calendar (pre 1582). Also
leap year code optimized by checking for most common case first.
We also handle month overflow correctly in mktime (eg month set to 13).
Day overflow for less than one month's days is supported.
28 Jan 2003 0.04
Gregorian correction handled. In PHP5, we might throw an error if
mktime uses invalid dates around 5-14 Oct 1582. Released with ADOdb 3.10.
Added limbo 5-14 Oct 1582 check, when we set to 15 Oct 1582.
27 Jan 2003 0.03
Fixed some more month problems due to gmt issues. Added constant ADODB_DATE_VERSION.
Fixed calculation of days since start of year for <1970.
27 Jan 2003 0.02
Changed _adodb_getdate() to inline leap year checking for better performance.
Fixed problem with time-zones west of GMT +0000.
PrepareEditorScript function must be called first.
If getting a JS error about missing CKEditor files, please review if PrepareEditorScript was called.
Import survey from an TSV file template that does not require assigning of GID or QID values.
TSVImportSurvey(string $sFullFilePath) : string
If ID's are presented, they would be respected and used
Multilanguage imports are supported
Original function is changed to allow generating of XML instead of creating database objects directly
Generated XML code is send to existing lss import function
ID of the survey
@param mixed $type Type of the chart to be created - null produces bar chart, any other value produces pie chart
@param array $lbl An array containing the labels for the chart items
@param mixed $gdata An array containing the percentages for the chart items
@param mixed $grawdata An array containing the raw count for the chart items
@param pCache $cache An object containing [Hashkey] and [CacheFolder]
@param mixed $sLanguageCode Language Code
@param string $sQuestionType The question type
@return false|string
Builds the list of addon SQL select statements
that builds the query result set
buildSelects(mixed $allfields, int $surveyid, mixed $language) : mixed
@param array $allfields An array containing the names of the fields/answers we want to display in the statistics summary
Parameters
$allfields
: mixed
$surveyid
: int
@param string $language The language to use
@return array $selects array of individual select statements that can be added/appended to
the 'where' portion of a SQL statement to restrict the result set
ie: array("FIELDNAME='Y'", "FIELDNAME2='Hello'");
Low-level function that returns the getdate() array. We have a special
$fast flag, which if set to true, will return fewer array values,
and is much faster as it does not calculate dow, etc.
the number of answers to a question, usually supplied by $anscount
$wrapperclass
: string
= ""
a global class for the wrapper
$itemclass
: string
= ""
a class for the item
Tags
deprecated
Don't use anymore. Only usage left in printabel survey where it needs to be replaced
It returns an array with the following items:
$wrapper['whole-start'] = Opening wrapper for the whole list
$wrapper['whole-end'] = closing wrapper for the whole list
$wrapper['col-devide'] = normal column devider
$wrapper['col-devide-last'] = the last column devider (to allow
for different styling of the last
column
$wrapper['item-start'] = opening wrapper tag for individual
option
$wrapper['item-start-other'] = opening wrapper tag for other
option
$wrapper['item-start-noanswer'] = opening wrapper tag for no answer
option
$wrapper['item-end'] = closing wrapper tag for individual
option
$wrapper['maxrows'] = maximum number of rows in each
column
$wrapper['cols'] = Number of columns to be inserted
(and checked against)
Columns are a problem.
Really there is no perfect solution to columns at the moment.
Using Tables is problematic semanticly.
Using inline or float to create columns, causes the answers
flows horizontally, not vertically which is not ideal visually.
Using CSS3 columns is also a problem because of browser support
and also because if you have answeres split across two or more
lines, and those answeres happen to fall at the bottom of a
column, the answer might be split across columns as well as
lines.
Using nested unordered list with the first level of <LI>s
floated is the same as using tables and so is bad semantically
for the same reason tables are bad.
Breaking the unordered lists into consecutive floated unordered
lists is not great semantically but probably not as bad as
using tables.
Because I haven't been able to decide which option is the least
bad, I have handed over that responsibility to the admin who sets
LimeSurvey up on their server.
There are four options:
'css' using one of the various CSS only methods for
rendering columns.
(Check the CSS file for your chosen template to see
how columns are defined.)
'ul' using multiple floated unordered lists. (DEFAULT)
'table' using conventional tables based layout.
NULL blocks the use of columns
'ul' is the default because it's the best possible compromise
between semantic markup and visual layout.
Return values
array<string|int, mixed>
—
with all the various opening and closing tags to generate a set of columns.
Returns a user list. If 'usercontrolSameGroupPolicy' is set and set to true, only users which are in the same
group as me (--> logged in user) will be returned. Superadmin always gets the full list of users.
Compares two elements from an array (passed by the usort function)
and returns -1, 0 or 1 depending on the result of the comparison of
the sort order of the group_order and question_order field
Used by :
- remotecontrol_handle->export_statistics with merging group and question attributes (all in same array)
- checkQuestions() in activate_helper function with ?
groupOrderThenQuestionOrder(mixed $a, mixed $b) : int
Parameters
$a
: mixed
$b
: mixed
Return values
int
fixMovedQuestionConditions()
fixMovedQuestionConditions(int $qid, mixed $oldgid, int $newgid[, int $iSurveyID = null ]) : mixed
Parameters
$qid
: int
$oldgid
: mixed
$newgid
: int
$iSurveyID
: int
= null
returnGlobal()
This function returns POST/REQUEST vars, for some vars like SID and others they are also sanitized
TODO: extends Yii:getParam
: use LimeMailer::validateAddresses($aEmailAddressList);
returns
array
Return values
string
—
List with valid email addresses - invalid email addresses are filtered - false if none of the email addresses are valid
createCompleteSGQA()
This functions generates a a summary containing the SGQA for questions of a survey, enriched with options per question
It can be used for the generation of statistics. Derived from StatisticsUserController
string Optional: The language if the particualr attributes is localizable
Tags
author:
lemeur
Return values
string
questionTitleSort()
questionTitleSort(mixed $a, mixed $b) : mixed
Parameters
$a
: mixed
$b
: mixed
HTMLEscape()
make a string safe to include in an HTML 'value' attribute.
HTMLEscape(mixed $str) : mixed
Parameters
$str
: mixed
Tags
deprecated
If you need this you are doing something wrong. Use CHTML functions instead.
stripCtrlChars()
This function strips UTF-8 control characters from strings, except tabs, CR and LF
- it is intended to be used before any response data is saved to the response table
stripCtrlChars(mixed $sValue) : string
Parameters
$sValue
: mixed
A string to be sanitized
Return values
string
—
A sanitized string, otherwise the unmodified original variable
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
This function returns the complete URL path to a given template name
getTemplateURL(mixed $sTemplateName) : string
Parameters
$sTemplateName
: mixed
Return values
string
getSubQuestions()
Return an array of subquestions for a given sid/qid
getSubQuestions(int $sid, int $qid, string $sLanguage) : array<string|int, mixed>
Parameters
$sid
: int
$qid
: int
$sLanguage
: string
Language of the subquestion text
Return values
array<string|int, mixed>
getXMLWriter()
Wrapper function to retrieve an xmlwriter object and do error handling if it is not compiled
into PHP
getXMLWriter() : mixed
SSLRedirect()
SSLRedirect() generates a redirect URL for the appropriate SSL mode then applies it.
SSLRedirect(string $enforceSSLMode) : mixed
(Was redirect() before CodeIgniter port.)
Parameters
$enforceSSLMode
: string
string 's' or '' (empty).
enforceSSLMode()
enforceSSLMode() $force_ssl is on or off, it checks if the current
request is to HTTPS (or not). If $force_ssl is on, and the
request is not to HTTPS, it redirects the request to the HTTPS
version of the URL, if the request is to HTTPS, it rewrites all
the URL variables so they also point to HTTPS.
enforceSSLMode() : mixed
getFullResponseTable()
Creates an array with details on a particular response for display purposes
Used in Print answers, Detailed response view and Detailed admin notification email
(optional) get only the dependencies applying to the group with gid depgid
$targgid
: string
= "all"
(optional) get only the dependencies for groups dependents on group targgid
$indexby
: string
= "by-depgid"
(optional) "by-depgid" for result indexed with $res[$depgid][$targgid]
"by-targgid" for result indexed with $res[$targgid][$depgid]
Return values
array<string|int, mixed>
—
returns an array describing the conditions or NULL if no dependecy is found
Example outupt assumin $index-by="by-depgid":
Array
(
[125] => Array // Group Id 125 is dependent on
(
[123] => Array // Group Id 123
(
[depgpname] => G3 // GID-125 has name G3
[targetgpname] => G1 // GID-123 has name G1
[conditions] => Array
(
[189] => Array // Because Question Id 189
(
[0] => 9 // Have condition 9 set
[1] => 10 // and condition 10 set
[2] => 14 // and condition 14 set
)
)
)
[124] => Array // GID 125 is also dependent on GID 124
(
[depgpname] => G3
[targetgpname] => G2
[conditions] => Array
(
[189] => Array // Because Question Id 189 have conditions set
(
[0] => 11
)
[215] => Array // And because Question Id 215 have conditions set
(
[0] => 12
)
)
)
)
)
Usage example:
Get all group dependencies for SID $sid indexed by depgid:
$result=getGroupDepsForConditions($sid);
Get all group dependencies for GID $gid in survey $sid indexed by depgid:
$result=getGroupDepsForConditions($sid,$gid);
Get all group dependents on group $gid in survey $sid indexed by targgid:
$result=getGroupDepsForConditions($sid,"all",$gid,"by-targgid");
getQuestDepsForConditions()
getQuestDepsForConditions() get Dependencies between groups caused by conditions
(optional) only search dependecies inside the Group Id $gid
$depqid
: string
= "all"
(optional) get only the dependencies applying to the question with qid depqid
$targqid
: string
= "all"
(optional) get only the dependencies for questions dependents on question Id targqid
$indexby
: string
= "by-depqid"
(optional) "by-depqid" for result indexed with $res[$depqid][$targqid]
"by-targqid" for result indexed with $res[$targqid][$depqid]
$searchscope
: mixed
= "samegroup"
Return values
array<string|int, mixed>
—
returns an array describing the conditions or NULL if no dependecy is found
Example outupt assumin $index-by="by-depqid":
Array
(
[184] => Array // Question Id 184
(
[183] => Array // Depends on Question Id 183
(
[0] => 5 // Because of condition Id 5
)
)
)
Usage example:
Get all questions dependencies for Survey $sid and group $gid indexed by depqid:
$result=getQuestDepsForConditions($sid,$gid);
Get all questions dependencies for question $qid in survey/group $sid/$gid indexed by depqid:
$result=getGroupDepsForConditions($sid,$gid,$qid);
Get all questions dependents on question $qid in survey/group $sid/$gid indexed by targqid:
$result=getGroupDepsForConditions($sid,$gid,"all",$qid,"by-targgid");
Assumes that the input text (file or string) consists of
a number of SQL statements ENDING WITH SEMICOLONS. The
semicolons MUST be the last character in a line.
Lines that are blank or that start with "#" or "--" (postgres) are ignored.
Only tested with mysql dump files (mysqldump -p -d limesurvey)
Function kindly borrowed by Moodle
Parameters
$sqlfile
: string
= ''
The path where a file with sql commands can be found on the server.
$sqlstring
: string
= ''
If no path is supplied then a string with semicolon delimited sql
commands can be supplied in this argument.
Return values
bool
—
Returns true if database was modified successfully.
getLabelSets()
Returns labelsets for given language(s), or for all if null
This function returns the header for the printable survey
getPrintableHeader() : string
Return values
string
getFooter()
This function returns the Footer as result string
If you want to echo the Footer use doFooter()!
getFooter() : string
Return values
string
doFooter()
doFooter() : mixed
fixSubquestions()
This function fixes the group ID and type on all subquestions,
or removes the subquestions if the parent question's type doesn't
allow them.
fixSubquestions() : mixed
Optimized for minimum memory usage even on huge databases
ls_json_encode()
Must use ls_json_encode to json_encode content, otherwise LimeExpressionManager will think that the associative arrays are expressions and try to parse them.
ls_json_encode(mixed $content) : mixed
Parameters
$content
: mixed
json_decode_ls()
Decode a json string, sometimes needs stripslashes
json_decode_ls(string $jsonString) : mixed
Parameters
$jsonString
: string
aEncodingsArray()
Return accepted codingsArray for importing files
aEncodingsArray() : array<string|int, mixed>
Used in vvimport
TODO : use in token and
Return values
array<string|int, mixed>
ellipsize()
Ellipsize String
ellipsize(string $sString, int $iMaxLength[, int $fPosition = 1 ][, string $sEllipsis = '…' ]) : string
This public static function will strip tags from a string, split it at its max_length and ellipsize
Parameters
$sString
: string
string to ellipsize
$iMaxLength
: int
max length of string
$fPosition
: int
= 1
int (1|0) or float, .5, .2, etc for position to split
$sEllipsis
: string
= '…'
ellipsis ; Default '...'
Return values
string
—
ellipsized string
getIPAddress()
This function tries to returns the 'real' IP address under all configurations
Do not rely security-wise on the detected IP address as except for REMOTE_ADDR all fields could be manipulated by the web client
getIPAddress() : string
Return values
string
—
Client's IP Address
getRealIPAddress()
This function returns the real IP address and should mainly be used for security sensitive purposes
If you want to use the IP address for language detection or similar, use getIPAddress() instead
getRealIPAddress() : string
Return values
string
—
Client IP Address
getBrowserLanguage()
This function tries to find out a valid language code for the language of the browser used
If it cannot find it it will return the default language from global settings
Calculate folder size
NB: If this function is changed, please notify LimeSurvey GmbH.
folderSize(string $dir) : int
An exact copy of this function is used to calculate storage
limit on LimeSurvey Pro hosting.
Parameters
$dir
: string
Folder
Return values
int
—
Size in bytes.
humanFilesize()
Format size in human readable format.
humanFilesize(int $bytes[, int $decimals = 2 ]) : string
Parameters
$bytes
: int
$decimals
: int
= 2
Return values
string
convertPHPSizeToBytes()
This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)
convertPHPSizeToBytes(string $sSize) : int
Parameters
$sSize
: string
Return values
int
—
The value in bytes
getMaximumFileUploadSize()
getMaximumFileUploadSize() : mixed
decodeTokenAttributes()
Decodes token attribute data because due to bugs in the past it can be written in JSON or be serialized - future format should be JSON as serialized data can be exploited
Do not use anymore. If you see this replace it with a proper ActiveRecord Model query
Return values
bool|CDbDataReader
dbRandom()
Return the database-specific random function to use in ORDER BY sql statements
dbRandom() : string
Return values
string
dbSelectTablesLike()
Return a sql statement for finding LIKE named tables
Be aware that you have to escape underscore chars by using a backslash
otherwise you might get table names returned you don't want
Implementation of listifop( $cmpAttr, $op, $value, $retAttr, $glue, $sgqa1, ..., sgqaN )
Return a list of retAttr from sgqa1...sgqaN which pass the critiera (cmpAttr op value)
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.
The number of "pages" that will be presented in this survey
The number of pages to be presented will differ depending on the survey format
Set totalsteps in session
setTotalSteps(int $surveyid, array<string|int, mixed> $thissurvey, int $totalquestions) : void
Parameters
$surveyid
: int
$thissurvey
: array<string|int, mixed>
$totalquestions
: int
breakOutAndCrash()
breakOutAndCrash(string $sTemplateViewPath, int $totalquestions, int $iTotalGroupsWithoutQuestions, array<string|int, mixed> $thissurvey) : void
FieldArray contains all necessary information regarding the questions
This function is needed to update it in case the survey is switched to another language
updateFieldArray() : mixed
Tags
todo:
Make 'fieldarray' obsolete by replacing with EM session info
checkCompletedQuota()
checkCompletedQuota() returns matched quotas information for the current response
killSurveySession : reset $_SESSION part for the survey
killSurveySession(int $iSurveyID) : mixed
Parameters
$iSurveyID
: int
resetTimers()
Resets all question timers by expiring the related cookie - this needs to be called before any output is done
resetTimers() : mixed
Tags
todo
Deprecated - Question timers no longer use cookies
resetQuestionTimers()
Removes all question timers for this survey from local storage
resetQuestionTimers(mixed $surveyid) : void
Parameters
$surveyid
: mixed
SetSurveyLanguage()
Set the public survey language
Control if language exist in this survey, else set to survey default language
if $surveyid <= 0 : set the language to default site language
If debug = 2 in application/config.php this will produce output in the console / firebug
similar to var_dump. It will also include the filename and line that called this method.
traceVar(mixed $variable[, int $depth = 10 ]) : mixed
Parameters
$variable
: mixed
The variable to be dumped
$depth
: int
= 10
Maximum depth to go into the variable, default is 10
getGlobalSetting()
Returns a global setting
getGlobalSetting(string $settingname) : string
Parameters
$settingname
: string
Tags
deprecated
: use App()->getConfig('settingname')
since all config are set at start of App : no need to read and test again
ldap_doTokenSearch(mixed $ds, mixed $ldapq, mixed &$ResArray, int $surveyid) : mixed
Parameters
$ds
: mixed
$ldapq
: mixed
$ResArray
: mixed
$surveyid
: int
prepareLDAPQuery()
prepareLDAPQuery(mixed $queryId) : mixed
Parameters
$queryId
: mixed
setNoAnswerMode()
setNoAnswerMode
setNoAnswerMode(mixed $thissurvey) : mixed
Parameters
$thissurvey
: mixed
retrieveAnswers()
This function returns an array containing the "question/answer" html display
and a list of the question/answer fieldnames associated. It is called from
question.php, group.php, survey.php or preview.php
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?
labelWidth as integer,inputWidth as integer,defaultWidth as boolean
fillDate()
Take a date string and fill out missing parts, like day, hour, minutes
(not seconds).
fillDate(string $dateString) : string
If string is NOT in standard date format (Y-m-d H:i), this methods makes no
sense.
Used when fetching answer for do_date, where answer can come from a default
answer expression like date('Y').
Will also truncate date('c') to format Y-m-d H:i.
By default, it just renders the required core view from application/views/survey/...
If user added a question template in the upload dirctory, add applied it to the question in its display settings, then the function will check if the required view exist in this directory
and then will use this one to render the question.
Rem: all the logic has been moved to LSETwigViewRenderer::renderQuestion()
We keep the function doRender here for convenience (it will probably be removed in further cycles of dev).
*
Parameters
$sView
: string
name of the view to be rendered.
$aData
: array<string|int, mixed>
data to be extracted into PHP variables and made available to the view script
$bReturn
: bool
= true
whether the rendering result should be returned instead of being displayed to end users (should be always true)
templatereplace()
This function replaces keywords in a text and is mainly intended for templates
If you use this functions put your replacement strings into the $replacements variable
instead of using global variables
NOTE - Don't do any embedded replacements in this function. Create the array of replacement values and
they will be done in batch at the end
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:
$string - The string to sanitize.
$force_lowercase - Force the string to lowercase?
$alphanumeric - If set to true, will remove all non-alphanumeric characters.
Parameters
$filename
: mixed
$force_lowercase
: mixed
= true
$alphanumeric
: mixed
= false
$beautify
: mixed
= true
$directory
: mixed
= false
beautify_filename()
beautify_filename(string $filename) : mixed
Parameters
$filename
: string
sanitize_dirname()
Function: sanitize_dirname
sanitizes a string that will be used as a directory name
Parameters:
$string - The string to sanitize.
$force_lowercase - Force the string to lowercase?
$alphanumeric - If set to true, will remove all non-alphanumeric characters.
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).
This function removes the old CPDB fields in token tables
replaces them with standard attribute fields
and records the mapping information in the attributedescription field in the survey table instead
upgradeTokens176() : mixed
upgradeCPDBAttributeDefaultNames173()
upgradeCPDBAttributeDefaultNames173() : mixed
upgradePermissions166()
Converts global permissions from users table to the new permission system,
and converts template permissions from template_rights to new permission table
upgradePermissions166() : mixed
upgradeSurveyTables164()
Make sure all active tables have the right sized token field
upgradeSurveyTables164() : string|null
During a small period in the 2.0 cycle some survey tables got no
token field or a token field that was too small. This patch makes
sure all surveys that are not anonymous have a token field with the
right size
Set a transaction bookmark - this is critical for Postgres because a transaction in Postgres cannot be continued unless you roll back to the transaction bookmark first
This function fixes Postgres sequences for one/all tables in a database
This is necessary if a table is renamed. If tablename is given then only that table is fixed
Should be true before dbversion 400 is finished, false after
removeMysqlZeroDate()
Remove all zero-dates in $tableName by checking datetime columns from $tableSchema
Zero-dates are replaced with null where possible; otherwise 1970-01-01
ID of the survey
@param mixed $type Type of the chart to be created - null produces bar chart, any other value produces pie chart
@param array $lbl An array containing the labels for the chart items
@param mixed $gdata An array containing the percentages for the chart items
@param mixed $grawdata An array containing the raw count for the chart items
@param pCache $cache An object containing [Hashkey] and [CacheFolder]
@param mixed $sLanguageCode Language Code
@param string $sQuestionType The question type
@return false|string
Builds the list of addon SQL select statements
that builds the query result set
buildSelects(mixed $allfields, int $surveyid, mixed $language) : mixed
@param array $allfields An array containing the names of the fields/answers we want to display in the statistics summary
Parameters
$allfields
: mixed
$surveyid
: int
@param string $language The language to use
@return array $selects array of individual select statements that can be added/appended to
the 'where' portion of a SQL statement to restrict the result set
ie: array("FIELDNAME='Y'", "FIELDNAME2='Hello'");