From 7b83e31243151208755220a82c927a50b6c779f8 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 13 Mar 2015 11:57:01 -0400 Subject: [PATCH] Move setting from dom to dynamic js --- CRM/Admin/Form/Preferences.php | 2 ++ CRM/Core/Resources.php | 2 +- templates/CRM/common/l10n.js.tpl | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Form/Preferences.php b/CRM/Admin/Form/Preferences.php index 2da915f66a..7ea5724279 100644 --- a/CRM/Admin/Form/Preferences.php +++ b/CRM/Admin/Form/Preferences.php @@ -305,6 +305,8 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form { ); } } + // Update any settings stored in dynamic js + CRM_Core_Resources::singleton()->resetCacheCode(); CRM_Core_Session::setStatus(ts('Your changes have been saved.'), ts('Saved'), 'success'); } diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index b46698fac7..f098456209 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -603,7 +603,6 @@ class CRM_Core_Resources { // Add global settings $settings = array( 'config' => array( - 'ajaxPopupsEnabled' => $this->ajaxPopupsEnabled, 'isFrontend' => $config->userFrameworkFrontend, ), ); @@ -676,6 +675,7 @@ class CRM_Core_Resources { 'contactCreate' => CRM_Core_BAO_UFGroup::getCreateLinks(), 'filters' => self::getEntityRefFilters(), ), + 'ajaxPopupsEnabled' => self::singleton()->ajaxPopupsEnabled, ); print CRM_Core_Smarty::singleton()->fetchWith('CRM/common/l10n.js.tpl', $vars); CRM_Utils_System::civiExit(); diff --git a/templates/CRM/common/l10n.js.tpl b/templates/CRM/common/l10n.js.tpl index 5984e543f6..d48aec7fb3 100644 --- a/templates/CRM/common/l10n.js.tpl +++ b/templates/CRM/common/l10n.js.tpl @@ -32,6 +32,7 @@ CRM.config.lcMessages = {$config->lcMessages|@json_encode}; $.datepicker._defaults.dateFormat = CRM.config.dateInputFormat = {$config->dateInputFormat|@json_encode}; CRM.config.timeIs24Hr = {if $config->timeInputFormat eq 2}true{else}false{/if}; + CRM.config.ajaxPopupsEnabled = {$ajaxPopupsEnabled|@json_encode}; // Merge entityRef settings CRM.config.entityRef = $.extend({ldelim}{rdelim}, {$entityRef|@json_encode}, CRM.config.entityRef || {ldelim}{rdelim}); -- 2.25.1