From cc90ed1f84174a89039feb6906775778e0c4eb18 Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 16 Jun 2011 12:20:19 +0000 Subject: - Add addressbook name in contact info frame (#1487958) --- program/include/rcube_addressbook.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'program/include/rcube_addressbook.php') 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,9 +43,14 @@ 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 * @@ -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); } -- cgit v1.2.3