From 5be9f1952729e353cf3a2b8431e432254b879b15 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Fri, 18 Jan 2002 11:53:18 +0000 Subject: [PATCH] some cleanup git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2159 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 7 ++-- functions/auth.php | 2 +- src/download.php | 16 ++++++--- src/image.php | 86 +++++++++++++++++++--------------------------- src/read_body.php | 39 ++++++++++++--------- src/validate.php | 9 ++--- 6 files changed, 78 insertions(+), 81 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb4dfb59..170f3280 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,9 @@ *** Squirrelmail Stable Series 1.2 *** ************************************** -Version 1.2.3 -- ?? -------------------- - - Fixed focus system on pages that contains forms. +Version 1.2.3 -- cvs +-------------------- + - Fixed focus system on pages that contain forms. - Fixed IMAP code to send different command identifiers as per section 2.2.1 of RFC 2060. - Fixed 'sticky priority' so that replies are set to the same @@ -20,7 +20,6 @@ Version 1.2.3 -- ?? make it bigger or smaller depending on their screen size. Sysops may add or remove these system-defined css located in themes/css/ - Version 1.2.2 -- 1 January 2002 ------------------------------- diff --git a/functions/auth.php b/functions/auth.php index 8d71465d..287be6ce 100644 --- a/functions/auth.php +++ b/functions/auth.php @@ -32,4 +32,4 @@ function is_logged_in () { exit; } -?> +?> \ No newline at end of file diff --git a/src/download.php b/src/download.php index 6ba0939e..abbadcbd 100644 --- a/src/download.php +++ b/src/download.php @@ -104,11 +104,17 @@ require_once('../functions/date.php'); } if (strlen($filename) < 1) { - if ($type1 == "plain" && $type0 == "text") $suffix = "txt"; - else if ($type1 == "richtext" && $type0 == "text") $suffix = "rtf"; - else if ($type1 == "postscript" && $type0 == "application") $suffix = "ps"; - else if ($type1 == "message" && $type0 == "rfc822") $suffix = "msg"; - else $suffix = $type1; + if ($type1 == 'plain' && $type0 == 'text') { + $suffix = 'txt'; + } else if ($type1 == 'richtext' && $type0 == 'text') { + $suffix = 'rtf'; + } else if ($type1 == 'postscript' && $type0 == 'application') { + $suffix = 'ps'; + } else if ($type1 == 'message' && $type0 == 'rfc822') { + $suffix = 'msg'; + } else { + $suffix = $type1; + } $filename = "untitled$passed_ent_id.$suffix"; } diff --git a/src/image.php b/src/image.php index 0e6763c2..4cad2b00 100644 --- a/src/image.php +++ b/src/image.php @@ -11,61 +11,45 @@ * $Id$ */ -/*****************************************************************/ -/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/ -/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/ -/*** + Base level indent should begin at left margin, as ***/ -/*** the require_once below looks. ***/ -/*** + All identation should consist of four space blocks ***/ -/*** + Tab characters are evil. ***/ -/*** + all comments should use "slash-star ... star-slash" ***/ -/*** style -- no pound characters, no slash-slash style ***/ -/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/ -/*** ALWAYS USE { AND } CHARACTERS!!! ***/ -/*** + Please use ' instead of ", when possible. Note " ***/ -/*** should always be used in _( ) function calls. ***/ -/*** Thank you for your help making the SM code more readable. ***/ -/*****************************************************************/ - require_once('../src/validate.php'); require_once('../functions/date.php'); require_once('../functions/page_header.php'); require_once('../src/load_prefs.php'); - displayPageHeader($color, 'None'); - - echo '
' . - '' . - "\n" . - '' . "\n" . - '
' . - '
' . - _("Viewing an image attachment") . " - "; - if (isset($where) && isset($what)) { - // from a search - echo '' . _("View message") . ''; - } else { - echo '' . _("View message") . ''; - } - - $DownloadLink = '../src/download.php?passed_id=' . $passed_id . - '&mailbox=' . urlencode($mailbox) . - '&passed_ent_id=' . $passed_ent_id . '&absolute_dl=true'; - - echo '
' . - _("Download this as a file") . - '
 ' . "\n" . - '
