Skip to content

Commit

Permalink
Dev: added few doc about the difference between motherTemplate and pa…
Browse files Browse the repository at this point in the history
…rentTemplate
  • Loading branch information
LouisGac committed Aug 14, 2017
1 parent 7cc4f22 commit aba5052
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 5 additions & 2 deletions application/models/TemplateConfig.php
Expand Up @@ -48,7 +48,10 @@ class TemplateConfig extends CActiveRecord
/** @var SimpleXMLElement $config Will contain the config.xml */
public $config;

/** @var TemplateConfiguration $oMotherTemplate The template name */
/**
* @var TemplateConfiguration $oMotherTemplate The mother template object
* This is used when a template inherit another one.
*/
public $oMotherTemplate;

/** @var array $oOptions The template options */
Expand Down Expand Up @@ -149,7 +152,7 @@ protected function createTemplatePackage($oTemplate)
$aTJsFiles = $this->getFilesToLoad($oTemplate, 'js');

$aCssFiles = array_merge($aCssFiles, $aTCssFiles);
$aJsFiles = array_merge($aJsFiles, $aTJsFiles);
$aJsFiles = array_merge($aJsFiles, $aTJsFiles);

$dir = getLanguageRTL(App()->language) ? 'rtl' : 'ltr';

Expand Down
11 changes: 10 additions & 1 deletion application/models/TemplateConfiguration.php
Expand Up @@ -38,6 +38,15 @@
*/
class TemplateConfiguration extends TemplateConfig
{

/**
* @var TemplateConfiguration $oParentTemplate 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)
*/
public $oParentTemplate;

/**
* @return string the associated database table name
*/
Expand Down Expand Up @@ -434,7 +443,7 @@ protected function setThisTemplate()
$this->cssFramework->name = $this->cssframework_name;
$this->cssFramework->css = json_decode($this->cssframework_css);
$this->cssFramework->js = json_decode($this->cssframework_js);

if ($this->cssFramework->name == 'inherit'){
$this->cssFramework->name = $this->getParentConfiguration()->cssframework_name;
}
Expand Down

0 comments on commit aba5052

Please sign in to comment.