LimeSurvey API - Master branch

surveytranslator_helper.php

Table of Contents

Functions

getDateFormatData()  : mixed
Returns all available dateformats in a structured aray If $iDateFormat is given only the particual dateformat will be returned
getLanguageData()  : mixed
getRadixPointData()  : int|array<string|int, mixed>
Returns avaliable formats for Radix Points (Decimal Separators) or returns radix point info about a specific format.
getPHPDateFromDateFormat()  : mixed
Convert a 'dateformat' format string to a 'phpdate' format.
getJSDateFromDateFormat()  : mixed
Convert a 'dateformat' format string to a 'jsdate' format.
getDateFormatDataForQID()  : mixed
Get the date format details for a specific question.
getDateFormatForSID()  : mixed
Get the date format for a specified survey
canShowDatePicker()  : mixed
Check whether we can show the JS date picker with the current format
getLanguageCodefromLanguage()  : int|string
Returns a language code from the name
getLanguageNameFromCode()  : string|array<string|int, mixed>
Returns a language name from the code
getLanguageRTL()  : mixed
getLanguageDetails()  : array<string|int, mixed>
Returns the locale settings for a certain language code
convertLStoDateTimePickerLocale()  : mixed
This functions translates LimeSurvey specific locale code to a matching datetimepicker locale
getLanguageDataRestricted()  : mixed
userSort()  : mixed
userSortNative()  : mixed
UTF8Strrev()  : string
This function support the ability NOT to reverse numbers (for example when you output a phrase as a parameter for a SWF file that can't handle RTL languages itself, but obviously any numbers should remain the same as in the original phrase).

Functions

getDateFormatData()

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

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

integer

$sLanguageCode : = 'en'

string

Tags
returns

array

getLanguageData()

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

getRadixPointData()

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

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

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

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

getPHPDateFromDateFormat()

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

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

string

Tags
returns

string

getJSDateFromDateFormat()

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

getJSDateFromDateFormat( $sDateformat) : mixed

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

Parameters
$sDateformat :

string

Tags
returns

string

getDateFormatDataForQID()

Get the date format details for a specific question.

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

array Question attributes

$mThisSurvey :

mixed Array of Survey attributes or surveyid

$language : mixed = ''
Tags
returns

array

getDateFormatForSID()

Get the date format for a specified survey

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

integer Survey id

$languagecode : = ''

string Survey language code (optional)

Tags
returns

integer

canShowDatePicker()

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

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

array Date format details for the question

$dateformats : = null

array Available date formats

Tags
returns

integer

getLanguageCodefromLanguage()

Returns a language code from the name

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

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

Return values
int|string

getLanguageNameFromCode()

Returns a language name from the code

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

Should not give back different data types

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

getLanguageDetails()

Returns the locale settings for a certain language code

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

Array with locale details

convertLStoDateTimePickerLocale()

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

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

LimeSurvey locale code

getLanguageDataRestricted()

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

UTF8Strrev()

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

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

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

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

        
On this page

Search results