Fixed issue 71, add atom feeds.

The basic building block is here with the feed of the timeline, it is
rather easy to add the feed other elements based on this work. This will
require iterations and polishing.
This commit is contained in:
Loic d'Anterroches
2008-12-03 15:00:47 +01:00
parent a79d13ee3f
commit 9c44bc5fe5
15 changed files with 397 additions and 11 deletions

View File

@@ -184,4 +184,30 @@ class IDF_Upload extends Pluf_Model
<div class="helptext right">'.sprintf(__('Addition of <a href="%s">download&nbsp;%d</a>'), $url, $this->id).', '.__('by').' '.Pluf_esc($submitter).'</div></td></tr>';
return Pluf_Template::markSafe($out);
}
public function feedFragment($request)
{
$base = '<entry>
<title>%%title%%</title>
<link href="%%url%%"/>
<id>%%url%%</id>
<updated>%%date%%</updated>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
%%content%%
</div></content>
</entry>';
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Download::view',
array($request->project->shortname,
$this->id));
$title = sprintf(__('%s: Download %d added - %s'),
Pluf_esc($request->project->name),
$this->id, Pluf_esc($this->summary));
$content = Pluf_esc($this->summary);
$date = Pluf_Date::gmDateToGmString($this->creation_dtime);
return Pluf_Translation::sprintf($base,
array('url' => $url,
'title' => $title,
'content' => $content,
'date' => $date));
}
}