[dev] Problem with compose_html logic (HEAD)

Jan Kuipers jrkuipers at lauwerscollege.nl
Thu Dec 11 10:04:27 PST 2003


Regarding HEAD:

There is a small problem with the compose_html logic in imp/compose.php
imho it should work this way:

compose_html
locked  value
  1       1      html, locked, no pref shown, switchlink in composescreen
  1       0      plain, locked, no pref shown, _no_ switchlink in composescreen
  0       1      html, not locked, pref shown, switchlink in composescreen
  0       0      plain, not locked, pref shown, switchlink in composescreen

With the existing logic it doesn't work this way.
I attached a small patch which accomplishes this behaviour.

--
Jan Kuipers
Systeembeheer Lauwers College

----------------------------------------------------------------
DISCLAIMER

This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.
-------------- next part --------------
Index: compose.php
===================================================================
RCS file: /repository/imp/compose.php,v
retrieving revision 2.698
diff -u -r2.698 compose.php
--- compose.php	9 Dec 2003 22:52:40 -0000	2.698
+++ compose.php	10 Dec 2003 23:53:34 -0000
@@ -341,17 +341,33 @@
 if ($actionID != 'redirect_compose') {
     /* Disable rich text composition if prefs value for 'compose_html' is
        disabled and locked. */
-    if ($browser->hasFeature('rte') &&
-        !($prefs->isLocked('compose_html') &&
-          $prefs->getValue('compose_html'))) {
-        $rtemode = Util::getFormData('rtemode');
+    if ($prefs->isLocked('compose_html')) {
+        if ($browser->hasFeature('rte') &&
+            $prefs->isLocked('compose_html') &&
+            $prefs->getValue('compose_html')) {
+            $rtemode = Util::getFormData('rtemode');
 
-        if (is_null($rtemode)) {
-            $rtemode = ($prefs->getValue('compose_html')) ? IMP_COMPOSE_HTML : IMP_COMPOSE_TEXT;
-        } else {
-            $oldrtemode = Util::getFormData('oldrtemode');
-            $rtemodechange = ($rtemode != $oldrtemode);
-            $get_sig = false;
+            if (is_null($rtemode)) {
+                $rtemode = ($prefs->getValue('compose_html')) ? IMP_COMPOSE_HTML : IMP_COMPOSE_TEXT;
+            } else {
+                $oldrtemode = Util::getFormData('oldrtemode');
+                $rtemodechange = ($rtemode != $oldrtemode);
+                $get_sig = false;
+            }
+        }
+    } else {
+        if ($browser->hasFeature('rte') &&
+            !($prefs->isLocked('compose_html') &&
+              $prefs->getValue('compose_html'))) {
+            $rtemode = Util::getFormData('rtemode');
+
+            if (is_null($rtemode)) {
+                $rtemode = ($prefs->getValue('compose_html')) ? IMP_COMPOSE_HTML : IMP_COMPOSE_TEXT;
+            } else {
+                $oldrtemode = Util::getFormData('oldrtemode');
+                $rtemodechange = ($rtemode != $oldrtemode);
+                $get_sig = false;
+            }
         }
     }
 }


More information about the dev mailing list