summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-10-02 15:27:55 -0400
committerEvan Prodromou <evan@status.net>2009-10-02 15:27:55 -0400
commitb3b3af9a2eff10c272bb213eccd3dd3060bc5830 (patch)
treeff0ae9108bcb085015a8e9f286963ad9fe58c13c /classes/User_group.php
parent51ac34e80c5a99008b1a945b2c00b6dbfdde1529 (diff)
parent5309910b9b4dd2533ff5b2190f90bf415fd20113 (diff)
Merge branch '0.8.x' into deleteuser
Diffstat (limited to 'classes/User_group.php')
-rw-r--r--classes/User_group.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php
index b1ab1c2d3..ea19cbb97 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -297,4 +297,45 @@ class User_group extends Memcached_DataObject
return $ids;
}
+
+ function asAtomEntry($namespace=false, $source=false)
+ {
+ $xs = new XMLStringer(true);
+
+ if ($namespace) {
+ $attrs = array('xmlns' => 'http://www.w3.org/2005/Atom',
+ 'xmlns:thr' => 'http://purl.org/syndication/thread/1.0');
+ } else {
+ $attrs = array();
+ }
+
+ $xs->elementStart('entry', $attrs);
+
+ if ($source) {
+ $xs->elementStart('source');
+ $xs->element('title', null, $profile->nickname . " - " . common_config('site', 'name'));
+ $xs->element('link', array('href' => $this->permalink()));
+ }
+
+ if ($source) {
+ $xs->elementEnd('source');
+ }
+
+ $xs->element('title', null, $this->nickname);
+ $xs->element('summary', null, $this->description);
+
+ $xs->element('link', array('rel' => 'alternate',
+ 'href' => $this->permalink()));
+
+ $xs->element('id', null, $this->permalink());
+
+ $xs->element('published', null, common_date_w3dtf($this->created));
+ $xs->element('updated', null, common_date_w3dtf($this->modified));
+
+ $xs->element('content', array('type' => 'html'), $this->description);
+
+ $xs->elementEnd('entry');
+
+ return $xs->getString();
+ }
}