From fada3517b0e461e2e6a112d6e4f6eb71d856816b Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Tue, 4 Oct 2011 21:13:44 +0200 Subject: All the basic field for add contact added --- apps/contacts/lib/vcard.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'apps/contacts/lib/vcard.php') diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php index 1c9a8049f73..78327ab15e1 100644 --- a/apps/contacts/lib/vcard.php +++ b/apps/contacts/lib/vcard.php @@ -272,6 +272,26 @@ class OC_Contacts_VCard{ return $array; } + /** + * @brief Add property to vcard object + * @param object $vcard + * @param object $name of property + * @param object $value of property + * @param object $paramerters of property + */ + public static function addVCardProperty($vcard, $name, $value, $parameters=array()){ + if(is_array($value)){ + $value = OC_Contacts_VCard::escapeSemicolons($value); + } + $property = new Sabre_VObject_Property( $name, $value ); + $parameternames = array_keys($parameters); + foreach($parameternames as $i){ + $property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]); + } + + $vcard->add($property); + } + /** * @brief Data structure of vCard * @param object $property -- cgit v1.2.3