From e50ac5b40d95afe162e56a0b446f9bcbb5e78a63 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 12 Feb 2013 08:28:04 +0000 Subject: [PATCH] sidebar stuff --- mail/inc/class.mail_ui.inc.php | 19 ++++++++++--------- mail/setup/setup.inc.php | 4 +--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index da203d39fe..6c73391980 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -253,7 +253,7 @@ class mail_ui /** * getFolderTree, get folders from server and prepare the folder tree - * + * @param bool $_fetchCounters, wether to fetch extended information on folders * @return array something like that: array( * '/INBOX'=>array('label'=>'INBOX','title'=>'INBOX','image'=>'kfm_home.png'), * '/INBOX/sub'=>array('label'=>'sub','title'=>'INBOX/sub'), @@ -261,7 +261,7 @@ class mail_ui * '/user/birgit' => 'birgit', * ); */ - function getFolderTree() + function getFolderTree($_fetchCounters=false) { $folderObjects = $this->mail_bo->getFolderObjects(); $trashFolder = $this->mail_bo->getTrashFolder(); @@ -276,32 +276,33 @@ class mail_ui //_debug_array($folderObjects); foreach($folderObjects as $key => $obj) { - $fS = $this->mail_bo->getFolderStatus($key); + if ($_fetchCounters) $fS = $this->mail_bo->getFolderStatus($key); //_debug_array($fS); $path = str_replace($obj->delimiter,'/',$obj->folderName); $oA =array('label'=> $obj->shortDisplayName, 'title'=> $obj->displayName); if ($fS['unseen']) $oA['label'] = ''.$oA['label'].' ('.$fS['unseen'].')'; if ($path=='INBOX') { - $oA['image'] = 'kfm_home.png'; + $oA['im0'] = 'kfm_home.png'; } elseif (in_array($obj->shortFolderName,mail_bo::$autoFolders)) { //echo $obj->shortFolderName.'
'; - $oA['image'] = $image1 = $image2 = $image3 = "MailFolder".$obj->shortFolderName.".png"; + $oA['im0'] = "MailFolder".$obj->shortFolderName.".png"; //$image2 = "'MailFolderPlain.png'"; //$image3 = "'MailFolderPlain.png'"; } elseif (in_array($key,$userDefinedFunctionFolders)) { $_key = array_search($key,$userDefinedFunctionFolders); - $oA['image'] = $image1 = $image2 = $image3 = "MailFolder".$_key.".png"; + $oA['im0'] = "MailFolder".$_key.".png"; } else { - $oA['image'] = $image1 = "MailFolderPlain.png"; // one Level - $image2 = "folderOpen.gif"; - if (stripos(array2string($fS['attributes']),'\hasChildren')!== false) $oA['image'] = $image3 = "MailFolderClosed.png"; // has Children + $oA['im0'] = "MailFolderPlain.png"; // one Level + $oA['im1'] = "folderOpen.gif"; +//if (stripos(array2string($fS['attributes']),'\hasChildren')!== false) + $oA['im2'] = "MailFolderClosed.png"; // has Children } $out[$path] = $oA; diff --git a/mail/setup/setup.inc.php b/mail/setup/setup.inc.php index a9b0151b92..8e0aabe962 100644 --- a/mail/setup/setup.inc.php +++ b/mail/setup/setup.inc.php @@ -36,12 +36,10 @@ $setup_info['mail']['hooks']['settings'] = 'mail_hooks::settings'; $setup_info['mail']['hooks']['preferences'] = 'mail_hooks::preferences'; $setup_info['mail']['hooks']['sidebox_menu'] = 'mail_hooks::sidebox_menu'; $setup_info['mail']['hooks']['session_creation'] = 'mail_bo::resetConnectionErrorCache'; +$setup_info['mail']['hooks']['verify_settings'] = 'mail_bo::forcePrefReload'; /* - $setup_info['mail']['hooks'][] = 'home'; -$setup_info['mail']['hooks']['verify_settings'] = 'mail_bo::forcePrefReload'; -$setup_info['mail']['hooks']['edit_user'] = 'mail_hooks::adminMenu'; */ /* Dependencies for this app to work */