diff options
author | Mario <mario@mariovavti.com> | 2021-10-15 19:17:06 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-10-15 19:17:06 +0000 |
commit | a622f533ad2f5890a782b6477406ce1d1d774d34 (patch) | |
tree | e5d04752ad37e3b04a6e908a83a177176a65fd05 /Zotlabs/Module/Import_items.php | |
parent | db18438db2a6f5aeb12da4a75aa7e772054f601b (diff) | |
download | volse-hubzilla-a622f533ad2f5890a782b6477406ce1d1d774d34.tar.gz volse-hubzilla-a622f533ad2f5890a782b6477406ce1d1d774d34.tar.bz2 volse-hubzilla-a622f533ad2f5890a782b6477406ce1d1d774d34.zip |
some heavylifting on manual item export
Diffstat (limited to 'Zotlabs/Module/Import_items.php')
-rw-r--r-- | Zotlabs/Module/Import_items.php | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/Zotlabs/Module/Import_items.php b/Zotlabs/Module/Import_items.php index c2b2506fe..512dd88fc 100644 --- a/Zotlabs/Module/Import_items.php +++ b/Zotlabs/Module/Import_items.php @@ -38,7 +38,7 @@ class Import_items extends \Zotlabs\Web\Controller { } unlink($src); } - +/* if(! $src) { $old_address = ((x($_REQUEST,'old_address')) ? $_REQUEST['old_address'] : ''); @@ -71,6 +71,7 @@ class Import_items extends \Zotlabs\Web\Controller { else notice( t('Unable to download data from old server') . EOL); } +*/ if(! $data) { logger('Empty file.'); @@ -79,7 +80,6 @@ class Import_items extends \Zotlabs\Web\Controller { } $data = json_decode($data, true); - //logger('import: data: ' . print_r($data,true)); //print_r($data); @@ -97,15 +97,45 @@ class Import_items extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); - if(array_key_exists('item',$data) && $data['item']) { - import_items($channel,$data['item'],false,((array_key_exists('relocate',$data)) ? $data['relocate'] : null)); + if(array_key_exists('item',$data) && is_array($data['item'])) { + import_items($channel, $data['item'], false, ((array_key_exists('relocate',$data)) ? $data['relocate'] : null)); + info( t('Content import completed') . EOL); + } + + if (array_key_exists('chatroom',$data) && is_array($data['chatroom'])) { + import_chatrooms($channel, $data['chatroom']); + info( t('Chatroom import completed') . EOL); + + } + + if (array_key_exists('event',$data) && is_array($data['event'])) { + import_events($channel, $data['event']); + info( t('Channel calendar import 1/2 completed') . EOL); + + } + + if (array_key_exists('event_item',$data) && is_array($data['event_item'])) { + import_items($channel, $data['event_item'], false, ((array_key_exists('relocate',$data)) ? $data['relocate'] : null)); + info( t('Channel calendar import 2/2 completed') . EOL); + + } + + if (array_key_exists('menu',$data) && is_array($data['menu'])) { + import_menus($channel, $data['menu']); + info( t('Menu import completed') . EOL); + } + + if (array_key_exists('wiki',$data) && is_array($data['wiki'])) { + import_items($channel, $data['wiki'], false, ((array_key_exists('relocate',$data)) ? $data['relocate'] : null)); + info( t('Wiki import completed') . EOL); + } - if(array_key_exists('item_id',$data) && $data['item_id']) { - import_item_ids($channel,$data['item_id']); + if (array_key_exists('webpages',$data) && is_array($data['webpages'])) { + import_items($channel, $data['webpages'], false, ((array_key_exists('relocate',$data)) ? $data['relocate'] : null)); + info( t('Webpages import completed') . EOL); } - info( t('Import completed') . EOL); } |