diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Gdata/Calendar.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Gdata/Calendar.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,169 @@ +registerPackage('Zend_Gdata_Calendar'); + $this->registerPackage('Zend_Gdata_Calendar_Extension'); + parent::__construct($client, $applicationId); + $this->_httpClient->setParameterPost('service', self::AUTH_SERVICE_NAME); + } + + /** + * Retreive feed object + * + * @param mixed $location The location for the feed, as a URL or Query + * @return Zend_Gdata_Calendar_EventFeed + */ + public function getCalendarEventFeed($location = null) + { + if ($location == null) { + $uri = self::CALENDAR_EVENT_FEED_URI; + } else if ($location instanceof Zend_Gdata_Query) { + $uri = $location->getQueryUrl(); + } else { + $uri = $location; + } + return parent::getFeed($uri, 'Zend_Gdata_Calendar_EventFeed'); + } + + /** + * Retreive entry object + * + * @return Zend_Gdata_Calendar_EventEntry + */ + public function getCalendarEventEntry($location = null) + { + if ($location == null) { + require_once 'Zend/Gdata/App/InvalidArgumentException.php'; + throw new Zend_Gdata_App_InvalidArgumentException( + 'Location must not be null'); + } else if ($location instanceof Zend_Gdata_Query) { + $uri = $location->getQueryUrl(); + } else { + $uri = $location; + } + return parent::getEntry($uri, 'Zend_Gdata_Calendar_EventEntry'); + } + + + /** + * Retrieve feed object + * + * @return Zend_Gdata_Calendar_ListFeed + */ + public function getCalendarListFeed() + { + $uri = self::CALENDAR_FEED_URI . '/default'; + return parent::getFeed($uri,'Zend_Gdata_Calendar_ListFeed'); + } + + /** + * Retreive entryobject + * + * @return Zend_Gdata_Calendar_ListEntry + */ + public function getCalendarListEntry($location = null) + { + if ($location == null) { + require_once 'Zend/Gdata/App/InvalidArgumentException.php'; + throw new Zend_Gdata_App_InvalidArgumentException( + 'Location must not be null'); + } else if ($location instanceof Zend_Gdata_Query) { + $uri = $location->getQueryUrl(); + } else { + $uri = $location; + } + return parent::getEntry($uri,'Zend_Gdata_Calendar_ListEntry'); + } + + public function insertEvent($event, $uri=null) + { + if ($uri == null) { + $uri = $this->_defaultPostUri; + } + $newEvent = $this->insertEntry($event, $uri, 'Zend_Gdata_Calendar_EventEntry'); + return $newEvent; + } + +}