diff options
author | Andrew Dolgov <[email protected]> | 2011-12-27 23:12:11 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-12-27 23:12:11 +0400 |
commit | 7acc194b538ca38a59dcd3fc3fef448459703533 (patch) | |
tree | c16908251b238bee68b76253a2828909520c3d72 /classes | |
parent | 2c43770f986aa321d0fff4d8c5e266ed58245bf0 (diff) | |
parent | 55f34b811fef1f5e834fbcc65e41f6748e49ffd1 (diff) |
Merge branch 'master' of github.com:gothfox/Tiny-Tiny-RSS
Diffstat (limited to 'classes')
-rw-r--r-- | classes/dlg.php | 23 | ||||
-rw-r--r-- | classes/pref_feeds.php | 26 |
2 files changed, 45 insertions, 4 deletions
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 "<div style='text-align : center'>"; + + if (is_file($_FILES['export_file']['tmp_name'])) { + + perform_data_import($this->link, $_FILES['export_file']['tmp_name'], $_SESSION['uid']); + + } else { + print "<p>" . 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.</p>"; + + } + + print "<button dojoType=\"dijit.form.Button\" + onclick=\"dijit.byId('dataImportDlg').hide()\">". + __('Close this window')."</button>"; + + print "</div>"; + + } + } ?> 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.") . "</p>"; - print "<br/><iframe id=\"upload_iframe\" + print "<iframe id=\"upload_iframe\" name=\"upload_iframe\" onload=\"opmlImportComplete(this)\" style=\"width: 400px; height: 100px; display: none;\"></iframe>"; print "<form name=\"opml_form\" style='display : block' target=\"upload_iframe\" enctype=\"multipart/form-data\" method=\"POST\" - action=\"backend.php\"> + action=\"backend.php\"> <input id=\"opml_file\" name=\"opml_file\" type=\"file\"> <input type=\"hidden\" name=\"op\" value=\"dlg\"> <input type=\"hidden\" name=\"method\" value=\"importOpml\"> @@ -1441,13 +1441,31 @@ class Pref_Feeds extends Protected_Handler { __('Display URL')."</button> "; - print "<h2>" . __("Data Export") . "</h2>"; + print "<h2>" . __("Article archive") . "</h2>"; + + print "<p>" . __("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.") . "</p>"; - print "<p>" . __("You can export your Starred and Archived articles using database-neutral format for safekeeping.") . "</p>"; + print "<h3>" . __("Export") . "</h3>"; print "<button dojoType=\"dijit.form.Button\" onclick=\"return exportData()\">". __('Export my data')."</button> "; + print "<h3>" . __("Import") . "</h3>"; + + print "<iframe id=\"data_upload_iframe\" + name=\"data_upload_iframe\" onload=\"dataImportComplete(this)\" + style=\"width: 400px; height: 100px; display: none;\"></iframe>"; + + print "<form name=\"opml_form\" style='display : block' target=\"data_upload_iframe\" + enctype=\"multipart/form-data\" method=\"POST\" + action=\"backend.php\"> + <input id=\"export_file\" name=\"export_file\" type=\"file\"> + <input type=\"hidden\" name=\"op\" value=\"dlg\"> + <input type=\"hidden\" name=\"method\" value=\"dataimport\"> + <button dojoType=\"dijit.form.Button\" onclick=\"return importData();\" type=\"submit\">" . + __('Import') . "</button>"; + + print "</div>"; # pane if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) { |