This is the model class for table "{{template_configuration}}".
NOTE: if you only need to access to the table, you don't need to call prepareTemplateRendering
The followings are the available columns in table '{{template_configuration}}':
package | LimeSurvey |
---|---|
subpackage | Backend |
__get(string $name): mixed
string
the name of the attribute
mixed
__toString(): string
todo | document me |
---|---|
string
addFileReplacement(string $sFile,string $sType): boolean|void
..}, "css/template.css",]} In general, should be called from TemplateManifest, after adding a file replacement inside the manifest.
Throws |
|
---|
string
the file to replace
string
css|js
boolean|void
addMotherTemplatePackage(array<mixed,string> $packages): array<mixed,string>
todo | document me |
---|
array<mixed,string>
array<mixed,string>
addOptionFromXMLToLiveTheme(): void
addOptionToLiveTheme(string $name,mixed $value): void
Will be used to turn ON ajax mode on update.
string
mixed
attributeLabels(): array
todo | document me |
---|---|
array
customized attribute labels (name=>label)
changeMotherConfiguration( $sType, $aSettings): array
var | string the type of settings to change (css or js) array array of local setting |
---|---|
array
checkAndcreateSurveyConfig(integer $iSurveyId): \TemplateConfiguration
Else, it will create it.
TODO | : recursivity for survey group |
---|
integer
\TemplateConfiguration
the template configuration for the survey group
checkTemplate(): boolean
todo | document me |
---|---|
boolean
createTemplatePackage(\TemplateConfiguration $oTemplate)
The asset manager will push to tmp/assets/xyxyxy/ the whole template directory (with css, js, files, etc.) And it will publish the CSS and the JS defined in config.xml. So CSS can use relative path for pictures. The publication of the package itself is in LSETwigViewRenderer::renderTemplateFromString()
defaultScope()
inheritdoc | |
---|---|
formatToJsonArray(array|object $oFiled,boolean $bConvertEmptyToString = false): string
It checks that the correct values is inserted.
array|object
the filed to convert
boolean
formats empty values as empty strings instead of objects.
string
json
getAllDbTemplateFolders(): array|null
todo | document me |
---|---|
array|null
getApiVersion(): integer
integer
getAttributeValue(string $attributeName): mixed
string
mixed
getButtons(): string
string
getClassAndAttributes()
Most classes and id and attributes from template views are defined here. So even if users extends/modify the core template, we can still apply some debugs
NB 1: Some of the classes should be bring back to templates
NB 2: This is a temporary function. Before releasing to master, it will be replaced by a XML file inside the template itself So third party providers will also be able to use this mechanics to provides bug fixes/enhancement to their templates
getDependsPackages(\TemplateConfiguration $oTemplate): array<mixed,string>
getDescription()
getFilePath(string $sFile,\TemplateConfig $oTemplate): string|false
It will check if css/js (relative to path), or view (view path) It will search for current template and mother templates
string
relative path to the file
string|false
getFilesToLoad( $oTemplate, $sType): array
var | string js or css ? |
---|---|
array
getFrameworkAssetsReplacement(string $sType): array
string
css|js the type of file
array
getFrameworkAssetsToReplace(string $sType,boolean $bInlcudeRemove = false): array
string
css|js the type of file
boolean
also get the files to remove
array
getGlobalParent(): \TemplateConfiguration
getHasOptionPage(): boolean
todo | document me |
---|---|
Throws |
|
boolean
getImageInfo(string $file, $pathPrefix = ''): array|null
string
with Path
array|null
getInstance(string $sTemplateName = null,integer $iSurveyGroupId = null,integer $iSurveyId = null, $abstractInstance = false): \TemplateConfiguration
if force_xmlsettings_for_survey_rendering is on, then the configuration from the XML file should be loaded, not the one from database
string
integer
integer
\TemplateConfiguration
getInstanceFromSurveyGroup(integer $iSurveyGroupId,string $sTemplateName = null,boolean $abstractInstance = false): \TemplateConfiguration
integer
string
boolean
\TemplateConfiguration
getInstanceFromSurveyId(integer $iSurveyId,string $sTemplateName = null,boolean $abstractInstance = false): \TemplateConfiguration
integer
string
boolean
\TemplateConfiguration
getInstanceFromTemplateName(string $sTemplateName,boolean $abstractInstance = false): \TemplateConfiguration
getOfiles( $oTemplate, $sField): boolean|mixed
the theme to check
name of the DB field to get (file_css, file_js, file_print_css)
boolean|mixed
getOptionKey(string $key): mixed
todo | document me |
---|
string
mixed
getOptionPage(): mixed
todo | document me |
---|---|
mixed
getOptionPageAttributes(): array
todo | document me |
---|---|
array
getParentConfiguration(): \TemplateConfiguration
getPreview(): array|mixed|string|null
todo | document me |
---|---|
array|mixed|string|null
getRelativePath( $from, $to): string
todo | document me |
---|
string
getshowpopups()
getTemplateAndMotherNames(): string
todo | document me |
---|---|
string
getTemplateConfigurationForAttribute(\TemplateConfiguration $oRTemplate,string $attribute): \TemplateConfiguration
getTemplateForAsset(string $sFile,\TemplateConfiguration $oRTemplate): \TemplateConfiguration|boolean
getTemplateForFile(string $sFile,\TemplateConfig $oRTemplate,boolean $force = false): \TemplateConfig
string
the file to look for (must contain relative path, unless it's a view file)
boolean
file to be in template or mother template
\TemplateConfig
getTemplatesWithNoDb(): array|null
todo | document me |
---|---|
array|null
getTemplateURL(): string
string
template url
getThemeOptionsFromSurveyId(integer $iSurveyId,boolean $bInherited = false): array
integer
boolean
should inherited theme option values be used?
array
getTypeIcon(): string
todo | document me |
---|---|
string
importManifest(string $sTemplateName,array $aDatas): boolean
Throws |
|
---|
string
the name of the template to import
array
boolean
true on success | exception
model(string $className = __CLASS__): \TemplateConfiguration
Please note that you should have this exact method in all your CActiveRecord descendants!
string
active record class name.
\TemplateConfiguration
the static model class
prepareTemplateRendering(string $sTemplateName = '',string $iSurveyId = '',boolean $bUseMagicInherit = true): self
string
the name of the template to load. The string comes from the template selector in survey settings
string
the id of the survey. If
boolean
self
relations(): array
todo | document me |
---|---|
array
relational rules.
removeFileFromPackage(string $sPackageName,string $sType, $aSettings): void
string
name of the package to edit
string
the type of settings to change (css or js)
array of local setting
removeFiles()
removeFilesFromPackage(string $sPackageName,array $aPackage,string $sType,array $aFilesToRemove)
string
name of the package
array
the package to check (as provided by Yii::app()->clientScript)
string
the type of file (css or js)
array
an array containing the files to chech and remove
rename(string $sOldName,string $sNewName)
string
The old name of the template
string
The newname of the template
rules(): array
todo | document me |
---|---|
array
validation rules for model attributes.
sanitizeImagePathsOnJson( $attribute, $params)
Options that match a file will be marked as invalid if the file is not valid, or replaced with the virtual path if the file is valid.
search(): \CActiveDataProvider
Typical usecase:
\CActiveDataProvider
the data provider that can return the models based on the search/filter conditions.
searchGrid(): \CActiveDataProvider
todo | document me |
---|---|
Throws |
|
\CActiveDataProvider
setBasics(string $sTemplateName = '',string $iSurveyId = '',boolean $bUseMagicInherit = false)
todo | document me |
---|---|
string
string
boolean
setCssFramework(): void
todo | document me |
---|---|
setGlobalOption(string $name,mixed $value): void
Will be used to turn ON ajax mode on update.
string
mixed
setIsStandard(): boolean|null
todo | document me missing return value (php warning) |
---|---|
boolean|null
setMotherTemplates()
setOption(string $name,mixed $value): void
string
mixed
setOptionInheritance()
todo | document me |
---|---|
setOptionKeysToInherit()
Keys are fetched from parent xml configuration.
setOptions(): void
todo | document me |
---|---|
setThisTemplate(): void
setToInherit()
todo | document me |
---|---|
tableName(): string
todo | document me |
---|---|
string
the associated database table name
throwConsoleError(string|null $sCustomMessage = null)
todo | document me |
---|---|
Throws |
|
string|null
uninstall(string $templatename): boolean|integer
todo | document me |
---|
string
Name of Template
boolean|integer
uninstallIncorectTheme(string $sTemplateName)
string
oParentTemplate :\TemplateConfiguration
var | The parent template name A template configuration, in the database, can inherit from another one. This used to manage the different configuration levels for a very same template: global, survey group, survey This is not related to motherTemplate (inheritance between two different templates) |
---|
\TemplateConfiguration
bUseMagicInherit :
bJustCreated :
sPreviewImgTag :string
var | the template preview image tag for the template list |
---|
string
aInstancesFromTemplateName :array
var | cache for method getInstanceFromTemplateName |
---|
array
aPreparedToRender :array
var | cache for method prepareTemplateRendering |
---|
array
bTemplateCheckResult :boolean
var | is the template valid? |
---|
boolean
sTypeIcon :string
var | the type of template for icon (core vs user) |
---|
string
aFilesTo :array
var | cache for the method getFilesTo |
---|
array
aFrameworkAssetsToReplace :array
var | cache for the method getFrameworkAssetsToReplace() |
---|
array
aReplacements :array
var | cache for the method getFrameworkAssetsReplacement |
---|
array
Ofiles :array
var | cache for the method getOfiles |
---|
array
generalFilesPath :
showpopups :integer
var | show warnings when running survey |
---|
integer
template_type :
template_extends :
template_description :
sTemplateName :string
var | The template name |
---|
string
sPackageName :string
var | Name of the asset package of this template |
---|
string
path :string
var | Path of this template |
---|
string
sTemplateurl :string
var | Url to reach the framework |
---|
string
viewPath :string
var | Path of the views files (twig template) |
---|
string
filesPath :string
var | Path of the tmeplate's files |
---|
string
cssFramework :object
var | What framework css is used |
---|
object
isStandard :boolean
var | Is this template a core one? |
---|
boolean
config :\SimpleXMLElement
var | Will contain the config.xml |
---|
\SimpleXMLElement
oMotherTemplate :\TemplateConfiguration
var | The mother template object This is used when a template inherit another one. |
---|
\TemplateConfiguration
oOptions :object
var | The template options |
---|
object
oOptionAttributes :
depends :array<mixed,string>
var | List of all dependencies (could be more that just the config.xml packages) |
---|
array<mixed,string>
apiVersion :integer
var | Version of the LS API when created. Must be private : disallow update |
---|
integer
iSurveyId :\int?
var | The current Survey Id. It can be void. It's use only to retreive the current template of a given survey |
---|
\int?
hasConfigFile :string
var | Does it has a config.xml file? |
---|
string
packages :array<mixed,string>
var | Array of package dependencies defined in config.xml |
---|
array<mixed,string>
xmlFile :string
var | What xml config file does it use? (config/minimal) |
---|
string
aCssFrameworkReplacement :array
var | Css Framework Replacement |
---|
array
allDbTemplateFolders :
aTemplatesWithoutDB :
id :integer
Primary key
integer
template_name :string
string
sid :integer
Survey ID
integer
gsid :integer
integer
uid :integer
user ID
integer
files_css :string
string
files_js :string
string
files_print_css :string
string
cssframework_name :string
string
cssframework_css :string
string
cssframework_js :string
string
packages_to_load :string
string
packages_ltr :string
string
packages_rtl :string
string
packages_rtl :string
string
template :\Template
\Template