mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Determine the number of unread messages in all folders.
This commit is contained in:
parent
975947a948
commit
b7c4aad3db
16 changed files with 499 additions and 262 deletions
|
|
@ -3417,7 +3417,7 @@ class Actions
|
|||
$aFlagsFilteredUids = array();
|
||||
if (0 < strlen($sFlagsUids))
|
||||
{
|
||||
$aFlagsUids = explode(',', (string) $this->GetActionParam('FlagsUids', ''));
|
||||
$aFlagsUids = explode(',', $sFlagsUids);
|
||||
$aFlagsFilteredUids = array_filter($aFlagsUids, function (&$sUid) {
|
||||
$sUid = (int) trim($sUid);
|
||||
return 0 < (int) trim($sUid);
|
||||
|
|
@ -3431,15 +3431,18 @@ class Actions
|
|||
try
|
||||
{
|
||||
$aInboxInformation = $this->MailClient()->FolderInformation($sFolder, $sPrevUidNext, $aFlagsFilteredUids);
|
||||
foreach ($aInboxInformation['Flags'] as $iUid => $aFlags)
|
||||
if (\is_array($aInboxInformation) && isset($aInboxInformation['Flags']) && \is_array($aInboxInformation['Flags']))
|
||||
{
|
||||
$aLowerFlags = array_map('strtolower', $aFlags);
|
||||
$aInboxInformation['Flags'][$iUid] = array(
|
||||
'IsSeen' => in_array('\\seen', $aLowerFlags),
|
||||
'IsFlagged' => in_array('\\flagged', $aLowerFlags),
|
||||
'IsAnswered' => in_array('\\answered', $aLowerFlags),
|
||||
'IsForwarded' => 0 < strlen($sForwardedFlag) && in_array(strtolower($sForwardedFlag), $aLowerFlags)
|
||||
);
|
||||
foreach ($aInboxInformation['Flags'] as $iUid => $aFlags)
|
||||
{
|
||||
$aLowerFlags = array_map('strtolower', $aFlags);
|
||||
$aInboxInformation['Flags'][$iUid] = array(
|
||||
'IsSeen' => in_array('\\seen', $aLowerFlags),
|
||||
'IsFlagged' => in_array('\\flagged', $aLowerFlags),
|
||||
'IsAnswered' => in_array('\\answered', $aLowerFlags),
|
||||
'IsForwarded' => 0 < strlen($sForwardedFlag) && in_array(strtolower($sForwardedFlag), $aLowerFlags)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
|
|
@ -3455,6 +3458,47 @@ class Actions
|
|||
return $this->DefaultResponse(__FUNCTION__, $aInboxInformation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\Exception
|
||||
*/
|
||||
public function DoFolderInformationMultiply()
|
||||
{
|
||||
$aResult = array(
|
||||
'List' => array(),
|
||||
'Version' => APP_VERSION
|
||||
);
|
||||
|
||||
$aFolders = $this->GetActionParam('Folders', null);
|
||||
if (\is_array($aFolders))
|
||||
{
|
||||
$this->initMailClientConnection();
|
||||
|
||||
$aFolders = \array_unique($aFolders);
|
||||
foreach ($aFolders as $sFolder)
|
||||
{
|
||||
if (0 < \strlen(\trim($sFolder)) && 'INBOX' !== \strtoupper($sFolder))
|
||||
{
|
||||
try
|
||||
{
|
||||
$aInboxInformation = $this->MailClient()->FolderInformation($sFolder);
|
||||
if (\is_array($aInboxInformation) && isset($aInboxInformation['Folder']))
|
||||
{
|
||||
$aResult['List'][] = $aInboxInformation;
|
||||
}
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
$this->Logger()->WriteException($oException);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, $aResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
|
|
|
|||
|
|
@ -60,11 +60,18 @@
|
|||
</div>
|
||||
<div class="control-group" data-bind="visible: subscriptionEnabled() && !licensingProcess()">
|
||||
<div class="controls">
|
||||
<button class="btn" data-bind="click: showActivationForm">
|
||||
<a class="btn" data-bind="click: showActivationForm">
|
||||
<i class="icon-heart-empty"></i>
|
||||
|
||||
Activate Subscription Key
|
||||
</button>
|
||||
</a>
|
||||
|
||||
|
||||
<a class="btn" href="http://rainloop.net/purchase/" target="_black">
|
||||
<i class="icon-purchase"></i>
|
||||
|
||||
Purchase
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
{{INCLUDE/MenuDropdownTop/PLACE}}
|
||||
<li class="e-item" data-bind="visible: facebookLoginEnabled">
|
||||
<a class="e-link" data-bind="command: facebookCommand">
|
||||
<i class="icon-facebook-2"></i>
|
||||
<i class="icon-facebook-alt"></i>
|
||||
|
||||
<span class="i18n" data-i18n-text="LOGIN/TITLE_SIGN_IN_FACEBOOK"></span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
<div class="e-item" data-bind="visible: visible">
|
||||
<a class="e-link" data-bind="droppable: function (oEvent, oUi) { $root.messagesDrop($data, oUi); },
|
||||
droppableOver: function (oEvent, oUi) { $root.messagesDropOver($data, oUi); },
|
||||
droppableOut: function (oEvent, oUi) { $root.messagesDropOut($data, oUi); },
|
||||
css: { 'selected': selected() && !isSystemFolder(), 'selectable': selectableForFolderList, 'hidden' : hidden, 'print-count': 0 < printableUnreadCount().length, 'system': isSystemFolder, 'anim-action-class': actionBlink }">
|
||||
<i data-bind="css: collapsedCss()"></i>
|
||||
<span class="name" data-bind="text: name"></span><!-- <span class="badge pull-right count" data-bind="text: printableUnreadCount"></span> -->
|
||||
</a>
|
||||
<div class="b-sub-folders" data-bind="template: { name: 'MailFolderListItem', foreach: subFolders }, css: { 'unpaddig-folder' : isUnpaddigFolder, 'collapsed': collapsed() }"></div>
|
||||
<div class="e-item" data-bind="visible: visible">
|
||||
<a class="e-link" data-bind="droppable: function (oEvent, oUi) { $root.messagesDrop($data, oUi); },
|
||||
droppableOver: function (oEvent, oUi) { $root.messagesDropOver($data, oUi); },
|
||||
droppableOut: function (oEvent, oUi) { $root.messagesDropOut($data, oUi); },
|
||||
css: { 'selected': selected() && !isSystemFolder(), 'selectable': selectableForFolderList, 'hidden' : hidden, 'print-count': 0 < printableUnreadCount().length, 'system': isSystemFolder, 'anim-action-class': actionBlink }">
|
||||
<span class="badge pull-right count" data-bind="text: printableUnreadCount"></span>
|
||||
<i data-bind="css: collapsedCss()"></i>
|
||||
<span class="name" data-bind="text: name"></span>
|
||||
</a>
|
||||
<div class="b-sub-folders" data-bind="template: { name: 'MailFolderListItem', foreach: subFolders }, css: { 'unpaddig-folder' : isUnpaddigFolder, 'collapsed': collapsed() }"></div>
|
||||
</div>
|
||||
|
|
@ -42,11 +42,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn" href="http://rainloop.net/purchase/" target="_black">
|
||||
<i class="icon-purchase"></i>
|
||||
|
||||
Purchase
|
||||
</a>
|
||||
<a class="btn buttonActivate" data-bind="visible: !activationSuccessed(), command: activateCommand">
|
||||
<i class="icon-key" data-bind="css: {'icon-key': !activateProcess(), 'icon-spinner animated': activateProcess()}" ></i>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue