diff options
author | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-05-19 13:25:00 +0200 |
---|---|---|
committer | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-05-19 13:25:00 +0200 |
commit | 429140df97a2c273fba6974147ac2e48e7688263 (patch) | |
tree | 2e337542da1b0f4c9c383dfeb8a7d9eb63990a72 /include/api_zot.php | |
parent | f92d2e3f7c6573bd7bab04223c7e28662605c6d8 (diff) | |
parent | af2b263bc74b16601ec7c123a58f0549613aed27 (diff) | |
download | volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.tar.gz volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.tar.bz2 volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'include/api_zot.php')
-rw-r--r-- | include/api_zot.php | 22 |
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) { |