aboutsummaryrefslogtreecommitdiffstats
path: root/include/api_zot.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-02-25 14:06:37 +0100
committerMario <mario@mariovavti.com>2019-02-25 14:06:37 +0100
commit04b92167583bd001033963e934abad6f39a9fd93 (patch)
tree571f8ee7ff57e70502909ed8ecc59024a2b889ed /include/api_zot.php
parent89bcb1de420b63883dce63e27aa81e6e636b6129 (diff)
parent1ff97754afee87f23b17a6b036ebe9e69d41a7c6 (diff)
downloadvolse-hubzilla-04b92167583bd001033963e934abad6f39a9fd93.tar.gz
volse-hubzilla-04b92167583bd001033963e934abad6f39a9fd93.tar.bz2
volse-hubzilla-04b92167583bd001033963e934abad6f39a9fd93.zip
Merge branch 'dev' into 'dev'
zot api changes to support combined content (items+files) import addon See merge request hubzilla/core!1533
Diffstat (limited to 'include/api_zot.php')
-rw-r--r--include/api_zot.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index 6a5b9a268..b332aea71 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -6,6 +6,8 @@
api_register_func('api/export/basic','api_export_basic', true);
api_register_func('api/red/channel/export/basic','api_export_basic', true);
api_register_func('api/z/1.0/channel/export/basic','api_export_basic', true);
+ api_register_func('api/red/item/export/page','api_item_export_page', true);
+ api_register_func('api/z/1.0/item/export/page','api_item_export_page', true);
api_register_func('api/red/channel/list','api_channel_list', true);
api_register_func('api/z/1.0/channel/list','api_channel_list', true);
api_register_func('api/red/channel/stream','api_channel_stream', true);
@@ -80,6 +82,26 @@
json_return_and_die(identity_basic_export(api_user(),$sections));
}
+ function api_item_export_page($type) {
+ if(api_user() === false) {
+ logger('api_item_export_page: no user');
+ return false;
+ }
+ $page = intval($_REQUEST['page']);
+ $records = intval($_REQUEST['records']);
+ if(! $records) {
+ $records = 50;
+ }
+ if(! $_REQUEST['since'])
+ $start = NULL_DATE;
+ else {
+ $start = datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['since']);
+ }
+ $finish = datetime_convert(date_default_timezone_get(),'UTC', (($_REQUEST['until']) ? $_REQUEST['until'] : 'now'));
+
+ json_return_and_die(channel_export_items_page(api_user(),$start,$finish,$page,$records));
+ }
+
function api_network_stream($type) {
if(api_user() === false) {