Author: as
Date: Fri Nov 16 10:57:11 2007
New Revision: 6750
Log:
- Added support for generating 'summary' ATOM feed entry sub-element.
# Not complete yet as it depends on 'content' and 'link'.
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_empty.in
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_empty.out
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_absent.in
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_absent.out
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_html.in
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_html.out
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_text.in
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_text.out
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_xhtml.in
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_xhtml.out
Modified:
trunk/Feed/src/processors/atom.php
Modified: trunk/Feed/src/processors/atom.php
==============================================================================
--- trunk/Feed/src/processors/atom.php [iso-8859-1] (original)
+++ trunk/Feed/src/processors/atom.php [iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -549,6 +549,16 @@
switch ( $element )
{
+ case 'summary':
+ $dataNode = $data;
+ if ( is_array( $data ) )
+ {
+ $dataNode = $data[0];
+ }
+
+ $this->generateNode( $entryTag, $element, $parent,
$dataNode );
+ break;
+
case 'author':
foreach ( $data as $dataNode )
{
Added: trunk/Feed/tests/atom/regression/generate/entry/summary/summary_empty.in
==============================================================================
--- trunk/Feed/tests/atom/regression/generate/entry/summary/summary_empty.in
(added)
+++ trunk/Feed/tests/atom/regression/generate/entry/summary/summary_empty.in
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,10 @@
+<?php
+return array( 'id' => 'Feed id',
+ 'title' => array( array( '#' => 'Feed title' ) ),
+ 'updated' => 'Feed updated',
+ 'author' => array( array( 'name' => 'Author name' ) ),
+ 'item' => array( array( 'id' => 'Entry id',
+ 'title' => array( array( '#' => 'Entry
title' ) ),
+ 'updated' => 'Entry updated',
+ 'summary' => array( array() ) ) ) );
+?>
Added: trunk/Feed/tests/atom/regression/generate/entry/summary/summary_empty.out
==============================================================================
--- trunk/Feed/tests/atom/regression/generate/entry/summary/summary_empty.out
(added)
+++ trunk/Feed/tests/atom/regression/generate/entry/summary/summary_empty.out
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>Feed id</id>
+ <title>Feed title</title>
+ <updated>XXX</updated>
+ <author>
+ <name>Author name</name>
+ </author>
+ <entry>
+ <id>Entry id</id>
+ <title>Entry title</title>
+ <updated>XXX</updated>
+ <summary></summary>
+ </entry>
+</feed>
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_absent.in
==============================================================================
---
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_absent.in
(added)
+++
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_absent.in
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,10 @@
+<?php
+return array( 'id' => 'Feed id',
+ 'title' => array( array( '#' => 'Feed title' ) ),
+ 'updated' => 'Feed updated',
+ 'author' => array( array( 'name' => 'Author name' ) ),
+ 'item' => array( array( 'id' => 'Entry id',
+ 'title' => array( array( '#' => 'Entry
title' ) ),
+ 'updated' => 'Entry updated',
+ 'summary' => array( array( '#' => 'Entry
summary' ) ) ) ) );
+?>
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_absent.out
==============================================================================
---
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_absent.out
(added)
+++
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_absent.out
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>Feed id</id>
+ <title>Feed title</title>
+ <updated>XXX</updated>
+ <author>
+ <name>Author name</name>
+ </author>
+ <entry>
+ <id>Entry id</id>
+ <title>Entry title</title>
+ <updated>XXX</updated>
+ <summary>Entry summary</summary>
+ </entry>
+</feed>
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_html.in
==============================================================================
---
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_html.in
(added)
+++
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_html.in
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,11 @@
+<?php
+return array( 'id' => 'Feed id',
+ 'title' => array( array( '#' => 'Feed title' ) ),
+ 'updated' => 'Feed updated',
+ 'author' => array( array( 'name' => 'Author name' ) ),
+ 'item' => array( array( 'id' => 'Entry id',
+ 'title' => array( array( '#' => 'Entry
title' ) ),
+ 'updated' => 'Entry updated',
+ 'summary' => array( array( '#' => 'Entry
summary',
+ 'type' =>
'html' ) ) ) ) );
+?>
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_html.out
==============================================================================
---
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_html.out
(added)
+++
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_html.out
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>Feed id</id>
+ <title>Feed title</title>
+ <updated>XXX</updated>
+ <author>
+ <name>Author name</name>
+ </author>
+ <entry>
+ <id>Entry id</id>
+ <title>Entry title</title>
+ <updated>XXX</updated>
+ <summary type="html">Entry summary</summary>
+ </entry>
+</feed>
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_text.in
==============================================================================
---
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_text.in
(added)
+++
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_text.in
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,11 @@
+<?php
+return array( 'id' => 'Feed id',
+ 'title' => array( array( '#' => 'Feed title' ) ),
+ 'updated' => 'Feed updated',
+ 'author' => array( array( 'name' => 'Author name' ) ),
+ 'item' => array( array( 'id' => 'Entry id',
+ 'title' => array( array( '#' => 'Entry
title' ) ),
+ 'updated' => 'Entry updated',
+ 'summary' => array( array( '#' => 'Entry
summary',
+ 'type' =>
'text' ) ) ) ) );
+?>
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_text.out
==============================================================================
---
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_text.out
(added)
+++
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_text.out
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>Feed id</id>
+ <title>Feed title</title>
+ <updated>XXX</updated>
+ <author>
+ <name>Author name</name>
+ </author>
+ <entry>
+ <id>Entry id</id>
+ <title>Entry title</title>
+ <updated>XXX</updated>
+ <summary type="text">Entry summary</summary>
+ </entry>
+</feed>
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_xhtml.in
==============================================================================
---
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_xhtml.in
(added)
+++
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_xhtml.in
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,11 @@
+<?php
+return array( 'id' => 'Feed id',
+ 'title' => array( array( '#' => 'Feed title' ) ),
+ 'updated' => 'Feed updated',
+ 'author' => array( array( 'name' => 'Author name' ) ),
+ 'item' => array( array( 'id' => 'Entry id',
+ 'title' => array( array( '#' => 'Entry
title' ) ),
+ 'updated' => 'Entry updated',
+ 'summary' => array( array( '#' => 'Entry
summary',
+ 'type' =>
'xhtml' ) ) ) ) );
+?>
Added:
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_xhtml.out
==============================================================================
---
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_xhtml.out
(added)
+++
trunk/Feed/tests/atom/regression/generate/entry/summary/summary_type_xhtml.out
[iso-8859-1] Fri Nov 16 10:57:11 2007
@@ -1,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>Feed id</id>
+ <title>Feed title</title>
+ <updated>XXX</updated>
+ <author>
+ <name>Author name</name>
+ </author>
+ <entry>
+ <id>Entry id</id>
+ <title>Entry title</title>
+ <updated>XXX</updated>
+ <summary type="xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <xhtml:div>Entry summary</xhtml:div>
+ </summary>
+ </entry>
+</feed>
--
svn-components mailing list
[EMAIL PROTECTED]
http://lists.ez.no/mailman/listinfo/svn-components