From 883480fb56dd62f69b606966a0a46b77c50142e3 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 18 Jul 2007 14:20:11 +0200 Subject: Action plugin hook for manipulating feed items darcs-hash:20070718122011-7ad00-5c9ae37801b80ff2e42929ae9729f625c447c405.gz --- feed.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/feed.php b/feed.php index ce8b26e28..cf1b7a64c 100644 --- a/feed.php +++ b/feed.php @@ -134,6 +134,7 @@ function rss_buildItems(&$rss,&$data,$opt){ global $conf; global $lang; + foreach($data as $ditem){ if(!is_array($ditem)){ // not an array? then only a list of IDs was given @@ -257,8 +258,16 @@ function rss_buildItems(&$rss,&$data,$opt){ if($cat) $item->category = $cat; } - // finally add the item to the feed object - $rss->addItem($item); + // finally add the item to the feed object, after handing it to registered plugins + $evdata = array('item' => &$item, + 'opt' => &$opt, + 'ditem' => &$ditem, + 'rss' => &$rss); + $evt = new Doku_Event('RSS_ITEM', $evdata); + if ($evt->advise_before()){ + $rss->addItem($item); + } + $evt->advise_after(); // for completeness } } -- cgit v1.2.3