feed tree context menu: add an entry to open originating website

This commit is contained in:
Andrew Dolgov 2021-10-10 22:08:17 +03:00
parent 949e2ab4d2
commit 145fc31625
2 changed files with 26 additions and 0 deletions

View File

@ -587,6 +587,23 @@ class Feeds extends Handler_Protected {
]);
}
function opensite() {
$feed = ORM::for_table('ttrss_feeds')
->find_one((int)$_REQUEST['feed_id']);
if ($feed) {
$site_url = UrlHelper::validate($feed->site_url);
if ($site_url) {
header("Location: $site_url");
return;
}
}
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
print "Feed not found or has an empty site URL.";
}
function updatedebugger() {
header("Content-type: text/html");

View File

@ -101,6 +101,15 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/co
CommonDialogs.editFeed(this.getParent().row_id, false);
}}));
menu.addChild(new dijit.MenuItem({
label: __("Open site"),
onClick: function() {
App.postOpenWindow("backend.php", {op: "feeds", method: "opensite",
feed_id: this.getParent().row_id, csrf_token: __csrf_token});
}}));
menu.addChild(new dijit.MenuSeparator());
menu.addChild(new dijit.MenuItem({
label: __("Debug feed"),
onClick: function() {