From 2ac6508fe697ed5e95cc7bf73ffb9e2e0bf0d3fa Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Feb 2021 15:53:00 +0300 Subject: [PATCH] mail, mailto: cleanup markup --- plugins/mail/init.php | 126 ++++++++++++++++++++++------------------ plugins/mailto/init.js | 2 +- plugins/mailto/init.php | 33 +++++------ 3 files changed, 85 insertions(+), 76 deletions(-) diff --git a/plugins/mail/init.php b/plugins/mail/init.php index 8a0d01aca..bb576a4d9 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -37,42 +37,44 @@ class Mail extends Plugin { function hook_prefs_tab($args) { if ($args != "prefPrefs") return; - print "
mail ".__('Mail plugin')."\">"; + $addresslist = $this->host->get($this, "addresslist"); - print "

" . __("You can set predefined email addressed here (comma-separated list):") . "

"; + ?> - print "
"; +
- print ""; + - print \Controls\hidden_tag("op", "pluginhandler"); - print \Controls\hidden_tag("method", "save"); - print \Controls\hidden_tag("plugin", "mail"); +
- $addresslist = $this->host->get($this, "addresslist"); + - print ""; +
- print "

"; + - print "

"; + - print "
"; +
+ "; - - print \Controls\hidden_tag("op", "pluginhandler"); - print \Controls\hidden_tag("plugin", "mail"); - print \Controls\hidden_tag("method", "sendEmail"); $sth = $this->pdo->prepare("SELECT email, full_name FROM ttrss_users WHERE id = ?"); @@ -107,9 +104,6 @@ class Mail extends Plugin { if (!$user_name) $user_name = $_SESSION['name']; - print \Controls\hidden_tag("from_email", "$user_email"); - print \Controls\hidden_tag("from_name", "$user_name"); - $tpl = new Templator(); $tpl->readTemplateFromFile("email_article_template.txt"); @@ -150,40 +144,58 @@ class Mail extends Plugin { $content = ""; $tpl->generateOutputToString($content); - print ""; + - print "
"; - $addresslist = explode(",", $this->host->get($this, "addresslist")); - print __('To:'); + ?> - print ""; +
- print \Controls\select_tag("destination", "", $addresslist, - ["style" => "width: 30em", "required" => 1, "dojoType" => "dijit.form.ComboBox"]); + + + - print "
"; + + - print __('Subject:'); + - print ""; +
+
+ + "width: 380px", "required" => 1, "dojoType" => "dijit.form.ComboBox"]) ?> +
+
- print ""; +
+
+ + +
+
- print "
"; +
+ + +
- print "
"; - - print ""; - - print ""; + + ".__('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)); + $mailto_link = "mailto:?subject=".rawurlencode($subject)."&body=".rawurlencode($content); - print __("Clicking the following link to invoke your mail client:"); + ?> - print "
"; - print "". - __("Forward selected article(s) by email.").""; - print "
"; +
+
+ + + +
+
- print __("You should be able to edit the message before sending in your mail client."); + - print "

"; - - print "

"; - - //return; +