Merge pull request #4880 from totten/master-cs3
[civicrm-core.git] / CRM / Custom / Form / CustomData.php
index 24b5a04d1cac3f526d38faff42df8bb9bfc65900..dfd78931c6f2240b195ef2b36b72b28406c13289 100644 (file)
@@ -43,13 +43,14 @@ class CRM_Custom_Form_CustomData {
    * @param null|string $subName
    * @param null|string $subType
    * @param null|int $groupCount
-   * @param null|String $type
+   * @param string $type
    * @param null|int $entityID
    * @param null $onlySubType
    *
    * @return void
    */
-  static function preProcess(&$form, $subName = NULL, $subType = NULL,
+  static function preProcess(
+    &$form, $subName = NULL, $subType = NULL,
     $groupCount = NULL, $type = NULL, $entityID = NULL, $onlySubType = NULL
   ) {
     if ($type) {
@@ -102,11 +103,12 @@ class CRM_Custom_Form_CustomData {
       $form->_entityId = CRM_Utils_Request::retrieve('entityID', 'Positive', $form);
     }
 
-    $typeCheck = CRM_Utils_Request::retrieve( 'type', 'String', CRM_Core_DAO::$_nullObject );
+    $typeCheck = CRM_Utils_Request::retrieve('type', 'String', CRM_Core_DAO::$_nullObject);
     $urlGroupId = CRM_Utils_Request::retrieve('groupID', 'Positive', CRM_Core_DAO::$_nullObject);
-    if ( isset($typeCheck) && $urlGroupId) {
+    if (isset($typeCheck) && $urlGroupId) {
       $form->_groupID = $urlGroupId;
-    } else {
+    }
+    else {
       $form->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $form);
     }
 
@@ -150,7 +152,7 @@ class CRM_Custom_Form_CustomData {
    *
    * @return array
    */
-  static function setDefaultValues(&$form) {
+  public static function setDefaultValues(&$form) {
     $defaults = array();
     CRM_Core_BAO_CustomGroup::setDefaults($form->_groupTree, $defaults, FALSE, FALSE, $form->get('action'));
     return $defaults;
@@ -160,10 +162,9 @@ class CRM_Custom_Form_CustomData {
    * @param CRM_Core_Form $form
    * @return void
    */
-  static function buildQuickForm(&$form) {
+  public static function buildQuickForm(&$form) {
     $form->addElement('hidden', 'hidden_custom', 1);
     $form->addElement('hidden', "hidden_custom_group_count[{$form->_groupID}]", $form->_groupCount);
     CRM_Core_BAO_CustomGroup::buildQuickForm($form, $form->_groupTree);
   }
 }
-