Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-03-23-18-45-28
[civicrm-core.git] / CRM / Admin / Form.php
index 40bc2bbc6e870cae0ebdb0b90fe5dab3a4440766..516b24f3c11c8be4ded342ad489edf5d28324a92 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -46,31 +46,31 @@ class CRM_Admin_Form extends CRM_Core_Form {
   protected $_id;
 
   /**
-   * The default values for form fields
+   * The default values for form fields.
    *
    * @var int
    */
   protected $_values;
 
   /**
-   * The name of the BAO object for this form
+   * The name of the BAO object for this form.
    *
    * @var string
    */
   protected $_BAOName;
 
   /**
-   * Basic setup
+   * Basic setup.
    */
-  function preProcess() {
-    $this->_id      = $this->get('id');
+  public function preProcess() {
+    $this->_id = $this->get('id');
     $this->_BAOName = $this->get('BAOName');
-    $this->_values  = array();
+    $this->_values = array();
     if (isset($this->_id)) {
       $params = array('id' => $this->_id);
       // this is needed if the form is outside the CRM name space
       $baoName = $this->_BAOName;
-      $baoName::retrieve($params, $this->_values );
+      $baoName::retrieve($params, $this->_values);
     }
   }
 
@@ -78,16 +78,15 @@ class CRM_Admin_Form extends CRM_Core_Form {
    * Set default values for the form. Note that in edit/view mode
    * the default values are retrieved from the database
    *
-   * @access public
    *
    * @return array
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     if (isset($this->_id) && empty($this->_values)) {
       $this->_values = array();
       $params = array('id' => $this->_id);
       $baoName = $this->_BAOName;
-      $baoName::retrieve($params, $this->_values );
+      $baoName::retrieve($params, $this->_values);
     }
     $defaults = $this->_values;
 
@@ -106,10 +105,9 @@ class CRM_Admin_Form extends CRM_Core_Form {
   }
 
   /**
-   * Add standard buttons
+   * Add standard buttons.
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
     if ($this->_action & CRM_Core_Action::VIEW || $this->_action & CRM_Core_Action::PREVIEW) {
@@ -137,5 +135,5 @@ class CRM_Admin_Form extends CRM_Core_Form {
       );
     }
   }
-}
 
+}