* Mail: fixed icons for special use folders did not use folders set in mail account

This commit is contained in:
Ralf Becker 2014-11-05 16:52:25 +00:00
parent 26ddee7b9d
commit b522552e3e

View File

@ -767,15 +767,14 @@ class mail_ui
$folderObjects = $this->mail_bo->getFolderObjects($_subscribedOnly,false,false,$_useCacheIfPossible); $folderObjects = $this->mail_bo->getFolderObjects($_subscribedOnly,false,false,$_useCacheIfPossible);
//$endtime = microtime(true) - $starttime; //$endtime = microtime(true) - $starttime;
//error_log(__METHOD__.__LINE__.' Fetching folderObjects took: '.$endtime); //error_log(__METHOD__.__LINE__.' Fetching folderObjects took: '.$endtime);
$trashFolder = $this->mail_bo->getTrashFolder(false); $userDefinedFunctionFolders = array(
$templateFolder = $this->mail_bo->getTemplateFolder(false); 'Trash' => $this->mail_bo->getTrashFolder(false),
$draftFolder = $this->mail_bo->getDraftFolder(false); 'Templates' => $this->mail_bo->getTemplateFolder(false),
$sentFolder = $this->mail_bo->getSentFolder(false); 'Drafts' => $this->mail_bo->getDraftFolder(false),
$userDefinedFunctionFolders = array(); 'Sent' => $this->mail_bo->getSentFolder(false),
if (isset($trashFolder) && $trashFolder != 'none') $userDefinedFunctionFolders['Trash'] = $trashFolder; 'Junk' => $this->mail_bo->getJunkFolder(false),
if (isset($sentFolder) && $sentFolder != 'none') $userDefinedFunctionFolders['Sent'] = $sentFolder; 'Outbox' => $this->mail_bo->getOutboxFolder(false),
if (isset($draftFolder) && $draftFolder != 'none') $userDefinedFunctionFolders['Drafts'] = $draftFolder; );
if (isset($templateFolder) && $templateFolder != 'none') $userDefinedFunctionFolders['Templates'] = $templateFolder;
} }
catch (Exception $e) catch (Exception $e)
{ {
@ -863,7 +862,7 @@ class mail_ui
// the rest of the array is the name of the parent // the rest of the array is the name of the parent
$parentName = implode((array)$folderParts,$obj->delimiter); $parentName = implode((array)$folderParts,$obj->delimiter);
$parentName = $this->mail_bo->profileID.self::$delimiter.$parentName; $parentName = $this->mail_bo->profileID.self::$delimiter.$parentName;
$oA =array('text'=> $obj->shortDisplayName, 'tooltip'=> $obj->displayName); $oA =array('text'=> $obj->shortDisplayName, 'tooltip'=> $obj->folderName);
array_unshift($fFP,$this->mail_bo->profileID); array_unshift($fFP,$this->mail_bo->profileID);
$oA['path'] = $fFP; $oA['path'] = $fFP;
$path = $key; $path = $key;
@ -873,15 +872,10 @@ class mail_ui
// mark on inbox if ACL is supported // mark on inbox if ACL is supported
$oA['data'] = array('acl' => $this->mail_bo->icServer->queryCapability('ACL')); $oA['data'] = array('acl' => $this->mail_bo->icServer->queryCapability('ACL'));
} }
elseif (in_array($obj->shortFolderName,mail_bo::$autoFolders)) elseif (($_key = array_search($obj->folderName, $userDefinedFunctionFolders)) !== false)
{ {
$oA['text'] = lang($oA['text']); $oA['text'] = lang($_key);
$oA['im0'] = $oA['im1']= $oA['im2'] = "MailFolder".$obj->shortFolderName.".png";
}
elseif (in_array($key,$userDefinedFunctionFolders))
{
$_key = array_search($key,$userDefinedFunctionFolders);
$oA['im0'] = $oA['im1']= $oA['im2'] = "MailFolder".$_key.".png"; $oA['im0'] = $oA['im1']= $oA['im2'] = "MailFolder".$_key.".png";
} }
else else