forked from GNUsocial/gnu-social
let callers pass in an XMLOutputter to output to
This commit is contained in:
parent
00516fc16f
commit
df18ba2fd9
@ -322,6 +322,7 @@ class Activity
|
|||||||
*
|
*
|
||||||
* @return DOMElement Atom entry
|
* @return DOMElement Atom entry
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function toAtomEntry()
|
function toAtomEntry()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@ -330,7 +331,12 @@ class Activity
|
|||||||
function asString($namespace=false, $author=true, $source=false)
|
function asString($namespace=false, $author=true, $source=false)
|
||||||
{
|
{
|
||||||
$xs = new XMLStringer(true);
|
$xs = new XMLStringer(true);
|
||||||
|
$this->outputTo($xs, $namespace, $author, $source);
|
||||||
|
return $xs->getString();
|
||||||
|
}
|
||||||
|
|
||||||
|
function outputTo($xs, $namespace=false, $author=true, $source=false)
|
||||||
|
{
|
||||||
if ($namespace) {
|
if ($namespace) {
|
||||||
$attrs = array('xmlns' => 'http://www.w3.org/2005/Atom',
|
$attrs = array('xmlns' => 'http://www.w3.org/2005/Atom',
|
||||||
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
|
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
|
||||||
@ -518,9 +524,7 @@ class Activity
|
|||||||
|
|
||||||
$xs->elementEnd('entry');
|
$xs->elementEnd('entry');
|
||||||
|
|
||||||
$str = $xs->getString();
|
return;
|
||||||
|
|
||||||
return $str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _child($element, $tag, $namespace=self::SPEC)
|
private function _child($element, $tag, $namespace=self::SPEC)
|
||||||
|
Loading…
Reference in New Issue
Block a user