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