Some cleanup.
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 24 Nov 2001 18:38:52 +0000 (18:38 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 24 Nov 2001 18:38:52 +0000 (18:38 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1798 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/options.php
plugins/newmail/newmail_opt.php
plugins/newmail/setup.php
po/squirrelmail.po
src/options_display.php
src/options_highlight.php
src/options_identities.php

index c944f995dfb889b1cf87984142017e1752032250..e1de4e73880e08eae49b8a5d153fd80c897e152f 100644 (file)
@@ -1,15 +1,15 @@
 <?php
 
     /**
-     * options.php
-     *
-     * Copyright (c) 1999-2001 The Squirrelmail Development Team
-     * Licensed under the GNU GPL. For full terms see the file COPYING.
-     *
-     * Functions needed to display the options pages.
-     *
-     * $Id$
-     */
+     ** options.php
+     **
+     ** Copyright (c) 1999-2001 The Squirrelmail Development Team
+     ** Licensed under the GNU GPL. For full terms see the file COPYING.
+     **
+     ** Functions needed to display the options pages.
+     **
+     ** $Id$
+     **/
 
 /**********************************************/
 /* Define constants used in the options code. */
index d8ad6f49acb046a83d834e759335474180967400..7affbf7b1f0eb2770d84ed6776406b229f268194 100644 (file)
@@ -85,7 +85,7 @@ _("Select from the list of <b>server files</b> the media file to play when new m
     if ($media_changetitle == 'on') {
               echo 'checked ';
     }
-    echo 'name=media_changetitle><b> ' . _("Change title on supported browsers.") . '</b> &nbsp; (' . _("requires IE and JavaScript to work") . ')</td>'.
+    echo 'name=media_changetitle><b> ' . _("Change title on supported browsers.") . '</b> &nbsp; (' . _("requires JavaScript to work") . ')</td>'.
             '</tr>'.
             '<tr>'.
                 '<td align=right nowrap>&nbsp</td>'.
index 0d3bac4dbe3d772de2572dab36007e423ecab18f..618a9314d98ee6999de78d998e2c58a414138141 100644 (file)
@@ -61,7 +61,6 @@
 
         $squirrelmail_plugin_hooks['left_main_before']['newmail'] = 'newmail_plugin';
         $squirrelmail_plugin_hooks['optpage_register_block']['newmail'] = 'newmail_optpage_register_block';
-        // $squirrelmail_plugin_hooks['options_link_and_description']['newmail'] = 'newmail_options';
         $squirrelmail_plugin_hooks['options_save']['newmail'] = 'newmail_sav';
         $squirrelmail_plugin_hooks['loading_prefs']['newmail'] = 'newmail_pref';
     }
         }
     }
 
