TemplateConfiguration

Extends \CFormModel

Template Configuration Model

This model retrieves all the data of template configuration from the configuration file

package

LimeSurvey

subpackage

Backend

Methods

This method construct a template object, having all the needed configuration datas.

setTemplateConfiguration(string $sTemplateName = '', string $iSurveyId = '') 

It checks if the required template is a core one or a user one. If it's a user template, it will check if it's an old 2.0x template to provide default configuration values corresponding to the old template system If it's not an old template, it will check if it has a configuration file to load its datas. If it's not the case (template probably doesn't exist), it will load the default template configuration TODO : more tests should be done, with a call to private function _is_valid_template(), testing not only if it has a config.xml, but also id this file is correct, if it has the needed pstpl files, if the files refered in css exist, etc.

Arguments

$sTemplateName

string

the name of the template to load. The string come from the template selector in survey settings

$iSurveyId

string

the id of the survey. If

Update the configuration file "last update" node.

actualizeLastUpdate() 

For now, it's called only from template editor

Create a package for the asset manager.

createTemplatePackage() 

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 done for now in replacements_helper, to respect the old logic of {TEMPLATECSS} replacement keyword

NOTE 1 : To refresh the assets, the base directory of the template must be updated.

NOTE 2: By default, Asset Manager is off when debug mode is on. Developers should then think about : 1. refreshing their brower's cache (ctrl + F5) to see their changes 2. update the config.xml last_update before pushing, to be sure that end users will have the new version

For more detail, see : http://www.yiiframework.com/doc/api/1.1/CClientScript#addPackage-detail http://www.yiiframework.com/doc/api/1.1/YiiBase#setPathOfAlias-detail

Return the list of ALL files present in the file directory

setOtherFiles() 

getName

getName() 

setIsStandard

setIsStandard() 

Properties

sTemplateName

sTemplateName : 

iSurveyId

iSurveyId : 

config

config : 

viewPath

viewPath : 

filesPath

filesPath : 

cssFramework

cssFramework : 

packages

packages : 

depends

depends : 

otherFiles

otherFiles : 

oSurvey

oSurvey : 

isStandard

isStandard : 

path

path : 

hasConfigFile

hasConfigFile : 

isOldTemplate

isOldTemplate : 

overwrite_question_views

overwrite_question_views : 

xmlFile

xmlFile :