示例#1
0
    bailOut(OC_Contacts_App::$l10n->t('element name is not set.'));
}
if (!$id) {
    bailOut(OC_Contacts_App::$l10n->t('id is not set.'));
}
if (!$checksum) {
    bailOut(OC_Contacts_App::$l10n->t('checksum is not set.'));
}
if (is_array($value)) {
    $value = array_map('strip_tags', $value);
    ksort($value);
    // NOTE: Important, otherwise the compound value will be set in the order the fields appear in the form!
    //if($name == 'CATEGORIES') {
    //	$value = OC_Contacts_VCard::escapeDelimiters($value, ',');
    //} else {
    $value = OC_Contacts_VCard::escapeDelimiters($value, ';');
    //}
} else {
    $value = trim(strip_tags($value));
}
$vcard = OC_Contacts_App::getContactVCard($id);
$line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum);
if (is_null($line)) {
    bailOut(OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page: ') . $checksum);
}
$element = $vcard->children[$line]->name;
if ($element != $name) {
    bailOut(OC_Contacts_App::$l10n->t('Something went FUBAR. ') . $name . ' != ' . $element);
}
/* preprocessing value */
switch ($element) {