* Added loginname=blah to the core code
[squirrelmail.git] / src / options_highlight.php
index 3aa5ce0bbdaf197ac33af413fe1b6dd90aa505e2..c2aa0864aece610918a8e2fca7690b8c7095171a 100644 (file)
     **  $Id$
     **/
 
-   session_start();
-
-   if (!isset($strings_php))
-      include('../functions/strings.php');
-   if (!isset($config_php))
-      include('../config/config.php');
-   if (!isset($page_header_php))
-      include('../functions/page_header.php');
-   if (!isset($display_messages_php))
-      include('../functions/display_messages.php');
-   if (!isset($imap_php))
-      include('../functions/imap.php');
-   if (!isset($array_php))
-      include('../functions/array.php');
-   if (!isset($i18n_php))
-      include('../functions/i18n.php');
-   if (!isset($plugin_php))
-      include('../functions/plugin.php');
+   include('../src/validate.php');
+   include('../functions/page_header.php');
+   include('../functions/display_messages.php');
+   include('../functions/imap.php');
+   include('../functions/array.php');
+   include('../functions/plugin.php');
 
    if (! isset($action))
        $action = '';
@@ -78,7 +66,7 @@
          echo "<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></nobr>\n";
          echo '   </td>';
          echo '   <td bgcolor="' . $message_highlight_list[$i]['color'] . "\">\n";
-         echo '      ' . $message_highlight_list[$i]['name'] . '&nbsp';
+         echo '      ' . $message_highlight_list[$i]['name'] . '&nbsp;';
          echo "   </td>\n";
          echo '   <td bgcolor="' . $message_highlight_list[$i]['color'] . "\">\n";
          echo '      '.$message_highlight_list[$i]['match_type'].' = ' . $message_highlight_list[$i]['value'];
       echo "<br>\n";
    }
    if ($action == 'edit' || $action == 'add') {
-      if (!isset($theid)) $theid = count($message_highlight_list);
-          $message_highlight_list[$theid] = array();
+      if (!isset($theid))
+      {
+        $theid = count($message_highlight_list);
+        $message_highlight_list[$theid] = array();
+      }
  
       $color_list[0] = '4444aa';
       $color_list[1] = '44aa44';
       $color_list[13] = 'ffffff';               
       
       $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';
-      else if (!isset($selected_choose))
+      else if ($selected_choose == '')
          $selected_input = ' checked';
  
       echo '<form name="f" action="options_highlight.php">' . "\n";