aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/feedwriter/FeedWriter.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/3rdparty/libraries/feedwriter/FeedWriter.php')
-rwxr-xr-xinc/3rdparty/libraries/feedwriter/FeedWriter.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/inc/3rdparty/libraries/feedwriter/FeedWriter.php b/inc/3rdparty/libraries/feedwriter/FeedWriter.php
index d708e99b..9446cddf 100755
--- a/inc/3rdparty/libraries/feedwriter/FeedWriter.php
+++ b/inc/3rdparty/libraries/feedwriter/FeedWriter.php
@@ -2,6 +2,7 @@
2define('RSS2', 1, true); 2define('RSS2', 1, true);
3define('JSON', 2, true); 3define('JSON', 2, true);
4define('JSONP', 3, true); 4define('JSONP', 3, true);
5define('ATOM', 4, true);
5 6
6 /** 7 /**
7 * Univarsel Feed Writer class 8 * Univarsel Feed Writer class
@@ -101,11 +102,11 @@ define('JSONP', 3, true);
101 header('Content-type: application/javascript; charset=UTF-8'); 102 header('Content-type: application/javascript; charset=UTF-8');
102 } 103 }
103 } 104 }
104 105
105 if ($this->version == JSON || $this->version == JSONP) { 106 if ($this->version == JSON || $this->version == JSONP) {
106 $this->json = new stdClass(); 107 $this->json = new stdClass();
107 } 108 }
108 109
109 110
110 $this->printHead(); 111 $this->printHead();
111 $this->printChannels(); 112 $this->printChannels();
@@ -116,6 +117,11 @@ define('JSONP', 3, true);
116 } 117 }
117 } 118 }
118 119
120 public function &getItems()
121 {
122 return $this->items;
123 }
124
119 /** 125 /**
120 * Create a new FeedItem. 126 * Create a new FeedItem.
121 * 127 *
@@ -199,7 +205,8 @@ define('JSONP', 3, true);
199 */ 205 */
200 public function setDescription($description) 206 public function setDescription($description)
201 { 207 {
202 $this->setChannelElement('description', $description); 208 $tag = ($this->version == ATOM)? 'subtitle' : 'description';
209 $this->setChannelElement($tag, $description);
203 } 210 }
204 211
205 /** 212 /**
@@ -244,7 +251,7 @@ define('JSONP', 3, true);
244 { 251 {
245 $out = '<?xml version="1.0" encoding="utf-8"?>'."\n"; 252 $out = '<?xml version="1.0" encoding="utf-8"?>'."\n";
246 if ($this->xsl) $out .= '<?xml-stylesheet type="text/xsl" href="'.htmlspecialchars($this->xsl).'"?>' . PHP_EOL; 253 if ($this->xsl) $out .= '<?xml-stylesheet type="text/xsl" href="'.htmlspecialchars($this->xsl).'"?>' . PHP_EOL;
247 $out .= '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">' . PHP_EOL; 254 $out .= '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">' . PHP_EOL;
248 echo $out; 255 echo $out;
249 } 256 }
250 elseif ($this->version == JSON || $this->version == JSONP) 257 elseif ($this->version == JSON || $this->version == JSONP)