diff options
author | Mario <mario@mariovavti.com> | 2021-10-16 18:10:23 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-10-16 18:10:23 +0000 |
commit | 27401794e113351f5f9a781bf7fdcca276c9a94d (patch) | |
tree | 4c90737eb241d466fe858f6ba9c3e559a8b8177e | |
parent | 862a7c2dbada4ec6b293d4c428e0272bec2f9e11 (diff) | |
download | volse-hubzilla-27401794e113351f5f9a781bf7fdcca276c9a94d.tar.gz volse-hubzilla-27401794e113351f5f9a781bf7fdcca276c9a94d.tar.bz2 volse-hubzilla-27401794e113351f5f9a781bf7fdcca276c9a94d.zip |
rename functions after heavy lifting and expand custom sections to all possible sections
-rw-r--r-- | Zotlabs/Module/Uexport.php | 6 | ||||
-rw-r--r-- | include/channel.php | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Zotlabs/Module/Uexport.php b/Zotlabs/Module/Uexport.php index c9f02fb35..8116f616b 100644 --- a/Zotlabs/Module/Uexport.php +++ b/Zotlabs/Module/Uexport.php @@ -56,7 +56,7 @@ class Uexport extends Controller { break; case 'custom': default: - $custom_sections = ['chatrooms', 'events', 'webpages', 'wikis']; + $custom_sections = ['channel', 'connections', 'config', 'apps', 'chatrooms', 'events', 'webpages', 'wikis']; $raw_sections = (($_REQUEST['sections']) ? explode(',', $_REQUEST['sections']) : ''); if ($raw_sections) { foreach ($raw_sections as $raw_section) { @@ -93,7 +93,7 @@ class Uexport extends Controller { $month = 1; while ($month <= 12) { $name = $channel['channel_address'] . '-' . $year . '-' . $month . '.json'; - $content = identity_export_year(local_channel(), $year, $month, $zap_compat); + $content = conv_item_export_year(local_channel(), $year, $month, $zap_compat); if(isset($content['item'])) { $zip_content_available = true; $zip->addFromString($name, json_encode($content)); @@ -125,7 +125,7 @@ class Uexport extends Controller { killme(); } elseif ($year && $month) { - $export = json_encode(identity_export_year(local_channel(), $year, $month, $zap_compat)); + $export = json_encode(conv_item_export_year(local_channel(), $year, $month, $zap_compat)); header('Content-Type: application/json'); header('Content-Disposition: attachment; filename="' . $channel['channel_address'] . '-' . $year . '-' . $month . '.json"'); diff --git a/include/channel.php b/include/channel.php index 7188d76f8..d438d0aa7 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1147,7 +1147,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals /** - * @brief Export items for a year, or a month of a year. + * @brief Export conv items for a year, or a month of a year. * * @param int $channel_id The channel ID * @param number $year YYYY @@ -1156,7 +1156,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals * * \e array \b relocate - (optional) * * \e array \b item - array with items encoded_item() */ -function identity_export_year($channel_id, $year, $month = 0, $zap_compat = false) { +function conv_item_export_year($channel_id, $year, $month = 0, $zap_compat = false) { if(! $year) return array(); @@ -1174,13 +1174,16 @@ function identity_export_year($channel_id, $year, $month = 0, $zap_compat = fals else $maxdate = datetime_convert('UTC', 'UTC', $year+1 . '-01-01 00:00:00'); - return channel_export_items_date($channel_id,$mindate,$maxdate, $zap_compat); + return channel_export_conv_items_date($channel_id,$mindate,$maxdate, $zap_compat); } /** * @brief Export conv items within an arbitrary date range. * + * In opposit to channel_export_items_page() which is used for bulk export via network, + * this function will only select conversational items (channel, cards, articles, direct messages). + * * Date/time is in UTC. * * @param int $channel_id The channel ID @@ -1189,7 +1192,7 @@ function identity_export_year($channel_id, $year, $month = 0, $zap_compat = fals * @return array */ -function channel_export_items_date($channel_id, $start, $finish, $zap_compat = false) { +function channel_export_conv_items_date($channel_id, $start, $finish, $zap_compat = false) { if(! $start) return array(); |