[imp] accessing horde prefs from within imp javascript?

Liam Hoekenga liamr at deathstar.org
Fri Jan 25 19:44:45 UTC 2008


There's a pref I made for IMP 4.0.x that allows the user to turn of the 
confirmation message they receive when they report a message as spam or 
as innocent, that I'd like to move forward to 4.2.x.

In 4.0.x, I simply did embedded some php login in 
templates/mailbox/javascript.inc.  I see in version 4.2, the javascript 
is in imp/js/src/mailbox.js (and message.js), and then a condenced (no 
line feeds, no extra white space, and no comments) version in located in 
imp/js.

Can I do something like $prefs->getValue() from with the javascript?

Is there an easy mechanism for generating the condensed javascript file?

My original diff follows...

Liam
---------------------------------

diff -uNrw -x CVS /usr/src/imp-h3-4.0.5/templates/mailbox/javascript.inc 
imp/tem
plates/mailbox/javascript.inc
--- /usr/src/imp-h3-4.0.5/templates/mailbox/javascript.inc      
2005-09-26 05:41
:12.000000000 -0400
+++ imp/templates/mailbox/javascript.inc        2005-11-09 
13:56:49.000000000 -0
500
@@ -70,6 +70,7 @@
         }
     }
 <?php endif; ?>
+<?php if ($prefs->getValue('confirm_spam_report')): ?>
     if (actID == 'spam_report') {
         if (!window.confirm('<?php echo addslashes(_("Are you sure you 
wish to
report this message as spam?")) ?>')) {
             return;
@@ -80,6 +81,7 @@
             return;
         }
     }
+<?php endif; ?>
     document.messages.actionID.value = actID;
     document.messages.submit();



More information about the imp mailing list