Skip to content

Commit

Permalink
Dev: reverted "Merge pull request #518 from hermannschwaerzlerUIBK/ma…
Browse files Browse the repository at this point in the history
…ster"

Dev: wasn't really solving the problem for old PHP version, and created new problems for some recent PHP versions (original code returned an array of strings, whereas the PR was returning an array of objects, rising a warning for some recent PHP version )
  • Loading branch information
LouisGac committed Jul 21, 2016
1 parent 70358e0 commit 97ed316
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions application/models/TemplateConfiguration.php
Expand Up @@ -137,7 +137,8 @@ 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;
$this->packages = $this->config->xpath('engine/packages/package');
$oPackages = $this->config->engine->packages->package;
$this->packages = (array) $oPackages;
$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 @@ -184,8 +185,8 @@ private function createTemplatePackage()
Yii::setPathOfAlias('survey.template.path', $this->path); // The package creation/publication need an alias
Yii::setPathOfAlias('survey.template.viewpath', $this->viewPath);

$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
$oCssFiles = $this->config->files->css->filename; // The CSS files of this template
$oJsFiles = $this->config->files->js->filename; // The JS files of this template

$jsDeactivateConsole = "
<script> var dummyConsole = {
Expand All @@ -198,13 +199,19 @@ private function createTemplatePackage()

if (getLanguageRTL(App()->language))
{
$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,
}
if(Yii::app()->getConfig('debug') == 0){
$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,
}

if (Yii::app()->getConfig('debug') == 0)
{
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/scripts/deactivatedebug.js', CClientScript::POS_END);
}

$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 97ed316

Please sign in to comment.