INFRA-132 - Batch 14 (g)
[civicrm-core.git] / CRM / UF / Form / Group.php
index cbb7a55e8dc73edf39390d5796264ad6288ed50f..77c3c3aa5c3cd1a04064625cce25c77f8005c276 100644 (file)
@@ -80,8 +80,8 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
     }
     elseif ($this->_action & (CRM_Core_Action::DISABLE | CRM_Core_Action::DELETE)) {
       $ufGroup['module'] = implode(' , ', CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id, TRUE));
-      $status            = 0;
-      $status            = CRM_Core_BAO_UFGroup::usedByModule($this->_id);
+      $status = 0;
+      $status = CRM_Core_BAO_UFGroup::usedByModule($this->_id);
       if ($this->_action & (CRM_Core_Action::DISABLE)) {
         if ($status) {
           $message = 'This profile is currently used for ' . $ufGroup['module'] . '. If you disable the profile - it will be removed from these forms and/or modules. Do you want to continue?';
@@ -251,9 +251,16 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
 
       $showAdvanced = 0;
       $advFields = array(
-        'group', 'post_URL', 'cancel_URL',
-        'add_captcha', 'is_map', 'is_uf_link', 'is_edit_link',
-        'is_update_dupe', 'is_cms_user', 'is_proximity_search',
+        'group',
+        'post_URL',
+        'cancel_URL',
+        'add_captcha',
+        'is_map',
+        'is_uf_link',
+        'is_edit_link',
+        'is_update_dupe',
+        'is_cms_user',
+        'is_proximity_search',
       );
       foreach ($advFields as $key) {
         if (!empty($defaults[$key])) {
@@ -287,8 +294,8 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
    * @param array $self
    *   Current form object.
    *
-   * @return true if no errors, else array of errors
-   * @static
+   * @return bool|array
+   *   true if no errors, else array of errors
    */
   public static function formRule($fields, $files, $self) {
     $errors = array();
@@ -299,9 +306,9 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
     $name .= $self->_id ? '_' . $self->_id : '';
     $query = 'select count(*) from civicrm_uf_group where ( name like %1 ) and id != %2';
     $pCnt = CRM_Core_DAO::singleValueQuery($query, array(
-    1 => array($name, 'String'),
-        2 => array((int) $self->_id, 'Integer'),
-      ));
+      1 => array($name, 'String'),
+      2 => array((int) $self->_id, 'Integer'),
+    ));
     if ($pCnt) {
       $errors['title'] = ts('Profile \'%1\' already exists in Database.', array(1 => $title));
     }
@@ -368,8 +375,8 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
         $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? '' : '/add';
         $url = CRM_Utils_System::url("civicrm/admin/uf/group/field$action", 'reset=1&new=1&gid=' . $ufGroup->id . '&action=' . ($action ? 'add' : 'browse'));
         CRM_Core_Session::setStatus(ts('Your CiviCRM Profile \'%1\' has been added. You can add fields to this profile now.',
-            array(1 => $ufGroup->title)
-          ), ts('Profile Added'), 'success');
+          array(1 => $ufGroup->title)
+        ), ts('Profile Added'), 'success');
       }
       $session = CRM_Core_Session::singleton();
       $session->replaceUserContext($url);