* Individual comment views now output valid Atom 1.0 entries:

http://example.gallery.com/index.php/comments/{comment_id}?_format=atom
* Changed Content-Type of Atom feeds and entries to XML for easier debugging.
* Added an Atom helper class with some common functions and cleaned up entry and feed generation code a bit in the comment helper.
* Style fixes.
This commit is contained in:
Jozef Selesi
2008-11-23 00:24:56 +00:00
parent d93d37a10c
commit d14d312d06
8 changed files with 98 additions and 15 deletions
+3 -3
View File
@@ -62,8 +62,7 @@ class Comments_Controller extends REST_Controller {
* @see Rest_Controller::_show($resource)
*/
public function _show($comment) {
$output_format = rest::output_format();
switch ($output_format) {
switch (rest::output_format()) {
case "xml":
rest::http_content_type(rest::XML);
print xml::to_xml($comment->as_array(), array("comment"));
@@ -75,7 +74,8 @@ class Comments_Controller extends REST_Controller {
break;
case "atom":
rest::http_content_type(rest::ATOM);
rest::http_content_type(rest::XML);
print comment::get_atom_entry($comment);
break;
default: