2010-02-10 22:24:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class AtomNoticeFeed extends Atom10Feed
|
|
|
|
{
|
|
|
|
function __construct($indent = true) {
|
|
|
|
parent::__construct($indent);
|
|
|
|
|
2010-02-11 02:55:14 +00:00
|
|
|
// Feeds containing notice info use these namespaces
|
2010-02-10 22:24:16 +00:00
|
|
|
|
|
|
|
$this->addNamespace(
|
|
|
|
'xmlns:thr',
|
|
|
|
'http://purl.org/syndication/thread/1.0'
|
|
|
|
);
|
2010-02-11 02:55:14 +00:00
|
|
|
|
|
|
|
$this->addNamespace(
|
|
|
|
'xmlns:georss',
|
|
|
|
'http://www.georss.org/georss'
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->addNamespace(
|
|
|
|
'xmlns:activity',
|
|
|
|
'http://activitystrea.ms/spec/1.0/'
|
|
|
|
);
|
|
|
|
|
|
|
|
// XXX: What should the uri be?
|
|
|
|
$this->addNamespace(
|
|
|
|
'xmlns:ostatus',
|
|
|
|
'http://ostatus.org/schema/1.0'
|
|
|
|
);
|
2010-02-10 22:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|