diff --git a/modules/opml_domdoc.php b/modules/opml_domdoc.php
index a29a1eb69..51b771337 100644
--- a/modules/opml_domdoc.php
+++ b/modules/opml_domdoc.php
@@ -22,8 +22,6 @@
$outlines = $xpath->query($query);
- print "
";
+
+ print "
";
+
+ $owner_uid = $_SESSION["uid"];
+
+ db_query($link, "BEGIN");
+
+ /* create Imported feeds category just in case */
+
+ $result = db_query($link, "SELECT id FROM
+ ttrss_feed_categories WHERE title = 'Imported feeds' AND
+ owner_uid = '$owner_uid' LIMIT 1");
+
+ if (db_num_rows($result) == 0) {
+ db_query($link, "INSERT INTO ttrss_feed_categories
+ (title,owner_uid)
+ VALUES ('Imported feeds', '$owner_uid')");
+ }
+
+ db_query($link, "COMMIT");
+
+ /* Handle OPML import by DOMXML/DOMDocument */
+
+ if (function_exists('domxml_open_file')) {
+ print "
";
+ print "- ".__("Importing using DOMXML.")."
";
+ require_once "modules/opml_domxml.php";
+ opml_import_domxml($link, $owner_uid);
+ print "
";
+ } else if (PHP_VERSION >= 5) {
+ print "
";
+ print "- ".__("Importing using DOMDocument.")."
";
+ require_once "modules/opml_domdoc.php";
+ opml_import_domdoc($link, $owner_uid);
+ print "
";
+ } else {
+ print_error(__("DOMXML extension is not found. It is required for PHP versions below 5."));
+ }
+
+ print "
";
+
+ print "
";
+
+ print "";
+
+ print "
";
+
+ print "";
+
+ print "
";
+
+ return;
+ }
+
if ($id == "editPrefProfiles") {
print "
+/* print "
";
- print " ";
+ print " "; */
+
+ print "
";
+
+ print "
";
+ print "";
+ print "
";
print "
";
diff --git a/prefs.js b/prefs.js
index 27a86c9d3..6c7f6f636 100644
--- a/prefs.js
+++ b/prefs.js
@@ -576,15 +576,17 @@ function removeSelectedFeeds() {
if (ok) {
- notify_progress("Unsubscribing from selected feeds...");
+ notify_progress("Unsubscribing from selected feeds...", true);
var query = "?op=pref-feeds&subop=remove&ids="+
param_escape(sel_rows.toString());
-
+
+ debug(query);
+
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
- feedlist_callback2(transport);
+ updateFeedList();
} });
}
@@ -996,7 +998,7 @@ function piggie(enable) {
}
}
-function validateOpmlImport() {
+function opmlImport() {
var opml_file = $("opml_file");
@@ -1006,6 +1008,8 @@ function validateOpmlImport() {
} else {
return true;
}
+
+ notify_progress("Importing, please wait...", true);
}
function updateFilterList(sort_key) {
@@ -2224,4 +2228,19 @@ function activatePrefProfile() {
return false;
}
+function opmlImportDone() {
+ closeInfoBox();
+ updateFeedList();
+}
+function opml_import_handler(iframe) {
+ try {
+ var tmp = new Object();
+ tmp.responseText = iframe.document.body.innerHTML;
+ notify('');
+ infobox_callback2(tmp);
+
+ } catch (e) {
+ exception_error("opml_import_handler", e);
+ }
+}