Browse Source

- Fix the syndication

pull/16/head
Jaussoin Timothée 12 years ago
parent
commit
021e3419b6
  1. 1
      app/controllers/FeedController.php
  2. 54
      app/widgets/Syndication/syndication.tpl
  3. 12
      system/controllers/BaseController.php

1
app/controllers/FeedController.php

@ -3,6 +3,7 @@
class FeedController extends BaseController {
function load() {
$this->session_only = false;
$this->raw = true;
}
function dispatch() {

54
app/widgets/Syndication/syndication.tpl

@ -1,32 +1,32 @@
{if="isset($from)"}
{if="!empty($messages)"}
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{$title}</title>
<updated>{$date}</updated>
<author>
<name>{$name}</name>
<uri>{$uri}</uri>
</author>
{$link}
<logo>{$logo}</logo>
<generator uri="http://movim.eu/" version="{#APP_VERSION#}">
Movim
</generator>
<id>urn:uuid:{$uuid}</id>
{loop="messages"}
<entry>
<title>{$c->prepareTitle($value->title)}</title>
<id>urn:uuid:{$c->generateUUID($value->content)}</id>
<updated>{$c->prepareUpdated($value->published)}</updated>
<content type="html">
<![CDATA[{$c->prepareContent($value->content)}]]>
</content>
</entry>
{/loop}
</feed>
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{$title}</title>
<updated>{$date}</updated>
<author>
<name>{$name}</name>
<uri>{$uri}</uri>
</author>
{$link}
<logo>{$logo}</logo>
<generator uri="http://movim.eu/" version="{#APP_VERSION#}">
Movim
</generator>
<id>urn:uuid:{$uuid}</id>
{loop="messages"}
<entry>
<title>{$c->prepareTitle($value->title)}</title>
<id>urn:uuid:{$c->generateUUID($value->content)}</id>
<updated>{$c->prepareUpdated($value->published)}</updated>
<content type="html">
<![CDATA[{$c->prepareContent($value->content)}]]>
</content>
</entry>
{/loop}
</feed>
{else}
{$c->t('No public feed for this contact')}
{/if}

12
system/controllers/BaseController.php

@ -3,6 +3,7 @@
class BaseController {
public $name = 'main'; // The name of the current page
protected $session_only = false;// The page is protected by a session ?
protected $raw = false; // Display only the content ?
protected $page;
function __construct() {
@ -87,8 +88,13 @@ class BaseController {
$content = new TplPageBuilder();
}
$built = $content->build($this->name.'.tpl');
$this->page->setContent($built);
echo $this->page->build('page.tpl');
if($this->raw) {
echo $content->build($this->name.'.tpl');
exit;
} else {
$built = $content->build($this->name.'.tpl');
$this->page->setContent($built);
echo $this->page->build('page.tpl');
}
}
}
Loading…
Cancel
Save