phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: email/inc class.bomessage.inc.php,1.12,1.13 clas


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.bomessage.inc.php,1.12,1.13 class.mail_dcom_base.inc.php,1.7,1.8 class.uimessage.inc.php,1.7,1.8
Date: Sat, 23 Nov 2002 20:57:49 -0500

Update of /cvsroot/phpgroupware/email/inc
In directory subversions:/tmp/cvs-serv19986

Modified Files:
        class.bomessage.inc.php class.mail_dcom_base.inc.php 
        class.uimessage.inc.php 
Log Message:
readded a call to calendar's hook_email and other X-phpGW-Type hooks


Index: class.bomessage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.bomessage.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.bomessage.inc.php     15 Nov 2002 07:32:54 -0000      1.12
--- class.bomessage.inc.php     24 Nov 2002 01:57:46 -0000      1.13
***************
*** 1,1643 ****
! <?php
!       
/**************************************************************************\
!       * Anglemail - E-Mail    BO for displaying email message content         
*
!       * http://www.anglemail.org                                              
                *
!       * Written by Angelo (Angles) Puglisi <address@hidden>           *
!       * Copyright 2001, 2002 Angelo "Angles" Puglisi 
!       * --------------------------------------------                          
                        *
!       *  This program is free software; you can redistribute it and/or modify 
it              *
!       *  under the terms of the GNU General Public License as published by 
the        *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your               *
[...3253 lines suppressed...]
!                       // used to show in calendar-notifications the event and 
allow to except it there
!                       if($application)
!                       {
!                               if(strstr($msgtype,'"; Id="'))
!                               {
!                                       $msg_type = explode(';',$msgtype);
!                                       $id_array = explode('=',$msg_type[2]);
!                                       $this->xi['calendar_id'] = 
intval(substr($id_array[1],1,-1));
!                               }
!                       }
!                       
!                       
//$GLOBALS['phpgw']->template->pparse('out','T_message_main');
!                       
!                       // DO NOT end request yet because the "echo_out" part 
(if exists) will require this connection
!                       //$GLOBALS['phpgw']->msg->end_request();
!                       if ($this->debug > 2) { echo 
'email.bomessage.message_data:  $this->part_nice (With Instructions) dump: 
<pre>'; print_r($this->part_nice); echo '</pre>'; }
!                       
!               }
!       }
! ?>

Index: class.mail_dcom_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.mail_dcom_base.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.mail_dcom_base.inc.php        25 Oct 2002 12:45:52 -0000      1.7
--- class.mail_dcom_base.inc.php        24 Nov 2002 01:57:46 -0000      1.8
***************
*** 1,321 ****
! <?php
!       
/**************************************************************************\
!       * AngleMail     http://www.anglemail.org                                
                                *
!       */
!       
/**************************************************************************\
!       * AngleMail - E-Mail Data Communications Class Core Functions           
        *
!       * This file written by Angelo "Angles" Puglisi <address@hidden> *
!       * Copyright (C) 2001-2002 Angelo "Angles" Puglisi                       
                        *
!       * 
-------------------------------------------------------------------------       
                                      *
!       * Most funtions have an authors line which attempts to identify and 
credit      *
!       * any previous authors and maintainers.                                 
                        *
!       * AngleMail appreciates the hard work of previous authors and 
maintainers.      *
!       * 
-------------------------------------------------------------------------       
                      *
!       * This file designed to work as part of a drop in email module for      
        *
!       * phpGroupWare  http://www.phpgroupware.org                             
        *
!       * 
-------------------------------------------------------------------------       
                      *
!       * This library is free software; you can redistribute it and/or modify 
it               *
!       * under the terms of the GNU Lesser General Public License as published 
by      *
!       * the Free Software Foundation; either version 2.1 of the License,      
                *
!       * or any later version.                                                 
        *
!       * This library is distributed in the hope that it will be useful, but   
                *
!       * WITHOUT ANY WARRANTY; without even the implied warranty of            
*
!       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  *
!       * See the GNU Lesser General Public License for more details.           
        *
!       * You should have received a copy of the GNU Lesser General Public 
License      *
!       * along with this library; if not, write to the Free Software 
Foundation,               *
!       * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
        *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       /*!
!       @class mail_dcom_base 
!       @abstract E-Mail Data Communications API
!       @discussion Part of a group of files which together comprise the "Data 
Communications" 
!       API for AngleMail. Certain files are loaded if IMAP is compiled into 
php, while other 
!       files are loaded if the sockets replacement functions are needed. 
!       @author Each function has an authors line. 
!       */
!       class mail_dcom_base
!       {
!               var $msg_struct;
!               var $err = array("code","msg","desc");
!               var $msg_info = Array(Array());
!               
!               var $debug_utf7=0;
!               //var $debug_utf7=3;
! 
!               var $tempfile;
!               var $folder_list_changed = False;
!               var $enable_utf7 = False;
!               var $imap_builtin = True;
!               var $force_msg_uids = False;
!               //var $att_files_dir;
!               var $force_check;
! 
!               var $boundary,
!                  $got_structure;
! 
!               /*!
!               @function mail_dcom_base
!               @abstract *constructor*
!               @author Angles
!               @access private
!               */
!               function mail_dcom_base()
!               {
!                       $this->err["code"] = " ";
!                       $this->err["msg"]  = " ";
!                       $this->err["desc"] = " ";
!                       $this->tempfile = 
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$GLOBALS['phpgw_info']['user']['sessionid'].'.mhd';
!                       $this->force_check = false;
!                       $this->got_structure = false;
!               }
! 
!               /*!
!               @function utf7_encode
!               @abstract ?
!               @author Angles
!               @access private
!               */
!               function utf7_encode($data, $called_by='not_provided')
!               {
!                       if ($this->debug_utf7 > 0) { echo 'mail_dcom_base: 
utf7_encode ('.__LINE__.'): ENTERING, $called_by ['.$called_by.']<br>'; } 
!                       if ($this->debug_utf7 > 1) { echo 'mail_dcom_base: 
utf7_encode ('.__LINE__.'): $data ['.serialize($data).']<br>'; } 
!                       // handle utf7 encoding of folder names, if necessary
!                       if (($this->enable_utf7 == False)
!                       || (function_exists('imap_utf7_encode') == False)
!                       || (!isset($data)))
!                       {
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING on error, returning param 
unmodified. Check if .. then to see why we exited here, $called_by 
['.$called_by.']<br>'; } 
!                               return $data;
!                       }
! 
!                       // data to and from the server can be either array or 
string
!                       if (gettype($data) == 'array')
!                       {
!                               // array data
!                               $return_array = Array();
!                               for ($i=0; $i<count($data);$i++)
!                               {
!                                       $return_array[$i] = 
$this->utf7_encode_string($data[$i]);
!                               }
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING, returning $return_array 
['.serialize($return_array).'], $called_by ['.$called_by.']<br>'; } 
!                               return $return_array;
!                       }
!                       elseif (gettype($data) == 'string')
!                       {
!                               // string data
!                               $return_string = 
$this->utf7_encode_string($data);
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING, returning $return_string 
['.serialize($return_string).'], $called_by ['.$called_by.']<br>'; } 
!                               return $return_string;
!                       }
!                       else
!                       {
!                               // ERROR
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING with ERROR, returning 
param unmodified. Data was not string nor array, $called_by 
['.$called_by.']<br>'; } 
!                               return $data;
!                       }
!               }
! 
!               /*!
!               @function utf7_encode_string
!               @abstract ?
!               @author Angles
!               @access private
!               */
!               function utf7_encode_string($data_str)
!               {
!                       $name = Array();
!                       $name['folder_before'] = '';
!                       $name['folder_after'] = '';
!                       $name['translated'] = '';
!                       
!                       if (strstr($data_str,'}'))
!                       {
!                               // folder name at this stage is  
{SERVER_NAME:PORT}FOLDERNAME
!                               // get everything to the right of the bracket 
"}", INCLUDES the bracket itself
!                               $name['folder_before'] = strstr($data_str,'}');
!                               // get rid of that 'needle' "}"
!                               $name['folder_before'] = 
substr($name['folder_before'], 1);
!                               // translate
!                               $name['folder_after'] = 
imap_utf7_encode($name['folder_before']);
!                               // replace old folder name with new folder name
!                               $name['translated'] = 
str_replace($name['folder_before'], $name['folder_after'], $data_str);
!                       }
!                       else
!                       {
!                               // folder name at this stage is  FOLDERNAME
!                               // there is NO {SERVER} part in this name, this 
is OK some commands do not require it (mail_move same acct)
!                               $name['folder_before'] = $data_str;
!                               // translate
!                               $name['folder_after'] = 
imap_utf7_encode($name['folder_before']);
!                               $name['translated'] = $name['folder_after'];
!                       }
!                       if ($this->debug_utf7 > 1) { echo ' _ mail_dcom_base: 
utf7_encode_string ('.__LINE__.'): $name DUMP: 
['.htmlspecialchars(serialize($name)).']<br>'; } 
!                       return $name['translated'];
!               }
! 
!               /*!
!               @function utf7_decode
!               @abstract ?
!               @author Angles
!               @access private
!               */
!               function utf7_decode($data)
!               {
!                       if ($this->debug_utf7 > 0) { echo 'mail_dcom_base: 
utf7_decode ('.__LINE__.'): ENTERING<br>'; } 
!                       if ($this->debug_utf7 > 1) { echo 'mail_dcom_base: 
utf7_decode ('.__LINE__.'): $data ['.serialize($data).']<br>'; } 
!                       // handle utf7 decoding of folder names, if necessary
!                       if (($this->enable_utf7 == False)
!                       || (function_exists('imap_utf7_decode') == False)
!                       || (!isset($data)))
!                       {
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING on error, returning param 
unmodified. Check if .. then to see why we exited here<br>'; } 
!                               return $data;
!                       }
! 
!                       // data to and from the server can be either array or 
string
!                       if (gettype($data) == 'array')
!                       {
!                               // array data
!                               $return_array = Array();
!                               for ($i=0; $i<count($data);$i++)
!                               {
!                                       $return_array[$i] = 
$this->utf7_decode_string($data[$i]);
!                               }
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING, returning $return_array 
['.serialize($return_array).']<br>'; } 
!                               return $return_array;
!                       }
!                       elseif (gettype($data) == 'string')
!                       {
!                               // string data
!                               $return_string = 
$this->utf7_decode_string($data);
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING, returning $return_string 
['.serialize($return_string).']<br>'; } 
!                               return $return_string;
!                       }
!                       else
!                       {
!                               // ERROR
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING with ERROR, returning 
param unmodified. Data was not string nor array.<br>'; } 
!                               return $data;
!                       }
!               }
! 
!               /*!
!               @function utf7_decode_string
!               @abstract ?
!               @author Angles
!               @access private
!               */
!               /*
!               function utf7_decode_string($data_str)
!               {
!                       $name = Array();
!                       $name['folder_before'] = '';
!                       $name['folder_after'] = '';
!                       $name['translated'] = '';
!                       
!                       // folder name at this stage is  
{SERVER_NAME:PORT}FOLDERNAME
!                       // get everything to the right of the bracket "}", 
INCLUDES the bracket itself
!                       $name['folder_before'] = strstr($data_str,'}');
!                       // get rid of that 'needle' "}"
!                       $name['folder_before'] = substr($name['folder_before'], 
1);
!                       // translate
!                       $name['folder_after'] = 
imap_utf7_decode($name['folder_before']);
!                       // "imap_utf7_decode" returns False if no translation 
occured
!                       if ($name['folder_after'] == False)
!                       {
!                               // no translation occured
!                               return $data_str;
!                       }
!                       else
!                       {
!                               // replace old folder name with new folder name
!                               $name['translated'] = 
str_replace($name['folder_before'], $name['folder_after'], $data_str);
!                               return $name['translated'];
!                       }
!               }
!               */
!               function utf7_decode_string($data_str)
!               {
!                       $name = Array();
!                       $name['folder_before'] = '';
!                       $name['folder_after'] = '';
!                       $name['translated'] = '';
!                       
!                       if (strstr($data_str,'}'))
!                       {
!                               // folder name at this stage is  
{SERVER_NAME:PORT}FOLDERNAME
!                               // get everything to the right of the bracket 
"}", INCLUDES the bracket itself
!                               $name['folder_before'] = strstr($data_str,'}');
!                               // get rid of that 'needle' "}"
!                               $name['folder_before'] = 
substr($name['folder_before'], 1);
!                               // translate
!                               $name['folder_after'] = 
imap_utf7_decode($name['folder_before']);
!                               // "imap_utf7_decode" returns False if no 
translation occured (supposed to, can return identical string too)
!                               if ( ($name['folder_after'] == False)
!                               || ($name['folder_before'] == 
$name['folder_after']) )
!                               {
!                                       // no translation occured
!                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning unmodified name, 
NO decoding needed, returning feed $data_str: 
['.htmlspecialchars(serialize($data_str)).']<br>'; } 
!                                       return $data_str;
!                               }
!                               else
!                               {
!                                       // replace old folder name with new 
folder name
!                                       $name['translated'] = 
str_replace($name['folder_before'], $name['folder_after'], $data_str);
!                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning decoded name, 
$name[] DUMP: ['.htmlspecialchars(serialize($name)).']<br>'; } 
!                                       return $name['translated'];
!                               }
!                       }
!                       else
!                       {
!                               // folder name at this stage is  FOLDERNAME
!                               // there is NO {SERVER} part in this name, 
!                               // DOES THIS EVER HAPPEN comming *from* the 
server? I DO NOT THINK SO, but just in case
!                               // translate
!                               $name['translated'] = 
imap_utf7_decode($data_str);
!                               // "imap_utf7_decode" returns False if no 
translation occured
!                               if (($name['translated'] == False)
!                               || ($name['folder_before'] == $data_str) )
!                               {
!                                       // no translation occured
!                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning unmodified name, 
NO decoding needed, returning feed $data_str: 
['.htmlspecialchars(serialize($data_str)).']<br>'; } 
!                                       return $data_str;
!                               }
!                               else
!                               {
!                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning decoded name, 
$name[] DUMP: ['.htmlspecialchars(serialize($name)).']<br>'; } 
!                                       return $name['translated'];
!                               }
!                       }
!               }
! 
!               /*!
!               @function get_flag
!               @abstract ?
!               */
!               function get_flag($stream,$msg_num,$flag)
!               {
!                       $header = $this->fetchheader($stream,$msg_num);
!                       $flag = strtolower($flag);
!                       for ($i=0;$i<count($header);$i++)
!                       {
!                               $pos = strpos($header[$i],":");
!                               if (is_int($pos) && $pos)
!                               {
!                                       $keyword = 
trim(substr($header[$i],0,$pos));
!                                       $content = 
trim(substr($header[$i],$pos+1));
!                                       if (strtolower($keyword) == $flag)
!                                       {
!                                               return $content;
!                                       }
!                               }
!                       }
!                       return false;
!               }
! 
!       } // end of class mail_dcom
! ?>
--- 1,321 ----
! <?php
!       
/**************************************************************************\
!       * AngleMail     http://www.anglemail.org                                
                                *
!       */
!       
/**************************************************************************\
!       * AngleMail - E-Mail Data Communications Class Core Functions           
        *
!       * This file written by Angelo "Angles" Puglisi <address@hidden> *
!       * Copyright (C) 2001-2002 Angelo "Angles" Puglisi                       
                        *
!       * 
-------------------------------------------------------------------------       
                                      *
!       * Most funtions have an authors line which attempts to identify and 
credit      *
!       * any previous authors and maintainers.                                 
                        *
!       * AngleMail appreciates the hard work of previous authors and 
maintainers.      *
!       * 
-------------------------------------------------------------------------       
                      *
!       * This file designed to work as part of a drop in email module for      
        *
!       * phpGroupWare  http://www.phpgroupware.org                             
        *
!       * 
-------------------------------------------------------------------------       
                      *
!       * This library is free software; you can redistribute it and/or modify 
it               *
!       * under the terms of the GNU Lesser General Public License as published 
by      *
!       * the Free Software Foundation; either version 2.1 of the License,      
                *
!       * or any later version.                                                 
        *
!       * This library is distributed in the hope that it will be useful, but   
                *
!       * WITHOUT ANY WARRANTY; without even the implied warranty of            
*
!       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  *
!       * See the GNU Lesser General Public License for more details.           
        *
!       * You should have received a copy of the GNU Lesser General Public 
License      *
!       * along with this library; if not, write to the Free Software 
Foundation,               *
!       * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
        *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       /*!
!       @class mail_dcom_base 
!       @abstract E-Mail Data Communications API
!       @discussion Part of a group of files which together comprise the "Data 
Communications" 
!       API for AngleMail. Certain files are loaded if IMAP is compiled into 
php, while other 
!       files are loaded if the sockets replacement functions are needed. 
!       @author Each function has an authors line. 
!       */
!       class mail_dcom_base
!       {
!               var $msg_struct;
!               var $err = array("code","msg","desc");
!               var $msg_info = Array(Array());
!               
!               var $debug_utf7=0;
!               //var $debug_utf7=3;
! 
!               var $tempfile;
!               var $folder_list_changed = False;
!               var $enable_utf7 = False;
!               var $imap_builtin = True;
!               var $force_msg_uids = False;
!               //var $att_files_dir;
!               var $force_check;
! 
!               var $boundary,
!                  $got_structure;
! 
!               /*!
!               @function mail_dcom_base
!               @abstract *constructor*
!               @author Angles
!               @access private
!               */
!               function mail_dcom_base()
!               {
!                       $this->err["code"] = " ";
!                       $this->err["msg"]  = " ";
!                       $this->err["desc"] = " ";
!                       $this->tempfile = 
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$GLOBALS['phpgw_info']['user']['sessionid'].'.mhd';
!                       $this->force_check = false;
!                       $this->got_structure = false;
!               }
! 
!               /*!
!               @function utf7_encode
!               @abstract ?
!               @author Angles
!               @access private
!               */
!               function utf7_encode($data, $called_by='not_provided')
!               {
!                       if ($this->debug_utf7 > 0) { echo 'mail_dcom_base: 
utf7_encode ('.__LINE__.'): ENTERING, $called_by ['.$called_by.']<br>'; } 
!                       if ($this->debug_utf7 > 1) { echo 'mail_dcom_base: 
utf7_encode ('.__LINE__.'): $data ['.serialize($data).']<br>'; } 
!                       // handle utf7 encoding of folder names, if necessary
!                       if (($this->enable_utf7 == False)
!                       || (function_exists('imap_utf7_encode') == False)
!                       || (!isset($data)))
!                       {
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING on error, returning param 
unmodified. Check if .. then to see why we exited here, $called_by 
['.$called_by.']<br>'; } 
!                               return $data;
!                       }
! 
!                       // data to and from the server can be either array or 
string
!                       if (gettype($data) == 'array')
!                       {
!                               // array data
!                               $return_array = Array();
!                               for ($i=0; $i<count($data);$i++)
!                               {
!                                       $return_array[$i] = 
$this->utf7_encode_string($data[$i]);
!                               }
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING, returning $return_array 
['.serialize($return_array).'], $called_by ['.$called_by.']<br>'; } 
!                               return $return_array;
!                       }
!                       elseif (gettype($data) == 'string')
!                       {
!                               // string data
!                               $return_string = 
$this->utf7_encode_string($data);
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING, returning $return_string 
['.serialize($return_string).'], $called_by ['.$called_by.']<br>'; } 
!                               return $return_string;
!                       }
!                       else
!                       {
!                               // ERROR
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_encode ('.__LINE__.'): LEAVING with ERROR, returning 
param unmodified. Data was not string nor array, $called_by 
['.$called_by.']<br>'; } 
!                               return $data;
!                       }
!               }
! 
!               /*!
!               @function utf7_encode_string
!               @abstract ?
!               @author Angles
!               @access private
!               */
!               function utf7_encode_string($data_str)
!               {
!                       $name = Array();
!                       $name['folder_before'] = '';
!                       $name['folder_after'] = '';
!                       $name['translated'] = '';
!                       
!                       if (strstr($data_str,'}'))
!                       {
!                               // folder name at this stage is  
{SERVER_NAME:PORT}FOLDERNAME
!                               // get everything to the right of the bracket 
"}", INCLUDES the bracket itself
!                               $name['folder_before'] = strstr($data_str,'}');
!                               // get rid of that 'needle' "}"
!                               $name['folder_before'] = 
substr($name['folder_before'], 1);
!                               // translate
!                               $name['folder_after'] = 
imap_utf7_encode($name['folder_before']);
!                               // replace old folder name with new folder name
!                               $name['translated'] = 
str_replace($name['folder_before'], $name['folder_after'], $data_str);
!                       }
!                       else
!                       {
!                               // folder name at this stage is  FOLDERNAME
!                               // there is NO {SERVER} part in this name, this 
is OK some commands do not require it (mail_move same acct)
!                               $name['folder_before'] = $data_str;
!                               // translate
!                               $name['folder_after'] = 
imap_utf7_encode($name['folder_before']);
!                               $name['translated'] = $name['folder_after'];
!                       }
!                       if ($this->debug_utf7 > 1) { echo ' _ mail_dcom_base: 
utf7_encode_string ('.__LINE__.'): $name DUMP: 
['.htmlspecialchars(serialize($name)).']<br>'; } 
!                       return $name['translated'];
!               }
! 
!               /*!
!               @function utf7_decode
!               @abstract ?
!               @author Angles
!               @access private
!               */
!               function utf7_decode($data)
!               {
!                       if ($this->debug_utf7 > 0) { echo 'mail_dcom_base: 
utf7_decode ('.__LINE__.'): ENTERING<br>'; } 
!                       if ($this->debug_utf7 > 1) { echo 'mail_dcom_base: 
utf7_decode ('.__LINE__.'): $data ['.serialize($data).']<br>'; } 
!                       // handle utf7 decoding of folder names, if necessary
!                       if (($this->enable_utf7 == False)
!                       || (function_exists('imap_utf7_decode') == False)
!                       || (!isset($data)))
!                       {
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING on error, returning param 
unmodified. Check if .. then to see why we exited here<br>'; } 
!                               return $data;
!                       }
! 
!                       // data to and from the server can be either array or 
string
!                       if (gettype($data) == 'array')
!                       {
!                               // array data
!                               $return_array = Array();
!                               for ($i=0; $i<count($data);$i++)
!                               {
!                                       $return_array[$i] = 
$this->utf7_decode_string($data[$i]);
!                               }
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING, returning $return_array 
['.serialize($return_array).']<br>'; } 
!                               return $return_array;
!                       }
!                       elseif (gettype($data) == 'string')
!                       {
!                               // string data
!                               $return_string = 
$this->utf7_decode_string($data);
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING, returning $return_string 
['.serialize($return_string).']<br>'; } 
!                               return $return_string;
!                       }
!                       else
!                       {
!                               // ERROR
!                               if ($this->debug_utf7 > 0) { echo 
'mail_dcom_base: utf7_decode ('.__LINE__.'): LEAVING with ERROR, returning 
param unmodified. Data was not string nor array.<br>'; } 
!                               return $data;
!                       }
!               }
! 
!               /*!
!               @function utf7_decode_string
!               @abstract ?
!               @author Angles
!               @access private
!               */
!               /*
!               function utf7_decode_string($data_str)
!               {
!                       $name = Array();
!                       $name['folder_before'] = '';
!                       $name['folder_after'] = '';
!                       $name['translated'] = '';
!                       
!                       // folder name at this stage is  
{SERVER_NAME:PORT}FOLDERNAME
!                       // get everything to the right of the bracket "}", 
INCLUDES the bracket itself
!                       $name['folder_before'] = strstr($data_str,'}');
!                       // get rid of that 'needle' "}"
!                       $name['folder_before'] = substr($name['folder_before'], 
1);
!                       // translate
!                       $name['folder_after'] = 
imap_utf7_decode($name['folder_before']);
!                       // "imap_utf7_decode" returns False if no translation 
occured
!                       if ($name['folder_after'] == False)
!                       {
!                               // no translation occured
!                               return $data_str;
!                       }
!                       else
!                       {
!                               // replace old folder name with new folder name
!                               $name['translated'] = 
str_replace($name['folder_before'], $name['folder_after'], $data_str);
!                               return $name['translated'];
!                       }
!               }
!               */
!               function utf7_decode_string($data_str)
!               {
!                       $name = Array();
!                       $name['folder_before'] = '';
!                       $name['folder_after'] = '';
!                       $name['translated'] = '';
!                       
!                       if (strstr($data_str,'}'))
!                       {
!                               // folder name at this stage is  
{SERVER_NAME:PORT}FOLDERNAME
!                               // get everything to the right of the bracket 
"}", INCLUDES the bracket itself
!                               $name['folder_before'] = strstr($data_str,'}');
!                               // get rid of that 'needle' "}"
!                               $name['folder_before'] = 
substr($name['folder_before'], 1);
!                               // translate
!                               $name['folder_after'] = 
imap_utf7_decode($name['folder_before']);
!                               // "imap_utf7_decode" returns False if no 
translation occured (supposed to, can return identical string too)
!                               if ( ($name['folder_after'] == False)
!                               || ($name['folder_before'] == 
$name['folder_after']) )
!                               {
!                                       // no translation occured
!                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning unmodified name, 
NO decoding needed, returning feed $data_str: 
['.htmlspecialchars(serialize($data_str)).']<br>'; } 
!                                       return $data_str;
!                               }
!                               else
!                               {
!                                       // replace old folder name with new 
folder name
!                                       $name['translated'] = 
str_replace($name['folder_before'], $name['folder_after'], $data_str);
!                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning decoded name, 
$name[] DUMP: ['.htmlspecialchars(serialize($name)).']<br>'; } 
!                                       return $name['translated'];
!                               }
!                       }
!                       else
!                       {
!                               // folder name at this stage is  FOLDERNAME
!                               // there is NO {SERVER} part in this name, 
!                               // DOES THIS EVER HAPPEN comming *from* the 
server? I DO NOT THINK SO, but just in case
!                               // translate
!                               $name['translated'] = 
imap_utf7_decode($data_str);
!                               // "imap_utf7_decode" returns False if no 
translation occured
!                               if (($name['translated'] == False)
!                               || ($name['folder_before'] == $data_str) )
!                               {
!                                       // no translation occured
!                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning unmodified name, 
NO decoding needed, returning feed $data_str: 
['.htmlspecialchars(serialize($data_str)).']<br>'; } 
!                                       return $data_str;
!                               }
!                               else
!                               {
!                                       if ($this->debug_utf7 > 0) { echo ' _ 
mail_dcom_base: utf7_decode_string ('.__LINE__.'): returning decoded name, 
$name[] DUMP: ['.htmlspecialchars(serialize($name)).']<br>'; }
!                                       return $name['translated'];
!                               }
!                       }
!               }
! 
!               /*!
!               @function get_flag
!               @abstract ?
!               */
!               function get_flag($stream,$msg_num,$flag)
!               {
!                       $header = 
explode("\n",$this->fetchheader($stream,$msg_num));
!                       $flag = strtolower($flag);
!                       for ($i=0;$i<count($header);$i++)
!                       {
!                               $pos = strpos($header[$i],":");
!                               if (is_int($pos) && $pos)
!                               {
!                                       $keyword = 
trim(substr($header[$i],0,$pos));
!                                       $content = 
trim(substr($header[$i],$pos+1));
!                                       if (strtolower($keyword) == $flag)
!                                       {
!                                               return $content;
!                                       }
!                               }
!                       }
!                       return false;
!               }
! 
!       } // end of class mail_dcom
! ?>

Index: class.uimessage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/email/inc/class.uimessage.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.uimessage.inc.php     25 Oct 2002 12:45:53 -0000      1.7
--- class.uimessage.inc.php     24 Nov 2002 01:57:46 -0000      1.8
***************
*** 1,270 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - email UI Class for Message Lists                       
        *
!       * http://www.phpgroupware.org                                           
        *
!       * Written by Angelo (Angles) Puglisi <address@hidden>           *
!       * --------------------------------------------                          
                        *
!       *  This program is free software; you can redistribute it and/or modify 
it              *
!       *  under the terms of the GNU General Public License as published by 
the        *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your               *
!       *  option) any later version.                                           
                *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       /*!
!       @class uimessage
!       @abstract ?
!       */
!       class uimessage
!       {
!               var $bo;
!               var $widgets;
!               var $debug = 0;
! 
!               var $public_functions = array(
!                       'message' => True
!               );
! 
!               function uimessage()
!               {
!                       return;
!               }
! 
!               /*!
!               @function message
!               @abstract ?
!               */
!               function message()
!               {
!                       $this->bo = CreateObject("email.bomessage");
!                       $this->bo->message_data();
!                       
!                       // NOW we can out the header, because "index_data()" 
filled this global
!                       //      
$GLOBALS['phpgw_info']['flags']['email_refresh_uri']
!                       // which is needed to preserve folder and sort settings 
during the auto-refresh-ing
!                       // currently (Dec 6, 2001) that logic is in 
phpgwapi/inc/templates/idsociety/head.inc.php
!                       unset($GLOBALS['phpgw_info']['flags']['noheader']);
!                       unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
!                       $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
!                       $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
!                       $GLOBALS['phpgw']->common->phpgw_header();
!                       // HOWEVER still this class must NOT invoke 
$GLOBALS['phpgw']->common->phpgw_header()
!                       // even though we had to output the header (go 
figure... :)
!                       
!                       // ---- BEGIN UIMESSAGE
!                       $GLOBALS['phpgw']->template->set_file(array(
!                               'T_message_main' => 'message_main.tpl',
!                               'T_message_echo_dump' => 'message_echo_dump.tpl'
!                       ));
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_x-phpgw-type','V_x-phpgw-type');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_cc_data','V_cc_data');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_attach_list','V_attach_list');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_debug_parts','V_debug_parts');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_display_part','V_display_part');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_echo_dump','B_setup_echo_dump','V_setup_echo_dump');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_echo_dump','B_done_echo_dump','V_done_echo_dump');
!                       
!                       //= = = = TOOLBAR WIDGET = = = 
!                       $this->widgets = CreateObject('email.html_widgets');
!                       
$GLOBALS['phpgw']->template->set_var('widget_toolbar',$this->widgets->get_toolbar());
!                       
!                       if (!empty($this->xi['msgtype']))
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('application',$this->bo->xi['application']);
!                               
$GLOBALS['phpgw']->template->parse('V_x-phpgw-type','B_x-phpgw-type');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('V_x-phpgw-type','');
!                       }
!                       
!                       //  ----  TOOL BAR / MENU BAR ----
!                       $tpl_vars = Array(
!                               //'accounts_label'              => 
$this->bo->xi['accounts_label'],
!                               //'ctrl_bar_font'                       => 
$this->bo->xi['ctrl_bar_font'],
!                               //'ctrl_bar_font_size'  => 
$this->bo->xi['ctrl_bar_font_size'],
!                               //'ctrl_bar_back1'              => 
$this->bo->xi['ctrl_bar_back1'],
!                               
!                               'bar_back1'             => '',
!                               //'bar_back1'           => 
$GLOBALS['phpgw_info']['theme']['table_bg'],
!                               //'bar_back1'           => 
$GLOBALS['phpgw_info']['theme']['bg08'],
!                               
!                               // ---- account switchbox  ----
!                               //'acctbox_listbox'             => 
$this->bo->xi['acctbox_listbox'],
!                               //'ilnk_accounts'                       => 
$this->bo->xi['ilnk_accounts'],
!                               //'acctbox_frm_name'            => 
$this->bo->xi['acctbox_frm_name'],
!                               //'acctbox_action'              => 
$this->bo->xi['acctbox_action'],
!                               // ---- Move Message Box  ----
!                               'move_current_sort'             => 
$this->bo->xi['move_current_sort'],
!                               'move_current_order'    => 
$this->bo->xi['move_current_order'],
!                               'move_current_start'    => 
$this->bo->xi['move_current_start'],
!                               'mlist_checkbox_name'   => 
$this->bo->xi['mlist_checkbox_name'],
!                                               
!                               'mlist_embedded_uri'    => 
$this->bo->xi['mlist_embedded_uri'],
!                               'frm_delmov_action'             => 
$this->bo->xi['frm_delmov_action'],
!                               'frm_delmov_name'               => 
$this->bo->xi['frm_delmov_name'],
!                               'delmov_listbox'                => 
$this->bo->xi['delmov_listbox'],
!                               'move_postmove_goto_name'       => 
$this->bo->xi['move_postmove_goto_name'],
!                               'move_postmove_goto_value'      => 
$this->bo->xi['move_postmove_goto_value'],
!                               
!                               'ilnk_prev_msg'                 => 
$this->bo->xi['ilnk_prev_msg'],
!                               'ilnk_next_msg'                 => 
$this->bo->xi['ilnk_next_msg'],
!                               
!                               // ----  Labels and Colors for From, To, CC, 
Files, and Subject  -----
!                               'tofrom_labels_bkcolor' => 
$this->bo->xi['tofrom_labels_bkcolor'],
!                               'tofrom_data_bkcolor'   => 
$this->bo->xi['tofrom_data_bkcolor'],
!                               
!                               'lang_from'             => 
$this->bo->xi['lang_from'],
!                               'lang_to'               => 
$this->bo->xi['lang_to'],
!                               'lang_cc'               => 
$this->bo->xi['lang_cc'],
!                               'lang_date'             => 
$this->bo->xi['lang_date'],
!                               'lang_files'    => $this->bo->xi['lang_files'],
!                               'lang_subject'  => 
$this->bo->xi['lang_subject'],
!                               
!                               // ----  From:  Message Data  -----
!                               'from_data_final'               => 
$this->bo->xi['from_data_final'],
!                               // ----  To:  Message Data  -----
!                               'to_data_final'                 => 
$this->bo->xi['to_data_final']
!                       );
!                       $GLOBALS['phpgw']->template->set_var($tpl_vars);
!                       
!                       // ----  Cc:  Message Data  -----
!                       //if (isset($msg_headers->cc) && 
count($msg_headers->cc) > 0)
!                       //      $this->bo->xi['
!                       if ( (isset($this->bo->xi['cc_data_final']))
!                       && ($this->bo->xi['cc_data_final'] != '') )
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('cc_data_final',$this->bo->xi['cc_data_final']);
!                               
$GLOBALS['phpgw']->template->parse('V_cc_data','B_cc_data');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('V_cc_data','');
!                       }
!                       
!                       // ---- Message Date  (set above)  -----
!                       
$GLOBALS['phpgw']->template->set_var('message_date',$this->bo->xi['message_date']);
!                       // ---- Message Subject  (set above)  -----
!                       
$GLOBALS['phpgw']->template->set_var('message_subject',$this->bo->xi['message_subject']);
!                       
!                       // ---- Attachments List  -----
!                       if ($this->bo->xi['list_of_files'] != '')
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('list_of_files',$this->bo->xi['list_of_files']);
!                               
$GLOBALS['phpgw']->template->parse('V_attach_list','B_attach_list');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('V_attach_list','');
!                       }
!                       
!                       
!                       $tpl_vars = Array(
!                               // ----  Images and Hrefs For Reply, ReplyAll, 
Forward, and Delete  -----
!                               'theme_font'            => 
$this->bo->xi['theme_font'],
!                               'theme_th_bg'           => 
$this->bo->xi['theme_th_bg'],
!                               'theme_row_on'          => 
$this->bo->xi['theme_row_on'],
!                               'reply_btns_bkcolor' => 
$this->bo->xi['reply_btns_bkcolor'],
!                               'reply_btns_text'       => 
$this->bo->xi['reply_btns_text'],
!                               
!                               'lnk_goback_folder'     => 
$this->bo->xi['lnk_goback_folder'],
!                               'ilnk_reply'            => 
$this->bo->xi['ilnk_reply'],
!                               'ilnk_replyall'         => 
$this->bo->xi['ilnk_replyall'],
!                               'ilnk_forward'          => 
$this->bo->xi['ilnk_forward'],
!                               'ilnk_delete'           => 
$this->bo->xi['ilnk_delete']
!                       );
!                       $GLOBALS['phpgw']->template->set_var($tpl_vars);
!                       
!                       
!                       // ---- DEBUG: Show Information About Each Part  -----
!                       //  the debug output needs updating
!                       if ($this->bo->debug > 0)
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('msg_body_info',$this->bo->xi['msg_body_info']);
!                               
$GLOBALS['phpgw']->template->parse('V_debug_parts','B_debug_parts');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('V_debug_parts','');
!                       }
!                       
!                       // -----  Message_Display Template Handles it from here 
 -------
!                       
$GLOBALS['phpgw']->template->set_var('theme_font',$this->bo->xi['theme_font']);
!                       
$GLOBALS['phpgw']->template->set_var('theme_th_bg',$this->bo->xi['theme_th_bg']);
!                       
$GLOBALS['phpgw']->template->set_var('theme_row_on',$this->bo->xi['theme_row_on']);
!                               
!                       // ----  so called "TOOLBAR" between the msg header 
data and the message siaplay
!                       
$GLOBALS['phpgw']->template->set_var('view_option',$this->bo->xi['view_option']);
!                       
$GLOBALS['phpgw']->template->set_var('view_headers_href',$this->bo->xi['view_headers_href']);
!                       
$GLOBALS['phpgw']->template->set_var('view_raw_message_href',$this->bo->xi['view_raw_message_href']);
!                       
!                       // -----  SHOW MESSAGE  -------
!                       //@set_time_limit(120);
!                       $count_part_nice = count($this->bo->part_nice);
!                       for ($i = 0; $i < $count_part_nice; $i++)
!                       {
!                               if ($this->bo->part_nice[$i]['d_instructions'] 
== 'show')
!                               {
!                                       
$GLOBALS['phpgw']->template->set_var('title_text',$this->bo->part_nice[$i]['title_text']);
!                                       
$GLOBALS['phpgw']->template->set_var('display_str',$this->bo->part_nice[$i]['display_str']);
!                                       
$GLOBALS['phpgw']->template->set_var('message_body',$this->bo->part_nice[$i]['message_body']);
!                                       
$GLOBALS['phpgw']->template->parse('V_display_part','B_display_part', True);
!                               }
!                               elseif 
($this->bo->part_nice[$i]['d_instructions'] == 'echo_out')
!                               {
!                                       // output a blank message body, we'll 
use an alternate method below
!                                       
$GLOBALS['phpgw']->template->set_var('V_display_part','');
!                                       // -----  Finished With Message_Mail 
Template, Output It
!                                       
$GLOBALS['phpgw']->template->pfp('out','T_message_main');
!                                       
!                                       // -----  Prepare a Table for this Echo 
Dump
!                                       
$GLOBALS['phpgw']->template->set_var('title_text',$this->bo->part_nice[$i]['title_text']);
!                                       
$GLOBALS['phpgw']->template->set_var('display_str',$this->bo->part_nice[$i]['display_str']);
!                                       
$GLOBALS['phpgw']->template->parse('V_setup_echo_dump','B_setup_echo_dump');
!                                       
$GLOBALS['phpgw']->template->set_var('V_done_echo_dump','');
!                                       
$GLOBALS['phpgw']->template->pfp('out','T_message_echo_dump');
!                                       
!                                       // -----  Prepare $msgball data for 
phpgw_fetchbody()
!                                       $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
!                                       $msgball['part_no'] = 
$this->bo->part_nice[$i]['m_part_num_mime'];
!                                       
!                                       // -----  Echo This Data Directly to 
the Client
!                                       // since the php version of this of 
b0rked for large msgs, perhaps use sockets code?
!                                       echo '<pre>';
!                                       echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
!                                       echo '</pre>';
!                                       // -----  Close Table
!                                       
$GLOBALS['phpgw']->template->set_var('V_setup_echo_dump','');
!                                       
$GLOBALS['phpgw']->template->parse('V_done_echo_dump','B_done_echo_dump');
!                                       
$GLOBALS['phpgw']->template->pfp('out','T_message_echo_dump');
!                                       
!                                       //  = = = =  = =======  CLEANUP AND 
EXIT PAGE ======= = = = = = =
!                                       $did_echo_dump = True;
!                                       break;
!                               }
!                       }
!                       //@set_time_limit(0);
!                       
!                       if ((isset($did_echo_dump))
!                       && ($did_echo_dump == True))
!                       {
!                               // DO NOTHING!
!                               // echo dump already outputted the template
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->pfp('out','T_message_main');
!                               //$GLOBALS['phpgw']->common->phpgw_footer();
!                       }
!                       // tell apache to release emeory back to the system on 
script end
!                       //apache_child_terminate();
! 
!                       // close down ALL mailserver streams
!                       $GLOBALS['phpgw']->msg->end_request();
!                       // destroy the object
!                       $GLOBALS['phpgw']->msg = '';
!                       unset($GLOBALS['phpgw']->msg);
!               }
!       }
! ?>
--- 1,277 ----
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - email UI Class for Message Lists                       
        *
!       * http://www.phpgroupware.org                                           
        *
!       * Written by Angelo (Angles) Puglisi <address@hidden>           *
!       * --------------------------------------------                          
                        *
!       *  This program is free software; you can redistribute it and/or modify 
it              *
!       *  under the terms of the GNU General Public License as published by 
the        *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your               *
!       *  option) any later version.                                           
                *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       /*!
!       @class uimessage
!       @abstract ?
!       */
!       class uimessage
!       {
!               var $bo;
!               var $widgets;
!               var $debug = 0;
! 
!               var $public_functions = array(
!                       'message' => True
!               );
! 
!               function uimessage()
!               {
!                       return;
!               }
! 
!               /*!
!               @function message
!               @abstract ?
!               */
!               function message()
!               {
!                       $this->bo = CreateObject("email.bomessage");
!                       $this->bo->message_data();
!                       
!                       // NOW we can out the header, because "index_data()" 
filled this global
!                       //      
$GLOBALS['phpgw_info']['flags']['email_refresh_uri']
!                       // which is needed to preserve folder and sort settings 
during the auto-refresh-ing
!                       // currently (Dec 6, 2001) that logic is in 
phpgwapi/inc/templates/idsociety/head.inc.php
!                       unset($GLOBALS['phpgw_info']['flags']['noheader']);
!                       unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
!                       $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
!                       $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
!                       $GLOBALS['phpgw']->common->phpgw_header();
!                       // HOWEVER still this class must NOT invoke 
$GLOBALS['phpgw']->common->phpgw_header()
!                       // even though we had to output the header (go 
figure... :)
!                       
!                       // ---- BEGIN UIMESSAGE
!                       $GLOBALS['phpgw']->template->set_file(array(
!                               'T_message_main' => 'message_main.tpl',
!                               'T_message_echo_dump' => 'message_echo_dump.tpl'
!                       ));
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_x-phpgw-type','V_x-phpgw-type');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_cc_data','V_cc_data');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_attach_list','V_attach_list');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_debug_parts','V_debug_parts');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_main','B_display_part','V_display_part');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_echo_dump','B_setup_echo_dump','V_setup_echo_dump');
!                       
$GLOBALS['phpgw']->template->set_block('T_message_echo_dump','B_done_echo_dump','V_done_echo_dump');
!                       
!                       //= = = = TOOLBAR WIDGET = = = 
!                       $this->widgets = CreateObject('email.html_widgets');
!                       
$GLOBALS['phpgw']->template->set_var('widget_toolbar',$this->widgets->get_toolbar());
!                       
!                       if (!empty($this->xi['msgtype']))
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('application',$this->bo->xi['application']);
!                               
$GLOBALS['phpgw']->template->parse('V_x-phpgw-type','B_x-phpgw-type');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('V_x-phpgw-type','');
!                       }
!                       
!                       //  ----  TOOL BAR / MENU BAR ----
!                       $tpl_vars = Array(
!                               //'accounts_label'              => 
$this->bo->xi['accounts_label'],
!                               //'ctrl_bar_font'                       => 
$this->bo->xi['ctrl_bar_font'],
!                               //'ctrl_bar_font_size'  => 
$this->bo->xi['ctrl_bar_font_size'],
!                               //'ctrl_bar_back1'              => 
$this->bo->xi['ctrl_bar_back1'],
!                               
!                               'bar_back1'             => '',
!                               //'bar_back1'           => 
$GLOBALS['phpgw_info']['theme']['table_bg'],
!                               //'bar_back1'           => 
$GLOBALS['phpgw_info']['theme']['bg08'],
!                               
!                               // ---- account switchbox  ----
!                               //'acctbox_listbox'             => 
$this->bo->xi['acctbox_listbox'],
!                               //'ilnk_accounts'                       => 
$this->bo->xi['ilnk_accounts'],
!                               //'acctbox_frm_name'            => 
$this->bo->xi['acctbox_frm_name'],
!                               //'acctbox_action'              => 
$this->bo->xi['acctbox_action'],
!                               // ---- Move Message Box  ----
!                               'move_current_sort'             => 
$this->bo->xi['move_current_sort'],
!                               'move_current_order'    => 
$this->bo->xi['move_current_order'],
!                               'move_current_start'    => 
$this->bo->xi['move_current_start'],
!                               'mlist_checkbox_name'   => 
$this->bo->xi['mlist_checkbox_name'],
!                                               
!                               'mlist_embedded_uri'    => 
$this->bo->xi['mlist_embedded_uri'],
!                               'frm_delmov_action'             => 
$this->bo->xi['frm_delmov_action'],
!                               'frm_delmov_name'               => 
$this->bo->xi['frm_delmov_name'],
!                               'delmov_listbox'                => 
$this->bo->xi['delmov_listbox'],
!                               'move_postmove_goto_name'       => 
$this->bo->xi['move_postmove_goto_name'],
!                               'move_postmove_goto_value'      => 
$this->bo->xi['move_postmove_goto_value'],
!                               
!                               'ilnk_prev_msg'                 => 
$this->bo->xi['ilnk_prev_msg'],
!                               'ilnk_next_msg'                 => 
$this->bo->xi['ilnk_next_msg'],
!                               
!                               // ----  Labels and Colors for From, To, CC, 
Files, and Subject  -----
!                               'tofrom_labels_bkcolor' => 
$this->bo->xi['tofrom_labels_bkcolor'],
!                               'tofrom_data_bkcolor'   => 
$this->bo->xi['tofrom_data_bkcolor'],
!                               
!                               'lang_from'             => 
$this->bo->xi['lang_from'],
!                               'lang_to'               => 
$this->bo->xi['lang_to'],
!                               'lang_cc'               => 
$this->bo->xi['lang_cc'],
!                               'lang_date'             => 
$this->bo->xi['lang_date'],
!                               'lang_files'    => $this->bo->xi['lang_files'],
!                               'lang_subject'  => 
$this->bo->xi['lang_subject'],
!                               
!                               // ----  From:  Message Data  -----
!                               'from_data_final'               => 
$this->bo->xi['from_data_final'],
!                               // ----  To:  Message Data  -----
!                               'to_data_final'                 => 
$this->bo->xi['to_data_final']
!                       );
!                       $GLOBALS['phpgw']->template->set_var($tpl_vars);
!                       
!                       // ----  Cc:  Message Data  -----
!                       //if (isset($msg_headers->cc) && 
count($msg_headers->cc) > 0)
!                       //      $this->bo->xi['
!                       if ( (isset($this->bo->xi['cc_data_final']))
!                       && ($this->bo->xi['cc_data_final'] != '') )
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('cc_data_final',$this->bo->xi['cc_data_final']);
!                               
$GLOBALS['phpgw']->template->parse('V_cc_data','B_cc_data');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('V_cc_data','');
!                       }
!                       
!                       // ---- Message Date  (set above)  -----
!                       
$GLOBALS['phpgw']->template->set_var('message_date',$this->bo->xi['message_date']);
!                       // ---- Message Subject  (set above)  -----
!                       
$GLOBALS['phpgw']->template->set_var('message_subject',$this->bo->xi['message_subject']);
!                       
!                       // ---- Attachments List  -----
!                       if ($this->bo->xi['list_of_files'] != '')
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('list_of_files',$this->bo->xi['list_of_files']);
!                               
$GLOBALS['phpgw']->template->parse('V_attach_list','B_attach_list');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('V_attach_list','');
!                       }
!                       
!                       
!                       $tpl_vars = Array(
!                               // ----  Images and Hrefs For Reply, ReplyAll, 
Forward, and Delete  -----
!                               'theme_font'            => 
$this->bo->xi['theme_font'],
!                               'theme_th_bg'           => 
$this->bo->xi['theme_th_bg'],
!                               'theme_row_on'          => 
$this->bo->xi['theme_row_on'],
!                               'reply_btns_bkcolor' => 
$this->bo->xi['reply_btns_bkcolor'],
!                               'reply_btns_text'       => 
$this->bo->xi['reply_btns_text'],
!                               
!                               'lnk_goback_folder'     => 
$this->bo->xi['lnk_goback_folder'],
!                               'ilnk_reply'            => 
$this->bo->xi['ilnk_reply'],
!                               'ilnk_replyall'         => 
$this->bo->xi['ilnk_replyall'],
!                               'ilnk_forward'          => 
$this->bo->xi['ilnk_forward'],
!                               'ilnk_delete'           => 
$this->bo->xi['ilnk_delete']
!                       );
!                       $GLOBALS['phpgw']->template->set_var($tpl_vars);
!                       
!                       
!                       // ---- DEBUG: Show Information About Each Part  -----
!                       //  the debug output needs updating
!                       if ($this->bo->debug > 0)
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('msg_body_info',$this->bo->xi['msg_body_info']);
!                               
$GLOBALS['phpgw']->template->parse('V_debug_parts','B_debug_parts');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('V_debug_parts','');
!                       }
!                       
!                       // -----  Message_Display Template Handles it from here 
 -------
!                       
$GLOBALS['phpgw']->template->set_var('theme_font',$this->bo->xi['theme_font']);
!                       
$GLOBALS['phpgw']->template->set_var('theme_th_bg',$this->bo->xi['theme_th_bg']);
!                       
$GLOBALS['phpgw']->template->set_var('theme_row_on',$this->bo->xi['theme_row_on']);
!                               
!                       // ----  so called "TOOLBAR" between the msg header 
data and the message siaplay
!                       
$GLOBALS['phpgw']->template->set_var('view_option',$this->bo->xi['view_option']);
!                       
$GLOBALS['phpgw']->template->set_var('view_headers_href',$this->bo->xi['view_headers_href']);
!                       
$GLOBALS['phpgw']->template->set_var('view_raw_message_href',$this->bo->xi['view_raw_message_href']);
!                       
!                       // -----  SHOW MESSAGE  -------
!                       //@set_time_limit(120);
!                       $count_part_nice = count($this->bo->part_nice);
!                       for ($i = 0; $i < $count_part_nice; $i++)
!                       {
!                               if ($this->bo->part_nice[$i]['d_instructions'] 
== 'show')
!                               {
!                                       
$GLOBALS['phpgw']->template->set_var('title_text',$this->bo->part_nice[$i]['title_text']);
!                                       
$GLOBALS['phpgw']->template->set_var('display_str',$this->bo->part_nice[$i]['display_str']);
!                                       
$GLOBALS['phpgw']->template->set_var('message_body',$this->bo->part_nice[$i]['message_body']);
!                                       
$GLOBALS['phpgw']->template->parse('V_display_part','B_display_part', True);
!                               }
!                               elseif 
($this->bo->part_nice[$i]['d_instructions'] == 'echo_out')
!                               {
!                                       // output a blank message body, we'll 
use an alternate method below
!                                       
$GLOBALS['phpgw']->template->set_var('V_display_part','');
!                                       // -----  Finished With Message_Mail 
Template, Output It
!                                       
$GLOBALS['phpgw']->template->pfp('out','T_message_main');
!                                       
!                                       // -----  Prepare a Table for this Echo 
Dump
!                                       
$GLOBALS['phpgw']->template->set_var('title_text',$this->bo->part_nice[$i]['title_text']);
!                                       
$GLOBALS['phpgw']->template->set_var('display_str',$this->bo->part_nice[$i]['display_str']);
!                                       
$GLOBALS['phpgw']->template->parse('V_setup_echo_dump','B_setup_echo_dump');
!                                       
$GLOBALS['phpgw']->template->set_var('V_done_echo_dump','');
!                                       
$GLOBALS['phpgw']->template->pfp('out','T_message_echo_dump');
!                                       
!                                       // -----  Prepare $msgball data for 
phpgw_fetchbody()
!                                       $msgball = 
$GLOBALS['phpgw']->msg->get_arg_value('msgball');
!                                       $msgball['part_no'] = 
$this->bo->part_nice[$i]['m_part_num_mime'];
!                                       
!                                       // -----  Echo This Data Directly to 
the Client
!                                       // since the php version of this of 
b0rked for large msgs, perhaps use sockets code?
!                                       echo '<pre>';
!                                       echo 
$GLOBALS['phpgw']->msg->phpgw_fetchbody($msgball);
!                                       echo '</pre>';
!                                       // -----  Close Table
!                                       
$GLOBALS['phpgw']->template->set_var('V_setup_echo_dump','');
!                                       
$GLOBALS['phpgw']->template->parse('V_done_echo_dump','B_done_echo_dump');
!                                       
$GLOBALS['phpgw']->template->pfp('out','T_message_echo_dump');
!                                       
!                                       //  = = = =  = =======  CLEANUP AND 
EXIT PAGE ======= = = = = = =
!                                       $did_echo_dump = True;
!                                       break;
!                               }
!                       }
!                       //@set_time_limit(0);
!                       
!                       if ((isset($did_echo_dump))
!                       && ($did_echo_dump == True))
!                       {
!                               // DO NOTHING!
!                               // echo dump already outputted the template
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->pfp('out','T_message_main');
!                               //$GLOBALS['phpgw']->common->phpgw_footer();
!                       }
!                       if (isset($this->bo->xi['application']))
!                       {
!                               global $calendar_id;
!                               $calendar_id = $this->bo->xi['calendar_id'];
!                               
$GLOBALS['phpgw']->hooks->single('email',$this->bo->xi['application']);
! 
!                       }
!                       // tell apache to release emeory back to the system on 
script end
!                       //apache_child_terminate();
! 
!                       // close down ALL mailserver streams
!                       $GLOBALS['phpgw']->msg->end_request();
!                       // destroy the object
!                       $GLOBALS['phpgw']->msg = '';
!                       unset($GLOBALS['phpgw']->msg);
!               }
!       }
! ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]