A call to the calendar API to get an array of events from a given calendar_id might be a useful feature. You can use it to filter events based on location, date, organizer aso. It could also be used to present events in whatever fashion you like. If a function like this existed, I'm guessing it would be easy enough to write a views plugin to render events in views...

The specification is here: https://developers.google.com/google-apps/calendar/v3/reference/events/list

The function call could be something like this:

function gcal_calendar_events_get($params, $account_name)

And that will return an array of events, as per https://developers.google.com/google-apps/calendar/v3/reference/events/list

Comments

Roensby’s picture

patch

Roensby’s picture

StatusFileSize
new3.42 KB
Roensby’s picture

StatusFileSize
new3.46 KB

original patch had wrong number of parameters.

sadashiv’s picture

Status: Active » Patch (to be ported)

Thanks for the patch. Will add this in the next version.

Roensby’s picture

Great! I've added a project to implement view support to gcal. Working sandbox code is here: https://drupal.org/sandbox/cchow/2223053. I've added it to the project issue queue.

Currently view integration is implemented with basic field functionality. I'm working on a custom filter handler and sort handler for whatever gcal_calendar_events_get returns.

So far gcalviews only supports the event resource, but the storage format is generic, so in a few code revisions it should be able to handle whatever resource Google Calendar returns.

kenorb’s picture

Status: Patch (to be ported) » Needs review
magicmyth’s picture

StatusFileSize
new3.82 KB

Just come across the need for this myself. I've made a slight API change so that $optional_parameters is actually optional as well as cleaned up the documentation a little.

I do think the underlying implementation of the service should be hidden and thus the Google API PHP Client objects should not be returned directly but gcal's own interface. This way things like caching could be added in the future and gcal would shield other modules from changes in the Google API PHP Client library (which has changed a lot over relatively short periods of time).