From 68c78fc532d0707dd504d997981a56370703a245 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sat, 14 Apr 2001 02:42:50 +0000 Subject: [PATCH] Use browser class header function --- addressbook/export.php | 16 ++-------------- addressbook/import.php | 16 ++-------------- addressbook/vcardout.php | 15 ++++----------- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/addressbook/export.php b/addressbook/export.php index 2030f5f649..987554cf38 100644 --- a/addressbook/export.php +++ b/addressbook/export.php @@ -118,21 +118,9 @@ $tsvfilename = $phpgw_info['server']['temp_dir'].$sep.$tsvfilename; - if ($phpgw->browser->get_agent() == "IE") // && browser_get_version() == "5.5") - { - $attachment = ""; - } - else - { - $attachment = " attachment;"; - } - if ( ($download == "on") || ($o->type == 'pdb') ) { - header("Content-disposition:".$attachment." filename=\"".$tsvfilename."\""); - header("Content-type: application/octetstream"); - header("Content-length: ".strlen($buffer)); - header("Pragma: no-cache"); - header("Expires: 0"); + // filename, default application/octet-stream, length of file, default nocache True + $phpgw->browser->content_header($tsvfilename,'',strlen($buffer)); echo $buffer; } else { echo "
\n";
diff --git a/addressbook/import.php b/addressbook/import.php
index 2f5817c229..55ef94fe63 100644
--- a/addressbook/import.php
+++ b/addressbook/import.php
@@ -164,22 +164,10 @@
 		fclose($fp);
 		$buffer = $this->import_end_file($buffer,$private,$cat_id);
 
-		if ($phpgw->browser->get_agent() == "IE") // && browser_get_version() == "5.5")
-		{
-			$attachment = "";
-		}
-		else
-		{
-			$attachment = " attachment;";
-		}
-
 		if ($download == "") {
 			if($conv_type=="Debug LDAP" || $conv_type=="Debug SQL" ) {
-				header("Content-disposition:".$attachment." filename=\"conversion.txt\"");
-				header("Content-type: application/octetstream");
-				header("Content-length: ".strlen($buffer));
-				header("Pragma: no-cache");
-				header("Expires: 0");
+				// filename, default application/octet-stream, length of file, default nocache True
+				$phpgw->browser->content_header($tsvfilename,'',strlen($buffer));
 				echo $buffer;
 			} else {
 				echo "
$buffer
"; diff --git a/addressbook/vcardout.php b/addressbook/vcardout.php index 17b61e07ed..6c541d75d7 100644 --- a/addressbook/vcardout.php +++ b/addressbook/vcardout.php @@ -93,19 +93,12 @@ $buffer[$myexport[$name]] = $value; } } - if ($phpgw->browser->get_agent() == "IE") // && browser_get_version() == "5.5") - { - $attachment = ""; - } - else - { - $attachment = " attachment;"; - } + // create a vcard from this translated array $entry = $vcard->out($buffer); - // print it - header("Content-type: text/x-vcard"); - header("Content-Disposition:$attachment filename=$filename"); + // print it using browser class for headers + // filename, mimetype, no length, default nocache True + $phpgw->browser->content_header($filename,'text/x-vcard'); echo $entry; $phpgw->common->exit; } /* !nolname && !nofname */