-function newmail_sav() {
-
-  global $username,$data_dir;
-  global $submit_newmail,$media_file,$media_reset,$media_enable,$media_popup;
-  global $media_recent,$media_sel;
-  global $media_allbox, $media_changetitle;
-
-  if ($submit_newmail) {
-   if(isset($media_enable)) {
-     setPref($data_dir,$username,"newmail_enable",$media_enable);
-   } else {
-     setPref($data_dir,$username,"newmail_enable","");
-   }
-   if(isset($media_popup)) {
-     setPref($data_dir,$username,"newmail_popup",$media_popup);
-   } else {
-     setPref($data_dir,$username,"newmail_popup","");
-   }
-   if(isset($media_allbox)) {
-     setPref($data_dir,$username,"newmail_allbox",$media_allbox);
-   } else {
-     setPref($data_dir,$username,"newmail_allbox","");
-   }
-   if(isset($media_recent)) {
-     setPref($data_dir,$username,"newmail_recent",$media_recent);
-   } else {
-     setPref($data_dir,$username,"newmail_recent","");
-   }
-   if(isset($media_changetitle)) {
-     setPref($data_dir,$username,"newmail_changetitle",$media_changetitle);
-   } else {
-     setPref($data_dir,$username,"newmail_changetitle","");
-   }
-   if(isset($media_sel)) {
-     if($media_sel == "(local media)") { 
-         setPref($data_dir,$username,"newmail_media",StripSlashes($media_file));
-     } else {
-        setPref($data_dir,$username,"newmail_media",$media_sel);
-     }
-   } else {
-     setPref($data_dir,$username,"newmail_media","");
-   }
-   echo '<center> ' . _("New Mail Notification options saved") . '</center>';
-  }
-}
+    function newmail_sav() {
+
+        global $username,$data_dir;
+        global $submit_newmail,$media_file,$media_reset,$media_enable,$media_popup;
+        global $media_recent,$media_sel;
+        global $media_allbox, $media_changetitle;
+
+        if ($submit_newmail) {
+            if(isset($media_enable)) {
+                setPref($data_dir,$username,'newmail_enable',$media_enable);
+            } else {
+                setPref($data_dir,$username,'newmail_enable','');
+            }
+            if(isset($media_popup)) {
+                setPref($data_dir,$username,'newmail_popup',$media_popup);
+            } else {
+                setPref($data_dir,$username,'newmail_popup','');
+            }
+            if(isset($media_allbox)) {
+                setPref($data_dir,$username,'newmail_allbox',$media_allbox);
+            } else {
+                setPref($data_dir,$username,'newmail_allbox','');
+            }
+            if(isset($media_recent)) {
+                setPref($data_dir,$username,'newmail_recent',$media_recent);
+            } else {
+                setPref($data_dir,$username,'newmail_recent','');
+            }
+            if(isset($media_changetitle)) {
+                setPref($data_dir,$username,'newmail_changetitle',$media_changetitle);
+            } else {
+                setPref($data_dir,$username,'newmail_changetitle','');
+            }
+            if(isset($media_sel)) {
+                if($media_sel == '(local media)') {
+                    setPref($data_dir,$username,'newmail_media',StripSlashes($media_file));
+                } else {
+                    setPref($data_dir,$username,'newmail_media',$media_sel);
+                }
+            } else {
+                setPref($data_dir,$username,'newmail_media','');
+            }
+            echo '<center> ' . _("New Mail Notification options saved") . '</center>';
+        }
+    }
 
     function newmail_pref() {
       
@@ -140,102 +139,103 @@ function newmail_sav() {
         $newmail_popup = getPref($data_dir, $username, 'newmail_popup');
         $newmail_allbox = getPref($data_dir, $username, 'newmail_allbox');
         $newmail_changetitle = getPref($data_dir, $username, 'newmail_changetitle');
-        
+
         if ($newmail_media == '') {
             $newmail_media = '../plugins/newmail/sounds/Notify.wav';
         }
-    
-    }
 
-function newmail_plugin() {
-
- global $username,$key,$imapServerAddress,$imapPort;
- global $newmail_media,$newmail_enable,$newmail_popup,$newmail_recent;
- global $newmail_changetitle;
- global $imapConnection;
-
- if ($newmail_enable == 'on' || $newmail_popup == 'on' || $newmail_changetitle) {
-
-   // open a connection on the imap port (143)
-
-   // $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output
-
-   $boxes = sqimap_mailbox_list($imapConnection);
-   $delimeter = sqimap_get_delimiter($imapConnection);
-
-   $status = 0;
-   $totalNew = 0;
-
-   for ($i = 0;$i < count($boxes); $i++) {
-
-      $line = '';
-      $mailbox = $boxes[$i]['formatted'];
-
-      if (! isset($boxes[$i]['unseen']))
-         $boxes[$i]['unseen'] = '';
-      if ($boxes[$i]['flags']) {
-         $noselect = false;
-         for ($h = 0; $h < count($boxes[$i]['flags']); $h++) {
-            if (strtolower($boxes[$i]["flags"][$h]) == 'noselect')
-               $noselect = true;
-         }
-         if (! $noselect) {
-            $status = $status + CheckNewMailboxSound($imapConnection, $mailbox,
-                       $boxes[$i]['unformatted'], $delimeter, $boxes[$i]['unseen'],
-                       $totalNew);
-         }
-      } else {
-         $status = $status + CheckNewMailboxSound($imapConnection, $mailbox, $boxes[$i]['unformatted'],
-                       $delimeter, $boxes[$i]['unseen'], $totalNew);
-      }
-   
-   }
-   
-   // sqimap_logout($imapConnection);
-
-   // If we found unseen messages, then we
-   // will play the sound as follows:
-
-    if ($newmail_changetitle) {
-        echo "<script language=\"javascript\">\n" .
-             "function ChangeTitleLoad() {\n";
-        if( $totalNew > 1 ) {
-            echo    'window.parent.document.title = "' . sprintf(_("%s New Messages"), $totalNew ) . "\";\n";
-        }else {
-            echo    'window.parent.document.title = "' . sprintf(_("%s New Message"), $totalNew ) . "\";\n";
-        }
-        echo    "if (BeforeChangeTitle != null)\n".
-                    "BeforeChangeTitle();\n".
-             "}\n".
-             "BeforeChangeTitle = window.onload;\n".
-             "window.onload = ChangeTitleLoad;\n".
-             "</script>\n";
     }
 
-    if ($status > 0 && $newmail_enable == 'on') {
-        echo "<EMBED SRC=\"$newmail_media\" HIDDEN=TRUE AUTOSTART=TRUE>";
-    }
-    if ($status >0 && $newmail_popup == 'on') {
-?>
-<SCRIPT LANGUAGE="JavaScript">
-<!--
-function PopupScriptLoad() {
-   window.open("../plugins/newmail/newmail.php", "SMPopup",
-      "width=200,height=130,scrollbars=no");
-   if (BeforePopupScript != null)
-      BeforePopupScript();
-}
-BeforePopupScript = window.onload;
-window.onload = PopupScriptLoad;
-
-// Idea by:  Nic Wolfe (Nic@TimelapseProductions.com)
-// Web URL:  http://fineline.xs.mw
-// More code from Tyler Akins
-// End -->
-</script>
-<?php
+    function newmail_plugin() {
+
+        global $username,$key,$imapServerAddress,$imapPort;
+        global $newmail_media,$newmail_enable,$newmail_popup,$newmail_recent;
+        global $newmail_changetitle;
+        global $imapConnection;
+
+        if ($newmail_enable == 'on' ||
+            $newmail_popup == 'on' ||
+            $newmail_changetitle) {
+
+            // open a connection on the imap port (143)
+
+            $boxes = sqimap_mailbox_list($imapConnection);
+            $delimeter = sqimap_get_delimiter($imapConnection);
+
+            $status = 0;
+            $totalNew = 0;
+
+            for ($i = 0;$i < count($boxes); $i++) {
+
+                $line = '';
+                $mailbox = $boxes[$i]['formatted'];
+
+                if (! isset($boxes[$i]['unseen']))
+                    $boxes[$i]['unseen'] = '';
+                if ($boxes[$i]['flags']) {
+                    $noselect = false;
+                    for ($h = 0; $h < count($boxes[$i]['flags']); $h++) {
+                        if (strtolower($boxes[$i]["flags"][$h]) == 'noselect')
+                            $noselect = TRUE;
+                    }
+                    if (! $noselect) {
+                        $status = $status + CheckNewMailboxSound($imapConnection, $mailbox,
+                        $boxes[$i]['unformatted'], $delimeter, $boxes[$i]['unseen'],
+                        $totalNew);
+                    }
+                } else {
+                    $status = $status + CheckNewMailboxSound($imapConnection, $mailbox, $boxes[$i]['unformatted'],
+                        $delimeter, $boxes[$i]['unseen'], $totalNew);
+                }
+
+            }
 
-   }
- }
-}
+            // sqimap_logout($imapConnection);
+
+            // If we found unseen messages, then we
+            // will play the sound as follows:
+
+            if ($newmail_changetitle) {
+                echo "<script language=\"javascript\">\n" .
+                    "function ChangeTitleLoad() {\n";
+                if( $totalNew > 1 ) {
+                    echo 'window.parent.document.title = "' .
+                        sprintf(_("%s New Messages"), $totalNew ) .
+                        "\";\n";
+                } else {
+                    echo 'window.parent.document.title = "' .
+                        sprintf(_("%s New Message"), $totalNew ) .
+                        "\";\n";
+                }
+                echo    "if (BeforeChangeTitle != null)\n".
+                            "BeforeChangeTitle();\n".
+                    "}\n".
+                    "BeforeChangeTitle = window.onload;\n".
+                    "window.onload = ChangeTitleLoad;\n".
+                    "</script>\n";
+            }
+
+            if ($status > 0 && $newmail_enable == 'on') {
+                echo "<EMBED SRC=\"$newmail_media\" HIDDEN=TRUE AUTOSTART=TRUE>";
+            }
+            if ($status >0 && $newmail_popup == 'on') {
+                echo "<SCRIPT LANGUAGE=\"JavaScript\">\n".
+                    "<!--\n".
+                    "function PopupScriptLoad() {\n".
+                    'window.open("../plugins/newmail/newmail.php", "SMPopup",'.
+                                "\"width=200,height=130,scrollbars=no\");\n".
+                    "if (BeforePopupScript != null)\n".
+                    "BeforePopupScript();\n".
+                    "}\n".
+                    "BeforePopupScript = window.onload;\n".
+                    "window.onload = PopupScriptLoad;\n".
+                    // Idea by:  Nic Wolfe (Nic@TimelapseProductions.com)
+                    // Web URL:  http://fineline.xs.mw
+                    // More code from Tyler Akins
+                    "// End -->\n".
+                    "</script>\n";
+
+            }
+        }
+    }
 ?>
index b33fa681425818bb41d32cf2fad471f0d26d60a9..a278359edb8530838e02eece72134219f0597b83 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-11-24 09:39+0100\n"
+"POT-Creation-Date: 2001-11-24 19:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -81,7 +81,9 @@ msgstr ""
 #: squirrelmail/functions/mailbox_display.php:560
 #: squirrelmail/plugins/filters/options.php:182
 #: squirrelmail/src/compose.php:103 squirrelmail/src/download.php:121
-#: squirrelmail/src/download.php:127 squirrelmail/src/options_order.php:43
+#: squirrelmail/src/download.php:127
+#: squirrelmail/src/options_highlight.php:329
+#: squirrelmail/src/options_order.php:43
 #: squirrelmail/src/printer_friendly_bottom.php:82
 #: squirrelmail/src/search.php:66 squirrelmail/src/search.php:67
 msgid "Subject"
@@ -90,7 +92,9 @@ msgstr ""
 #: squirrelmail/functions/mailbox_display.php:546
 #: squirrelmail/plugins/filters/options.php:170
 #: squirrelmail/src/compose.php:104 squirrelmail/src/download.php:122
-#: squirrelmail/src/download.php:129 squirrelmail/src/options_order.php:41
+#: squirrelmail/src/download.php:129
+#: squirrelmail/src/options_highlight.php:317
+#: squirrelmail/src/options_order.php:41
 #: squirrelmail/src/printer_friendly_bottom.php:76
 #: squirrelmail/src/search.php:69 squirrelmail/src/search.php:70
 msgid "From"
@@ -100,6 +104,7 @@ msgstr ""
 #: squirrelmail/plugins/filters/options.php:173
 #: squirrelmail/src/compose.php:105 squirrelmail/src/download.php:123
 #: squirrelmail/src/download.php:131
+#: squirrelmail/src/options_highlight.php:320
 #: squirrelmail/src/printer_friendly_bottom.php:77
 #: squirrelmail/src/search.php:75 squirrelmail/src/search.php:76
 msgid "To"
@@ -257,8 +262,11 @@ msgstr ""
 
 #: squirrelmail/functions/mailbox_display.php:516
 #: squirrelmail/plugins/filters/options.php:86
-#: squirrelmail/plugins/mail_fetch/options.php:185
-#: squirrelmail/src/folders.php:104 squirrelmail/src/read_body.php:452
+#: squirrelmail/plugins/mail_fetch/options.php:168
+#: squirrelmail/plugins/mail_fetch/options.php:175
+#: squirrelmail/src/folders.php:104 squirrelmail/src/options_highlight.php:71
+#: squirrelmail/src/options_identities.php:304
+#: squirrelmail/src/read_body.php:452
 msgid "Delete"
 msgstr ""
 
@@ -323,7 +331,7 @@ msgstr ""
 #: squirrelmail/plugins/newmail/newmail_opt.php:139
 #: squirrelmail/plugins/translate/options.php:133
 #: squirrelmail/src/folders_rename_getname.php:47
-#: squirrelmail/src/options_highlight.php:331
+#: squirrelmail/src/options_highlight.php:342
 msgid "Submit"
 msgstr ""
 
@@ -401,7 +409,7 @@ msgid "Name:"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:126
-#: squirrelmail/plugins/mail_fetch/options.php:223
+#: squirrelmail/plugins/mail_fetch/options.php:207
 #: squirrelmail/src/login.php:127
 msgid "Password:"
 msgstr ""
@@ -441,87 +449,87 @@ msgstr ""
 msgid "Never"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:90
+#: squirrelmail/src/options_display.php:89
 msgid "Mailbox Display Options"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:95
+#: squirrelmail/src/options_display.php:94
 msgid "Number of Messages to Index"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:103
+#: squirrelmail/src/options_display.php:102
 msgid "Enable Alternating Row Colors"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:110
+#: squirrelmail/src/options_display.php:109
 msgid "Enable Page Selector"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:117
+#: squirrelmail/src/options_display.php:116
 msgid "Maximum Number of Pages to Show"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:124
+#: squirrelmail/src/options_display.php:123
 msgid "Message Display and Composition"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:129
+#: squirrelmail/src/options_display.php:128
 msgid "Wrap Incoming Text At"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:137
+#: squirrelmail/src/options_display.php:136
 msgid "Size of Editor Window"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:145
+#: squirrelmail/src/options_display.php:144
 msgid "Location of Buttons when Composing"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:148
+#: squirrelmail/src/options_display.php:147
 msgid "Before headers"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:149
+#: squirrelmail/src/options_display.php:148
 msgid "Between headers and message body"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:150
+#: squirrelmail/src/options_display.php:149
 msgid "After message body"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:155
+#: squirrelmail/src/options_display.php:154
 msgid "Addressbook Display Format"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:158
+#: squirrelmail/src/options_display.php:157
 msgid "Javascript"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:159
+#: squirrelmail/src/options_display.php:158
 msgid "HTML"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:164
+#: squirrelmail/src/options_display.php:163
 msgid "Show HTML Version by Default"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:171
+#: squirrelmail/src/options_display.php:170
 msgid "Include Me in CC when I Reply All"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:178
+#: squirrelmail/src/options_display.php:177
 msgid "Enable Mailer Display"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:185
+#: squirrelmail/src/options_display.php:184
 msgid "Display Attached Images with Message"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:192
+#: squirrelmail/src/options_display.php:191
 msgid "Enable Subtle Printer Friendly Link"
 msgstr ""
 
-#: squirrelmail/src/options_display.php:199
+#: squirrelmail/src/options_display.php:198
 msgid "Enable Printer Friendly Clean Display"
 msgstr ""
 
@@ -653,105 +661,122 @@ msgstr ""
 #: squirrelmail/plugins/filters/options.php:73
 #: squirrelmail/plugins/newmail/newmail_opt.php:41
 #: squirrelmail/plugins/translate/options.php:67
-#: squirrelmail/src/options.php:157 squirrelmail/src/options_highlight.php:50
+#: squirrelmail/src/options.php:157 squirrelmail/src/options_highlight.php:57
 #: squirrelmail/src/options_identities.php:42
 #: squirrelmail/src/options_order.php:32
 msgid "Options"
 msgstr ""
 
 #: squirrelmail/src/options.php:110 squirrelmail/src/options.php:255
-#: squirrelmail/src/options_highlight.php:50
+#: squirrelmail/src/options_highlight.php:57
 msgid "Message Highlighting"
 msgstr ""
 
 #: squirrelmail/plugins/filters/options.php:75
-#: squirrelmail/src/options_highlight.php:54
+#: squirrelmail/src/options_highlight.php:61
 msgid "New"
 msgstr ""
 
 #: squirrelmail/plugins/filters/options.php:76
 #: squirrelmail/plugins/mail_fetch/fetch.php:225
-#: squirrelmail/src/options_highlight.php:55
+#: squirrelmail/src/options_highlight.php:62
 msgid "Done"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:76
+#: squirrelmail/plugins/filters/options.php:84
+#: squirrelmail/plugins/filters/options.php:116
+#: squirrelmail/src/options_highlight.php:69
+msgid "Edit"
+msgstr ""
+
+#: squirrelmail/src/options_highlight.php:82
 msgid "No highlighting is defined"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:248
+#: squirrelmail/src/options_highlight.php:254
 msgid "Identifying name"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:262
+#: squirrelmail/src/options_highlight.php:268
 msgid "Color"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:266
+#: squirrelmail/src/options_highlight.php:272
 msgid "Dark Blue"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:267
+#: squirrelmail/src/options_highlight.php:273
 msgid "Dark Green"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:268
+#: squirrelmail/src/options_highlight.php:274
 msgid "Dark Yellow"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:269
+#: squirrelmail/src/options_highlight.php:275
 msgid "Dark Cyan"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:270
+#: squirrelmail/src/options_highlight.php:276
 msgid "Dark Magenta"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:271
+#: squirrelmail/src/options_highlight.php:277
 msgid "Light Blue"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:272
+#: squirrelmail/src/options_highlight.php:278
 msgid "Light Green"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:273
+#: squirrelmail/src/options_highlight.php:279
 msgid "Light Yellow"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:274
+#: squirrelmail/src/options_highlight.php:280
 msgid "Light Cyan"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:275
+#: squirrelmail/src/options_highlight.php:281
 msgid "Light Magenta"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:276
+#: squirrelmail/src/options_highlight.php:282
 msgid "Dark Gray"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:277
+#: squirrelmail/src/options_highlight.php:283
 msgid "Medium Gray"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:278
+#: squirrelmail/src/options_highlight.php:284
 msgid "Light Gray"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:279
+#: squirrelmail/src/options_highlight.php:285
 msgid "White"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:281
+#: squirrelmail/src/options_highlight.php:287
 msgid "Other:"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:283
+#: squirrelmail/src/options_highlight.php:289
 msgid "Ex: 63aa7f"
 msgstr ""
 
-#: squirrelmail/src/options_highlight.php:320
+#: squirrelmail/plugins/filters/options.php:176
+#: squirrelmail/src/options_highlight.php:323 squirrelmail/src/search.php:72
+#: squirrelmail/src/search.php:73
+msgid "Cc"
+msgstr ""
+
+#: squirrelmail/plugins/filters/options.php:179
+#: squirrelmail/src/options_highlight.php:326
+msgid "To or Cc"
+msgstr ""
+
+#: squirrelmail/src/options_highlight.php:331
 msgid "Matches"
 msgstr ""
 
@@ -772,29 +797,29 @@ msgstr ""
 msgid "Add a New Identity"
 msgstr ""
 
-#: squirrelmail/src/options_identities.php:291
+#: squirrelmail/src/options_identities.php:290
 #: squirrelmail/src/options_personal.php:49
 msgid "Full Name"
 msgstr ""
 
-#: squirrelmail/src/options_identities.php:300
+#: squirrelmail/src/options_identities.php:291
 msgid "E-Mail Address"
 msgstr ""
 
-#: squirrelmail/src/options_identities.php:309
+#: squirrelmail/src/options_identities.php:292
 #: squirrelmail/src/options_personal.php:65
 msgid "Reply To"
 msgstr ""
 
-#: squirrelmail/src/options_identities.php:321
+#: squirrelmail/src/options_identities.php:299
 msgid "Save / Update"
 msgstr ""
 
-#: squirrelmail/src/options_identities.php:325
+#: squirrelmail/src/options_identities.php:302
 msgid "Make Default"
 msgstr ""
 
-#: squirrelmail/src/options_identities.php:332
+#: squirrelmail/src/options_identities.php:308
 msgid "Move Up"
 msgstr ""
 
@@ -1051,11 +1076,6 @@ msgstr ""
 msgid "Everywhere"
 msgstr ""
 
-#: squirrelmail/plugins/filters/options.php:176 squirrelmail/src/search.php:72
-#: squirrelmail/src/search.php:73
-msgid "Cc"
-msgstr ""
-
 #: squirrelmail/functions/page_header.php:56 squirrelmail/src/signout.php:66
 msgid "Sign Out"
 msgstr ""
@@ -1695,11 +1715,6 @@ msgstr ""
 msgid "Message Filtering"
 msgstr ""
 
-#: squirrelmail/plugins/filters/options.php:84
-#: squirrelmail/plugins/filters/options.php:116
-msgid "Edit"
-msgstr ""
-
 #: squirrelmail/plugins/filters/options.php:90
 msgid "Down"
 msgstr ""
@@ -1747,10 +1762,6 @@ msgstr ""
 msgid "OFF"
 msgstr ""
 
-#: squirrelmail/plugins/filters/options.php:179
-msgid "To or Cc"
-msgstr ""
-
 #: squirrelmail/plugins/filters/options.php:189
 msgid "Contains:"
 msgstr ""
@@ -2598,15 +2609,12 @@ msgid "Change title on supported browsers."
 msgstr ""
 
 #: squirrelmail/plugins/newmail/newmail_opt.php:88
-msgid "requires IE and JavaScript to work"
-msgstr ""
-
 #: squirrelmail/plugins/newmail/newmail_opt.php:96
-msgid "Show popup window on new mail"
+msgid "requires JavaScript to work"
 msgstr ""
 
 #: squirrelmail/plugins/newmail/newmail_opt.php:96
-msgid "requires JavaScript to work"
+msgid "Show popup window on new mail"
 msgstr ""
 
 #: squirrelmail/plugins/newmail/newmail_opt.php:99
@@ -2641,17 +2649,17 @@ msgstr ""
 msgid "You have new mail!"
 msgstr ""
 
-#: squirrelmail/plugins/newmail/setup.php:77
+#: squirrelmail/plugins/newmail/setup.php:76
 msgid "NewMail Options"
 msgstr ""
 
-#: squirrelmail/plugins/newmail/setup.php:79
+#: squirrelmail/plugins/newmail/setup.php:78
 msgid ""
 "This configures settings for playing sounds and/or showing popup windows "
 "when new mail arrives."
 msgstr ""
 
-#: squirrelmail/plugins/newmail/setup.php:127
+#: squirrelmail/plugins/newmail/setup.php:126
 msgid "New Mail Notification options saved"
 msgstr ""
 
@@ -2660,7 +2668,7 @@ msgstr ""
 msgid "%s New Messages"
 msgstr ""
 
-#: squirrelmail/plugins/newmail/setup.php:205
+#: squirrelmail/plugins/newmail/setup.php:207
 #, c-format
 msgid "%s New Message"
 msgstr ""
@@ -2991,94 +2999,89 @@ msgid "Add Server"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:123
-#: squirrelmail/plugins/mail_fetch/options.php:217
+#: squirrelmail/plugins/mail_fetch/options.php:201
 msgid "Server:"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:124
-#: squirrelmail/plugins/mail_fetch/options.php:219
+#: squirrelmail/plugins/mail_fetch/options.php:203
 msgid "Alias:"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:125
-#: squirrelmail/plugins/mail_fetch/options.php:221
+#: squirrelmail/plugins/mail_fetch/options.php:205
 msgid "Username:"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:127
-#: squirrelmail/plugins/mail_fetch/options.php:225
+#: squirrelmail/plugins/mail_fetch/options.php:209
 msgid "Store in Folder:"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:148
-#: squirrelmail/plugins/mail_fetch/options.php:248
+#: squirrelmail/plugins/mail_fetch/options.php:233
 msgid "Leave Mail on Server"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:149
-#: squirrelmail/plugins/mail_fetch/options.php:250
+#: squirrelmail/plugins/mail_fetch/options.php:235
 msgid "Check mail during login"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:150
-#: squirrelmail/plugins/mail_fetch/options.php:252
+#: squirrelmail/plugins/mail_fetch/options.php:237
 msgid "Check mail during folder refresh"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:157
-#: squirrelmail/plugins/mail_fetch/options.php:253
+#: squirrelmail/plugins/mail_fetch/options.php:238
 msgid "Modify Server"
 msgstr ""
 
 #: squirrelmail/plugins/mail_fetch/options.php:161
-#: squirrelmail/plugins/mail_fetch/options.php:179
 msgid "Server Name:"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:166
+#: squirrelmail/plugins/mail_fetch/options.php:167
+#: squirrelmail/plugins/mail_fetch/options.php:190
 msgid "Modify"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:168
-#: squirrelmail/plugins/mail_fetch/options.php:187
+#: squirrelmail/plugins/mail_fetch/options.php:171
 msgid "No-one server in use. Try to add."
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:175
-msgid "Delete Server"
-msgstr ""
-
-#: squirrelmail/plugins/mail_fetch/options.php:193
-#: squirrelmail/plugins/mail_fetch/options.php:208
-#: squirrelmail/plugins/mail_fetch/options.php:258
+#: squirrelmail/plugins/mail_fetch/options.php:177
+#: squirrelmail/plugins/mail_fetch/options.php:192
+#: squirrelmail/plugins/mail_fetch/options.php:243
 msgid "Fetching Servers"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:197
+#: squirrelmail/plugins/mail_fetch/options.php:181
 msgid "Confirm Deletion of a Server"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:201
+#: squirrelmail/plugins/mail_fetch/options.php:185
 msgid "Selected Server:"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:202
+#: squirrelmail/plugins/mail_fetch/options.php:186
 msgid "Confirm delete of selected server?"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:203
+#: squirrelmail/plugins/mail_fetch/options.php:187
 msgid "Confirm Delete"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:212
+#: squirrelmail/plugins/mail_fetch/options.php:196
 msgid "Mofify a Server"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:261
+#: squirrelmail/plugins/mail_fetch/options.php:246
 msgid "Undefined Function"
 msgstr ""
 
-#: squirrelmail/plugins/mail_fetch/options.php:263
+#: squirrelmail/plugins/mail_fetch/options.php:248
 msgid "Hey! Wath do You are looking for?"
 msgstr ""
 
index c351a990b569ceb69f93da59781c876c042364b3..2e03483ef3cb563331389d4920e4b8caeb592157 100644 (file)
@@ -71,11 +71,10 @@ function load_optpage_data_display() {
                            SMPREF_JS_OFF        => _("Never"))
     );
 
