LimeSurvey API - Master branch

QuestionTemplate extends CFormModel
in package

Table of Contents

Properties

$aCustomAttributes  : array<string|int, mixed>
$aViews  : array<string|int, mixed>
$bHasCustomAttributes  : bool
$bHasTemplate  : bool
$oConfig  : SimpleXMLElement
$oQuestion  : Question
$sTemplateFolderName  : string
$bHasConfigFile  : bool
$bLoadCoreCss  : bool
$bLoadCoreJs  : bool
$bLoadCorePackage  : bool
$instance  : QuestionTemplate
$sTemplatePath  : string
$sTemplateQuestionPath  : string
$sTemplateUrl  : string
$xmlFile  : string

Methods

checkIfTemplateHasView()  : mixed
Check if the question template offer a specific replacement for that view file.
getCustomAttributes()  : array<string|int, mixed>
getFolderName()  : string|null
getNewInstance()  : QuestionTemplate
Get a new instance of the template object Each question on the page could have a different template.
getQuestionTemplateFolderName()  : false|string
Get the template folder name
getQuestionTemplateList()  : array<string|int, mixed>
Called from admin, to generate the template list for a given question type
getTemplatePath()  : null|string
Retrieve the template base path if exist
getTemplateUrl()  : string
getTypeToFolder()  : array<string|int, mixed>
Correspondence between question type and the view folder name Rem: should be in question model. We keep it here for easy access
registerAssets()  : mixed
registerCssFile()  : mixed
Register a core css file
registerPackage()  : mixed
Register a core package file
registerScript()  : mixed
Register a core script
registerScriptFile()  : mixed
Register a core script file
setConfig()  : mixed
In the future, could retrieve data from DB
templateLoadsCoreCss()  : null|bool
Return true if the core css should be loaded.
templateLoadsCoreJs()  : null|bool
Return true if the core css should be loaded.
templateLoadsCorePackage()  : null|bool
Return true if the core packages should be loaded.

Properties

$aCustomAttributes

public array<string|int, mixed> $aCustomAttributes

array (attribute=>value)

$aViews

public array<string|int, mixed> $aViews

Array of views the template can handle ($aViews['path_to_my_view']==true)

$bHasCustomAttributes

public bool $bHasCustomAttributes

Does the template provides custom attributes?

$bHasTemplate

public bool $bHasTemplate

Does this question has a template?

$sTemplateFolderName

public string $sTemplateFolderName

The folder of the template applied to this question (if no template applied, it's false)

$bLoadCoreCss

private bool $bLoadCoreCss

Should it render the core CSS of this question (script are registered in qanda)

$bLoadCoreJs

private bool $bLoadCoreJs

Should it render the core javascript of this question (script are registered in qanda)

$bLoadCorePackage

private bool $bLoadCorePackage

Should it render the core packages of this question (script are registered in qanda)

$sTemplateQuestionPath

private string $sTemplateQuestionPath

The path to the folder corresponding to the current question type

Methods

checkIfTemplateHasView()

Check if the question template offer a specific replacement for that view file.

public checkIfTemplateHasView(string $sView) : mixed
Parameters
$sView : string

getCustomAttributes()

public getCustomAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFolderName()

public static getFolderName(string $type) : string|null
Parameters
$type : string
Tags
deprecated

use QuestionTheme::getQuestionXMLPathForBaseType

Return values
string|null

getQuestionTemplateFolderName()

Get the template folder name

public getQuestionTemplateFolderName() : false|string
Return values
false|string

getQuestionTemplateList()

Called from admin, to generate the template list for a given question type

public static getQuestionTemplateList(string $type) : array<string|int, mixed>
Parameters
$type : string
Tags
todo

Move to QuestionTheme?

todo

This is not the same as QuestionTheme::findQuestionMetaDataForAllTypes() which is the database layer

todo

this should check the filestructure instead of the database as this is the filestructure layer

Return values
array<string|int, mixed>

getTemplatePath()

Retrieve the template base path if exist

public getTemplatePath() : null|string
Return values
null|string

getTypeToFolder()

Correspondence between question type and the view folder name Rem: should be in question model. We keep it here for easy access

public static getTypeToFolder() : array<string|int, mixed>
Tags
deprecated
Return values
array<string|int, mixed>

registerCssFile()

Register a core css file

public registerCssFile(string $sCssFile[, string $media = '' ]) : mixed
Parameters
$sCssFile : string
$media : string = ''

registerPackage()

Register a core package file

public registerPackage(string $sPackage) : mixed
Parameters
$sPackage : string

registerScript()

Register a core script

public registerScript(string $sScript[, int $pos = CClientScript::POS_BEGIN ]) : mixed
Parameters
$sScript : string
$pos : int = CClientScript::POS_BEGIN

registerScriptFile()

Register a core script file

public registerScriptFile(string $sFile[, int $pos = CClientScript::POS_BEGIN ]) : mixed
Parameters
$sFile : string
$pos : int = CClientScript::POS_BEGIN

setConfig()

In the future, could retrieve data from DB

public setConfig() : mixed

templateLoadsCoreCss()

Return true if the core css should be loaded.

public templateLoadsCoreCss() : null|bool
Return values
null|bool

templateLoadsCoreJs()

Return true if the core css should be loaded.

public templateLoadsCoreJs() : null|bool
Return values
null|bool

templateLoadsCorePackage()

Return true if the core packages should be loaded.

public templateLoadsCorePackage() : null|bool
Return values
null|bool

        
On this page

Search results