예제 #1
0
    //if($name == 'CATEGORIES') {
    //	$value = VCard::escapeDelimiters($value, ',');
    //} else {
    //	$value = VCard::escapeDelimiters($value, ';');
    //}
} else {
    $value = trim(strip_tags($value));
}
$vcard = App::getContactVCard($id);
if (!$vcard) {
    bailOut(App::$l10n->t('Couldn\'t find vCard for %d.', array($id)));
}
$property = null;
if (in_array($name, $multi_properties)) {
    if ($checksum !== 'new') {
        $line = App::getPropertyLineByChecksum($vcard, $checksum);
        if (is_null($line)) {
            bailOut(App::$l10n->t('Information about vCard is incorrect. Please reload the page: ') . $checksum);
        }
        $property = $vcard->children[$line];
        $element = $property->name;
        if ($element != $name) {
            bailOut(App::$l10n->t('Something went FUBAR. ') . $name . ' != ' . $element);
        }
    } else {
        // Add new property
        $element = $name;
        if (!is_scalar($value)) {
            $property = VObject\Property::create($name);
            if (in_array($name, array('ADR'))) {
                $property->setParts($value);