af_psql_trgm: don't load dialog via http

This commit is contained in:
Andrew Dolgov 2021-02-17 14:08:06 +03:00
parent d439685895
commit 538f87e415
2 changed files with 11 additions and 8 deletions

View File

@ -1,15 +1,18 @@
/* global dijit, Plugins, __ */ /* global dijit, dojo, Plugins, xhrPost, __ */
Plugins.Psql_Trgm = { Plugins.Psql_Trgm = {
showRelated: function (id) { showRelated: function (id) {
const query = "backend.php?op=pluginhandler&plugin=af_psql_trgm&method=showrelated&param=" + encodeURIComponent(id);
const dialog = new dijit.Dialog({ const dialog = new dijit.Dialog({
title: __("Related articles"), title: __("Related articles"),
execute: function () { content: __("Loading, please wait...")
// });
},
href: query, const tmph = dojo.connect(dialog, "onShow", null, function (/* e */) {
dojo.disconnect(tmph);
xhrPost("backend.php", {op: 'pluginhandler', plugin: 'af_psql_trgm', method: 'showrelated', id: id}, (transport) => {
dialog.attr('content', transport.responseText);
});
}); });
dialog.show(); dialog.show();

View File

@ -46,7 +46,7 @@ class Af_Psql_Trgm extends Plugin {
} }
function showrelated() { function showrelated() {
$id = (int) $_REQUEST['param']; $id = (int) $_REQUEST['id'];
$owner_uid = $_SESSION["uid"]; $owner_uid = $_SESSION["uid"];
$sth = $this->pdo->prepare("SELECT title FROM ttrss_entries, ttrss_user_entries $sth = $this->pdo->prepare("SELECT title FROM ttrss_entries, ttrss_user_entries