]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
let callers pass in an XMLOutputter to output to
authorEvan Prodromou <evan@status.net>
Sun, 2 Jan 2011 23:21:56 +0000 (15:21 -0800)
committerEvan Prodromou <evan@status.net>
Sat, 8 Jan 2011 00:29:10 +0000 (19:29 -0500)
lib/activity.php

index 8d7ae1540b7b23b06daba33d30ff580a13227235..b77d53427cd087df7dc9b23e014980672613d92a 100644 (file)
@@ -322,6 +322,7 @@ class Activity
      *
      * @return DOMElement Atom entry
      */
+
     function toAtomEntry()
     {
         return null;
@@ -330,7 +331,12 @@ class Activity
     function asString($namespace=false, $author=true, $source=false)
     {
         $xs = new XMLStringer(true);
+        $this->outputTo($xs, $namespace, $author, $source);
+        return $xs->getString();
+    }
 
+    function outputTo($xs, $namespace=false, $author=true, $source=false)
+    {
         if ($namespace) {
             $attrs = array('xmlns' => 'http://www.w3.org/2005/Atom',
                            'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
@@ -518,9 +524,7 @@ class Activity
 
         $xs->elementEnd('entry');
 
-        $str = $xs->getString();
-       
-        return $str;
+        return;
     }
 
     private function _child($element, $tag, $namespace=self::SPEC)