INFRA-132 - CRM/Contribute - phpcbf
[civicrm-core.git] / CRM / Contribute / Form / ContributionPage / Settings.php
index a880c93629ca383bcc32c60460071c3bd01f8471..8b5e7dc43662831f0c7751bce4caab564871dd78 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -38,7 +38,6 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
    * Set variables up before form is built
    *
    * @return void
-   * @access public
    */
   public function preProcess() {
     parent::preProcess();
@@ -48,11 +47,10 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
    * Set default values for the form. Note that in edit/view mode
    * the default values are retrieved from the database
    *
-   * @access public
    *
    * @return void
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     $defaults = parent::setDefaultValues();
     $soft_credit_types = CRM_Core_OptionGroup::values('soft_credit_type', TRUE, FALSE, FALSE, NULL, 'name');
 
@@ -116,7 +114,6 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
    * Build the form object
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
 
@@ -216,16 +213,16 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
   /**
    * Global validation rules for the form
    *
-   * @param array $values posted values of the form
+   * @param array $values
+   *   Posted values of the form.
    *
    * @param $files
    * @param $self
    *
    * @return array list of errors to be posted back to the form
    * @static
-   * @access public
    */
-  static function formRule($values, $files, $self) {
+  public static function formRule($values, $files, $self) {
     $errors = array();
     $contributionPageId = $self->_id;
     //CRM-4286
@@ -295,7 +292,6 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
    * Process the form
    *
    * @return void
-   * @access public
    */
   public function postProcess() {
     // get the submitted form values.
@@ -351,23 +347,22 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
         )
     );
 
-
     foreach ($ufJoinParams as $index => $ufJoinParam) {
       if (!empty($params[$index])) {
-          $ufJoinParam['weight'] = 1;
-          if ($index == 'honor_block_is_active') {
-            $ufJoinParam['is_active'] = 1;
-            $ufJoinParam['module'] = 'soft_credit';
-            $ufJoinParam['uf_group_id'] = $params['honoree_profile'];
-            $ufJoinParam['module_data'] = $sctJSON;
-          }
-          else {
-            // first delete all past entries
-            CRM_Core_BAO_UFJoin::deleteAll($ufJoinParam);
-            $ufJoinParam['uf_group_id'] = $params[$index];
-          }
-            CRM_Core_BAO_UFJoin::create($ufJoinParam);
+        $ufJoinParam['weight'] = 1;
+        if ($index == 'honor_block_is_active') {
+          $ufJoinParam['is_active'] = 1;
+          $ufJoinParam['module'] = 'soft_credit';
+          $ufJoinParam['uf_group_id'] = $params['honoree_profile'];
+          $ufJoinParam['module_data'] = $sctJSON;
+        }
+        else {
+          // first delete all past entries
+          CRM_Core_BAO_UFJoin::deleteAll($ufJoinParam);
+          $ufJoinParam['uf_group_id'] = $params[$index];
         }
+        CRM_Core_BAO_UFJoin::create($ufJoinParam);
+      }
       elseif ($index == 'honor_block_is_active') {
         //On subsequent honor_block_is_active uncheck, disable(don't delete)
         //that particular honoree profile entry in UFjoin table, CRM-13981
@@ -402,10 +397,8 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
    * Return a descriptive name for the page, used in wizard header
    *
    * @return string
-   * @access public
    */
   public function getTitle() {
     return ts('Title and Settings');
   }
 }
-