Merge pull request #24148 from civicrm/5.52
[civicrm-core.git] / CRM / Mailing / Form / Subscribe.php
index 4afec4edc65fd9f83031b2f166b57f8149274dab..110cb39395a76472e06e0ab4079a7ab39d5ef2aa 100644 (file)
@@ -43,7 +43,7 @@ SELECT   title, frontend_title, description, frontend_description
       $dao = CRM_Core_DAO::executeQuery($query);
       if ($dao->fetch()) {
         $this->assign('groupName', !empty($dao->frontend_title) ? $dao->frontend_title : $dao->title);
-        CRM_Utils_System::setTitle(ts('Subscribe to Mailing List - %1', [1 => !empty($dao->frontend_title) ? $dao->frontend_title : $dao->title]));
+        $this->setTitle(ts('Subscribe to Mailing List - %1', [1 => !empty($dao->frontend_title) ? $dao->frontend_title : $dao->title]));
       }
       else {
         CRM_Core_Error::statusBounce("The specified group is not configured for this action OR The group doesn't exist.");
@@ -53,7 +53,7 @@ SELECT   title, frontend_title, description, frontend_description
     }
     else {
       $this->assign('single', FALSE);
-      CRM_Utils_System::setTitle(ts('Mailing List Subscription'));
+      $this->setTitle(ts('Mailing List Subscription'));
     }
   }
 
@@ -105,24 +105,12 @@ ORDER BY title";
       $this->addFormRule(['CRM_Mailing_Form_Subscribe', 'formRule']);
     }
 
-    // CRM-11316 Enable ReCAPTCHA for anonymous visitors
-    $session = CRM_Core_Session::singleton();
-    $contactID = $session->get('userID');
-
-    if (!$contactID) {
-      CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this);
-    }
-
     $this->addButtons([
       [
         'type' => 'next',
         'name' => ts('Subscribe'),
         'isDefault' => TRUE,
       ],
-      [
-        'type' => 'cancel',
-        'name' => ts('Cancel'),
-      ],
     ]);
   }