[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] folders/inc class.bofolders.inc.php,1.1.1.1,1.2
From: |
Philipp Kamps <address@hidden> |
Subject: |
[Phpgroupware-cvs] folders/inc class.bofolders.inc.php,1.1.1.1,1.2 |
Date: |
Fri, 07 Nov 2003 17:01:12 +0000 |
Update of /cvsroot/phpgroupware/folders/inc
In directory subversions:/tmp/cvs-serv17321/inc
Modified Files:
class.bofolders.inc.php
Log Message:
function get_mailFolders a lot more smarter. Several mail accounts allowed.
Proper representation of the mail folder hierarchy (even for MS Exchange)
Index: class.bofolders.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/folders/inc/class.bofolders.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** class.bofolders.inc.php 4 Nov 2003 12:10:23 -0000 1.1.1.1
--- class.bofolders.inc.php 7 Nov 2003 17:01:09 -0000 1.2
***************
*** 16,20 ****
include ('folders/phplayersmenu/lib/layersmenu-common.inc.php');
include ('folders/phplayersmenu/lib/treemenu.inc.php');
! include ('folders/phplayersmenu/lib/phpgw-treemenu.inc.php');
--- 16,20 ----
include ('folders/phplayersmenu/lib/layersmenu-common.inc.php');
include ('folders/phplayersmenu/lib/treemenu.inc.php');
! include ('folders/inc/class.treemenu.inc.php');
***************
*** 79,142 ****
$this->msg_bootstrap =
CreateObject("email.msg_bootstrap");
$this->msg_bootstrap->ensure_mail_msg_exists('email.bofolder.folder',
$this->debug);
! $account_list = $this->bo->ex_accounts_list();
! $account_num[] = array('acctnum' => '0',
! 'status' => 'enabled',
! 'display_string' => 'Mailbox'
! );
! $account_list = array_merge($account_list,$account_num);
! sort($account_list);
! $return = array();
! /**
! $acctnum = $val['acctnum'];
! $display = $val['display_string'];
! $intdisp = strrpos($display,"]");
! $username = ltrim(substr($display,$intdisp),"]");
! }
! $ind_folder_list =
$GLOBALS['phpgw']->msg->get_arg_value('folder_list',$acctnum);
! $folder_list = array_merge($folder_list,$ind_folder_list);
! **/
! foreach ($account_list as $key => $val)
{
! if ($val['status'] == 'enabled')
! {
! if ($val['display_string'] == '')
! {
! $val['display_string'] =
'Mailbox';
! }
! $return[] = array( 'id' => $val['display_string'],
! 'name' => $val['display_string'],
! 'parent_id' => '0',
! 'icon' => 'email.png'
! );
!
! // what is it?
! $ind_folder_list =
$GLOBALS['phpgw']->msg->get_arg_value('folder_list',$val['acctnum']);
! $folder_list =
array_merge($folder_list,$ind_folder_list);
! for ($i=0; $i < count($folder_list); ++$i)
! {
! $return[] = array ( 'id' =>
$folder_list[$i]['folder_short'],
! 'name' =>
$folder_list[$i]['folder_short'],
! 'title' =>
$folder_list[$i]['folder_long'],
! 'icon' => 'email.png',
! 'parent_id' => $val['display_string'],
! 'href' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uiindex.index&fldball[folder]='.$GLOBALS['phpgw']->msg->prep_folder_out($folder_list[$i]['folder_long']).'&fldball[acctnum]='.$acctnum),
! 'target' => '_parent'
! );
! //$acctnum = $folder_list[$i]['acctnum'];
! //??
! if ($folder_list[$i]['folder_long'] == 'INBOX')
{
! $folder_list[$i]['postbox'] = $acctnum;
}
}
! }
! }
! return $return;
! }
! }
\ No newline at end of file
--- 79,170 ----
$this->msg_bootstrap =
CreateObject("email.msg_bootstrap");
$this->msg_bootstrap->ensure_mail_msg_exists('email.bofolder.folder',
$this->debug);
!
! $standard_account = array ('acctnum' => 0,
! 'status' =>
'enabled',
! 'display_string' => '[0]
standard'
! );
! $extra_account_list = $this->bo->ex_accounts_list();
!
! array_unshift($extra_account_list, $standard_account);
! $account_list = $extra_account_list;
! $return = array();
! for ($i=0; $i < count($account_list); $i++)
{
! if ($account_list[$i]['status'] == 'enabled')
! {
! $account_name =
substr($account_list[$i]['display_string'],(strrpos($account_list[$i]['display_string'],']')+2));
! $account_name = lang('mailbox').'
\''.$account_name.'\'';
! $return[] = array('id' =>
strval($account_list[$i]['acctnum']+1),
! 'name' =>
$account_name,
! 'parent_id' => '0',
! 'icon' => 'email.png'
! );
! $folder_list_i =
$GLOBALS['phpgw']->msg->get_arg_value('folder_list',$account_list[$i]['acctnum']);
! for ($j=0; $j < count($folder_list_i);
$j++)
! {
!
! $separator =
$this->get_IMAP_folder_separator($folder_list_i[$j]['folder_long']);
! $path = explode($separator,
$folder_list_i[$j]['folder_long']);
! // calculate parent folder
! if (count($path) == 1)
! {
! $parent =
strval($account_list[$i]['acctnum']+1);
! }
! else
! {
! //special handling for
the courir server
! if ( $path[count($path)
- 2] == 'INBOX' && $separator == '.' )
! {
! $parent =
strval($account_list[$i]['acctnum']+1);
! }
! else
! {
! $parent =
$path[count($path) - 2].strval($account_list[$i]['acctnum']+1);
! }
! }
!
! // parse link to view email
folder
! $folderName =
$GLOBALS['phpgw']->msg->prep_folder_out($folder_list_i[$j]['folder_long']);
! $folderLink =
$GLOBALS['phpgw']->link('/index.php','menuaction=email.uiindex.index'.
!
'&fldball[folder]='.$folderName.
!
'&fldball[acctnum]='.$account_list[$i]['acctnum']
!
);
!
! $return[] = array ('id'
=> $path[count($path)-1].strval($account_list[$i]['acctnum']+1),
! 'name'
=> $path[count($path)-1],
! 'title'
=> $folder_list_i[$j]['folder_long'],
! 'icon'
=> 'email.png',
! 'parent_id' =>
$parent,
! 'href' =>
$folderLink,
! 'target' =>
'_parent'
! );
! }
! }
! }
! return $return;
! }
! function get_IMAP_folder_separator($string)
{
! //exchange
! if (strpos($string, '/'))
! {
! $separator = '/';
}
+ //courir
+ elseif (strpos($string, '.'))
+ {
+ $separator = '.';
+ }
+ else
+ {
+ $separator = 'I doubt this string is used
somewhere';
+ }
+ return $separator;
}
! }
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] folders/inc class.bofolders.inc.php,1.1.1.1,1.2,
Philipp Kamps <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] folders/templates/default helpers.tpl, NONE, 1.1 style.css, 1.1.1.1, 1.2
- Next by Date:
[Phpgroupware-cvs] admin/inc class.boaclmanager.inc.php, 1.3, 1.4 class.uiaclmanager.inc.php, 1.8, 1.9
- Previous by thread:
[Phpgroupware-cvs] folders/templates/default helpers.tpl, NONE, 1.1 style.css, 1.1.1.1, 1.2
- Next by thread:
[Phpgroupware-cvs] admin/inc class.boaclmanager.inc.php, 1.3, 1.4 class.uiaclmanager.inc.php, 1.8, 1.9
- Index(es):