Skip to content

Commit

Permalink
Fixed #11405: for php compatibility-reasons use xpath() instead of '-…
Browse files Browse the repository at this point in the history
…>' to retrieve array of settings from config.xml
  • Loading branch information
hermannschwaerzlerUIBK committed Jul 6, 2016
1 parent ea64ed3 commit ede82d5
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions application/models/TemplateConfiguration.php
Expand Up @@ -137,8 +137,7 @@ public function setTemplateConfiguration($sTemplateName='', $iSurveyId='')
$this->overwrite_question_views = (isset($this->config->engine->overwrite_question_views))? ( $this->config->engine->overwrite_question_views=='true' || $this->config->engine->overwrite_question_views=='yes' ) : false;

$this->cssFramework = $this->config->engine->cssframework;
$oPackages = $this->config->engine->packages->package;
$this->packages = (array) $oPackages;
$this->packages = $this->config->xpath('engine/packages/package');
$this->otherFiles = $this->setOtherFiles();
$this->depends = $this->packages;
//$this->depends[] = (string) $this->cssFramework; // Bootstrap CSS is no more needed for Bootstrap templates (their custom css like "flat_and_modern.css" is a custom version of bootstrap.css )
Expand Down Expand Up @@ -185,20 +184,16 @@ private function createTemplatePackage()
Yii::setPathOfAlias('survey.template.path', $this->path); // The package creation/publication need an alias
Yii::setPathOfAlias('survey.template.viewpath', $this->viewPath);

$oCssFiles = $this->config->files->css->filename; // The CSS files of this template
$oJsFiles = $this->config->files->js->filename; // The JS files of this template
$aCssFiles = $this->config->xpath('files/css/filename'); // The CSS files of this template
$aJsFiles = $this->config->xpath('files/js/filename'); // The JS files of this template


if (getLanguageRTL(App()->language))
{
$oCssFiles = $this->config->files->rtl->css->filename; // In RTL mode, original CSS files should not be loaded, else padding-left could be added to padding-right.)
$oJsFiles = $this->config->files->rtl->js->filename; // In RTL mode,
$aCssFiles = $this->config->xpath('files/rtl/css/filename'); // In RTL mode, original CSS files should not be loaded, else padding-left could be added to padding-right.)
$aJsFiles = $this->config->xpath('files/rtl/js/filename'); // In RTL mode,
}

$aCssFiles = (array) $oCssFiles;
$aJsFiles = (array) $oJsFiles;


// The package "survey-template" will be available from anywhere in the app now.
// To publish it : Yii::app()->clientScript->registerPackage( 'survey-template' );
// It will create the asset directory, and publish the css and js files
Expand Down

0 comments on commit ede82d5

Please sign in to comment.