Re: newmail_changetitle

Paul Lesniewski <[email protected]>
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <[email protected]>
On Wed, Mar 10, 2010 at 4:16 AM, javier wilson <[email protected]> wrote:
> I use Squirrelmail 1.4.20.
>
> I use the newmail_changetitle feaute in the newmail plugin, however I
> also use org_title to display the user's email address. In order to
> not "lose" the original title, I propose to change
> plugins/newmail/setup.php:
>
>        global $org_title;
> [...]
>                    sprintf(_("%s New Messages"), $totalNew ) .  ': '
> . $org_title .
>
> Does it sound like a good idea to anyone else?

I would do something like this

--- setup.php   (revision 13927)
+++ setup.php   (working copy)
@@ -220,16 +220,17 @@
         // will play the sound as follows:

         if ($newmail_changetitle) {
+            global $org_title;
             echo "<script language=\"javascript\"
type=\"text/javascript\">\n" .
                 "function ChangeTitleLoad() {\n";
             if( $totalNew > 1 || $totalNew == 0 ) {
-                echo 'window.parent.document.title = "' .
+                echo 'window.parent.document.title = "' . $org_title . ' [' .
                     sprintf(_("%s New Messages"), $totalNew ) .
-                    "\";\n";
+                    "]\";\n";
             } else {
-                echo 'window.parent.document.title = "' .
+                echo 'window.parent.document.title = "' . $org_title . ' [' .
                     sprintf(_("%s New Message"), $totalNew ) .
-                    "\";\n";
+                    "]\";\n";
             }
             echo    "if (BeforeChangeTitle != null)\n".
                 "BeforeChangeTitle();\n".


But it's better to make it a configurable thing so the admin can
decide.  That's exactly what happens in the New Mail plugin in
SquirrelMail 1.5.2, so I'm not sure we'll want to change this in
1.4.x.  You could try to use New Mail from 1.5.2 in 1.4.x, but I have
no idea if it'd work (and I have my doubts).

-- 
Paul Lesniewski
SquirrelMail Team
Please support Open Source Software by donating to SquirrelMail!
http://squirrelmail.org/donate_paul_lesniewski.php

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.