RSS feed for blocks and suggested API change for Modules

RSS feed for blocks and suggested API change for Modules

by Stacey Walker -
Number of replies: 1
Hi,

We developed an RSS feed for the "recent activity" block for a client running 1.9, which provides a solution for this Tracker issue: http://tracker.moodle.org/browse/MDL-17045. The patch is provided there.

These changes took care of the basic rss feed for course updates, however the new users functionality is still using a deprecated function and will need some work it seems to get this up to a current version so doesn't actually return any useful results. The changes to rss/file.php opens up the possiblity for all blocks to write RSS feeds which could be a helpful feature for other blocks as well; the "latest news" and "upcoming events" blocks for example.

After this simple RSS feed functionality we needed to develop the recent activity per modules while still retaining the standard printing for the block. The result we came up with we would like to suggest as a module API change for 2.0 and we have also added a new Tracker issue for this here: http://tracker.moodle.org/browse/MDL-19065.

Using the forum module as an example, we added a new function to the mod/forum/lib.php file that split up the log retrieval from the display: adding forum_get_recent_activity(..) to return an array of recent activity objects. The function forum_print_recent_activity(..) then only needs to call this new get function and display the results as it wishes. The RSS functionality for recent activity in course/lib.php can
then use the new get function to add items to the feed and the existing recent activity block function can call the existing print.

This allows for simpler porting of modules when implementing this change as existing modules can just retain the print function if they don't wish to add RSS feed functionality.

The two patches for our development are attached to the Tracker issues

Any feedback?

Stacey Walker
Average of ratings: -
In reply to Stacey Walker

Re: RSS feed for blocks and suggested API change for Modules

by bill explicit -
hi,
i've downloadded your plugin and try it on my 1.9.5 but i don't get any xml file. the file.php give a blank page.

did you have any idea how to solve that ?

thanks a lot

and nice work.