Sorry, a bug slipped into the CVS.
[squirrelmail.git] / src / options_display.php
index 7c5e34ce1f616341d8c8188bf6c4d3e0e5f89a60..9c98ef14b111639328536604b4f1b1ca0b69b431 100644 (file)
     **  $Id$
     **/
 
-   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');
-   include('../src/load_prefs.php');
+   require_once('../src/validate.php');
+   require_once('../functions/display_messages.php');
+   require_once('../functions/imap.php');
+   require_once('../functions/array.php');
+   require_once('../functions/plugin.php');
    
    displayPageHeader($color, 'None');
    $chosen_language = getPref($data_dir, $username, 'language');  
 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
 <tr><td bgcolor="<?php echo $color[0] ?>" align="center">
 
-      <b><?php echo _("Options") . ' - ' . _("Display Preferences"); ?></b><br>
+   <b><?php echo _("Options") . ' - ' . _("Display Preferences"); ?></b><br>
 
-    <table width="100%" border="0" cellpadding="1" cellspacing="1">
-    <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
+   <table width="100%" border="0" cellpadding="1" cellspacing="1">
+   <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
 
    <form name="f" action="options.php" method="post"><br>
       <table width="100%" cellpadding="2" cellspacing="0" border="0">
 <?php
    echo '         <tt><select name="language">' . "\n";
    foreach ($languages as $code => $name) {
-      if ($code==$chosen_language)
-         echo '         <OPTION SELECTED VALUE="'.$code.'">'.$languages[$code]['NAME']."\n";
-      else
-         echo '         <OPTION VALUE="'.$code.'">'.$languages[$code]['NAME']."\n";
+      if (! isset($name['ALIAS'])) {
+         if ($code==$chosen_language)
+            echo '         <OPTION SELECTED VALUE="'.$code.'">'.$name['NAME']."\n";
+         else
+            echo '         <OPTION VALUE="'.$code.'">'.$name['NAME']."\n";
+      }
    }
    echo '         </select></tt>';  
    if (! $use_gettext)
 ?>
             </td>
          </tr>
-         <tr>
-            <td align="right" nowrap><?PHP echo _("Location of folder list") ?>:</td>
-            <td><select name="folder_new_location">
-                <option value="left"<?PHP
-                    if ($location_of_bar != 'right') echo ' SELECTED';
-                    ?>><?PHP echo _("Left"); ?></option>
-                <option value="right"<?PHP
-                    if ($location_of_bar == 'right') echo ' SELECTED';
-                    ?>><?PHP echo _("Right"); ?></option>
-                </select>
-            </td>
-         </tr>
          <tr>
             <td align="right" nowrap><?PHP echo _("Location of buttons when composing") ?>:</td>
             <td><select name="button_new_location">
                 </select>
             </td>
          </tr>
+         <tr>
+            <td align="right" nowrap><?PHP echo _("Location of folder list") ?>:</td>
+            <td><select name="folder_new_location">
+                <option value="left"<?PHP
+                    if ($location_of_bar != 'right') echo ' SELECTED';
+                    ?>><?PHP echo _("Left"); ?></option>
+                <option value="right"<?PHP
+                    if ($location_of_bar == 'right') echo ' SELECTED';
+                    ?>><?PHP echo _("Right"); ?></option>
+                </select>
+            </td>
+         </tr>
          <tr>
             <td align=right nowrap><?php echo _("Width of folder list"); ?>:
             </td><td>
    $minutes_str = _("Minutes");
 
    echo '               <SELECT name="leftrefresh">';
-   if (($left_refresh == 'None') || ($left_refresh == ''))
-      echo '                  <OPTION VALUE="None" SELECTED>'.$none_str;
-   else
-      echo '                  <OPTION VALUE="None">'.$none_str;
-   if (($left_refresh <= 300))
-      echo '                  <OPTION VALUE="300" SELECTED>5 '.$minutes_str;
-   else
-      echo '                  <OPTION VALUE="300">5 '.$minutes_str;
-   if (($left_refresh == 720))
-      echo '                  <OPTION VALUE="720" SELECTED>12 '.$minutes_str;
-   else
-      echo '                  <OPTION VALUE="720">12 '.$minutes_str;
-   if (($left_refresh == 1200))
-      echo '                  <OPTION VALUE="1200" SELECTED>20 '.$minutes_str;
-   else
-      echo '                  <OPTION VALUE="1200">20 '.$minutes_str;
-   if (($left_refresh == 3600))
-      echo '                  <OPTION VALUE="3600" SELECTED>60 '.$minutes_str;
-   else
-      echo '                  <OPTION VALUE="3600">60 '.$minutes_str;
+   
+   if ($left_refresh == '')
+      $left_refresh = 'None';
+   if ($left_refresh > 600)
+      $left_refresh = 600;
+   RefreshOption($left_refresh, '', _("Never"));
+   RefreshOption($left_refresh, 30);
+   RefreshOption($left_refresh, 60);
+   RefreshOption($left_refresh, 120);
+   RefreshOption($left_refresh, 180);
+   RefreshOption($left_refresh, 300);
+   RefreshOption($left_refresh, 600);
+   // Refreshes after the session auto-timeout (default 15 min) is pointless
+
+function RefreshOption(&$current, $val, $str = '') {
+   static $lastVal = 0;
+   
+   if (is_int($val) && is_int($current)) {
+      if ($current > $lastVal && $current <= $val)
+         $current = $val;
+   }
+   
+   if ($str == '') {
+      if ($val > 60) {
+         $str = ($val / 60) . ' ' . _("Minutes");
+      } elseif ($val == 60) {
+         $str = '1 ' . _("Minute");
+      } else {
+         $str = $val . ' ' . _("Seconds");
+      }
+   }
+   
+   echo '<option value="' . $val . '"';
+   if ($val == $current)
+      echo ' SELECTED';
+   echo '>' . $str . "\n";
+}
       echo '               </SELECT>'; 
 ?>
             </td>
@@ -222,6 +234,20 @@ echo _("Yes, show me the HTML version of a mail message, if it is available.");
                  ?>
             </td>
          </tr>
+         <tr>
+            <td align=right>
+               <?php echo _("Include Self"); ?>:
+            </td>
+            <td>
+               <input type=checkbox name=includeselfreplyall <?php 
+              if (getPref($data_dir, $username, 'include_self_reply_all')
+                  != '')
+              echo " checked"; ?>>
+                <?php 
+echo _("Don't remove me from the CC addresses when I use \"Reply All\"");
+                 ?>
+            </td>
+         </tr>
          <?php do_hook('options_display_inside'); ?>
          <tr>
             <td>&nbsp;
@@ -239,4 +265,4 @@ echo _("Yes, show me the HTML version of a mail message, if it is available.");
 
 </td></tr>
 </table>
-</body></html>
+</body></html>
\ No newline at end of file