Skip to content

Commit

Permalink
Dev: few comments on setTemplateConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Aug 1, 2017
1 parent 39bcc9b commit 5f419bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion application/models/Template.php
Expand Up @@ -421,7 +421,10 @@ public static function isStandardTemplate($sTemplateName)
/**
* Get instance of template object.
* Will instantiate the template object first time it is called.
* Please use this instead of global variable.
*
* NOTE 1: This function will call setTemplateConfiguration that create/update all the packages needed to render the template, which imply to do the same for all mother templates
* NOTE 2: So if you just want to access the TemplateConfiguration AR Object, you don't need to use this one. Call it only before rendering anything related to the template.
* NOTE 3: If you need to get the related configuration to this template, rather use: getTemplateConfiguration()
*
* @param string $sTemplateName
* @param int|string $iSurveyId
Expand Down
3 changes: 2 additions & 1 deletion application/models/TemplateConfiguration.php
Expand Up @@ -60,7 +60,6 @@ public function rules()
array('cssframework_name', 'length', 'max'=>45),
array('files_css, files_js, files_print_css, options, cssframework_css, cssframework_js, packages_to_load', 'safe'),
// The following rule is used by search().
// @todo Please remove those attributes that should not be searched.
array('id, templates_name, sid, gsid, files_css, files_js, files_print_css, options, cssframework_name, cssframework_css, cssframework_js, packages_to_load', 'safe', 'on'=>'search'),
);
}
Expand Down Expand Up @@ -218,6 +217,8 @@ public function checkTemplate()
/**
* Constructs a template configuration object
* If any problem (like template doesn't exist), it will load the default template configuration
* NOTE 1: This function will create/update all the packages needed to render the template, which imply to do the same for all mother templates
* NOTE 2: So if you just want to access the TemplateConfiguration AR Object, you don't need to call it. Call it only before rendering anything related to the template.
*
* @param string $sTemplateName the name of the template to load. The string comes from the template selector in survey settings
* @param string $iSurveyId the id of the survey. If
Expand Down

0 comments on commit 5f419bb

Please sign in to comment.