summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2007-07-17 17:21:50 +0000
committerxue <>2007-07-17 17:21:50 +0000
commit9a59a5cab1384998872f8ee3b6653b90e03718c3 (patch)
tree17f2d5ed7cf94763f035d7875d33453c15047aa9
parent837b7af71deb8c16d9cf7301b989ffd6016c106d (diff)
Fixed #667.
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/Services/TFeedService.php24
2 files changed, 24 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index ce4b820f..59688d03 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2,6 +2,7 @@ Version 3.1.1 To be released
============================
BUG: Ticket#656 - TDatePicker does not return correct value when in callback mode (Christophe)
BUG: Ticket#670 - TDatePicker: Year Issue (Christophe)
+ENH: Ticket#667 - Added TFeedService.ContentType property (Qiang)
ENH: Added THead requirement check (Qiang)
Version 3.1.0 July 2, 2007
diff --git a/framework/Web/Services/TFeedService.php b/framework/Web/Services/TFeedService.php
index 2b6bb7e2..a40bcca9 100644
--- a/framework/Web/Services/TFeedService.php
+++ b/framework/Web/Services/TFeedService.php
@@ -44,6 +44,7 @@
class TFeedService extends TService
{
private $_feeds=array();
+ private $_contentType='text/xml';
/**
* Initializes this module.
@@ -92,7 +93,7 @@ class TFeedService extends TService
$content=$feed->getFeedContent();
//$this->getResponse()->setContentType('application/rss+xml');
- $this->getResponse()->setContentType('text/xml');
+ $this->getResponse()->setContentType($this->getContentType());
$this->getResponse()->write($content);
}
else
@@ -104,6 +105,27 @@ class TFeedService extends TService
else
throw new THttpException(404,'feedservice_feed_unknown',$id);
}
+
+ /**
+ * @return string the content type for the feed content. Defaults to 'text/xml'.
+ */
+ public function getContentType()
+ {
+ return $this->_contentType;
+ }
+
+ /**
+ * Sets the content type of the feed content to be sent.
+ * Some examples are:
+ * RSS 1.0 feed: application/rdf+xml
+ * RSS 2.0 feed: application/rss+xml or application/xml or text/xml
+ * ATOM feed: application/atom+xml
+ * @param string the content type for the feed content.
+ */
+ public function setContentType($type)
+ {
+ $this->_contentType=$type;
+ }
}
/**