Commit 758e562a724f7d072a86db7f3fcb46b36f327111
1 parent
dab96ce5
Notes
Showing
1 changed file
with
11 additions
and
11 deletions
ktatompub/lib/KTAPPFeed.inc.php
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 32 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 33 | * must display the words "Powered by KnowledgeTree" and retain the original | 33 | * must display the words "Powered by KnowledgeTree" and retain the original |
| 34 | * copyright notice. | 34 | * copyright notice. |
| 35 | - * Contributor( s): | 35 | + * Contributor( s): |
| 36 | * Mark Holtzhausen <mark@knowledgetree.com> | 36 | * Mark Holtzhausen <mark@knowledgetree.com> |
| 37 | * | 37 | * |
| 38 | */ | 38 | */ |
| @@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
| 43 | */ | 43 | */ |
| 44 | include_once('KTAPDoc.inc.php'); | 44 | include_once('KTAPDoc.inc.php'); |
| 45 | 45 | ||
| 46 | -/* | 46 | +/* Remember to include support for feed attributes / nodes |
| 47 | <?xml version="1.0" encoding="utf-8"?> | 47 | <?xml version="1.0" encoding="utf-8"?> |
| 48 | <feed xmlns="http://www.w3.org/2005/Atom"> | 48 | <feed xmlns="http://www.w3.org/2005/Atom"> |
| 49 | 49 | ||
| @@ -69,44 +69,44 @@ include_once('KTAPDoc.inc.php'); | @@ -69,44 +69,44 @@ include_once('KTAPDoc.inc.php'); | ||
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | class KTAPPFeed extends KTAPDoc { | 71 | class KTAPPFeed extends KTAPDoc { |
| 72 | - | 72 | + |
| 73 | private $baseURI=NULL; | 73 | private $baseURI=NULL; |
| 74 | private $feed=NULL; | 74 | private $feed=NULL; |
| 75 | 75 | ||
| 76 | - | 76 | + |
| 77 | public function __construct($baseURI=NULL,$title=NULL,$link=NULL,$updated=NULL,$author=NULL,$id=NULL){ | 77 | public function __construct($baseURI=NULL,$title=NULL,$link=NULL,$updated=NULL,$author=NULL,$id=NULL){ |
| 78 | parent::__construct(); | 78 | parent::__construct(); |
| 79 | $this->constructHeader(); | 79 | $this->constructHeader(); |
| 80 | $this->baseURI=$baseURI; | 80 | $this->baseURI=$baseURI; |
| 81 | } | 81 | } |
| 82 | - | 82 | + |
| 83 | private function constructHeader(){ | 83 | private function constructHeader(){ |
| 84 | $feed=$this->newElement('feed'); | 84 | $feed=$this->newElement('feed'); |
| 85 | $feed->appendChild($this->newAttr('xmlns','http://www.w3.org/2005/Atom')); | 85 | $feed->appendChild($this->newAttr('xmlns','http://www.w3.org/2005/Atom')); |
| 86 | $this->feed=&$feed; | 86 | $this->feed=&$feed; |
| 87 | $this->DOM->appendChild($this->feed); | 87 | $this->DOM->appendChild($this->feed); |
| 88 | } | 88 | } |
| 89 | - | 89 | + |
| 90 | public function &newEntry(){ | 90 | public function &newEntry(){ |
| 91 | $entry=$this->newElement('entry'); | 91 | $entry=$this->newElement('entry'); |
| 92 | $this->feed->appendChild($entry); | 92 | $this->feed->appendChild($entry); |
| 93 | - return $entry; | 93 | + return $entry; |
| 94 | } | 94 | } |
| 95 | - | 95 | + |
| 96 | public function &newField($name=NULL,$value=NULL,&$entry=NULL){ | 96 | public function &newField($name=NULL,$value=NULL,&$entry=NULL){ |
| 97 | $field=$this->newElement($name,$value); | 97 | $field=$this->newElement($name,$value); |
| 98 | if(isset($entry))$entry->appendChild($field); | 98 | if(isset($entry))$entry->appendChild($field); |
| 99 | return $field; | 99 | return $field; |
| 100 | } | 100 | } |
| 101 | - | 101 | + |
| 102 | public function getAPPdoc(){ | 102 | public function getAPPdoc(){ |
| 103 | return $this->formatXmlString(trim($this->DOM->saveXML())); | 103 | return $this->formatXmlString(trim($this->DOM->saveXML())); |
| 104 | } | 104 | } |
| 105 | - | 105 | + |
| 106 | public function render(){ | 106 | public function render(){ |
| 107 | return $this->getAPPdoc(); | 107 | return $this->getAPPdoc(); |
| 108 | } | 108 | } |
| 109 | - | 109 | + |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | 112 |