TemplateConfig

Extends \CActiveRecord

Class TemplateConfig Common methods for TemplateConfiguration and TemplateManifest

package

Default

Methods

__toString

__toString() 

Create a package for the asset manager.

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()

Arguments

$oTemplate

\TemplateConfiguration

TemplateManifest

Convert the values to a json.

formatToJsonArray(array|object $oFiled) : string
static

It checks that the correct values is inserted.

Arguments

$oFiled

array|object

the filed to convert

Response

string

json

getAllDbTemplateFolders

getAllDbTemplateFolders() 

get the template API version

getApiVersion() : integer

Response

integer

Core config and attributes

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

Get the depends package

getDependsPackages(\TemplateConfiguration $oTemplate) : array<mixed,string>
uses

Arguments

Response

array<mixed,string>

Get the file path for a given template.

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

Arguments

$sFile

string

relative path to the file

$oTemplate

\TemplateConfig

the template where to look for (and its mother templates)

Response

string|false

getPreview

getPreview() 

Get the template for a given file. It checks if a file exist in the current template or in one of its mother templates

getTemplateForFile(string $sFile, \TemplateConfig $oRTemplate) : \TemplateConfig
Throws
\Exception

Arguments

$sFile

string

the file to look for (must contain relative path, unless it's a view file)

$oRTemplate

\TemplateConfig

template from which the recurrence should start

Response

\TemplateConfig

getTemplatesWithNoDb

getTemplatesWithNoDb() 

Returns the complete URL path to a given template name

getTemplateURL() : string

Response

string

template url

Create a new entry in {{templates}} and {{template_configuration}} table using the template manifest

importManifest(string $sTemplateName, array $aDatas) : boolean
static
Throws
\Exception,

InvalidArgumentException

Arguments

$sTemplateName

string

the name of the template to import

$aDatas

array

Response

boolean

true on success | exception

setIsStandard

setIsStandard() : boolean|null

Response

boolean|null

uninstall

uninstall( $templatename) 
static

Arguments

$templatename

Properties

The template name

sTemplateName : string
var

The template name

Type(s)

string

Name of the asset package of this template

sPackageName : string
var

Name of the asset package of this template

Type(s)

string

Path of this template

path : string
var

Path of this template

Type(s)

string

Url to reach the framework

sTemplateurl : array<mixed,string>
var

Url to reach the framework

Type(s)

array<mixed,string>

Path of the views files (twig template)

viewPath : string
var

Path of the views files (twig template)

Type(s)

string

Path of the tmeplate's files

filesPath : string
var

Path of the tmeplate's files

Type(s)

string

What framework css is used

cssFramework : array<mixed,string>
var

What framework css is used

Type(s)

array<mixed,string>

Is this template a core one?

isStandard : boolean
var

Is this template a core one?

Type(s)

boolean

Will contain the config.xml

config : \SimpleXMLElement
var

Will contain the config.xml

Type(s)

\SimpleXMLElement

The mother template object This is used when a template inherit another one.

oMotherTemplate : \TemplateConfiguration
var

The mother template object This is used when a template inherit another one.

Type(s)

\TemplateConfiguration

The template options

oOptions : array
var

The template options

Type(s)

array

List of all dependencies (could be more that just the config.xml packages)

depends : array<mixed,string>
var

List of all dependencies (could be more that just the config.xml packages)

Type(s)

array<mixed,string>

Version of the LS API when created. Must be private : disallow update

apiVersion : integer
var

Version of the LS API when created. Must be private : disallow update

Type(s)

integer

The current Survey Id. It can be void. It's use only to retreive the current template of a given survey

iSurveyId : string
var

The current Survey Id. It can be void. It's use only to retreive the current template of a given survey

Type(s)

string

Does it has a config.xml file?

hasConfigFile : string
var

Does it has a config.xml file?

Type(s)

string

Array of package dependencies defined in config.xml

packages : array<mixed,\stdClass>
var

Array of package dependencies defined in config.xml

Type(s)

array<mixed,\stdClass>

What xml config file does it use? (config/minimal)

xmlFile : string
var

What xml config file does it use? (config/minimal)

Type(s)

string

Css Framework Replacement

aCssFrameworkReplacement : array
var

Css Framework Replacement

Type(s)

array

allDbTemplateFolders

allDbTemplateFolders : 

Type(s)

aTemplatesWithoutDB

aTemplatesWithoutDB : 
static

Type(s)