LimeSurvey API - Master branch

SurveyTemplate
in package
implements CommandInterface Uses AuthPermissionTrait

Survey Template

Used by cloud / account to retrieve templates.

Table of Contents

Interfaces

CommandInterface

Properties

$responseFactory  : ResponseFactory
$session  : CHttpSession
$survey  : Survey
$surveyLanguageSetting  : SurveyLanguageSetting
$permissionModel  : Permission|null

Methods

__construct()  : mixed
Constructor
run()  : Response
Run survey template command
setPermissionModel()  : void
getPermissionModel()  : Permission
hasGlobalPermission()  : Response
hasSurveyPermission()  : Response
ensurePermissions()  : Response|false
Ensure Permissions
getTemplateData()  : Response|bool|string
Get template data

Properties

Methods

run()

Run survey template command

public run(Request $request) : Response

Supports GET and POST, with the sid at the end of the endpoint, lookin like rest/v1/survey-template/571271

If it's a GET request, then language is not specified, so it is inferred from the survey's default language and falling back to en if not found

If it's a POST, language can be specified like this: { "language": "en", }

Responds with an object, like this: { "template": "<some HTML>" "title": "Lunch" "subtitle": "What should we eat for lunch?" }

Parameters
$request : Request
Return values
Response

hasGlobalPermission()

protected hasGlobalPermission(string $sPermission, string $sCRUD[, int|null $iUserID = null ]) : Response
Parameters
$sPermission : string
$sCRUD : string
$iUserID : int|null = null
Return values
Response

| boolean

hasSurveyPermission()

protected hasSurveyPermission(int $iSurveyID, string $sPermission, string $sCRUD[, string|null $iUserID = null ]) : Response
Parameters
$iSurveyID : int
$sPermission : string
$sCRUD : string
$iUserID : string|null = null
Return values
Response

| boolean

ensurePermissions()

Ensure Permissions

private ensurePermissions(int $surveyId) : Response|false
Parameters
$surveyId : int
Return values
Response|false

getTemplateData()

Get template data

private getTemplateData(int $surveyId, string $language) : Response|bool|string
Parameters
$surveyId : int
$language : string
Return values
Response|bool|string

        
On this page

Search results