[geeklog-cvs] geeklog: Remember the content of the "Mail Users" form upon erro...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Mar 19 09:37:35 EDT 2011


changeset 8177:86c6c613074a
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/86c6c613074a
user: Rouslan Placella <rouslan at placella.com>
date: Sat Mar 19 13:37:13 2011 +0000
description:
Remember the content of the "Mail Users" form upon error. Bug #0001270

diffstat:

 public_html/admin/mail.php                                    |  25 ++++++++--
 public_html/layout/professional/admin/mail/mailform.thtml     |  10 ++--
 public_html/layout/professional_css/admin/mail/mailform.thtml |  10 ++--
 3 files changed, 29 insertions(+), 16 deletions(-)

diffs (111 lines):

diff -r 390ab9de58d9 -r 86c6c613074a public_html/admin/mail.php
--- a/public_html/admin/mail.php	Sat Mar 19 12:09:25 2011 +0100
+++ b/public_html/admin/mail.php	Sat Mar 19 13:37:13 2011 +0000
@@ -2,13 +2,13 @@
 
 /* Reminder: always indent with 4 spaces (no tabs). */
 // +---------------------------------------------------------------------------+
-// | Geeklog 1.7                                                               |
+// | Geeklog 1.8                                                               |
 // +---------------------------------------------------------------------------+
 // | mail.php                                                                  |
 // |                                                                           |
 // | Geeklog mail administration page.                                         |
 // +---------------------------------------------------------------------------+
-// | Copyright (C) 2001-2010 by the following authors:                         |
+// | Copyright (C) 2001-2011 by the following authors:                         |
 // |                                                                           |
 // | Authors: Tony Bibbs - tony AT tonybibbs DOT com                           |
 // |          Dirk Haun  - dirk AT haun-online DOT de                          |
@@ -135,7 +135,21 @@
     $fromemail = substr($fromemail, 0, strcspn($fromemail, "\r\n"));
     $fromemail = htmlspecialchars(trim($fromemail), ENT_QUOTES);
     $mail_templates->set_var('site_mail', $fromemail);
-
+    if (isset($vars['subject'])) {
+        $mail_templates->set_var('subject', COM_applyFilter($vars['subject']));
+    }
+    if (isset($vars['message'])) {
+        $mail_templates->set_var('message', COM_applyFilter($vars['message']));
+    }
+    if (isset($vars['html']) && trim($vars['html']) == 'on') {
+        $mail_templates->set_var('html', ' checked="checked"');
+    }
+    if (isset($vars['priority']) && trim($vars['priority']) == 'on') {
+        $mail_templates->set_var('priority', ' checked="checked"');
+    }
+    if (isset($vars['overstyr']) && trim($vars['overstyr']) == 'on') {
+        $mail_templates->set_var('overstyr', ' checked="checked"');
+    }
     $mail_templates->set_var('lang_subject', $LANG31[4]);
     $mail_templates->set_var('lang_body', $LANG31[5]);
     $mail_templates->set_var('lang_sendto', $LANG31[6]);
@@ -174,9 +188,8 @@
 
     $retval = '';
 
-    if (empty($vars['fra']) OR empty($vars['fraepost']) OR
-            empty($vars['subject']) OR empty($vars['message']) OR
-            empty($vars['to_group']) OR (strpos($vars['fra'], '@') !== false)) {
+    if (empty($vars['fra']) || empty($vars['fraepost']) || empty($vars['subject']) ||
+        empty($vars['message']) || empty($vars['to_group']) || strpos($vars['fra'], '@') !== false) {
         $retval .= COM_showMessageText($LANG31[26]);
         $retval .= display_mailform($vars);
 
diff -r 390ab9de58d9 -r 86c6c613074a public_html/layout/professional/admin/mail/mailform.thtml
--- a/public_html/layout/professional/admin/mail/mailform.thtml	Sat Mar 19 12:09:25 2011 +0100
+++ b/public_html/layout/professional/admin/mail/mailform.thtml	Sat Mar 19 13:37:13 2011 +0000
@@ -19,23 +19,23 @@
         </tr>
         <tr>
             <td class="alignright"><b>{lang_subject}:</b></td>
-            <td><input type="text" name="subject" size="40"{xhtml}></td>
+            <td><input type="text" name="subject" value="{subject}" size="40"{xhtml}></td>
         </tr>
         <tr>
             <td class="alignright" style="vertical-align:top;"><b>{lang_body}:</b></td>
-            <td><textarea name="message" rows="10" style="width:100%"></textarea></td>
+            <td><textarea name="message" rows="10" style="width:100%">{message}</textarea></td>
         </tr>
         <tr>
             <td class="alignright"><b>{lang_options}:</b></td>
-            <td><input type="checkbox" name="html"{xhtml}> {lang_HTML}</td>
+            <td><input type="checkbox" name="html"{html}{xhtml}> {lang_HTML}</td>
         </tr>
         <tr>
             <td> </td>
-            <td><input type="checkbox" name="priority"{xhtml}> {lang_urgent}</td>
+            <td><input type="checkbox" name="priority"{priority}{xhtml}> {lang_urgent}</td>
         </tr>
         <tr>
             <td> </td>
-            <td><input type="checkbox" name="overstyr"{xhtml}> {lang_ignoreusersettings}</td>
+            <td><input type="checkbox" name="overstyr"{overstyr}{xhtml}> {lang_ignoreusersettings}</td>
         </tr>
         <tr>
             <td colspan="2" class="aligncenter" style="padding-top:10px;">
diff -r 390ab9de58d9 -r 86c6c613074a public_html/layout/professional_css/admin/mail/mailform.thtml
--- a/public_html/layout/professional_css/admin/mail/mailform.thtml	Sat Mar 19 12:09:25 2011 +0100
+++ b/public_html/layout/professional_css/admin/mail/mailform.thtml	Sat Mar 19 13:37:13 2011 +0000
@@ -19,16 +19,16 @@
       <dd><input type="text" value="{site_mail}" size="40" name="fraepost" class="text" id="admin-mailform-fraepost"{xhtml}></dd>
 
       <dt><label for="admin-mailform-subject">{lang_subject}</label></dt>
-      <dd><input type="text" size="40" name="subject" class="text" id="admin-mailform-subject"{xhtml}></dd>
+      <dd><input type="text" value="{subject}" size="40" name="subject" class="text" id="admin-mailform-subject"{xhtml}></dd>
 
       <dt><label for="admin-mailform-message">{lang_body}</label></dt>
-      <dd><textarea rows="12" cols="44" name="message" id="admin-mailform-message"></textarea></dd>
+      <dd><textarea rows="12" cols="44" name="message" id="admin-mailform-message">{message}</textarea></dd>
 
       <dt><label for="admin-mailform-html">{lang_options}</label></dt>
       <dd>
-        <input type="checkbox" name="html" id="admin-mailform-html"{xhtml}>{lang_HTML}
-        <input type="checkbox" name="priority"{xhtml}>{lang_urgent}
-        <input type="checkbox" name="overstyr"{xhtml}>{lang_ignoreusersettings}
+        <input type="checkbox" name="html" id="admin-mailform-html"{html}{xhtml}>{lang_HTML}
+        <input type="checkbox" name="priority"{priority}{xhtml}>{lang_urgent}
+        <input type="checkbox" name="overstyr"{overstyr}{xhtml}>{lang_ignoreusersettings}
       </dd>
     </dl>
 



More information about the geeklog-cvs mailing list