diff options
author | alecpl <alec@alec.pl> | 2010-10-27 07:23:57 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-10-27 07:23:57 +0000 |
commit | b393e542472ed9a6b6aada78103e1ad26e167973 (patch) | |
tree | bbd8eacc212e78af34afc455b891b02cdc1bc69a /program | |
parent | 125e935306ae32850a6baaea537485983f4359d1 (diff) |
- Add rcube_addressbook::get_record_groups() (#1487089)
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcube_addressbook.php | 56 | ||||
-rw-r--r-- | program/include/rcube_contacts.php | 6 |
2 files changed, 41 insertions, 21 deletions
diff --git a/program/include/rcube_addressbook.php b/program/include/rcube_addressbook.php index c8e18ea85..8b621f669 100644 --- a/program/include/rcube_addressbook.php +++ b/program/include/rcube_addressbook.php @@ -64,13 +64,6 @@ abstract class rcube_addressbook abstract function list_records($cols=null, $subset=0); /** - * List all active contact groups of this source - * - * @return array Indexed list of contact groups, each a hash array - */ - function list_groups() { } - - /** * Search records * * @param array List of fields to search in @@ -99,6 +92,7 @@ abstract class rcube_addressbook * * @param mixed record identifier(s) * @param boolean True to return record as associative array, otherwise a result set is returned + * * @return mixed Result object with all record fields or False if not found */ abstract function get_record($id, $assoc=false); @@ -132,12 +126,6 @@ abstract class rcube_addressbook } /** - * Setter for the current group - * (empty, has to be re-implemented by extending class) - */ - function set_group($gid) { } - - /** * Create a new contact record * * @param array Assoziative array with save data @@ -180,6 +168,23 @@ abstract class rcube_addressbook } /** + * Setter for the current group + * (empty, has to be re-implemented by extending class) + */ + function set_group($gid) { } + + /** + * List all active contact groups of this source + * + * @return array Indexed list of contact groups, each a hash array + */ + function list_groups() + { + /* empty for address books don't supporting groups */ + return array(); + } + + /** * Create a contact group with the given name * * @param string The group name @@ -190,7 +195,7 @@ abstract class rcube_addressbook /* empty for address books don't supporting groups */ return false; } - + /** * Delete the given group and all linked group members * @@ -202,7 +207,7 @@ abstract class rcube_addressbook /* empty for address books don't supporting groups */ return false; } - + /** * Rename a specific contact group * @@ -215,20 +220,20 @@ abstract class rcube_addressbook /* empty for address books don't supporting groups */ return false; } - + /** * Add the given contact records the a certain group * * @param string Group identifier * @param array List of contact identifiers to be added - * @return int Number of contacts added + * @return int Number of contacts added */ function add_to_group($group_id, $ids) { /* empty for address books don't supporting groups */ return 0; } - + /** * Remove the given contact records from a certain group * @@ -241,4 +246,19 @@ abstract class rcube_addressbook /* empty for address books don't supporting groups */ return 0; } + + /** + * Get group assignments of a specific contact record + * + * @param mixed Record identifier + * + * @return array List of assigned groups as ID=>Name pairs + * @since 0.5-beta + */ + function get_record_groups($id) + { + /* empty for address books don't supporting groups */ + return array(); + } } + diff --git a/program/include/rcube_contacts.php b/program/include/rcube_contacts.php index e1dc7c535..d017793e9 100644 --- a/program/include/rcube_contacts.php +++ b/program/include/rcube_contacts.php @@ -355,10 +355,10 @@ class rcube_contacts extends rcube_addressbook /** - * Get group assignments of a specific contacr record + * Get group assignments of a specific contact record * * @param mixed Record identifier - * @param array List of assigned groups as ID=>Name pairs + * @return array List of assigned groups as ID=>Name pairs */ function get_record_groups($id) { @@ -384,7 +384,7 @@ class rcube_contacts extends rcube_addressbook /** * Create a new contact record * - * @param array Assoziative array with save data + * @param array Associative array with save data * @return integer|boolean The created record ID on success, False on error */ function insert($save_data, $check=false) |