Attempt to fix paging on contact summary
[civicrm-core.git] / CRM / Utils / ReCAPTCHA.php
index d1afe457a1c785ae8a2935725dd877f839676f71..fab82510ce85e98c4a5cae8f4b9495a9f648782b 100644 (file)
@@ -62,7 +62,6 @@ class CRM_Utils_ReCAPTCHA {
     return self::$_singleton;
   }
 
-
   /**
    * Check if reCaptcha settings is avilable to add on form.
    */
@@ -121,4 +120,17 @@ class CRM_Utils_ReCAPTCHA {
     }
   }
 
+  /**
+   * Enable ReCAPTCHA on Contribution form
+   *
+   * @param CRM_Core_Form $form
+   */
+  public static function enableCaptchaOnForm(&$form) {
+    $captcha = CRM_Utils_ReCAPTCHA::singleton();
+    if ($captcha->hasSettingsAvailable()) {
+      $captcha->add($form);
+      $form->assign('isCaptcha', TRUE);
+    }
+  }
+
 }