Skip to content

Commit

Permalink
Dev: some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 18, 2018
1 parent 57bcb0b commit db420e5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions application/models/TemplateConfiguration.php
Expand Up @@ -166,7 +166,7 @@ public static function getInstanceFromTemplateName($sTemplateName, $abstractInst
if (!is_a($oInstance, 'TemplateConfiguration')) {
$oInstance = self::getInstanceFromTemplateName(getGlobalSetting('defaulttheme'));
}

if($abstractInstance === true) {
return $oInstance;
}
Expand Down Expand Up @@ -625,7 +625,7 @@ public function getHasOptionPage()

/**
* Set a value on a given option at global setting level (survey level not affected).
* Will be used to turn ON ajax mode on update.
* Will be used to turn ON ajax mode on update.
*
* @param string $name
* @param mixed $value
Expand All @@ -646,23 +646,23 @@ public function setGlobalOption($name, $value)
}

/**
* Apply options from XML configuration for all missing template options
* Apply options from XML configuration for all missing template options
*
* @return void
*/
public function addOptionFromXMLToLiveTheme()
{
{
if ($this->options != 'inherit') {
$oOptions = get_object_vars(json_decode($this->options));
$oTemplateConfigurationModel = new TemplateManifest;
$oTemplateConfigurationModel->setBasics();
$oXmlOptions = get_object_vars($oTemplateConfigurationModel->config->options);
$oXmlOptions = get_object_vars($oTemplateConfigurationModel->config->options);

// compare template options to options from the XML and add if missing
foreach ($oXmlOptions as $key=>$value){
if (!array_key_exists($key, $oOptions)){
$this->addOptionToLiveTheme($key, $value);
}
}
}
}
}
Expand Down Expand Up @@ -709,7 +709,7 @@ public function setOption($name, $value)

private function _filterImages($file)
{
$imagePath = (file_exists($this->filesPath.$file['name']))
$imagePath = (file_exists($this->filesPath.$file['name']))
? $this->filesPath.'/'.$file['name']
: $this->generalFilesPath.$file['name'] ;

Expand Down Expand Up @@ -754,8 +754,8 @@ public function getOptionPage()
//We add some extra values to the option page
//This is just a dirty hack, and somewhere in the future we will correct it
$renderArray['oParentOptions'] = array_merge(
((array) $oSimpleInheritanceTemplate->oOptions),
array('packages_to_load' => $oTemplate->packages_to_load,
((array) $oSimpleInheritanceTemplate->oOptions),
array('packages_to_load' => $oTemplate->packages_to_load,
'files_css' => $oTemplate->files_css)
);

Expand Down Expand Up @@ -1186,12 +1186,12 @@ public function getshowpopups(){
$config = (int)Yii::app()->getConfig('showpopups');
if ($config == 2){
if (isset($this->oOptions->showpopups)){
$this->showpopups = (int)$this->oOptions->showpopups;
$this->showpopups = (int)$this->oOptions->showpopups;
} else {
$this->showpopups = 1;
}
} else {
$this->showpopups = $config;
}
}
}
}

0 comments on commit db420e5

Please sign in to comment.