Move setting from dom to dynamic js
authorColeman Watts <coleman@civicrm.org>
Fri, 13 Mar 2015 15:57:01 +0000 (11:57 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 13 Mar 2015 15:57:01 +0000 (11:57 -0400)
CRM/Admin/Form/Preferences.php
CRM/Core/Resources.php
templates/CRM/common/l10n.js.tpl

index 2da915f66a186c7021d12aa815f93509430aa89b..7ea57242790e09e02aa360b9982422b10291e821 100644 (file)
@@ -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');
   }
index b46698fac7a7578e0e8a607ce781e22aa2d21e68..f098456209a92473a7f7391fec47c79d35ac59cb 100644 (file)
@@ -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();
index 5984e543f6f45e7a6e646ab49dc5374d094a9b11..d48aec7fb399ff5420b52768d8771106e0f939d5 100644 (file)
@@ -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});