Update action-menu styles
[civicrm-core.git] / CRM / Contact / Form / GroupContact.php
index ba7ec81bed680a2fc8ec05b70452d1b107c8f5bd..a6ad2c36c20fe894c80581b2b1bfccfffd41bc63 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -59,33 +59,10 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
   }
 
-  /**
-   * This function sets the default values for the form. GroupContact that in edit/view mode
-   * the default values are retrieved from the database
-   *
-   * @access public
-   *
-   * @return None
-   */
-  function setDefaultValues() {
-    $defaults = array();
-    $params = array();
-
-    return $defaults;
-  }
-
-  /**
-   * This function is used to add the rules for form.
-   *
-   * @return None
-   * @access public
-   */
-  function addRules() {}
-
   /**
    * Function to build the form
    *
-   * @return None
+   * @return void
    * @access public
    */
   public function buildQuickForm() {
@@ -99,9 +76,7 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
     }
 
     // Arrange groups into hierarchical listing (child groups follow their parents and have indentation spacing in title)
-    $ids = implode(',', array_keys($allGroups));
-    $ids = 'IN (' . $ids . ')';
-    $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($ids, NULL, '&nbsp;&nbsp;', TRUE);
+    $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($allGroups, NULL, '&nbsp;&nbsp;', TRUE);
 
     // get the list of groups contact is currently in ("Added") or unsubscribed ("Removed").
     $currentGroups = CRM_Contact_BAO_GroupContact::getGroupList($this->_contactId);
@@ -127,7 +102,7 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
         $msg = ts('Add to a group');
       }
 
-      $this->add('select', 'group_id', $msg, $groupSelect, TRUE);
+      $this->add('select', 'group_id', '', $groupSelect, TRUE, array('class' => 'crm-select2 crm-action-menu action-icon-plus', 'placeholder' => $msg));
 
       $this->addButtons(array(
           array(
@@ -144,12 +119,11 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
    *
    * @access public
    *
-   * @return None
+   * @return void
    */
   public function postProcess() {
     $contactID = array($this->_contactId);
     $groupId   = $this->controller->exportValue('GroupContact', 'group_id');
-    $method    = 'Admin';
     $method    = ($this->_context == 'user') ? 'Web' : 'Admin';
 
     $session = CRM_Core_Session::singleton();