diff options
Diffstat (limited to 'lib/atomnoticefeed.php')
-rw-r--r-- | lib/atomnoticefeed.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/atomnoticefeed.php b/lib/atomnoticefeed.php new file mode 100644 index 000000000..a28c9cda7 --- /dev/null +++ b/lib/atomnoticefeed.php @@ -0,0 +1,34 @@ +<?php + +class AtomNoticeFeed extends Atom10Feed +{ + function __construct($indent = true) { + parent::__construct($indent); + + // Feeds containing notice info use the Atom Threading Extensions + + $this->addNamespace( + 'xmlns:thr', + 'http://purl.org/syndication/thread/1.0' + ); + } + + function addEntryFromNotices($notices) + { + if (is_array($notices)) { + foreach ($notices as $notice) { + $this->addEntryFromNotice($notice); + } + } else { + while ($notices->fetch()) { + $this->addEntryFromNotice($notice); + } + } + } + + function addEntryFromNotice($notice) + { + $this->addEntryRaw($notice->asAtomEntry()); + } + +}
\ No newline at end of file |