| | |
| | | 'spouse' => 'X-SPOUSE', |
| | | ); |
| | | private $typemap = array('iPhone' => 'mobile', 'CELL' => 'mobile'); |
| | | private $phonetypemap = array('HOME1' => 'HOME', 'BUSINESS1' => 'WORK', 'BUSINESS2' => 'WORK2', 'WORKFAX' => 'BUSINESSFAX'); |
| | | private $phonetypemap = array('HOME1' => 'HOME', 'BUSINESS1' => 'WORK', 'BUSINESS2' => 'WORK2', 'BUSINESSFAX' => 'WORKFAX'); |
| | | private $addresstypemap = array('BUSINESS' => 'WORK'); |
| | | private $immap = array('X-JABBER' => 'jabber', 'X-ICQ' => 'icq', 'X-MSN' => 'msn', 'X-AIM' => 'aim', 'X-YAHOO' => 'yahoo', 'X-SKYPE' => 'skype', 'X-SKYPE-USERNAME' => 'skype'); |
| | | |
| | |
| | | ($detected_charset = self::detect_encoding(self::vcard_encode($this->raw))) && $detected_charset != RCMAIL_CHARSET) { |
| | | $this->raw = self::charset_convert($this->raw, $detected_charset); |
| | | } |
| | | |
| | | // consider FN empty if the same as the primary e-mail address |
| | | if ($this->raw['FN'][0][0] == $this->raw['EMAIL'][0][0]) |
| | | $this->raw['FN'][0][0] = ''; |
| | | |
| | | // find well-known address fields |
| | | $this->displayname = $this->raw['FN'][0][0]; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Setter for individual vcard properties |
| | | * |
| | | * @param string VCard tag name |
| | | * @param array Value-set of this vcard property |
| | | * @param boolean Set to true if the value-set should be appended instead of replacing any existing value-set |
| | | */ |
| | | public function set_raw($tag, $value, $append = false) |
| | | { |
| | | $index = $append ? count($this->raw[$tag]) : 0; |
| | | $this->raw[$tag][$index] = (array)$value; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Find index with the '$type' attribute |
| | |
| | | if (preg_match('/^END:VCARD$/i', $line)) { |
| | | // parse vcard |
| | | $obj = new rcube_vcard(self::cleanup($vcard_block), $charset, true); |
| | | if (!empty($obj->displayname)) |
| | | if (!empty($obj->displayname) || !empty($obj->email)) |
| | | $out[] = $obj; |
| | | |
| | | $in_vcard_block = false; |
| | |
| | | return $result; |
| | | } |
| | | else { |
| | | return strtr($s, array("\r" => '', '\\\\' => '\\', '\n' => "\n", '\N' => "\n", '\,' => ',', '\;' => ';')); |
| | | return strtr($s, array("\r" => '', '\\\\' => '\\', '\n' => "\n", '\N' => "\n", '\,' => ',', '\;' => ';', '\:' => ':')); |
| | | } |
| | | } |
| | | |