Add the $c->hide_alarms functionality into DAVResource class.

This commit is contained in:
Andrew McMillan 2011-10-30 16:05:14 +13:00
parent 3cc3396d67
commit 02b6d47082

View File

@ -283,6 +283,17 @@ class DAVResource
$this->resource->location = null;
$this->resource->url = null;
}
else if ( isset($c->hide_alarms) && $c->hide_alarms && !$this->HavePrivilegeTo('write') ) {
$vcal1 = new iCalComponent($this->resource->caldav_data);
$comps = $vcal1->GetComponents();
$vcal2 = new iCalComponent();
$vcal2->VCalendar();
foreach( $comps AS $comp ) {
$comp->ClearComponents('VALARM');
$vcal2->AddComponent($comp);
}
$this->resource->caldav_data = $vcal2->Render();
}
}
else if ( strtoupper(substr($this->resource->caldav_data,0,11)) == 'BEGIN:VCARD' ) {
$this->contenttype = 'text/vcard';