FolderList:sort folders by displayname, preference to show all (subscribed/unsubscribed) Folders in MainView FolderPane, (default is NO)

This commit is contained in:
Klaus Leithoff 2010-04-09 11:20:22 +00:00
parent f8c6e7d25f
commit 6694e6d351
2 changed files with 30 additions and 4 deletions

View File

@ -1325,6 +1325,13 @@
*/
$inboxData->counter = self::getMailBoxCounters('INBOX');
}
// force unsubscribed by preference showAllFoldersInFolderPane
if ($_subscribedOnly == true &&
isset($this->mailPreferences->preferences['showAllFoldersInFolderPane']) &&
$this->mailPreferences->preferences['showAllFoldersInFolderPane']==1)
{
$_subscribedOnly = false;
}
#$inboxData->attributes = 64;
$folders = array('INBOX' => $inboxData);
#_debug_array($folders);
@ -1528,22 +1535,32 @@
$folderObject->subscribed = true;
// translate the automatic Folders (Sent, Drafts, ...) like the INBOX
} elseif (in_array($shortName,$this->autoFolders)) {
$folderObject->displayName = $folderObject->shortDisplayName = lang($shortName);
$tmpfolderparts = explode($delimiter,$folderObject->folderName);
array_pop($tmpfolderparts);
$folderObject->displayName = $this->encodeFolderName(implode($delimiter,$tmpfolderparts).$delimiter.lang($shortName));
$folderObject->shortDisplayName = lang($shortName);
unset($tmpfolderparts);
} else {
$folderObject->displayName = $this->encodeFolderName($folderObject->folderName);
$folderObject->shortDisplayName = $this->encodeFolderName($shortName);
}
$folderName = $folderName;
$folders[$folderName] = $folderObject;
$sortby[$folderName] = $folderObject->displayName;
}
}
}
#_debug_array($folders); #exit;
uasort($folders,array($this,"sortByDisplayName"));
//_debug_array($folders); #exit;
return $folders;
}
function sortByDisplayName($a,$b)
{
// 0, 1 und -1
return strcasecmp($a->displayName,$b->displayName);
}
function getMailBoxCounters($folderName)
{
$folderStatus = $this->icServer->getStatus($folderName);

View File

@ -387,6 +387,15 @@ class felamimail_hooks
'xmlrpc' => True,
'admin' => False,
),
'showAllFoldersInFolderPane' => array(
'type' => 'select',
'label' => 'show all Folders (subscribed AND unsubscribed) in Main Screen Folder Pane',
'name' => 'showAllFoldersInFolderPane',
'values' => $no_yes,
'xmlrpc' => True,
'default'=> 0,
'admin' => False,
),
'sieveScriptName' => array(
'type' => 'input',
'label' => 'sieve script name',