I am attaching a patch for the event_get_calendar api function to add some additional features to make it work better in displaying event nodes in the event_views module. I tried to be very careful not to change anything that would affect the results for any modules that expect the current behavior, while adding a couple additional features. Basically the patch:

* adds an optional $params variable that can contain additional parameters that need to be passed to the api

* $params['as_array'] would instruct the api to return the calendar row array instead of the themed output so another module could further massage or theme the array.

* $params['force_week'] is a week number. If provided, the resulting calendar will display only that week. The current api behavior will return an entire month calendar even if the 'week' option is selected. That is correct if several weeks of items are submitted, but not if you really only want the one week.

* $params['hide_header'], if provided, will omit the heading rows the api adds in at the beginning of each year and month. They are returned as td rows in addition to whatever was requested as a title in the th. I am trying to emulate the existing calendar look and feel so themes and css will work correctly, so I want only the th heading not td rows with a month or year name in them.

To test this patch, you can use the new version of the event_views module (http://drupal.org/node/67060) which I will be committing to cvs shortly. This should make it possible to use views to create a collection of events and view them in a display that looks very nearly like the current event calendar, with the year, month, day, and week as args to filter dates, prev and next links that take you to the next and previous calendar, and the ability to add exposed filters to select type and taxonomy.

CommentFileSizeAuthor
event.module_38.patch5.48 KBkarens

Comments

RayZ’s picture

It doesn't appear that the current version of event_views requires this patch, correct?
Does it still add useful features?
Just wondering whether and how to test the functionality.

karens’s picture

Yes, I'd still like to see this patch. The current version of event views is getting along by including a copy of the api with the patch applied and using that instead of the original api. If this patch gets applied I'll drop the copy from event views and use the original api instead.

You're testing it by using the event views module, which is using the api with the patch applied. It would be nice to make sure that it also works for other modules that use the api, but I don't know what other modules are using it.

RayZ’s picture

OK, thanks.

+1 to committing it then. Event_views is working for me.

killes@www.drop.org’s picture

Is this patch still needed for D5?

karens’s picture

Status: Needs review » Closed (won't fix)

This code was moved to the Calendar module which has its own version of this code, so this patch is no longer needed. Sorry I forgot to update this issue!