-    $js_autodetect_script = "
-        <SCRIPT LANGUAGE=\"JavaScript\"><!--
-           document.forms[0].new_js_autodetect_results.value = '" . SMPREF_JS_ON . "';
-        // --></SCRIPT>
-    ";
+    $js_autodetect_script =
+        "<SCRIPT LANGUAGE=\"JavaScript\"><!--\n".
+           "document.forms[0].new_js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
+        "// --></SCRIPT>\n";
     $js_autodetect_results = SMPREF_JS_OFF;
     $optvals[SMOPT_GRP_GENERAL][] = array(
         'name'    => 'js_autodetect_results',
index 1bc8afb2d89eb0ee5d00d0fe4e219fd6c6c79355..2bfe3b0cfc0d4c6b2fe16b4ecd90fee331f4752b 100644 (file)
    require_once('../functions/array.php');
    require_once('../functions/plugin.php');
 
+    function oh_opt( $val, $sel, $tit ) {
+        echo "            <option value=\"$val\"";
+        if ( $sel )
+            echo 'selected';
+        echo  ">$tit</option>\n";
+    }
+
    if (! isset($action))
        $action = '';
    if (! isset($message_highlight_list))
@@ -30,7 +37,7 @@
       if ($color_type == 1) $newcolor = $newcolor_choose;
       elseif ($color_type == 2) $newcolor = $newcolor_input;
       else $newcolor = $color_type;
+
       $newcolor = ereg_replace(',', '', $newcolor);
       $newcolor = ereg_replace('#', '', $newcolor);
       $newcolor = ereg_replace('"', '', $newcolor);
@@ -42,7 +49,7 @@
       $message_highlight_list[$theid]['color'] = $newcolor;
       $message_highlight_list[$theid]['value'] = $value;
       $message_highlight_list[$theid]['match_type'] = $match_type;
-   } 
+   }
    displayPageHeader($color, 'None');
 ?>
    <br>
    </td></tr></table>
 
 <?php
