mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
PreRelease 1.8.3
This commit is contained in:
parent
39566292af
commit
0ea982671b
40 changed files with 712 additions and 370 deletions
|
|
@ -58,62 +58,17 @@ class AttachmentCollection extends \MailSo\Base\Collection
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return array
|
||||
*/
|
||||
public function ImageCount()
|
||||
public function SpecData()
|
||||
{
|
||||
$aList = $this->FilterList(function ($oAttachment) {
|
||||
return $oAttachment && $oAttachment->IsImage();
|
||||
return $this->MapList(function ($oAttachment) {
|
||||
if ($oAttachment)
|
||||
{
|
||||
return array($oAttachment->FileName(true), $oAttachment->MimeType());
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
return \is_array($aList) ? \count($aList) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function ArchiveCount()
|
||||
{
|
||||
$aList = $this->FilterList(function ($oAttachment) {
|
||||
return $oAttachment && $oAttachment->IsArchive();
|
||||
});
|
||||
|
||||
return \is_array($aList) ? \count($aList) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function PdfCount()
|
||||
{
|
||||
$aList = $this->FilterList(function ($oAttachment) {
|
||||
return $oAttachment && $oAttachment->IsPdf();
|
||||
});
|
||||
|
||||
return \is_array($aList) ? \count($aList) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function DocCount()
|
||||
{
|
||||
$aList = $this->FilterList(function ($oAttachment) {
|
||||
return $oAttachment && $oAttachment->IsDoc();
|
||||
});
|
||||
|
||||
return \is_array($aList) ? \count($aList) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function CertificateCount()
|
||||
{
|
||||
$aList = $this->FilterList(function ($oAttachment) {
|
||||
return $oAttachment && $oAttachment->IsPgpSignature();
|
||||
});
|
||||
|
||||
return \is_array($aList) ? \count($aList) : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2630,6 +2630,17 @@ class Actions
|
|||
return $this->FalseResponse(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\Exception
|
||||
*/
|
||||
public function DoAttachmentsActions()
|
||||
{
|
||||
\sleep(1);
|
||||
return $this->TrueResponse(__FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
|
|
@ -9079,28 +9090,7 @@ class Actions
|
|||
$iAttachmentsCount = $oAttachments ? $oAttachments->Count() : 0;
|
||||
|
||||
$mResult['HasAttachments'] = 0 < $iAttachmentsCount;
|
||||
$mResult['AttachmentsMainType'] = '';
|
||||
if (0 < $iAttachmentsCount)
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case $iAttachmentsCount === $oAttachments->ImageCount():
|
||||
$mResult['AttachmentsMainType'] = 'image';
|
||||
break;
|
||||
case $iAttachmentsCount === $oAttachments->ArchiveCount():
|
||||
$mResult['AttachmentsMainType'] = 'archive';
|
||||
break;
|
||||
case $iAttachmentsCount === $oAttachments->PdfCount():
|
||||
$mResult['AttachmentsMainType'] = 'pdf';
|
||||
break;
|
||||
case $iAttachmentsCount === $oAttachments->DocCount():
|
||||
$mResult['AttachmentsMainType'] = 'doc';
|
||||
break;
|
||||
case $iAttachmentsCount === $oAttachments->CertificateCount():
|
||||
$mResult['AttachmentsMainType'] = 'certificate';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$mResult['AttachmentsSpecData'] = $mResult['HasAttachments'] ? $oAttachments->SpecData() : array();
|
||||
|
||||
$sSubject = $mResult['Subject'];
|
||||
$mResult['Hash'] = \md5($mResult['Folder'].$mResult['Uid']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue