Skip to content

Commit

Permalink
Dev: Fixed : be sure to get the actual 'survey-template' package
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Dec 18, 2016
1 parent 707a9f2 commit da5193c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions application/controllers/admin/templates.php
Expand Up @@ -686,7 +686,8 @@ protected function _templatesummary($templatename, $screenname, $editfile, $temp
// The following lines are forcing the browser to refresh the templates on each save
@$fnew = fopen("$tempdir/template_temp_$time.html", "w+");
$aData['time'] = $time;

/* Load this template config, else 'survey-template' package can be outdated */
$oEditedTemplate = Template::model()->getTemplateConfiguration($templatename);
if (!$fnew) {
$aData['filenotwritten'] = true;
}
Expand All @@ -703,9 +704,6 @@ protected function _templatesummary($templatename, $screenname, $editfile, $temp
$myoutput = implode("\n", $myoutput);
/* Must remove all exitsing scripts / css and js */

App()->getClientScript()->registerPackage('jqueryui');
App()->getClientScript()->registerPackage('jquery-touch-punch');
App()->getClientScript()->registerPackage('limesurvey-public');
$this->registerScriptFile( 'SCRIPT_PATH', 'survey_runtime.js');
/* register template package : PS : use asset :) */
Yii::app()->clientScript->registerPackage( 'survey-template' );
Expand Down Expand Up @@ -733,7 +731,7 @@ protected function _templatesummary($templatename, $screenname, $editfile, $temp
default: $sEditorFileType='html';
break;
}
$oEditedTemplate = Template::model()->getTemplateConfiguration($templatename);

$editableCssFiles = $this->_initcssfiles($oEditedTemplate, true);
$filesdir = $oEditedTemplate->filesPath;
$aData['screenname'] = $screenname;
Expand Down
1 change: 0 additions & 1 deletion application/models/TemplateConfiguration.php
Expand Up @@ -160,7 +160,6 @@ public function setTemplateConfiguration($sTemplateName='', $iSurveyId='')

$this->otherFiles = $this->setOtherFiles();


// Package creation
$this->createTemplatePackage();

Expand Down

0 comments on commit da5193c

Please sign in to comment.