-   echo '<br><center>[<a href="options_highlight.php?action=add">' . _("New") . '</a>]';
-   echo ' - [<a href="options.php">'._("Done").'</a>]</center><br>'."\n";
+   echo '<br><center>[<a href="options_highlight.php?action=add">' . _("New") . '</a>]'.
+        ' - [<a href="options.php">'._("Done").'</a>]</center><br>'."\n";
    if (count($message_highlight_list) >= 1) {
       echo '<table border="0" cellpadding="3" cellspacing="0" align="center" width="80%">'."\n";
       for ($i=0; $i < count($message_highlight_list); $i++) {
-?><tr bgcolor="<?PHP echo $message_highlight_list[$i]['color'] ?>">
-<td width=5% bgcolor="<?PHP echo $color[4] ?>" nobr>
-  <small>[<a href="options_highlight.php?action=edit&theid=<?PHP echo $i 
-  ?>"><?PHP echo  _("Edit") 
-  ?></a>]&nbsp;[<a href="options_highlight.php?action=delete&theid=<?PHP
-  echo $i ?>"><?PHP echo _("Delete") ?></a>]</small>
-</td><td>
-  <?PHP echo htmlspecialchars($message_highlight_list[$i]['name']) ?>
-</td><td>
-  <?PHP echo $message_highlight_list[$i]['match_type'] . ' = ' .
-     htmlspecialchars($message_highlight_list[$i]['value']); ?>
-</td></tr>
-<?PHP
+        echo '<tr bgcolor="' . $message_highlight_list[$i]['color'] . '">'.
+                "<td width=5% bgcolor=\"$color[4]\" nobr>".
+                   "<small>[<a href=\"options_highlight.php?action=edit&theid=$i\">".
+             _("Edit") .
+             '</a>]&nbsp;[<a href="options_highlight.php?action=delete&theid='.
+             $i . '">' . _("Delete") . '</a>]</small>'.
+             '</td><td>'.
+             htmlspecialchars($message_highlight_list[$i]['name']) .
+             '</td><td>'.
+             $message_highlight_list[$i]['match_type'] . ' = ' .
+             htmlspecialchars($message_highlight_list[$i]['value']).
+             '</td></tr>';
       }
-      echo "</table>\n";
-      echo "<br>\n";
+      echo "</table>\n".
+           "<br>\n";
    } else {
-      echo '<center>' . _("No highlighting is defined") . "</center><br>\n";
-      echo "<br>\n";
+      echo '<center>' . _("No highlighting is defined") . "</center><br>\n".
+           "<br>\n";
    }
    if ($action == 'edit' || $action == 'add') {
       if (!isset($theid))
@@ -82,7 +88,7 @@
         $theid = count($message_highlight_list);
         $message_highlight_list[$theid] = array();
       }
+
       $color_list[0] = '4444aa';
       $color_list[1] = '44aa44';
       $color_list[2] = 'aaaa44';
       $color_list[10] = 'aaaaaa';
       $color_list[11] = 'bfbfbf';
       $color_list[12] = 'dfdfdf';
-      $color_list[13] = 'ffffff';               
-      
+      $color_list[13] = 'ffffff';
+
       # helpful color chart from http://www.visibone.com/colorlab/big.html
       $new_color_list["0,0"] = 'cccccc';
       $new_color_list["0,1"] = '999999';
       $new_color_list["6,2"] = '66ff66';
       $new_color_list["6,3"] = '33ff33';
       $new_color_list["6,4"] = '00ff00';
-      
+
       # blue
       $new_color_list["7,0"] = '0000ff';
       $new_color_list["7,1"] = '0000cc';
 
       $selected_input = '';
       $selected_choose = '';
-      
+
       for ($i=0; $i < 14; $i++) {
          ${"selected".$i} = '';
       }
                ${"selected".$i} = ' selected';
                continue;
             }
