rcube_vcard

Logical representation of a vcard-based address record Provides functions to parse and export vCard data format

package

Framework

subpackage

Addressbook

Methods

Constructor

__construct($vcard = null, $charset = RCUBE_CHARSET, $detect = false, $fieldmap = array()) 

Arguments

$vcard

$charset

$detect

$fieldmap

Load record from (internal, unfolded) vcard 3.0 format

load($vcard, $charset = RCUBE_CHARSET, $detect = false) 

Arguments

$vcard

$charset

$detect

Return vCard data as associative array to be unsed in Roundcube address books

get_assoc() : array

Response

array

Hash array with key-value pairs

Convert the data structure into a vcard 3.0 string

export($folded = true) 

Arguments

$folded

Clear the given fields in the loaded vcard data

reset($fields = null) 

Arguments

$fields

Setter for address record fields

set($field, $value, $type = 'HOME') 

Arguments

$field

$value

$type

Setter for individual vcard properties

set_raw($tag, $value, $append = false) 

Arguments

$tag

$value

$append

Find index with the '$type' attribute

get_type_index($field, $type = 'pref') : int

Arguments

$field

$type

Response

int

Field index having $type set

Convert a whole vcard (array) to UTF-8.

charset_convert($card, $force_charset = null) 
static

If $force_charset is null, each member value that has a charset parameter will be converted

Arguments

$card

$force_charset

Extends fieldmap definition

extend_fieldmap($map) 

Arguments

$map

Factory method to import a vcard file

import($data) : array
static

Arguments

$data

Response

array

List of rcube_vcard objects

Normalize vcard data for better parsing

cleanup($vcard) : string
static

Arguments

$vcard

Response

string

Cleaned vcard block

x_abrelatednames_callback

x_abrelatednames_callback($matches) 
static

Arguments

$matches

rfc2425_fold_callback

rfc2425_fold_callback($matches) 
static

Arguments

$matches

rfc2425_fold

rfc2425_fold($val) 
static

Arguments

$val

Decodes a vcard block (vcard 3.0 format, unfolded) into an array structure

vcard_decode($vcard) : array
static

Arguments

$vcard

Response

array

Raw data structure

Decode a given string with the encoding rule from ENCODING attributes

decode_value($value, $encoding) : string
static

Arguments

$value

$encoding

Response

string

Decoded 8bit value

Encodes an entry for storage in our database (vcard 3.0 format, unfolded)

vcard_encode($data) : string
static

Arguments

$data

Response

string

vCard encoded string

Join indexed data array to a vcard quoted string

vcard_quote($s, $sep = ';') : string
static

Arguments

$s

$sep

Response

string

Joined and quoted string

Split quoted string

vcard_unquote($s, $sep = ';') : array
static

Arguments

$s

$sep

Response

array

List with splited values

Check if vCard entry is empty: empty string or an array with all entries empty.

is_empty(mixed $value) : bool
static

Arguments

$value

mixed

Attribute value (string or array)

Response

bool

True if the value is empty, False otherwise

Extract array values by a filter

array_filter($arr, $values, $inverse = false) : array
static

Arguments

$arr

$values

$inverse

Response

array

The filtered array

Returns UNICODE type based on BOM (Byte Order Mark)

detect_encoding($string) : string
static

Arguments

$string

Response

string

Detected encoding

Properties

values_decoded

values_decoded : 
static

raw

raw : 

fieldmap

fieldmap : 
static

typemap

typemap : 

phonetypemap

phonetypemap : 

addresstypemap

addresstypemap : 

immap

immap : 

business

business : 

displayname

displayname : 

surname

surname : 

firstname

firstname : 

middlename

middlename : 

nickname

nickname : 

organization

organization : 

email

email : 

eol

eol : 
static