From 55f34b811fef1f5e834fbcc65e41f6748e49ffd1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 27 Dec 2011 23:10:04 +0400 Subject: implement experimental personal data import --- classes/dlg.php | 23 +++++++++++++++++++++++ classes/pref_feeds.php | 26 ++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/dlg.php b/classes/dlg.php index 2d1cb9cc5..55eb5e37e 100644 --- a/classes/dlg.php +++ b/classes/dlg.php @@ -954,5 +954,28 @@ class Dlg extends Protected_Handler { return; } + function dataImport() { + header("Content-Type: text/html"); # required for iframe + + print "
"; + + if (is_file($_FILES['export_file']['tmp_name'])) { + + perform_data_import($this->link, $_FILES['export_file']['tmp_name'], $_SESSION['uid']); + + } else { + print "

" . T_sprintf("Could not upload file. You might need to adjust upload_max_filesize + in PHP.ini (current value = %s)", ini_get("upload_max_filesize")) . " or use CLI import tool.

"; + + } + + print ""; + + print "
"; + + } + } ?> diff --git a/classes/pref_feeds.php b/classes/pref_feeds.php index f9ed1b554..f5cb6e649 100644 --- a/classes/pref_feeds.php +++ b/classes/pref_feeds.php @@ -1408,13 +1408,13 @@ class Pref_Feeds extends Protected_Handler { print __("Only main settings profile can be migrated using OPML.") . "

"; - print "
"; print "
+ action=\"backend.php\">   @@ -1441,13 +1441,31 @@ class Pref_Feeds extends Protected_Handler { __('Display URL')." "; - print "

" . __("Data Export") . "

"; + print "

" . __("Article archive") . "

"; + + print "

" . __("You can export your Starred and Archived articles using neutral storage format. Please note that import and export of such data is only supported between same tt-rss versions.") . "

"; - print "

" . __("You can export your Starred and Archived articles using database-neutral format for safekeeping.") . "

"; + print "

" . __("Export") . "

"; print " "; + print "

" . __("Import") . "

"; + + print ""; + + print " +   + + + "; + + print ""; # pane if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) { -- cgit v1.2.3