/**
  * Returns a list of addressbook's groups.
  *
  * @return array addressbook's groups list.
  */
 public function get_addressbook_groups()
 {
     // get addressbook's id from request
     $address_book_id = get_input_value('address_book_id', RCUBE_INPUT_POST);
     // get key from request. Key identifies the row wich sent the request
     $key = get_input_value('key', RCUBE_INPUT_POST);
     // get addressbook by id
     $rcube_contacts = $this->rcmail->get_address_book($address_book_id);
     // send back to client a group list in array form
     $response = array('groups' => $rcube_contacts->list_groups(), 'key' => $key);
     $this->rcmail->output->command('plugin.recipient_to_contact_get_addressbook_groups_response', $response);
 }