summaryrefslogtreecommitdiff
path: root/app/Template/feed
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-06-19 19:38:23 -0400
committerFrederic Guillot <fred@kanboard.net>2015-06-19 19:38:23 -0400
commit73c47d9461cbfea88c84f3f2b01cdeb2d22c2f87 (patch)
treec7749fee7885ecfe6f12ae53a55c615ef0191971 /app/Template/feed
parentff85518fa8f6dc48ac5dedb4847c6bb24ea35b2f (diff)
Add RSS feed for users and change address of project feeds
Diffstat (limited to 'app/Template/feed')
-rw-r--r--app/Template/feed/project.php27
-rw-r--r--app/Template/feed/user.php27
2 files changed, 54 insertions, 0 deletions
diff --git a/app/Template/feed/project.php b/app/Template/feed/project.php
new file mode 100644
index 00000000..60b7ee96
--- /dev/null
+++ b/app/Template/feed/project.php
@@ -0,0 +1,27 @@
+<?= '<?xml version="1.0" encoding="utf-8"?>' ?>
+<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
+ <title><?= t('%s\'s activity', $project['name']) ?></title>
+ <link rel="alternate" type="text/html" href="<?= $this->url->base() ?>"/>
+ <link rel="self" type="application/atom+xml" href="<?= $this->url->base().$this->url->href('feed', 'project', array('token' => $project['token'])) ?>"/>
+ <updated><?= date(DATE_ATOM) ?></updated>
+ <id><?= $this->url->base().$this->url->href('feed', 'project', array('token' => $project['token'])) ?></id>
+ <icon><?= $this->url->base() ?>assets/img/favicon.png</icon>
+
+ <?php foreach ($events as $e): ?>
+ <entry>
+ <title type="text"><?= $e['event_title'] ?></title>
+ <link rel="alternate" href="<?= $this->url->base().$this->url->href('task', 'show', array('task_id' => $e['task_id'])) ?>"/>
+ <id><?= $e['id'].'-'.$e['event_name'].'-'.$e['task_id'].'-'.$e['date_creation'] ?></id>
+ <published><?= date(DATE_ATOM, $e['date_creation']) ?></published>
+ <updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated>
+ <author>
+ <name><?= $this->e($e['author']) ?></name>
+ </author>
+ <content type="html">
+ <![CDATA[
+ <?= $e['event_content'] ?>
+ ]]>
+ </content>
+ </entry>
+ <?php endforeach ?>
+</feed> \ No newline at end of file
diff --git a/app/Template/feed/user.php b/app/Template/feed/user.php
new file mode 100644
index 00000000..b3279a0c
--- /dev/null
+++ b/app/Template/feed/user.php
@@ -0,0 +1,27 @@
+<?= '<?xml version="1.0" encoding="utf-8"?>' ?>
+<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
+ <title><?= t('Project activities for %s', $user['name'] ?: $user['username']) ?></title>
+ <link rel="alternate" type="text/html" href="<?= $this->url->base() ?>"/>
+ <link rel="self" type="application/atom+xml" href="<?= $this->url->base().$this->url->href('feed', 'user', array('token' => $user['token'])) ?>"/>
+ <updated><?= date(DATE_ATOM) ?></updated>
+ <id><?= $this->url->base().$this->url->href('feed', 'user', array('token' => $user['token'])) ?></id>
+ <icon><?= $this->url->base() ?>assets/img/favicon.png</icon>
+
+ <?php foreach ($events as $e): ?>
+ <entry>
+ <title type="text"><?= $e['event_title'] ?></title>
+ <link rel="alternate" href="<?= $this->url->base().$this->url->href('task', 'show', array('task_id' => $e['task_id'])) ?>"/>
+ <id><?= $e['id'].'-'.$e['event_name'].'-'.$e['task_id'].'-'.$e['date_creation'] ?></id>
+ <published><?= date(DATE_ATOM, $e['date_creation']) ?></published>
+ <updated><?= date(DATE_ATOM, $e['date_creation']) ?></updated>
+ <author>
+ <name><?= $this->e($e['author']) ?></name>
+ </author>
+ <content type="html">
+ <![CDATA[
+ <?= $e['event_content'] ?>
+ ]]>
+ </content>
+ </entry>
+ <?php endforeach ?>
+</feed> \ No newline at end of file