From a2e688fcb2d463a5db700ebd013c783e3a8f4971 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 14 Feb 2021 22:17:13 +0300 Subject: render headline-specific toolbar on the client --- plugins/mailto/init.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/mailto/init.php') diff --git a/plugins/mailto/init.php b/plugins/mailto/init.php index 390984b71..3e24dcf29 100644 --- a/plugins/mailto/init.php +++ b/plugins/mailto/init.php @@ -12,6 +12,11 @@ class MailTo extends Plugin { $this->host = $host; $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); + $host->add_hook($host::HOOK_HEADLINE_TOOLBAR_SELECT_MENU_ITEM, $this); + } + + function hook_headline_toolbar_select_menu_item($feed_id, $is_cat) { + return "
".__('Forward by email')."
"; } function get_js() { -- cgit v1.2.3 From 2b2833bb4fa6f958b89a83adea89d9e7c73daee7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Feb 2021 14:56:36 +0300 Subject: plugins: load dialogs via xhr instead of http --- plugins/mailto/init.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/mailto/init.php') diff --git a/plugins/mailto/init.php b/plugins/mailto/init.php index 3e24dcf29..4b858eae6 100644 --- a/plugins/mailto/init.php +++ b/plugins/mailto/init.php @@ -20,7 +20,7 @@ class MailTo extends Plugin { } function get_js() { - return file_get_contents(dirname(__FILE__) . "/init.js"); + return file_get_contents(__DIR__ . "/init.js"); } function hook_article_button($line) { @@ -31,7 +31,7 @@ class MailTo extends Plugin { function emailArticle() { - $ids = explode(",", $_REQUEST['param']); + $ids = explode(",", clean($_REQUEST['ids'])); $ids_qmarks = arr_qmarks($ids); $tpl = new Templator(); @@ -85,7 +85,7 @@ class MailTo extends Plugin { print "

"; print "

"; - print ""; + print \Controls\submit_tag(__('Close this dialog')); print "
"; //return; -- cgit v1.2.3 From 2ac6508fe697ed5e95cc7bf73ffb9e2e0bf0d3fa Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Feb 2021 15:53:00 +0300 Subject: mail, mailto: cleanup markup --- plugins/mailto/init.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'plugins/mailto/init.php') diff --git a/plugins/mailto/init.php b/plugins/mailto/init.php index 4b858eae6..c34b400ce 100644 --- a/plugins/mailto/init.php +++ b/plugins/mailto/init.php @@ -16,7 +16,7 @@ class MailTo extends Plugin { } function hook_headline_toolbar_select_menu_item($feed_id, $is_cat) { - return "
".__('Forward by email')."
"; + return "
".__('Forward by email (mailto:)')."
"; } function get_js() { @@ -26,7 +26,7 @@ class MailTo extends Plugin { function hook_article_button($line) { return "mail_outline"; + title='".__('Forward by email (mailto:)')."'>mail_outline"; } function emailArticle() { @@ -42,7 +42,6 @@ class MailTo extends Plugin { //$tpl->setVariable('USER_EMAIL', $user_email, true); $tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"], true); - $sth = $this->pdo->prepare("SELECT DISTINCT link, content, title FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND id IN ($ids_qmarks) AND owner_uid = ?"); @@ -70,25 +69,23 @@ class MailTo extends Plugin { $content = ""; $tpl->generateOutputToString($content); - $mailto_link = htmlspecialchars("mailto:?subject=".rawurlencode($subject). - "&body=".rawurlencode($content)); - - print __("Clicking the following link to invoke your mail client:"); - - print ""; + $mailto_link = "mailto:?subject=".rawurlencode($subject)."&body=".rawurlencode($content); - print __("You should be able to edit the message before sending in your mail client."); + ?> - print "

"; +

+
+ + + +
+
- print "
"; - print \Controls\submit_tag(__('Close this dialog')); - print "
"; +
+ +
- //return; +