mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-25 14:51:35 +01:00
* email: Sort FunctionFolders to the top of the FolderTree in MainView (all MailBox FolderTree Views are affected)
This commit is contained in:
parent
c3bd75e917
commit
6b6ddacd0a
@ -61,7 +61,7 @@
|
||||
* foldernames are subject to translation, keep that in mind too, if you change names here.
|
||||
* @var array
|
||||
*/
|
||||
var $autoFolders = array('Drafts', 'Junk', 'Sent', 'Trash', 'Templates');
|
||||
static $autoFolders = array('Drafts', 'Templates', 'Sent', 'Trash', 'Junk');
|
||||
|
||||
/**
|
||||
* Autoload classes from emailadmin, 'til they get autoloading conform names
|
||||
@ -1277,7 +1277,7 @@
|
||||
$retValue['shortDisplayName'] = lang('INBOX');
|
||||
}
|
||||
// translate the automatic Folders (Sent, Drafts, ...) like the INBOX
|
||||
elseif (in_array($retValue['shortName'],$this->autoFolders))
|
||||
elseif (in_array($retValue['shortName'],self::$autoFolders))
|
||||
{
|
||||
$retValue['displayName'] = $retValue['shortDisplayName'] = lang($retValue['shortName']);
|
||||
}
|
||||
@ -1350,7 +1350,7 @@
|
||||
$_subscribedOnly = false;
|
||||
}
|
||||
#$inboxData->attributes = 64;
|
||||
$folders = array('INBOX' => $inboxData);
|
||||
$inboxFolderObject = array('INBOX' => $inboxData);
|
||||
#_debug_array($folders);
|
||||
|
||||
$nameSpace = $this->icServer->getNameSpaces();
|
||||
@ -1458,9 +1458,9 @@
|
||||
}
|
||||
if ($this->mailPreferences->preferences['notavailableautofolders'] && !empty($this->mailPreferences->preferences['notavailableautofolders']))
|
||||
{
|
||||
$foldersToCheck = array_diff($this->autoFolders,explode(',',$this->mailPreferences->preferences['notavailableautofolders']));
|
||||
$foldersToCheck = array_diff(self::$autoFolders,explode(',',$this->mailPreferences->preferences['notavailableautofolders']));
|
||||
} else {
|
||||
$foldersToCheck = $this->autoFolders;
|
||||
$foldersToCheck = self::$autoFolders;
|
||||
}
|
||||
#echo "foldersToCheck:";_debug_array($foldersToCheck);
|
||||
foreach($foldersToCheck as $personalFolderName) {
|
||||
@ -1550,8 +1550,9 @@
|
||||
$folderObject->displayName = lang('INBOX');
|
||||
$folderObject->shortDisplayName = lang('INBOX');
|
||||
$folderObject->subscribed = true;
|
||||
|
||||
// translate the automatic Folders (Sent, Drafts, ...) like the INBOX
|
||||
} elseif (in_array($shortName,$this->autoFolders)) {
|
||||
} elseif (in_array($shortName,self::$autoFolders)) {
|
||||
$tmpfolderparts = explode($delimiter,$folderObject->folderName);
|
||||
array_pop($tmpfolderparts);
|
||||
$folderObject->displayName = $this->encodeFolderName(implode($delimiter,$tmpfolderparts).$delimiter.lang($shortName));
|
||||
@ -1562,13 +1563,21 @@
|
||||
$folderObject->shortDisplayName = $this->encodeFolderName($shortName);
|
||||
}
|
||||
$folderName = $folderName;
|
||||
if (in_array($shortName,self::$autoFolders)) {
|
||||
$autoFolderObjects[$folderName] = $folderObject;
|
||||
} else {
|
||||
$folders[$folderName] = $folderObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
uasort($folders,array($this,"sortByDisplayName"));
|
||||
//_debug_array($folders); #exit;
|
||||
return $folders;
|
||||
}
|
||||
if (is_array($autoFolderObjects)) {
|
||||
uasort($autoFolderObjects,array($this,"sortByAutoFolderPos"));
|
||||
}
|
||||
if (is_array($folders)) uasort($folders,array($this,"sortByDisplayName"));
|
||||
$folders2return = array_merge($autoFolderObjects,$folders);
|
||||
//_debug_array($folders2return); #exit;
|
||||
return array_merge($inboxFolderObject,(array)$autoFolderObjects,(array)$folders);
|
||||
}
|
||||
|
||||
function sortByDisplayName($a,$b)
|
||||
@ -1577,6 +1586,15 @@
|
||||
return strcasecmp($a->displayName,$b->displayName);
|
||||
}
|
||||
|
||||
function sortByAutoFolderPos($a,$b)
|
||||
{
|
||||
// 0, 1 und -1
|
||||
$pos1 = array_search($a->shortFolderName,self::$autoFolders);
|
||||
$pos2 = array_search($b->shortFolderName,self::$autoFolders);
|
||||
if ($pos1 == $pos2) return 0;
|
||||
return ($pos1 < $pos2) ? -1 : 1;
|
||||
}
|
||||
|
||||
function getMailBoxCounters($folderName)
|
||||
{
|
||||
$folderStatus = $this->icServer->getStatus($folderName);
|
||||
|
@ -56,7 +56,7 @@ class felamimail_hooks
|
||||
}
|
||||
|
||||
$availableAutoFolders['none'] = lang('none, create all');
|
||||
foreach($bofelamimail->autoFolders as $aname) {
|
||||
foreach(bofelamimail::$autoFolders as $aname) {
|
||||
$availableAutoFolders[$aname] = lang($aname);
|
||||
}
|
||||
|
||||
|
@ -147,9 +147,23 @@
|
||||
#_debug_array($allFolders);
|
||||
foreach($allFolders as $longName => $obj) {
|
||||
$messageCount = '';
|
||||
$image1 = "'folderClosed.gif'";
|
||||
$image2 = "0";
|
||||
$image3 = "0";
|
||||
|
||||
if (in_array($obj->shortFolderName,bofelamimail::$autoFolders))
|
||||
{
|
||||
//echo $obj->shortFolderName.'<br>';
|
||||
$image1 = $image2 = $image3 = "'MailFolder".$obj->shortFolderName.".png'";
|
||||
//$image2 = "'MailFolderPlain.png'";
|
||||
//$image3 = "'MailFolderPlain.png'";
|
||||
}
|
||||
elseif (in_array($longName,$userDefinedFunctionFolders))
|
||||
{
|
||||
$key = array_search($longName,$userDefinedFunctionFolders);
|
||||
$image1 = $image2 = $image3 = "'MailFolder".$key.".png'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$image1 = $image2 = $image3 = "'folderClosed.gif'";
|
||||
}
|
||||
|
||||
$folderParts = explode($obj->delimiter, $longName);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user