From 0768773669776e69bc394f265dbb300584c33a29 Mon Sep 17 00:00:00 2001 From: jmunro Date: Wed, 17 Apr 2002 14:41:50 +0000 Subject: [PATCH] lets the users set the size of the 'compose in new window' pop up git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2744 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/page_header.php | 16 ++++++++-------- src/compose.php | 5 ++++- src/load_prefs.php | 3 +++ src/options_display.php | 23 ++++++++++++++++++++++- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/functions/page_header.php b/functions/page_header.php index e194b4bc..b2802169 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -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"; } diff --git a/src/compose.php b/src/compose.php index ecf7e387..8b9e1205 100644 --- a/src/compose.php +++ b/src/compose.php @@ -599,6 +599,7 @@ function showInputForm ($session) { } echo '' . "\n"; if ($compose_new_win == '1') { + echo '
'."\n"; echo ' '."\n"; } if ($location_of_buttons == 'top') { @@ -750,7 +751,9 @@ function showInputForm ($session) { ''; } /* End of attachment code */ - + if ($compose_new_win == '1') { + echo '
'."\n"; + } echo '' . "\n"; if ($reply_id) { echo ' _("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"), -- 2.25.1