From 6031f90ab6dfd81a22aa42dc737da09fb9161890 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Wed, 28 Dec 2016 11:12:51 +0100 Subject: [PATCH] Dev: switch not active in question edit Dev: bootstrap.js not loaded for public template --- application/controllers/survey/index.php | 2 +- .../admin/survey/Question/advanced_settings_view.php | 11 ++++++----- application/views/layouts/public.php | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/application/controllers/survey/index.php b/application/controllers/survey/index.php index 0bbaa225ed0..bc1eba0dc1d 100644 --- a/application/controllers/survey/index.php +++ b/application/controllers/survey/index.php @@ -51,7 +51,7 @@ public function run() App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts')."survey_runtime.js"); - if($oTemplate->cssFramework == 'bootstrap') + if($oTemplate->cssFramework->name == 'bootstrap') { // We now use the bootstrap package isntead of the Yiistrap TbApi::register() method // Then instead of using the composer dependency system for templates diff --git a/application/views/admin/survey/Question/advanced_settings_view.php b/application/views/admin/survey/Question/advanced_settings_view.php index 7b5e6daf344..98b7411d549 100644 --- a/application/views/admin/survey/Question/advanced_settings_view.php +++ b/application/views/admin/survey/Question/advanced_settings_view.php @@ -154,10 +154,11 @@ clientScript->scripts as $index=>$script) -//~ { - //~ echo CHtml::script(implode("\n",$script)); -//~ } -//~ Yii::app()->clientScript->reset(); +/* Launch all needed script (here after load) needed for widget */ +foreach (Yii::app()->clientScript->scripts as $index=>$script) +{ + echo CHtml::script(implode("\n",$script)); +} +Yii::app()->clientScript->reset(); ?> diff --git a/application/views/layouts/public.php b/application/views/layouts/public.php index 428ecddf361..5c7ea0809e5 100644 --- a/application/views/layouts/public.php +++ b/application/views/layouts/public.php @@ -31,7 +31,7 @@ getInstance($this->sTemplate); Yii::app()->clientScript->registerPackage('survey-template'); - if($oTemplate->cssFramework == 'bootstrap') + if($oTemplate->cssFramework->name == 'bootstrap') { /* Why not add it for whole framework ? */ Yii::app()->getClientScript()->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport');