lets the users set the size of the 'compose in new window' pop up
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 17 Apr 2002 14:41:50 +0000 (14:41 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 17 Apr 2002 14:41:50 +0000 (14:41 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2744 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/page_header.php
src/compose.php
src/load_prefs.php
src/options_display.php

index e194b4bc3f197d47152ef57b6161c8a8156c6aaf..b28021692e08dd0761024abffaf6a43d0146e30c 100644 (file)
@@ -45,7 +45,8 @@ function displayInternalLink($path, $text, $target='') {
 
 function displayPageHeader($color, $mailbox, $xtra='') {
 
-    global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF, $frame_top, $compose_new_win, $username, $datadir;
+    global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF, $frame_top,
+    $compose_new_win, $username, $datadir, $compose_width, $compose_height;
 
     $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 );
     if (!isset($frame_top)) {
@@ -80,17 +81,16 @@ function displayPageHeader($color, $mailbox, $xtra='') {
                "$xtra\n".
             "}\n";
             if ($compose_new_win == '1') {
-                $width= getPref($username, $datadir, 'editor_size', 76);
-                if ($width < 65) {
-                    $pix_width = 560;
+                if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
+                    $compose_width = '640';
                 }
-                else {
-                    $width = (.9*$width);
-                    $pix_width = intval($width).'0';
+                if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
+                    $compose_height = '550';
                 }
                 $js .= "function comp_in_new() {\n".
                      "    var newwin = window.open(\"".$base_uri."src/compose.php\"".
-                     ", \"compose_window\", \"width=".$pix_width.",height=650".
+                     ", \"compose_window\",
+                \"width=".$compose_width.",height=$compose_height".
                      ",scrollbars=yes,resizable=yes\");\n".
                      "}\n";
             }
index ecf7e387d0fcd878af588c204a0fbdf841bd4c41..8b9e12057d97d8f5234c529ce89b451dfc7abd70 100644 (file)
@@ -599,6 +599,7 @@ function showInputForm ($session) {
     }
     echo '<TABLE WIDTH="100%" ALIGN=center CELLSPACING=0 BORDER=0>' . "\n";
     if ($compose_new_win == '1') {
+        echo '<TABLE ALIGN=CENTER BGCOLOR="'.$color[0].'" WIDTH="100%" BORDER=0>'."\n";
         echo '   <TR><TD></TD><TD ALIGN="RIGHT"><INPUT TYPE="BUTTON" NAME="Close" onClick="return self.close()" VALUE='._("Close").'></TD></TR>'."\n";
     }
     if ($location_of_buttons == 'top') {
@@ -750,7 +751,9 @@ function showInputForm ($session) {
              '</td></tr>';
     }
     /* End of attachment code */
-
+    if ($compose_new_win == '1') {
+        echo '</TABLE>'."\n";
+    }
     echo '</TABLE>' . "\n";
     if ($reply_id) {
         echo '<input type=hidden name=reply_id value=' . $reply_id . ">\n";
index 9862013887c4157f4bd64ab53a22c4bcf43975b0..fb2dd9e51dc4a29645a9061eca4b683cfc869006 100644 (file)
@@ -210,6 +210,9 @@ $hour_format = getPref($data_dir, $username, 'hour_format', 2);
 
 /*  compose in new window setting */
 $compose_new_win = getPref($data_dir, $username, 'compose_new_win', 0);
+$compose_height = getPref($data_dir, $username, 'compose_height', 550);
+$compose_width = getPref($data_dir, $username, 'compose_width', 640);
+
 
 /* signature placement settings */
 $sig_first = getPref($data_dir, $username, 'sig_first', 0);
index 113c35b091dce205943292f9b15758fd3425f989..f009b0c1de24594eee016d21f3f814065a2b7d31 100644 (file)
@@ -19,7 +19,7 @@ define('SMOPT_GRP_MESSAGE', 2);
 /* Define the optpage load function for the display options page. */
 function load_optpage_data_display() {
     global $theme, $language, $languages, $js_autodetect_results,
-           $default_use_mdn, $squirrelmail_language, $allow_thread_sort;
+    $compose_new_win, $default_use_mdn, $squirrelmail_language, $allow_thread_sort;
 
     /* Build a simple array into which we will build options. */
     $optgrps = array();
@@ -177,6 +177,7 @@ function load_optpage_data_display() {
                            SMPREF_LOC_BOTTOM  => _("After message body"))
     );
 
+
     $optvals[SMOPT_GRP_MESSAGE][] = array(
         'name'    => 'use_javascript_addr_book',
         'caption' => _("Addressbook Display Format"),
@@ -234,6 +235,7 @@ function load_optpage_data_display() {
         'type'    => SMOPT_TYPE_BOOLEAN,
         'refresh' => SMOPT_REFRESH_NONE
     );
+
     if ($default_use_mdn) {
         $optvals[SMOPT_GRP_MESSAGE][] = array(
             'name'    => 'mdn_user_support',
@@ -242,18 +244,37 @@ function load_optpage_data_display() {
             'refresh' => SMOPT_REFRESH_NONE
         );
     }
+
     $optvals[SMOPT_GRP_MESSAGE][] = array(
         'name'    => 'compose_new_win',
         'caption' => _("Always compose in a new window"),
         'type'    => SMOPT_TYPE_BOOLEAN,
         'refresh' => SMOPT_REFRESH_ALL
     );
+
+    $optvals[SMOPT_GRP_MESSAGE][] = array(
+        'name'    => 'compose_width',
+        'caption' => _("Width of compose window"),
+        'type'    => SMOPT_TYPE_INTEGER,
+        'refresh' => SMOPT_REFRESH_ALL,
+        'size'    => SMOPT_SIZE_TINY
+    );
+
+    $optvals[SMOPT_GRP_MESSAGE][] = array(
+        'name'    => 'compose_height',
+        'caption' => _("Height of compose window"),
+        'type'    => SMOPT_TYPE_INTEGER,
+        'refresh' => SMOPT_REFRESH_ALL,
+        'size'    => SMOPT_SIZE_TINY
+    );
+
     $optvals[SMOPT_GRP_MESSAGE][] = array(
         'name'    => 'sig_first',
         'caption' => _("Append signature before reply/forward text"),
         'type'    => SMOPT_TYPE_BOOLEAN,
         'refresh' => SMOPT_REFRESH_NONE
     );
+
     $optvals[SMOPT_GRP_MESSAGE][] = array(
         'name'    => 'internal_date_sort',
         'caption' => _("Use receive date for sort"),