Skip to content

Commit

Permalink
Dev: replace getFieldFromParentConfiguration by __get override for cs…
Browse files Browse the repository at this point in the history
…sframework_css/js
  • Loading branch information
LouisGac committed Aug 14, 2017
1 parent 680c6d3 commit 6c181b4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions application/models/TemplateConfiguration.php
Expand Up @@ -497,12 +497,6 @@ protected function getFrameworkAssetsToReplace( $sType, $bInlcudeRemove = false)
$sFieldName = 'cssframework_'.$sType;
$aFieldValue = (array) json_decode($this->$sFieldName);

// Whole field inheritance
if ($this->$sFieldName == "inherit"){
$parentFieldValue = $this->getFieldFromParentConfiguration($sFieldName);
$aFieldValue = (array) json_decode($parentFieldValue);
}

$aAssetsToRemove = array();
if (!empty( $aFieldValue )){
$aAssetsToRemove = (array) $aFieldValue['replace'] ;
Expand Down Expand Up @@ -595,7 +589,7 @@ public function getFieldFromParentConfiguration($sField){

public function __get($name)
{
$aAttributesThatCanBeInherited = array('files_css', 'files_js', 'options');
$aAttributesThatCanBeInherited = array('files_css', 'files_js', 'options', 'cssframework_css', 'cssframework_js');

if (in_array($name, $aAttributesThatCanBeInherited)){
// Full inheritance of the whole field
Expand Down

0 comments on commit 6c181b4

Please sign in to comment.