Provide correct getcontenttype property for addressbook resources.

This commit is contained in:
Andrew McMillan 2010-09-25 17:17:06 +12:00
parent 5ebbb198e9
commit 1e22e9a8a1

View File

@ -259,7 +259,12 @@ class DAVResource
else {
$this->resourcetypes = '';
if ( isset($this->resource->caldav_data) ) {
if ( substr($this->resource->caldav_data,0,15) == 'BEGIN:VCALENDAR' ) $this->contenttype = 'text/calendar';
if ( substr($this->resource->caldav_data,0,15) == 'BEGIN:VCALENDAR' ) {
$this->contenttype = 'text/calendar';
}
else if ( isset($this->resource->fn) ) {
$this->contenttype = 'text/vcard';
}
$this->resource->displayname = $this->resource->summary;
}
}
@ -523,6 +528,9 @@ EOQRY;
if ( substr($this->resource->caldav_data,0,15) == 'BEGIN:VCALENDAR' ) {
$this->contenttype = 'text/calendar';
}
else if ( isset($this->resource->fn) ) {
$this->contenttype = 'text/vcard';
}
$this->resourcetypes = '';
}
else {