-        }
+      }
       }
       if (!isset($message_highlight_list[$theid]['color']))
          $selected_choose = ' checked';
       if (isset($message_highlight_list[$theid]['name']))
           $disp = $message_highlight_list[$theid]['name'];
       else
-          $disp = '&nbsp;';
+          $disp = '';
       $disp = htmlspecialchars($disp);
       echo "         <input type=\"text\" value=\"".$disp."\" name=\"identname\">";
       echo "      </td>\n";
         for($y = 0; $y < 19; $y++) {
           $gridindex = "$y,$x";
           $gridcolor = $new_color_list[$gridindex];
-         $selected = ($gridcolor == $current_color)?'SELECTED':'' ;
+          $selected = ($gridcolor == $current_color)?'SELECTED':'' ;
           echo "<td bgcolor=#$gridcolor><input type='radio' name=color_type value='#$gridcolor' $selected>\n";
           echo "</td>\n";
         }
       echo "   <tr bgcolor=\"$color[0]\">\n";
       echo '      <td align="center" colspan=2>' . "\n";
       echo "         <select name=match_type>\n";
-      if (isset($message_highlight_list[$theid]['match_type']) && $message_highlight_list[$theid]['match_type'] == 'from')    echo "            <option value=\"from\" selected>From\n";
-      else                                                         echo "            <option value=\"from\">From\n";
-      if (isset($message_highlight_list[$theid]['match_type']) && $message_highlight_list[$theid]['match_type'] == 'to')      echo "            <option value=\"to\" selected>To\n";
-      else                                                         echo "            <option value=\"to\">To\n";
-      if (isset($message_highlight_list[$theid]['match_type']) && $message_highlight_list[$theid]['match_type'] == 'cc')      echo "            <option value=\"cc\" selected>Cc\n";
-      else                                                         echo "            <option value=\"cc\">Cc\n";
-      if (isset($message_highlight_list[$theid]['match_type']) && $message_highlight_list[$theid]['match_type'] == 'to_cc')   echo "            <option value=\"to_cc\" selected>To or Cc\n";
-      else                                                         echo "            <option value=\"to_cc\">To or Cc\n";
-      if (isset($message_highlight_list[$theid]['match_type']) && $message_highlight_list[$theid]['match_type'] == 'subject') echo "            <option value=\"subject\" selected>Subject\n";
-      else                                                         echo "            <option value=\"subject\">Subject\n";
+      oh_opt( 'from',
+              ($message_highlight_list[$theid]['match_type'] == 'from'),
+              _("From") );
+      oh_opt( 'to',
+              ($message_highlight_list[$theid]['match_type'] == 'to'),
+              _("To") );
+      oh_opt( 'cc',
+              ($message_highlight_list[$theid]['match_type'] == 'cc'),
+              _("Cc") );
+      oh_opt( 'to_cc',
+              ($message_highlight_list[$theid]['match_type'] == 'to_cc'),
+              _("To or Cc") );
+      oh_opt( 'subject',
+              ($message_highlight_list[$theid]['match_type'] == 'subject'),
+              _("Subject") );
       echo "         </select>\n";
       echo '<b>' . _("Matches") . ':</b> ';
       if (isset($message_highlight_list[$theid]['value']))
       echo "</table>\n";
       echo '<center><input type="submit" value="' . _("Submit") . "\"></center>\n";
       echo "</form>\n";
