INFRA-132 - Spaces around "."
[civicrm-core.git] / CRM / Price / Form / Set.php
index 1aadbe2b05f0af546f4bea3e157e2827c46d5c1b..5bcc4d664e15254b52329e88cea932ee37064141 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 class CRM_Price_Form_Set extends CRM_Core_Form {
 
   /**
-   * the set id saved to the session for an update
+   * The set id saved to the session for an update
    *
    * @var int
-   * @access protected
    */
   protected $_sid;
 
   /**
-   * Function to set variables up before form is built
+   * Set variables up before form is built
    *
    * @param null
    *
    * @return void
-   * @access public
    */
   public function preProcess() {
     // current set id
@@ -72,24 +70,27 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     CRM_Utils_System::setTitle($title);
 
     $url = CRM_Utils_System::url('civicrm/admin/price', 'reset=1');
-    $breadCrumb = array(array('title' => ts('Price Sets'),
+    $breadCrumb = array(array(
+    'title' => ts('Price Sets'),
         'url' => $url,
       ));
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
   }
 
   /**
-   * global form rule
+   * Global form rule
    *
-   * @param array $fields  the input form values
-   * @param array $files   the uploaded files if any
-   * @param array $options additional user data
+   * @param array $fields
+   *   The input form values.
+   * @param array $files
+   *   The uploaded files if any.
+   * @param array $options
+   *   Additional user data.
    *
    * @return true if no errors, else array of errors
-   * @access public
    * @static
    */
-  static function formRule($fields, $files, $options) {
+  public static function formRule($fields, $files, $options) {
     $errors = array();
     $count = count(CRM_Utils_Array::value('extends', $fields));
     //price sets configured for membership
@@ -109,12 +110,11 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
   }
 
   /**
-   * Function to actually build the form
+   * Build the form object
    *
    * @param null
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
     $this->applyFilter('__ALL__', 'trim');
@@ -150,6 +150,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
           }
           $extends[] = $option;
           break;
+
         case 'CiviContribute':
           $option = $this->createElement('checkbox', $compObj->componentID, NULL, ts('Contribution'));
           if (!empty($priceSetUsedTables)) {
@@ -162,6 +163,7 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
           }
           $extends[] = $option;
           break;
+
         case 'CiviMember':
           $option = $this->createElement('checkbox', $compObj->componentID, NULL, ts('Membership'));
           if (!empty($priceSetUsedTables)) {
@@ -231,22 +233,23 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
   }
 
   /**
-   * This function sets the default values for the form. Note that in edit/view mode
+   * Set default values for the form. Note that in edit/view mode
    * the default values are retrieved from the database
    *
    * @param null
    *
    * @return array   array of default values
-   * @access public
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     $defaults = array('is_active' => TRUE);
     if ($this->_sid) {
       $params = array('id' => $this->_sid);
       CRM_Price_BAO_PriceSet::retrieve($params, $defaults);
       $extends = explode(CRM_Core_DAO::VALUE_SEPARATOR, $defaults['extends']);
       unset($defaults['extends']);
-      foreach ($extends as $compId) $defaults['extends'][$compId] = 1;
+      foreach ($extends as $compId) {
+        $defaults['extends'][$compId] = 1;
+      }
     }
 
     return $defaults;
@@ -258,7 +261,6 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
    * @param null
    *
    * @return void
-   * @access public
    */
   public function postProcess() {
     // get the submitted form values.
@@ -270,7 +272,11 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     $compIds = array();
     $extends = CRM_Utils_Array::value('extends', $params);
     if (is_array($extends)) {
-      foreach ($extends as $compId => $selected) if ($selected) {   $compIds[] = $compId; }
+      foreach ($extends as $compId => $selected) {
+        if ($selected) {
+          $compIds[] = $compId;
+        }
+      }
     }
     $params['extends'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $compIds);
 
@@ -298,4 +304,3 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     }
   }
 }
-