diff --git a/classes/dlg.php b/classes/dlg.php index 7c07cf4f1..93c1c4c51 100644 --- a/classes/dlg.php +++ b/classes/dlg.php @@ -128,41 +128,4 @@ class Dlg extends Handler_Protected { print ""; } - - function generatedFeed() { - - $this->params = explode(":", $this->param, 3); - $feed_id = $this->params[0]; - $is_cat = (bool) $this->params[1]; - - $key = Feeds::get_feed_access_key($feed_id, $is_cat); - - $url_path = htmlspecialchars($this->params[2]) . "&key=" . $key; - - $feed_title = Feeds::getFeedTitle($feed_id, $is_cat); - - print "
".T_sprintf("%s can be accessed via the following secret URL:", $feed_title)."
"; - - print "
"; - print "
"; - print "$url_path"; - print "
"; - print "
"; - - print ""; - - //return; - } - } diff --git a/classes/feeds.php b/classes/feeds.php index bcfcbf894..e8c3bcf2c 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -37,7 +37,7 @@ class Feeds extends Handler_Protected { $reply .= " + onclick='CommonDialogs.generatedFeed(\"$feed_id\", \"$is_cat\", \"$rss_link\")'> rss_feed"; $reply .= ""; diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index cb2e79853..55bdfae9f 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1391,10 +1391,10 @@ class Pref_Feeds extends Handler_Protected { print "

" . __('Published articles can be subscribed by anyone who knows the following URL:') . "

"; - $rss_url = '-2::' . htmlspecialchars(get_self_url_prefix() . + $rss_url = htmlspecialchars(get_self_url_prefix() . "/public.php?op=rss&id=-2&view-mode=all_articles");; - print " "; print " - + + ` + }); + + dialog.show(); + + Notify.close(); + + } catch (e) { + this.Error.report(e); + } + }); + }, + generatedFeed: function(feed, is_cat, rss_url) { + + Notify.progress("Loading, please wait...", true); + + xhrJson("backend.php", {op: "pref-feeds", method: "getFeedKey", id: feed, is_cat: is_cat}, (reply) => { + try { + if (dijit.byId("genFeedDlg")) + dijit.byId("genFeedDlg").destroyRecursive(); + + const feed_title = Feeds.getName(feed, is_cat); + + const secret_url = rss_url + "&key=" + encodeURIComponent(reply.link); + + const dialog = new dijit.Dialog({ + title: __("Show as feed"), + id: 'genFeedDlg', + style: "width: 600px", + onCancel: function () { + return true; + }, + onExecute: function () { + return true; + }, + onClose: function () { + return true; + }, + content: ` +
${__("%s can be accessed via the following secret URL:").replace("%s", feed_title)}
+
+ +
+ ` });