-   } 
+   }
    do_hook('options_highlight_bottom');
 ?>
 </body></html>
\ No newline at end of file
index 37e5f5f62e19bdde9ee5ab88063e7467cc31d381..63723f6a28da449b3dee576cd1ee148aac6573b2 100644 (file)
@@ -77,7 +77,7 @@
 
    ShowTableInfo('', '', '', $num);
 ?>
-</table>   
+</table>
 </form>
 
     </td></tr>
 
 <?PHP
 
-function SaveUpdateFunction()
-{
-   global $username, $data_dir, $full_name, $email_address, $reply_to;
-    
-   $i = 1;
-   $fakeI = 1;
-   $name = 'form_for_' . $i;
-   global $$name;
-   while (isset($$name))
-   {
-      $name = 'delete_' . $i;
-      global $$name;
-      if (isset($$name)) {
-         $fakeI --;
-      } else {
-         do_hook('options_identities_renumber', $i, $fakeI);
-         $filled = 0;
-        
-         $name = 'full_name' . $i;
-         global $$name;
-        if ($$name != '') 
-           $filled ++;
-         setPref($data_dir, $username, 'full_name' . $fakeI, $$name);
-        
-         $name = 'email_address' . $i;
-         global $$name;
-        if ($$name != '') 
-           $filled ++;
-         setPref($data_dir, $username, 'email_address' . $fakeI, $$name);
-        
-         $name = 'reply_to' . $i;
-         global $$name;
-        if ($$name != '') 
-           $filled ++;
-         setPref($data_dir, $username, 'reply_to' . $fakeI, $$name);
-        
-        if ($filled == 0) 
-           $fakeI --;
-      }
-      
-      $fakeI ++;
-      $i ++;
-      $name = 'form_for_' . $i;
-      global $$name;
-   }
-   
-   setPref($data_dir, $username, 'identities', $fakeI);
-   
-   while ($fakeI != $i)
-   {
-      removePref($data_dir, $username, 'full_name' . $fakeI);
-      removePref($data_dir, $username, 'email_address' . $fakeI);
-      removePref($data_dir, $username, 'reply_to' . $fakeI);
-      $fakeI ++;
-   }
+    function SaveUpdateFunction() {
+        global $username, $data_dir, $full_name, $email_address, $reply_to;
 
-   setPref($data_dir, $username, 'full_name', $full_name);
-   setPref($data_dir, $username, 'email_address', $email_address);
-   setPref($data_dir, $username, 'reply_to', $reply_to);
-}
+        $i = 1;
+        $fakeI = 1;
+        $name = 'form_for_' . $i;
+        global $$name;
+        while (isset($$name))
+        {
+            $name = 'delete_' . $i;
+            global $$name;
+            if (isset($$name)) {
+                $fakeI --;
+            } else {
+                do_hook('options_identities_renumber', $i, $fakeI);
+                $filled = 0;
 
-function CheckAndDoDefault()
-{
-   global $username, $data_dir, $full_name, $email_address, $reply_to;
-    
-   $i = 1;
-   $name = 'form_for_' . $i;
-   global $$name;
-   while (isset($$name))
-   {
-      $name = 'make_default_' . $i;
-      global $$name;
-      if (isset($$name)) {
-          do_hook('options_identities_renumber', $i, 'default');
-          global $full_name, $email_address, $reply_to;
-         
-          $name = 'full_name' . $i;
-          global $$name;
-          $temp = $full_name;
-          $full_name = $$name;
-          $$name = $temp;
-          
-          $name = 'email_address' . $i;
-          global $$name;
-          $temp = $email_address;
-          $email_address = $$name;
-          $$name = $temp;
-          
-          $name = 'reply_to' . $i;
-          global $$name;
-          $temp = $reply_to;
-          $reply_to = $$name;
-          $$name = $temp;
-          
-          return true;
-      }
-      
-      $i ++;
-      $name = 'form_for_' . $i;
-      global $$name;
-   }
-   return false;
-}
+                $name = 'full_name' . $i;
+                global $$name;
+            if ($$name != '')
+                $filled ++;
+                setPref($data_dir, $username, 'full_name' . $fakeI, $$name);
 
-function CheckForDelete()
-{
-   global $username, $data_dir, $full_name, $email_address, $reply_to;
-    
-   $i = 1;
-   $name = 'form_for_' . $i;
-   global $$name;
-   while (isset($$name))
-   {
-      $name = 'delete_' . $i;
-      global $$name;
-      if (isset($$name)) {
-          return true;
-      }
-      
-      $i ++;
-      $name = 'form_for_' . $i;
-      global $$name;
-   }
-   return false;
-}
+                $name = 'email_address' . $i;
+                global $$name;
+            if ($$name != '')
+                $filled ++;
+                setPref($data_dir, $username, 'email_address' . $fakeI, $$name);
 
-function CheckAndDoPromote()
-{
-   global $username, $data_dir, $full_name, $email_address, $reply_to;
-    
-   $i = 1;
-   $name = 'form_for_' . $i;
-   global $$name;
-   while (isset($$name))
-   {
-      $name = 'promote_' . $i;
-      global $$name;
-      if (isset($$name) && $i > 1) {
-          do_hook('options_identities_renumber', $i, $i - 1);
-         
-         $nameA = 'full_name' . $i;
-         $nameB = 'full_name' . ($i - 1);
-         global $$nameA, $$nameB;
-         $temp = $$nameA;
-         $$nameA = $$nameB;
-         $$nameB = $temp;
-         
-         $nameA = 'email_address' . $i;
-         $nameB = 'email_address' . ($i - 1);
-         global $$nameA, $$nameB;
-         $temp = $$nameA;
-         $$nameA = $$nameB;
-         $$nameB = $temp;
-         
-         $nameA = 'reply_to' . $i;
-         $nameB = 'reply_to' . ($i - 1);
-         global $$nameA, $$nameB;
-         $temp = $$nameA;
-         $$nameA = $$nameB;
-         $$nameB = $temp;
-         
-         return true;
-      }
-
-      $i ++;
-      $name = 'form_for_' . $i;
-      global $$name;
-   }
-   return false;
-}
+                $name = 'reply_to' . $i;
+                global $$name;
+            if ($$name != '')
+                $filled ++;
+                setPref($data_dir, $username, 'reply_to' . $fakeI, $$name);
+
+            if ($filled == 0)
+                $fakeI --;
+            }
+
+            $fakeI ++;
+            $i ++;
+            $name = 'form_for_' . $i;
+            global $$name;
+        }
+
+        setPref($data_dir, $username, 'identities', $fakeI);
+
+        while ($fakeI != $i)
+        {
+            removePref($data_dir, $username, 'full_name' . $fakeI);
+            removePref($data_dir, $username, 'email_address' . $fakeI);
+            removePref($data_dir, $username, 'reply_to' . $fakeI);
+            $fakeI ++;
+        }
+
+        setPref($data_dir, $username, 'full_name', $full_name);
+        setPref($data_dir, $username, 'email_address', $email_address);
+        setPref($data_dir, $username, 'reply_to', $reply_to);
+    }
+
+    function CheckAndDoDefault() {
+        global $username, $data_dir, $full_name, $email_address, $reply_to;
+
+        $i = 1;
+        $name = 'form_for_' . $i;
+        global $$name;
+        while (isset($$name))
+        {
+            $name = 'make_default_' . $i;
+            global $$name;
+            if (isset($$name)) {
+                do_hook('options_identities_renumber', $i, 'default');
+                global $full_name, $email_address, $reply_to;
+
+                $name = 'full_name' . $i;
+                global $$name;
+                $temp = $full_name;
+                $full_name = $$name;
+                $$name = $temp;
+
+                $name = 'email_address' . $i;
+                global $$name;
+                $temp = $email_address;
+                $email_address = $$name;
+                $$name = $temp;
+
+                $name = 'reply_to' . $i;
+                global $$name;
+                $temp = $reply_to;
+                $reply_to = $$name;
+                $$name = $temp;
+
+                return true;
+            }
+
+            $i ++;
+            $name = 'form_for_' . $i;
+            global $$name;
+        }
+        return FALSE;
+    }
+
+    function CheckForDelete() {
+        global $username, $data_dir, $full_name, $email_address, $reply_to;
 
-function LoadInfo(&$n, &$e, &$r, $post)
-{
-   global $username, $data_dir;
+        $i = 1;
+        $name = 'form_for_' . $i;
+        global $$name;
+        while (isset($$name))
+        {
+            $name = 'delete_' . $i;
+            global $$name;
+            if (isset($$name)) {
+                return true;
+            }
 
-   $n = getPref($data_dir, $username, 'full_name' . $post);
-   $e = getPref($data_dir, $username, 'email_address' . $post);
-   $r = getPref($data_dir, $username, 'reply_to' . $post);
+            $i ++;
+            $name = 'form_for_' . $i;
+            global $$name;
+        }
+        return false;
+    }
+
+    function CheckAndDoPromote() {
+        global $username, $data_dir, $full_name, $email_address, $reply_to;
+
+        $i = 1;
+        $name = 'form_for_' . $i;
+        global $$name;
+        while (isset($$name)) {
+            $name = 'promote_' . $i;
+            global $$name;
+            if (isset($$name) && $i > 1) {
+                do_hook('options_identities_renumber', $i, $i - 1);
+
+            $nameA = 'full_name' . $i;
+            $nameB = 'full_name' . ($i - 1);
+            global $$nameA, $$nameB;
+            $temp = $$nameA;
+            $$nameA = $$nameB;
+            $$nameB = $temp;
+
+            $nameA = 'email_address' . $i;
+            $nameB = 'email_address' . ($i - 1);
+            global $$nameA, $$nameB;
+            $temp = $$nameA;
+            $$nameA = $$nameB;
+            $$nameB = $temp;
+
+            $nameA = 'reply_to' . $i;
+            $nameB = 'reply_to' . ($i - 1);
+            global $$nameA, $$nameB;
+            $temp = $$nameA;
+            $$nameA = $$nameB;
+            $$nameB = $temp;
+
+            return true;
+            }
+
+            $i ++;
+            $name = 'form_for_' . $i;
+            global $$name;
+        }
+        return false;
+    }
+
+    function LoadInfo(&$n, &$e, &$r, $post) {
+        global $username, $data_dir;
+
+        $n = getPref($data_dir, $username, 'full_name' . $post);
+        $e = getPref($data_dir, $username, 'email_address' . $post);
+        $r = getPref($data_dir, $username, 'reply_to' . $post);
+
+        if ($n != '' || $e != '' || $r != '')
+            return true;
+    }
+
+function sti_input( $title, $hd, $data, $post, $bg ) {
+
+    echo "<tr$bg><td align=right nowrap>$title:".
+         '</td><td>'.
+         '<input size=50 type=text value="' . htmlspecialchars($data) .
+         "\" name=\"$hd$post\"></td></tr>";
 
-   if ($n != '' || $e != '' || $r != '')
-      return true;
 }
 
-function ShowTableInfo($full_name, $email_address, $reply_to, $post)
-{
-   global $color;
-   
-   $OtherBG = ' bgcolor="' . $color[0] . '"';
-   if ($full_name == '' && $email_address == '' && $reply_to == '')
-         $OtherBG = '';
+function ShowTableInfo($full_name, $email_address, $reply_to, $post) {
+    global $color;
 
-   if ($full_name == '' && $email_address == '' && $reply_to == '')
-      $isEmptySection = true;
-   else
-      $isEmptySection = false;
+    $OtherBG = ' bgcolor="' . $color[0] . '"';
+    if ($full_name == '' && $email_address == '' && $reply_to == '')
+        $OtherBG = '';
 
-?>
-  <tr<?PHP echo $OtherBG ?>>
-    <td align=right nowrap>
-      <?php echo _("Full Name"); ?>:
-    </td>
-    <td>
-      <input size=50 type=text value="<?php echo htmlspecialchars($full_name)
-      ?>" name="full_name<?PHP echo $post ?>"> 
-    </td>
-  </tr>
-  <tr<?PHP echo $OtherBG ?>>
-    <td align=right nowrap>
-      <?php echo _("E-Mail Address"); ?>:
-    </td>
-    <td>
-      <input size=50 type=text value="<?php echo htmlspecialchars($email_address)
-      ?>" name="email_address<?PHP echo $post ?>"> 
-    </td>
-  </tr>
-  <tr<?PHP echo $OtherBG ?>>
-    <td align=right nowrap>
-      <?php echo _("Reply To"); ?>:
-    </td>
-    <td>
-      <input size=50 type=text value="<?php echo htmlspecialchars($reply_to)
-      ?>" name="reply_to<?PHP echo $post ?>"> 
-    </td>
-  </tr>
-<?PHP do_hook('options_identities_table', $OtherBG, $isEmptySection, $post); ?>
-  <tr<?PHP echo $OtherBG ?>>
-    <td>&nbsp;</td><td>
-      <input type=hidden name="form_for_<?PHP echo $post ?>" value="1">
-      <input type=submit name="update" value="<?PHP 
-   echo _("Save / Update") . '">';
-   if (! $isEmptySection && $post != '') {
-?>
-      <input type=submit name="make_default_<?PHP echo $post ?>" value="<?PHP
-         echo _("Make Default") ?>">
-      <input type=submit name="delete_<?PHP echo $post ?>" value="<?PHP echo _("Delete") ?>">
-<?PHP
-   }
-   if (! $isEmptySection && $post != '' && $post > 1) {
-?>
-      <input type=submit name="promote_<?PHP echo $post ?>" value="<?PHP
-         echo _("Move Up") ?>">
-<?PHP
-   }
-   do_hook('options_identities_buttons', $isEmptySection, $post);
-?>
-    </td>
-  </tr>
-  <tr>
-    <td colspan="2">&nbsp;</td>
-  </tr>
-<?PHP
+    if ($full_name == '' && $email_address == '' && $reply_to == '')
+        $isEmptySection = true;
+    else
+        $isEmptySection = false;
+
+    sti_input( _("Full Name"), 'full_name', $full_name, $post, $OtherBG );
+    sti_input( _("E-Mail Address"), 'email_address', $email_address, $post, $OtherBG );
+    sti_input( _("Reply To"), 'reply_to', $reply_to, $post, $OtherBG );
+
+    do_hook('options_identities_table', $OtherBG, $isEmptySection, $post);
+    echo "<tr$OtherBG>".
+         '<td>&nbsp;</td><td>'.
+         "<input type=hidden name=\"form_for_$post\" value=\"1\">".
+         '<input type=submit name="update" value="'.
+         _("Save / Update") . '">';
+    if (! $isEmptySection && $post != '') {
+        echo "<input type=submit name=\"make_default_$post\" value=\"".
+             _("Make Default") . '">'.
+             "<input type=submit name=\"delete_$post\" value=\"".
+             _("Delete") . '">';
+    }
+    if (! $isEmptySection && $post != '' && $post > 1) {
+        echo '<input type=submit name="promote_' . $post . '" value="'.
+             _("Move Up") . '">';
+    }
+    do_hook('options_identities_buttons', $isEmptySection, $post);
+    echo '</td></tr>'.
+         '<tr><td colspan="2">&nbsp;</td></tr>';
 }
 ?>
\ No newline at end of file