formats: Use same general entity generation order
This commit is contained in:
parent
0d94f1fe0e
commit
606e756bc1
3 changed files with 6 additions and 10 deletions
|
@ -23,13 +23,11 @@ class AtomFormat extends FormatAbstract{
|
||||||
|
|
||||||
$entries = '';
|
$entries = '';
|
||||||
foreach($this->getDatas() as $data){
|
foreach($this->getDatas() as $data){
|
||||||
$entryAuthor = is_null($data->author) ? $title : $this->xml_encode($data->author);
|
$entryAuthor = is_null($data->author) ? '' : $this->xml_encode($data->author);
|
||||||
$entryTitle = is_null($data->title) ? '' : $this->xml_encode($data->title);
|
$entryTitle = is_null($data->title) ? '' : $this->xml_encode($data->title);
|
||||||
$entryUri = is_null($data->uri) ? '' : $this->xml_encode($data->uri);
|
$entryUri = is_null($data->uri) ? '' : $this->xml_encode($data->uri);
|
||||||
$entryTimestamp = is_null($data->timestamp) ? '' : $this->xml_encode(date(DATE_ATOM, $data->timestamp));
|
$entryTimestamp = is_null($data->timestamp) ? '' : $this->xml_encode(date(DATE_ATOM, $data->timestamp));
|
||||||
// We prevent content from closing the CDATA too early.
|
|
||||||
$entryContent = is_null($data->content) ? '' : $this->xml_encode($this->sanitizeHtml($data->content));
|
$entryContent = is_null($data->content) ? '' : $this->xml_encode($this->sanitizeHtml($data->content));
|
||||||
|
|
||||||
$entries .= <<<EOD
|
$entries .= <<<EOD
|
||||||
|
|
||||||
<entry>
|
<entry>
|
||||||
|
|
|
@ -16,10 +16,10 @@ class HtmlFormat extends FormatAbstract{
|
||||||
|
|
||||||
$entries = '';
|
$entries = '';
|
||||||
foreach($this->getDatas() as $data){
|
foreach($this->getDatas() as $data){
|
||||||
$entryUri = is_null($data->uri) ? $uri : $data->uri;
|
|
||||||
$entryTitle = is_null($data->title) ? '' : $this->sanitizeHtml(strip_tags($data->title));
|
|
||||||
$entryTimestamp = is_null($data->timestamp) ? '' : '<time datetime="' . date(DATE_ATOM, $data->timestamp) . '">' . date(DATE_ATOM, $data->timestamp) . '</time>';
|
|
||||||
$entryAuthor = is_null($data->author) ? '' : '<br /><p class="author">by: ' . $data->author . '</p>';
|
$entryAuthor = is_null($data->author) ? '' : '<br /><p class="author">by: ' . $data->author . '</p>';
|
||||||
|
$entryTitle = is_null($data->title) ? '' : $this->sanitizeHtml(strip_tags($data->title));
|
||||||
|
$entryUri = is_null($data->uri) ? $uri : $data->uri;
|
||||||
|
$entryTimestamp = is_null($data->timestamp) ? '' : '<time datetime="' . date(DATE_ATOM, $data->timestamp) . '">' . date(DATE_ATOM, $data->timestamp) . '</time>';
|
||||||
$entryContent = is_null($data->content) ? '' : '<div class="content">' . $this->sanitizeHtml($data->content). '</div>';
|
$entryContent = is_null($data->content) ? '' : '<div class="content">' . $this->sanitizeHtml($data->content). '</div>';
|
||||||
$entries .= <<<EOD
|
$entries .= <<<EOD
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,11 @@ class MrssFormat extends FormatAbstract{
|
||||||
|
|
||||||
$items = '';
|
$items = '';
|
||||||
foreach($this->getDatas() as $data){
|
foreach($this->getDatas() as $data){
|
||||||
|
$itemAuthor = is_null($data->author) ? '' : $this->xml_encode($data->author);
|
||||||
$itemTitle = strip_tags(is_null($data->title) ? '' : $this->xml_encode($data->title));
|
$itemTitle = strip_tags(is_null($data->title) ? '' : $this->xml_encode($data->title));
|
||||||
$itemUri = is_null($data->uri) ? '' : $this->xml_encode($data->uri);
|
$itemUri = is_null($data->uri) ? '' : $this->xml_encode($data->uri);
|
||||||
$itemAuthor = is_null($data->author) ? $title : $this->xml_encode($data->author);
|
|
||||||
$itemTimestamp = is_null($data->timestamp) ? '' : $this->xml_encode(date(DATE_RFC2822, $data->timestamp));
|
$itemTimestamp = is_null($data->timestamp) ? '' : $this->xml_encode(date(DATE_RFC2822, $data->timestamp));
|
||||||
// We prevent content from closing the CDATA too early.
|
|
||||||
$itemContent = is_null($data->content) ? '' : $this->xml_encode($this->sanitizeHtml($data->content));
|
$itemContent = is_null($data->content) ? '' : $this->xml_encode($this->sanitizeHtml($data->content));
|
||||||
|
|
||||||
$items .= <<<EOD
|
$items .= <<<EOD
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Reference in a new issue