From 4841adaa6a401c0400930a9ae1cc70901a0a0c7c Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 6 Feb 2012 07:23:44 +0100 Subject: [PATCH] Modification for adding photos. --- ajax/addproperty.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ajax/addproperty.php b/ajax/addproperty.php index a00346c7..23f0a937 100644 --- a/ajax/addproperty.php +++ b/ajax/addproperty.php @@ -71,6 +71,28 @@ if(is_array($value)) { $value = strip_tags($value); } +switch($name) { + case 'BDAY': + $date = New DateTime($value); + $value = $date->format(DateTime::ATOM); + case 'FN': + if(!$value) { + // create a method thats returns an alternative for FN. + //$value = getOtherValue(); + } + case 'N': + case 'ORG': + case 'NICKNAME': + break; + case 'EMAIL': + $value = strtolower($value); + break; + case 'TEL': + case 'ADR': // should I delete the property if empty or throw an error? + break; +} + + $property = $vcard->addProperty($name, $value); //, $parameters); $line = count($vcard->children) - 1;