diff --git a/classes/dlg.php b/classes/dlg.php
index 64f9aca9d..7c07cf4f1 100644
--- a/classes/dlg.php
+++ b/classes/dlg.php
@@ -35,32 +35,6 @@ class Dlg extends Handler_Protected {
//return;
}
- function pubOPMLUrl() {
- $url_path = Opml::opml_publish_url();
-
- print "" . __("Your Public OPML URL is:") . " ";
-
- print "";
-
- print "";
- print "
$url_path ";
- print "
";
-
- print " ";
-
- print "";
-
- print "".
- __('Generate new URL')." ";
-
- print "".
- __('Close this window')." ";
-
- print " ";
-
- //return;
- }
-
function explainError() {
print "
";
@@ -191,17 +165,4 @@ class Dlg extends Handler_Protected {
//return;
}
- function defaultPasswordWarning() {
-
- print_warning(__("You are using default tt-rss password. Please change it in the Preferences (Personal data / Authentication)."));
-
- print "
";
- print "".
- __('Open Preferences')." ";
- print "".
- __('Close this window')." ";
- print " ";
- }
}
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index 0b12bda13..cb2e79853 100755
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -1379,7 +1379,7 @@ class Pref_Feeds extends Handler_Protected {
" " .
__("Published OPML does not include your Tiny Tiny RSS settings, feeds that require authentication or feeds hidden from Popular feeds.") . "";
- print "
".
+ print "".
__('Display published OPML URL')." ";
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefFeedsOPML");
@@ -1706,13 +1706,17 @@ class Pref_Feeds extends Handler_Protected {
}
}
+ function getOPMLKey() {
+ print json_encode(["link" => OPML::opml_publish_url()]);
+ }
+
function regenOPMLKey() {
$this->update_feed_access_key('OPML:Publish',
- false, $_SESSION["uid"]);
+ false, $_SESSION["uid"]);
- $new_link = Opml::opml_publish_url();
+ $new_link = OPML::opml_publish_url();
- print json_encode(array("link" => $new_link));
+ print json_encode(["link" => $new_link]);
}
function regenFeedKey() {
diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js
index b344967a7..08a32de86 100644
--- a/js/CommonDialogs.js
+++ b/js/CommonDialogs.js
@@ -359,5 +359,54 @@ const CommonDialogs = {
});
}
return false;
- }
+ },
+ publishedOPML: function() {
+
+ Notify.progress("Loading, please wait...", true);
+
+ xhrJson("backend.php", {op: "pref-feeds", method: "getOPMLKey"}, (reply) => {
+ try {
+ if (dijit.byId("publicOPMLDlg"))
+ dijit.byId("publicOPMLDlg").destroyRecursive();
+
+ const dialog = new dijit.Dialog({
+ title: "Public OPML URL",
+ id: 'publicOPMLDlg',
+ style: "width: 600px",
+ onCancel: function () {
+ return true;
+ },
+ onExecute: function () {
+ return true;
+ },
+ onClose: function () {
+ return true;
+ },
+ content: `
+ ${__("Your Public OPML URL is:")}
+
+
+
+ ${__('Generate new URL')}
+
+
+ ${__('Close this window')}
+
+
+ `
+ });
+
+ dialog.show();
+
+ Notify.close();
+
+ } catch (e) {
+ this.Error.report(e);
+ }
+ });
+ },
};
diff --git a/js/Feeds.js b/js/Feeds.js
index 64e932ca2..1e476dd98 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -226,25 +226,34 @@ const Feeds = {
if (dijit.byId("defaultPasswordDlg"))
dijit.byId("defaultPasswordDlg").destroyRecursive();
- xhrPost("backend.php", {op: 'dlg', method: 'defaultpasswordwarning'}, (transport) => {
- const dialog = new dijit.Dialog({
- title: __("Your password is at default value"),
- content: transport.responseText,
- id: 'defaultPasswordDlg',
- style: "width: 600px",
- onCancel: function () {
- return true;
- },
- onExecute: function () {
- return true;
- },
- onClose: function () {
- return true;
- }
- });
+ const dialog = new dijit.Dialog({
+ title: __("Your password is at default value"),
+ content: `
+ ${__("You are using default tt-rss password. Please change it in the Preferences (Personal data / Authentication).")}
+
- dialog.show();
+
+
+ ${__('Open Preferences')}
+
+
+ ${__('Close this window')}
+
+ `,
+ id: 'defaultPasswordDlg',
+ style: "width: 600px",
+ onCancel: function () {
+ return true;
+ },
+ onExecute: function () {
+ return true;
+ },
+ onClose: function () {
+ return true;
+ }
});
+
+ dialog.show();
}
if (dijit.byId("safeModeDlg"))
@@ -258,7 +267,7 @@ const Feeds = {
${__('Tiny Tiny RSS is running in safe mode. All themes and plugins are disabled. You will need to log out and back in to disable it.')}