Skip to content

Commit

Permalink
Fixed issue #15599: Ajax mode being activated when importing an old s…
Browse files Browse the repository at this point in the history
…urvey which has it enabled
  • Loading branch information
c-schmitz committed Nov 20, 2019
1 parent 7deb416 commit 0abf282
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/themeoptions.php
Expand Up @@ -80,7 +80,7 @@ public function update($id)
{
$model = $this->loadModel($id);
if (Permission::model()->hasTemplatePermission($model->template_name, 'update')) {
// Turn Ajax off as defualt save it after.
// Turn Ajax off as default save it after.
$model = $this->turnAjaxmodeOffAsDefault($model);
$model->save();

Expand Down
6 changes: 3 additions & 3 deletions application/core/LsDefaultDataSets.php
Expand Up @@ -167,7 +167,7 @@ public static function getTemplateConfigurationData()
'files_css' => '{"add":["css/ajaxify.css","css/theme.css","css/custom.css"]}',
'files_js' => '{"add":["scripts/theme.js","scripts/ajaxify.js","scripts/custom.js"]}',
'files_print_css' => '{"add":["css/print_theme.css"]}',
'options' => '{"ajaxmode":"on","brandlogo":"on","container":"on", "hideprivacyinfo": "off", "brandlogofile":"./files/logo.png","font":"noto"}',
'options' => '{"ajaxmode":"off","brandlogo":"on","container":"on", "hideprivacyinfo": "off", "brandlogofile":"./files/logo.png","font":"noto"}',
'cssframework_name' => 'bootstrap',
'cssframework_css' => '{}',
'cssframework_js' => '',
Expand All @@ -183,7 +183,7 @@ public static function getTemplateConfigurationData()
'files_css' => '{"add":["css/ajaxify.css","css/animate.css","css/variations/sea_green.css","css/theme.css","css/custom.css"]}',
'files_js' => '{"add":["scripts/theme.js","scripts/ajaxify.js","scripts/custom.js"]}',
'files_print_css' => '{"add":["css/print_theme.css"]}',
'options' => '{"ajaxmode":"on","brandlogo":"on","brandlogofile":"./files/logo.png","container":"on","backgroundimage":"off","backgroundimagefile":null,"animatebody":"off","bodyanimation":"fadeInRight","bodyanimationduration":"500","animatequestion":"off","questionanimation":"flipInX","questionanimationduration":"500","animatealert":"off","alertanimation":"shake","alertanimationduration":"500","font":"noto","bodybackgroundcolor":"#ffffff","fontcolor":"#444444","questionbackgroundcolor":"#ffffff","questionborder":"on","questioncontainershadow":"on","checkicon":"f00c","animatecheckbox":"on","checkboxanimation":"rubberBand","checkboxanimationduration":"500","animateradio":"on","radioanimation":"zoomIn","radioanimationduration":"500","zebrastriping":"off","stickymatrixheaders":"off","greyoutselected":"off","hideprivacyinfo":"off","crosshover":"off","showpopups":"1"}',
'options' => '{"ajaxmode":"off","brandlogo":"on","brandlogofile":"./files/logo.png","container":"on","backgroundimage":"off","backgroundimagefile":null,"animatebody":"off","bodyanimation":"fadeInRight","bodyanimationduration":"500","animatequestion":"off","questionanimation":"flipInX","questionanimationduration":"500","animatealert":"off","alertanimation":"shake","alertanimationduration":"500","font":"noto","bodybackgroundcolor":"#ffffff","fontcolor":"#444444","questionbackgroundcolor":"#ffffff","questionborder":"on","questioncontainershadow":"on","checkicon":"f00c","animatecheckbox":"on","checkboxanimation":"rubberBand","checkboxanimationduration":"500","animateradio":"on","radioanimation":"zoomIn","radioanimationduration":"500","zebrastriping":"off","stickymatrixheaders":"off","greyoutselected":"off","hideprivacyinfo":"off","crosshover":"off","showpopups":"1"}',
'cssframework_name' => 'bootstrap',
'cssframework_css' => '{}',
'cssframework_js' => '',
Expand All @@ -199,7 +199,7 @@ public static function getTemplateConfigurationData()
'files_css' => '{"add":["css/ajaxify.css","css/theme.css","css/custom.css"]}',
'files_js' => '{"add":["scripts/theme.js","scripts/ajaxify.js","scripts/custom.js"]}',
'files_print_css' => '{"add":["css/print_theme.css"]}',
'options' => '{"ajaxmode":"on","brandlogo":"on","container":"on","brandlogofile":"./files/logo.png"}',
'options' => '{"ajaxmode":"off","brandlogo":"on","container":"on","brandlogofile":"./files/logo.png"}',
'cssframework_name' => 'bootstrap',
'cssframework_css' => '{"replace":[["css/bootstrap.css","css/variations/flatly.min.css"]]}',
'cssframework_js' => '',
Expand Down
7 changes: 0 additions & 7 deletions themes/survey/vanilla/views/layout_global.twig
Expand Up @@ -74,13 +74,6 @@
{{ include('./subviews/header/head.twig') }}
{% endblock %}
<body style="padding-top: 90px;" class=" {{ aSurveyInfo.class.body }} font-{{ aSurveyInfo.options.font }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {% if( aSurveyInfo.options.brandlogo == "on") %}brand-logo{%endif%}" {{ aSurveyInfo.attr.body }} >
{% if (aSurveyInfo.options.ajaxmode == "on" and aSurveyInfo.printPdf != 1) %}
{% block ajaxindicator %}
{# In vanilla, this file is empty, we keep it to have a common layout between all core themes #}
{{ include('./subviews/navigation/ajax_indicator.twig') }}
{% endblock %}

{% endif %}

{# This used for the pjax system #}
{% block pjaxbegin %}
Expand Down
4 changes: 0 additions & 4 deletions themes/survey/vanilla/views/layout_survey_list.twig
Expand Up @@ -91,10 +91,6 @@
{{ include('./subviews/header/head.twig') }}

<body class=" {{ aSurveyInfo.class.body }} font-{{ aSurveyInfo.options.font }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {% if( aSurveyInfo.options.brandlogo == "on") %}brand-logo{%endif%}" {{ aSurveyInfo.attr.body }} >
{% if (aSurveyInfo.options.ajaxmode == "on" and aSurveyInfo.printPdf != 1) %}
{# In vanilla, this file is empty, we keep it to have a common layout between all core themes #}
{{ include('./subviews/navigation/ajax_indicator.twig') }}
{% endif %}

{# This used for the pjax system #}
<div id="beginScripts">
Expand Down
9 changes: 0 additions & 9 deletions themes/survey/vanilla/views/subviews/header/head.twig
Expand Up @@ -39,15 +39,6 @@
window.basicThemeScripts = new ThemeScripts();
}
</script>
{# Ajax mode #}
{% if(aSurveyInfo.options.ajaxmode == "on") %}
<script type="text/javascript">
var ajaxHandler = new AjaxSubmitObject();
$(document).on('ready', function () {
ajaxHandler.bindActions();
});
</script>
{% endif %}
{# LSvar update with #}
{{ registerScript("LSvarTemplateInit","LSvar= LSvar || {};","POS_HEAD") }}
{% if(aSurveyInfo.options.fixnumauto and aSurveyInfo.options.fixnumauto != "off") %}
Expand Down
Expand Up @@ -56,7 +56,7 @@
<!-- Needs to be set by javascript! Because if JavaScript is disabled, ajaxmode will completely fail! -->
{{
registerScript("AJAXACTIVATE", "
$('#limesurvey').append('<input type=\"hidden\" name=\"ajax\" value=\"" ~ aSurveyInfo.options.ajaxmode ~ "\" id=\"ajax\" />');
$('#limesurvey').append('<input type=\"hidden\" name=\"ajax\" value=\"off\" id=\"ajax\" />');
", "POS_POSTSCRIPT")
}}

Expand Down

0 comments on commit 0abf282

Please sign in to comment.