Przeglądaj źródła

Folder list bar on left/right

Tyler Akins 25 lat temu
rodzic
commit
51b28e729d
5 zmienionych plików z 55 dodań i 13 usunięć
  1. 13 1
      po/squirrelmail.po
  2. 4 0
      src/load_prefs.php
  3. 1 0
      src/options.php
  4. 13 1
      src/options_display.php
  5. 24 11
      src/webmail.php

+ 13 - 1
po/squirrelmail.po

@@ -554,7 +554,19 @@ msgid "Size of editor window"
 msgstr ""
 msgstr ""
 
 
 #: squirrelmail/src/options_display.php:121
 #: squirrelmail/src/options_display.php:121
-msgid "Width of left folder list"
+msgid "Location of folder list"
+msgstr ""
+
+#: squirrelmail/src/options_display.php:125
+msgid "Left"
+msgstr ""
+
+#: squirrelmail/src/options_display.php:128
+msgid "Right"
+msgstr ""
+
+#: squirrelmail/src/options_display.php:121
+msgid "Width of folder list"
 msgstr ""
 msgstr ""
 
 
 #: squirrelmail/src/options_display.php:175
 #: squirrelmail/src/options_display.php:175

+ 4 - 0
src/load_prefs.php

@@ -147,6 +147,10 @@
       $message_highlight_list[$i]["value"] = $ary[2];
       $message_highlight_list[$i]["value"] = $ary[2];
       $message_highlight_list[$i]["match_type"] = $ary[3];
       $message_highlight_list[$i]["match_type"] = $ary[3];
    }
    }
+   
+   $location_of_bar = getPref($data_dir, $username, 'location_of_bar');
+   if ($location_of_bar == '')
+       $location_of_bar = 'left';
 
 
    do_hook("loading_prefs");
    do_hook("loading_prefs");
 
 

+ 1 - 0
src/options.php

@@ -65,6 +65,7 @@
       setPref($data_dir, $username, "editor_size", $editorsize);
       setPref($data_dir, $username, "editor_size", $editorsize);
       setPref($data_dir, $username, "left_refresh", $leftrefresh);
       setPref($data_dir, $username, "left_refresh", $leftrefresh);
       setPref($data_dir, $username, "language", $language);
       setPref($data_dir, $username, "language", $language);
+      setPref($data_dir, $username, 'location_of_bar', $folder_new_location);
       setPref($data_dir, $username, "left_size", $leftsize);
       setPref($data_dir, $username, "left_size", $leftsize);
       setPref($data_dir, $username, "use_javascript_addr_book", $javascript_abook);
       setPref($data_dir, $username, "use_javascript_addr_book", $javascript_abook);
     
     

+ 13 - 1
src/options_display.php

@@ -118,7 +118,19 @@
             </td>
             </td>
          </tr>
          </tr>
          <tr>
          <tr>
-            <td align=right nowrap><?php echo _("Width of left folder list"); ?>:
+            <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>
             </td><td>
 <?php
 <?php
    echo "         <select name=leftsize>\n";
    echo "         <select name=leftsize>\n";

+ 24 - 11
src/webmail.php

@@ -71,8 +71,15 @@
    echo "$org_title";
    echo "$org_title";
    echo "</TITLE>";
    echo "</TITLE>";
    $ishelp = substr(getenv(REQUEST_URI),-8);			// If calling help, set left frame to 300
    $ishelp = substr(getenv(REQUEST_URI),-8);			// If calling help, set left frame to 300
-   if ($ishelp == "help.php") {			
-      echo "<FRAMESET COLS=\"300, *\" NORESIZE=yes BORDER=0>";
+   
+   if (ishelp == 'help.php')
+       $bar_size = 300;
+   else
+       $bar_size = $left_size;
+   
+   if ($location_of_bar == 'right')
+   {
+      echo "<FRAMESET COLS=\"*, $left_size\" NORESIZE=yes BORDER=0>";
    } else {
    } else {
       echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>";
       echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>";
    }
    }
@@ -91,19 +98,25 @@
 **/
 **/
    if ($right_frame == "right_main.php") {
    if ($right_frame == "right_main.php") {
       $urlMailbox = urlencode($mailbox);
       $urlMailbox = urlencode($mailbox);
-      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
-      echo "<FRAME SRC=\"right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage\" NAME=\"right\">";
+      $right_frame_url = "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage";
    } else if ($right_frame == "options.php") {
    } else if ($right_frame == "options.php") {
-      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
-      echo "<FRAME SRC=\"options.php\" NAME=\"right\">";
+      $right_frame_url = "options.php";
    } else if ($right_frame == "folders.php") {
    } else if ($right_frame == "folders.php") {
-      $urlMailbox = urlencode($mailbox);
-      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
-      echo "<FRAME SRC=\"folders.php\" NAME=\"right\">";
+      $right_frame_url = "folders.php";
    } else {
    } else {
-      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
       if (!isset($just_logged_in)) $just_logged_in = 0;
       if (!isset($just_logged_in)) $just_logged_in = 0;
-      echo "<FRAME SRC=\"right_main.php?just_logged_in=$just_logged_in\" NAME=\"right\">";
+      $right_frame_url = "right_main.php?just_logged_in=$just_logged_in";
+   }
+
+   if ($location_of_bar == 'right')
+   {
+      echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">";
+      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
+   }
+   else
+   {
+      echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
+      echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">";
    }
    }
 
 
 ?>
 ?>