CRM-13863 - Added setting to disable ajax popups
[civicrm-core.git] / CRM / Event / Form / ParticipantFeeSelection.php
index 10d9d22d099013a5a9c3a689d55d02e53e212caa..f5eddbd10708a4ead3f0b65f29cd232acdabe23a 100644 (file)
@@ -125,7 +125,9 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
   }
 
   public function buildQuickForm() {
-    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
+    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
+      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
+    }
 
     $statuses = CRM_Event_PseudoConstant::participantStatus();
     $this->assign('partiallyPaid',  array_search('Partially paid', $statuses));