Added category parsing
This commit is contained in:
parent
cc6b3898a5
commit
35a157ead9
@ -1,5 +1,11 @@
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/h44z/vcard"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"jeroendesloovere/vcard": "1.2.*"
|
||||
"jeroendesloovere/vcard": "dev-patchcategories"
|
||||
}
|
||||
}
|
||||
|
@ -397,6 +397,11 @@ class ContactModule extends Module
|
||||
$vCard->addNote($notes);
|
||||
}
|
||||
|
||||
if (!empty($this->getProp($messageProps, "categories"))) {
|
||||
$categories = array_map('trim', explode(';', trim($this->getProp($messageProps, "categories"), " ;")));
|
||||
$vCard->addCategories($categories);
|
||||
}
|
||||
|
||||
$hasPicture = $this->getProp($messageProps, "has_picture");
|
||||
if (!empty($hasPicture) && $hasPicture === true) {
|
||||
$attachNum = -1;
|
||||
@ -921,6 +926,14 @@ class ContactModule extends Module
|
||||
if (isset($vCard->note)) {
|
||||
$properties["notes"] = $vCard->note;
|
||||
}
|
||||
if (isset($vCard->categories) && count($vCard->categories) > 0) {
|
||||
$categories = array();
|
||||
foreach ($vCard->categories as $category) {
|
||||
$categories[] = $category;
|
||||
}
|
||||
|
||||
$properties["categories"] = $categories;
|
||||
}
|
||||
if (isset($vCard->rawPhoto) || isset($vCard->photo)) {
|
||||
if (!is_writable(TMP_PATH . "/")) {
|
||||
error_log("Can not write to export tmp directory!");
|
||||
|
Loading…
Reference in New Issue
Block a user