diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index f337d7f4e..2649d58a1 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1557,52 +1557,10 @@ class Pref_Feeds extends Handler_Protected { } function batchSubscribe() { - print "
"; + print json_encode([ + "enable_cats" => (int)get_pref('ENABLE_FEED_CATS'), + "cat_select" => format_feed_cat_select("cat", false, 'dojoType="fox.form.Select"') + ]); } function batchAddFeeds() { diff --git a/include/controls.php b/include/controls.php index 8f49e99c5..e6678db9a 100755 --- a/include/controls.php +++ b/include/controls.php @@ -181,11 +181,19 @@ function print_feed_multi_select($id, $default_ids = [], } } -function print_feed_cat_select($id, $default_id, - $attributes, $include_all_cats = true, $root_id = null, $nest_level = 0) { +function print_feed_cat_select($id, $default_id, $attributes, $include_all_cats = true, + $root_id = null, $nest_level = 0) { + + print format_feed_cat_select($id, $default_id, $attributes, $include_all_cats, $root_id, $nest_level); +} + +function format_feed_cat_select($id, $default_id, $attributes, $include_all_cats = true, + $root_id = null, $nest_level = 0) { + + $ret = ""; if (!$root_id) { - print ""; } + + return $ret; } function stylesheet_tag($filename, $id = false) { diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index 3e3584a9a..c3dda4187 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -378,35 +378,77 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b } }, batchSubscribe: function() { - const dialog = new fox.SingleUseDialog({ - id: "batchSubDlg", - title: __("Batch subscribe"), - execute: function () { - if (this.validate()) { - Notify.progress(__("Subscribing to feeds..."), true); + xhrJson("backend.php", {op: 'pref-feeds', method: 'batchSubscribe'}, (reply) => { + const dialog = new fox.SingleUseDialog({ + id: "batchSubDlg", + title: __("Batch subscribe"), + execute: function () { + if (this.validate()) { + Notify.progress(__("Subscribing to feeds..."), true); - xhrPost("backend.php", this.attr('value'), () => { - Notify.close(); + xhrPost("backend.php", this.attr('value'), () => { + Notify.close(); - const tree = dijit.byId("feedTree"); - if (tree) tree.reload(); + const tree = dijit.byId("feedTree"); + if (tree) tree.reload(); + + dialog.hide(); + }); + } + }, + content: ` + + ` + }); + + dialog.show(); - dialog.hide(); - }); - } - }, - content: __("Loading, please wait...") }); - - const tmph = dojo.connect(dialog, 'onShow', function () { - dojo.disconnect(tmph); - - xhrPost("backend.php", {op: 'pref-feeds', method: 'batchSubscribe'}, (transport) => { - dialog.attr('content', transport.responseText); - }) - }); - - dialog.show(); }, showInactiveFeeds: function() { xhrJson("backend.php", {op: 'pref-feeds', method: 'inactivefeeds'}, function (reply) {