diff options
author | alecpl <alec@alec.pl> | 2011-06-16 12:20:19 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-06-16 12:20:19 +0000 |
commit | cc90ed1f84174a89039feb6906775778e0c4eb18 (patch) | |
tree | 24984caa4b857dffb84a12ac3cde73bb967c466b /program/include/rcube_addressbook.php | |
parent | 1a034323fc7cefc8dd0283ae9d1a83ce3abbaf0a (diff) |
- Add addressbook name in contact info frame (#1487958)
Diffstat (limited to 'program/include/rcube_addressbook.php')
-rw-r--r-- | program/include/rcube_addressbook.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/program/include/rcube_addressbook.php b/program/include/rcube_addressbook.php index c580c400d..cefe4612f 100644 --- a/program/include/rcube_addressbook.php +++ b/program/include/rcube_addressbook.php @@ -33,7 +33,7 @@ abstract class rcube_addressbook const ERROR_INCOMPLETE = 3; const ERROR_SAVING = 4; const ERROR_SEARCH = 5; - + /** public properties (mandatory) */ public $primary_key; public $groups = false; @@ -43,10 +43,15 @@ abstract class rcube_addressbook public $list_page = 1; public $page_size = 10; public $coltypes = array('name' => array('limit'=>1), 'firstname' => array('limit'=>1), 'surname' => array('limit'=>1), 'email' => array('limit'=>1)); - + protected $error; /** + * Returns addressbook name (e.g. for addressbooks listing) + */ + abstract function get_name(); + + /** * Save a search string for future listings * * @param mixed Search params to use in listing method, obtained by get_search_set() @@ -129,7 +134,7 @@ abstract class rcube_addressbook { return $this->error; } - + /** * Setter for errors for internal use * @@ -378,7 +383,7 @@ abstract class rcube_addressbook } } } - + return $out; } @@ -397,7 +402,7 @@ abstract class rcube_addressbook array('/[\s;\+\-\/]+/i', '/(\d)[-.\s]+(\d)/', '/\s\w{1,3}\s/'), array(' ', '\\1\\2', ' '), $str)); - + foreach ($arr as $i => $part) { if (utf8_encode(utf8_decode($part)) == $part) { // is latin-1 ? $arr[$i] = utf8_encode(strtr(strtolower(strtr(utf8_decode($part), @@ -408,7 +413,7 @@ abstract class rcube_addressbook else $arr[$i] = mb_strtolower($part); } - + return join(" ", $arr); } |