diff options
| author | 2014-03-18 22:42:47 +0100 | |
|---|---|---|
| committer | 2014-03-18 22:42:47 +0100 | |
| commit | d1c5db7461ecb69c529149536718baf9b73a1f2c (patch) | |
| tree | c880b6d1b7eebb6481d3525b2e0ed80b959b452e /app/views | |
| parent | e685b541487b814cbab87ea2b6a6a4d12cd72f06 (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')
| -rw-r--r-- | app/views/helpers/export/articles.phtml | 30 | ||||
| -rw-r--r-- | app/views/helpers/export/opml.phtml (renamed from app/views/importExport/export.phtml) | 0 | ||||
| -rw-r--r-- | app/views/importExport/index.phtml | 33 |
3 files changed, 60 insertions, 3 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 diff --git a/app/views/importExport/export.phtml b/app/views/helpers/export/opml.phtml index 2e66e5054..2e66e5054 100644 --- a/app/views/importExport/export.phtml +++ b/app/views/helpers/export/opml.phtml diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml index c7db752a7..d8c76543e 100644 --- a/app/views/importExport/index.phtml +++ b/app/views/importExport/index.phtml @@ -4,7 +4,7 @@ <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data"> - <legend><?php echo Minz_Translate::t ('import_export'); ?></legend> + <legend><?php echo Minz_Translate::t ('import'); ?></legend> <div class="form-group"> <label class="group-name" for="file"><?php echo Minz_Translate::t ('file_to_import'); ?></label> <div class="group-controls"> @@ -15,8 +15,35 @@ <div class="form-group form-actions"> <div class="group-controls"> <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('import'); ?></button> - <?php echo Minz_Translate::t ('or'); ?> - <a target="_blank" class="btn btn-important" href="<?php echo _url ('importExport', 'export'); ?>"><?php echo Minz_Translate::t ('export'); ?></a> + </div> + </div> + </form> + + <form method="post" action="<?php echo _url('importExport', 'export'); ?>"> + <legend><?php echo Minz_Translate::t ('export'); ?></legend> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="export_opml"> + <input type="checkbox" name="export_opml" id="export_opml" value="1" checked="checked" /> + <?php echo Minz_Translate::t ('export_opml'); ?> + </label> + + <label class="checkbox" for="export_starred"> + <input type="checkbox" name="export_starred" id="export_starred" value="1" checked="checked" /> + <?php echo Minz_Translate::t ('export_starred'); ?> + </label> + + <label class="checkbox" for="export_all"> + <input type="checkbox" name="export_all" id="export_all" value="1" /> + <?php echo Minz_Translate::t ('export_all'); ?> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('export_all_is_long'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('export'); ?></button> </div> </div> </form> |
