LimeSurvey API - Master branch

replacements_helper.php

Table of Contents

Functions

templatereplace()  : string
This function replaces keywords in a text and is mainly intended for templates If you use this functions put your replacement strings into the $replacements variable instead of using global variables NOTE - Don't do any embedded replacements in this function. Create the array of replacement values and they will be done in batch at the end
getStandardsReplacementFields()  : mixed
ReplaceFields()  : mixed
PassthruReplace()  : string
passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables which it then substitutes for parameter data sent in the initial URL and stored in the session array containing responses

Functions

templatereplace()

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

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

Text to search in

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

Array of replacements: Array( =>

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

: array of global var used in the function

$debugSrc : null = null

unused

$anonymized : null = null

unused (all done in EM now)

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

UndefinedVariable

Return values
string

Text with replaced strings

getStandardsReplacementFields()

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

UndefinedVariable TODO

ReplaceFields()

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

PassthruReplace()

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

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

string - the string to iterate, and then return

$thissurvey : mixed

string - the string containing the surveyinformation

Return values
string

This string is returned containing the substituted responses


        
On this page

Search results