' . "\n" . - - '' . "\n" . - '
' . - '' . - - '
' . "\n"; - '' . "\n"; +displayPageHeader($color, 'None'); + +echo '
' . + '' . + "\n" . + '' . "\n" . + '
' . + '
' . + _("Viewing an image attachment") . " - "; +if (isset($where) && isset($what)) { + // from a search + echo '' . _("View message") . ''; +} else { + echo '' . _("View message") . ''; +} + +$DownloadLink = '../src/download.php?passed_id=' . $passed_id . + '&mailbox=' . urlencode($mailbox) . + '&passed_ent_id=' . $passed_ent_id . '&absolute_dl=true'; + +echo '
' . + _("Download this as a file") . + '
 ' . "\n" . + '
' . "\n" . + + '' . "\n" . + '
' . + '' . + + '
' . "\n"; + '' . "\n"; ?> diff --git a/src/read_body.php b/src/read_body.php index 8d647a54..11999687 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -17,7 +17,7 @@ require_once('../functions/imap.php'); require_once('../functions/mime.php'); require_once('../functions/date.php'); require_once('../functions/url_parser.php'); - + /** * Given an IMAP message id number, this will look it up in the cached * and sorted msgs array and return the index. Used for finding the next @@ -420,23 +420,23 @@ if ($default_use_priority) { switch($priority_level) { /* check for a higher then normal priority. */ case '1': - case '2': - $priority_string = _("High"); + case '2': + $priority_string = _("High"); break; /* check for a lower then normal priority. */ case '4': - case '5': - $priority_string = _("Low"); + case '5': + $priority_string = _("Low"); break; - + /* check for a normal priority. */ - case '3': + case '3': default: $priority_level = '3'; - $priority_string = _("Normal"); + $priority_string = _("Normal"); break; - + } } @@ -638,11 +638,12 @@ if (!$pf_subtle_link) { echo printer_friendly_link(true); } -do_hook("read_body_header"); +do_hook('read_body_header'); echo '' . ' ' . ''; flush(); + echo "\n" . "
\n" . '
'. @@ -653,23 +654,29 @@ echo "\n" '
' . "\n"; /* show attached images inline -- if pref'fed so */ -if (($attachment_common_show_images) and +if (($attachment_common_show_images) && is_array($attachment_common_show_images_list)) { + foreach ($attachment_common_show_images_list as $img) { + $imgurl = '../src/download.php' . + "?startMessage=$startMessage". + '&passed_id=' . urlencode($img['passed_id']) . + '&mailbox=' . urlencode($img['mailbox']) . + '&passed_ent_id=' . urlencode($img['ent_id']) . + '&absolute_dl=true'; + echo "\n" . " \n" . " \n" . " \n" . "
\n" . - ' ' . "\n" . + " \n" . "
\n"; + } } + do_hook('read_body_bottom'); do_hook('html_bottom'); sqimap_logout($imapConnection); diff --git a/src/validate.php b/src/validate.php index 655e70cc..2d6fc3d5 100644 --- a/src/validate.php +++ b/src/validate.php @@ -21,10 +21,10 @@ is_logged_in(); if (get_magic_quotes_gpc()) { global $REQUEST_METHOD; - if ($REQUEST_METHOD == "POST") { + if ($REQUEST_METHOD == 'POST') { global $HTTP_POST_VARS; RemoveSlashes($HTTP_POST_VARS); - } else if ($REQUEST_METHOD == "GET") { + } else if ($REQUEST_METHOD == 'GET') { global $HTTP_GET_VARS; RemoveSlashes($HTTP_GET_VARS); } @@ -43,7 +43,7 @@ global $send, $PHP_SELF; if (isset($send) && (substr($send, 0, 1) == "\n") && (substr($PHP_SELF, -12) == '/compose.php')) { - if ($REQUEST_METHOD == "POST") { + if ($REQUEST_METHOD == 'POST') { global $HTTP_POST_VARS; TrimArray($HTTP_POST_VARS); } else { @@ -69,4 +69,5 @@ require_once('../functions/prefs.php'); /* Set up the language (i18n.php was included by auth.php). */ global $username, $data_dir; set_up_language(getPref($data_dir, $username, 'language')); -?> + +?> \ No newline at end of file -- 2.25.1