summaryrefslogtreecommitdiff
path: root/app/views/helpers/export/articles.phtml
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-03-18 22:42:47 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-03-18 22:42:47 +0100
commitd1c5db7461ecb69c529149536718baf9b73a1f2c (patch)
treec880b6d1b7eebb6481d3525b2e0ed80b959b452e /app/views/helpers/export/articles.phtml
parente685b541487b814cbab87ea2b6a6a4d12cd72f06 (diff)
New version to export articles + opml
It does not work yet! A lot of work has still to be done. Next versions should fix TODOs - OPML export works fine but can be improved - a framework has been created for articles export
Diffstat (limited to 'app/views/helpers/export/articles.phtml')
-rw-r--r--app/views/helpers/export/articles.phtml30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml
new file mode 100644
index 000000000..b7df58caf
--- /dev/null
+++ b/app/views/helpers/export/articles.phtml
@@ -0,0 +1,30 @@
+<?php
+ // TODO: A lot have to be done!
+ $username = Minz_Session::param('currentUser', '_');
+ $type_id = "TODO";
+ $title = Minz_Translate::t("TODO");
+ $entries = [];
+?>{
+ "id": "user/<?php echo str_replace("\"", "", $username); ?>/state/org.freshrss/<?php echo $type_id; ?>",
+ "title": "<?php echo addslashes($title); ?>",
+ "author": "<?php echo addslashes($username); ?>",
+ "items": [
+ <?php $i = 0; foreach($entries as $entry) { $i++;
+ echo $i > 1 ? ', ': ''; ?>{
+ "id": "<?php echo $entry->id(); ?>",
+ "categories": [<?php /* TODO */ ?>],
+ "title": "<?php echo addslashes($entry->title()); ?>",
+ "published": <?php echo $entry->date(true); ?>,
+ "updated": <?php echo $entry->date(true); ?>,
+ "content": "<?php echo addslashes($entry->content()); ?>",
+ "origin": {
+ <?php /* TODO */ ?>
+ "streamId": "",
+ "title": "",
+ "htmlUrl": "",
+ "feedUrl": ""
+ }
+ }
+ <?php } ?>
+ ]
+} \ No newline at end of file