当前位置: 首页>>代码示例>>PHP>>正文


PHP CApi::isExpandMimeTypeSupported方法代码示例

本文整理汇总了PHP中CApi::isExpandMimeTypeSupported方法的典型用法代码示例。如果您正苦于以下问题:PHP CApi::isExpandMimeTypeSupported方法的具体用法?PHP CApi::isExpandMimeTypeSupported怎么用?PHP CApi::isExpandMimeTypeSupported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CApi的用法示例。


在下文中一共展示了CApi::isExpandMimeTypeSupported方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AjaxFileExpand

 /**
  * @return array
  */
 public function AjaxFileExpand()
 {
     $self = $this;
     $mResult = false;
     $oAccount = null;
     $sHash = \md5(\microtime(true) . \rand(1000, 9999));
     $this->rawCallback((string) $this->getParamValue('RawKey', ''), function ($oAccount, $sContentType, $sFileName, $rResource) use($self, $sHash, &$mResult) {
         if ($self->ApiFileCache()->putFile($oAccount, $sHash, $rResource)) {
             $sFullFilePath = $self->ApiFileCache()->generateFullFilePath($oAccount, $sHash);
             $aExpand = array();
             \CApi::Plugin()->RunHook('webmail.expand-attachment', array($oAccount, $sContentType, $sFileName, $sFullFilePath, &$aExpand, $self->ApiFileCache()));
             if (is_array($aExpand) && 0 < \count($aExpand)) {
                 foreach ($aExpand as $aItem) {
                     if ($aItem && isset($aItem['FileName'], $aItem['MimeType'], $aItem['Size'], $aItem['TempName'])) {
                         $mResult[] = array('FileName' => $aItem['FileName'], 'MimeType' => $aItem['MimeType'], 'EstimatedSize' => $aItem['Size'], 'CID' => '', 'Thumb' => \CApi::GetConf('labs.allow-thumbnail', true) && \api_Utils::IsGDImageMimeTypeSuppoted($aItem['MimeType'], $aItem['FileName']), 'Expand' => \CApi::isExpandMimeTypeSupported($aItem['MimeType'], $aItem['FileName']), 'Iframed' => \CApi::isIframedMimeTypeSupported($aItem['MimeType'], $aItem['FileName']), 'IsInline' => false, 'IsLinked' => false, 'Hash' => \CApi::EncodeKeyValues(array('TempFile' => true, 'Iframed' => \CApi::isIframedMimeTypeSupported($aItem['MimeType'], $aItem['FileName']), 'AccountID' => $oAccount->IdAccount, 'Name' => $aItem['FileName'], 'TempName' => $aItem['TempName'])));
                     }
                 }
             }
             $self->ApiFileCache()->clear($oAccount, $sHash);
         }
     }, false, $oAccount);
     return $this->DefaultResponse($oAccount, __FUNCTION__, $mResult);
 }
开发者ID:nsine,项目名称:webmail-lite,代码行数:26,代码来源:Actions.php

示例2: responseObject


//.........这里部分代码省略.........
                                     /* @var $mResponse CHelpdeskAttachment */
                                     $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdHelpdeskAttachment' => $mResponse->IdHelpdeskAttachment, 'IdHelpdeskPost' => $mResponse->IdHelpdeskPost, 'IdHelpdeskThread' => $mResponse->IdHelpdeskThread, 'SizeInBytes' => $mResponse->SizeInBytes, 'FileName' => $mResponse->FileName, 'MimeType' => \MailSo\Base\Utils::MimeContentType($mResponse->FileName), 'Thumb' => \CApi::GetConf('labs.allow-thumbnail', true) && $mResponse->SizeInBytes < $iThumbnailLimit && \api_Utils::IsGDImageMimeTypeSuppoted(\MailSo\Base\Utils::MimeContentType($mResponse->FileName), $mResponse->FileName), 'Hash' => $mResponse->Hash, 'Content' => $mResponse->Content, 'Created' => $mResponse->Created));
                                 } else {
                                     if ('CFetcher' === $sClassName) {
                                         /* @var $mResponse \CFetcher */
                                         $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdFetcher' => $mResponse->IdFetcher, 'IdAccount' => $mResponse->IdAccount, 'IsEnabled' => $mResponse->IsEnabled, 'IsLocked' => $mResponse->IsLocked, 'Folder' => $mResponse->Folder, 'Name' => $mResponse->Name, 'Email' => $mResponse->Email, 'Signature' => $mResponse->Signature, 'SignatureOptions' => $mResponse->SignatureOptions, 'LeaveMessagesOnServer' => $mResponse->LeaveMessagesOnServer, 'IncomingMailServer' => $mResponse->IncomingMailServer, 'IncomingMailPort' => $mResponse->IncomingMailPort, 'IncomingMailLogin' => $mResponse->IncomingMailLogin, 'IsOutgoingEnabled' => $mResponse->IsOutgoingEnabled, 'OutgoingMailServer' => $mResponse->OutgoingMailServer, 'OutgoingMailPort' => $mResponse->OutgoingMailPort, 'OutgoingMailAuth' => $mResponse->OutgoingMailAuth, 'IncomingMailSsl' => $mResponse->IncomingMailSecurity === \MailSo\Net\Enumerations\ConnectionSecurityType::SSL, 'OutgoingMailSsl' => $mResponse->OutgoingMailSecurity === \MailSo\Net\Enumerations\ConnectionSecurityType::SSL));
                                     } else {
                                         if ('CApiMailFolder' === $sClassName) {
                                             $aExtended = null;
                                             $mStatus = $mResponse->getStatus();
                                             if (is_array($mStatus) && isset($mStatus['MESSAGES'], $mStatus['UNSEEN'], $mStatus['UIDNEXT'])) {
                                                 $aExtended = array('MessageCount' => (int) $mStatus['MESSAGES'], 'MessageUnseenCount' => (int) $mStatus['UNSEEN'], 'UidNext' => (string) $mStatus['UIDNEXT'], 'Hash' => \api_Utils::GenerateFolderHash($mResponse->getRawFullName(), $mStatus['MESSAGES'], $mStatus['UNSEEN'], $mStatus['UIDNEXT']));
                                             }
                                             $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('Type' => $mResponse->getType(), 'Name' => $mResponse->getName(), 'FullName' => $mResponse->getFullName(), 'FullNameRaw' => $mResponse->getRawFullName(), 'FullNameHash' => md5($mResponse->getRawFullName()), 'Delimiter' => $mResponse->getDelimiter(), 'IsSubscribed' => $oAccount->isExtensionEnabled(\CAccount::IgnoreSubscribeStatus) ? true : $mResponse->isSubscribed(), 'IsSelectable' => $mResponse->isSelectable(), 'Exists' => $mResponse->exists(), 'Extended' => $aExtended, 'SubFolders' => $this->responseObject($oAccount, $mResponse->getSubFolders(), $sParent, $aParameters)));
                                         } else {
                                             if ('CApiMailAttachment' === $sClassName) {
                                                 $mFoundedCIDs = isset($aParameters['FoundedCIDs']) && is_array($aParameters['FoundedCIDs']) ? $aParameters['FoundedCIDs'] : null;
                                                 $mFoundedContentLocationUrls = isset($aParameters['FoundedContentLocationUrls']) && \is_array($aParameters['FoundedContentLocationUrls']) && 0 < \count($aParameters['FoundedContentLocationUrls']) ? $aParameters['FoundedContentLocationUrls'] : null;
                                                 if ($mFoundedCIDs || $mFoundedContentLocationUrls) {
                                                     $aFoundedCIDs = \array_merge($mFoundedCIDs ? $mFoundedCIDs : array(), $mFoundedContentLocationUrls ? $mFoundedContentLocationUrls : array());
                                                     $aFoundedCIDs = 0 < \count($mFoundedCIDs) ? $mFoundedCIDs : null;
                                                 }
                                                 $sMimeType = strtolower(trim($mResponse->getMimeType()));
                                                 $sMimeIndex = strtolower(trim($mResponse->getMimeIndex()));
                                                 $sContentTransferEncoding = strtolower(trim($mResponse->getEncoding()));
                                                 $sFileName = $mResponse->getFileName(true);
                                                 $iEstimatedSize = $mResponse->getEstimatedSize();
                                                 $iThumbnailLimit = 1024 * 1024 * 2;
                                                 // 2MB //TODO
                                                 if (in_array($sMimeType, array('application/octet-stream'))) {
                                                     $sMimeType = \MailSo\Base\Utils::MimeContentType($sFileName);
                                                 }
                                                 $sCid = \trim(\trim($mResponse->getCid()), '<>');
                                                 $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('FileName' => $sFileName, 'MimeType' => $sMimeType, 'MimePartIndex' => 'message/rfc822' === $sMimeType && ('base64' === $sContentTransferEncoding || 'quoted-printable' === $sContentTransferEncoding) ? '' : $sMimeIndex, 'EstimatedSize' => $iEstimatedSize, 'CID' => $sCid, 'ContentLocation' => $mResponse->getContentLocation(), 'Thumb' => \CApi::GetConf('labs.allow-thumbnail', true) && $iEstimatedSize < $iThumbnailLimit && \api_Utils::IsGDImageMimeTypeSuppoted($sMimeType, $sFileName), 'Expand' => \CApi::isExpandMimeTypeSupported($sMimeType, $sFileName), 'Iframed' => \CApi::isIframedMimeTypeSupported($sMimeType, $sFileName), 'Content' => $mResponse->getContent(), 'IsInline' => $mResponse->isInline(), 'IsLinked' => !empty($sCid) && $mFoundedCIDs && \in_array($sCid, $mFoundedCIDs) || $mFoundedContentLocationUrls && \in_array(\trim($mResponse->getContentLocation()), $mFoundedContentLocationUrls)));
                                                 $mResult['Hash'] = \CApi::EncodeKeyValues(array('Iframed' => $mResult['Iframed'], 'AccountID' => $oAccount ? $oAccount->IdAccount : 0, 'Folder' => $mResponse->getFolder(), 'Uid' => $mResponse->getUid(), 'MimeIndex' => $sMimeIndex, 'MimeType' => $sMimeType, 'FileName' => $mResponse->getFileName(true)));
                                             } else {
                                                 if ('MailSo\\Mime\\Email' === $sClassName) {
                                                     $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('DisplayName' => \MailSo\Base\Utils::Utf8Clear($mResponse->GetDisplayName()), 'Email' => \MailSo\Base\Utils::Utf8Clear($mResponse->GetEmail())));
                                                 } else {
                                                     if ('CApiMailMessageCollection' === $sClassName) {
                                                         $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('Uids' => $mResponse->Uids, 'UidNext' => $mResponse->UidNext, 'FolderHash' => $mResponse->FolderHash, 'MessageCount' => $mResponse->MessageCount, 'MessageUnseenCount' => $mResponse->MessageUnseenCount, 'MessageResultCount' => $mResponse->MessageResultCount, 'FolderName' => $mResponse->FolderName, 'Offset' => $mResponse->Offset, 'Limit' => $mResponse->Limit, 'Search' => $mResponse->Search, 'Filters' => $mResponse->Filters, 'New' => $mResponse->New));
                                                     } else {
                                                         if ('CIdentity' === $sClassName) {
                                                             $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdIdentity' => $mResponse->IdIdentity, 'IdAccount' => $mResponse->IdAccount, 'Default' => $mResponse->Default, 'Enabled' => $mResponse->Enabled, 'Email' => $mResponse->Email, 'FriendlyName' => $mResponse->FriendlyName, 'UseSignature' => $mResponse->UseSignature, 'Signature' => $mResponse->Signature));
                                                         } else {
                                                             if ('CApiMailFolderCollection' === $sClassName) {
                                                                 $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('Namespace' => $mResponse->GetNamespace()));
                                                             } else {
                                                                 if ('CContactListItem' === $sClassName) {
                                                                     $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdUser' => $oAccount->IdUser, 'Id' => $mResponse->Id, 'Name' => $mResponse->Name, 'Email' => $mResponse->Email, 'Emails' => $mResponse->Emails, 'Phones' => $mResponse->Phones, 'UseFriendlyName' => $mResponse->UseFriendlyName, 'IsGroup' => $mResponse->IsGroup, 'IsOrganization' => $mResponse->IsOrganization, 'ReadOnly' => $mResponse->ReadOnly, 'ItsMe' => $mResponse->ItsMe, 'Global' => $mResponse->Global, 'ForSharedToAll' => $mResponse->ForSharedToAll, 'SharedToAll' => $mResponse->SharedToAll, 'Frequency' => $mResponse->Frequency, 'AgeScore' => $mResponse->AgeScore));
                                                                 } else {
                                                                     if ('CContact' === $sClassName) {
                                                                         $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdUser' => $mResponse->IdUser, 'IdContact' => $mResponse->IdContact, 'IdContactStr' => $mResponse->IdContactStr, 'Global' => $mResponse->Global, 'ItsMe' => $mResponse->ItsMe, 'PrimaryEmail' => $mResponse->PrimaryEmail, 'UseFriendlyName' => $mResponse->UseFriendlyName, 'GroupsIds' => $mResponse->GroupsIds, 'FullName' => $mResponse->FullName, 'Title' => $mResponse->Title, 'FirstName' => $mResponse->FirstName, 'LastName' => $mResponse->LastName, 'NickName' => $mResponse->NickName, 'Skype' => $mResponse->Skype, 'Facebook' => $mResponse->Facebook, 'HomeEmail' => $mResponse->HomeEmail, 'HomeStreet' => $mResponse->HomeStreet, 'HomeCity' => $mResponse->HomeCity, 'HomeState' => $mResponse->HomeState, 'HomeZip' => $mResponse->HomeZip, 'HomeCountry' => $mResponse->HomeCountry, 'HomePhone' => $mResponse->HomePhone, 'HomeFax' => $mResponse->HomeFax, 'HomeMobile' => $mResponse->HomeMobile, 'HomeWeb' => $mResponse->HomeWeb, 'BusinessEmail' => $mResponse->BusinessEmail, 'BusinessCompany' => $mResponse->BusinessCompany, 'BusinessStreet' => $mResponse->BusinessStreet, 'BusinessCity' => $mResponse->BusinessCity, 'BusinessState' => $mResponse->BusinessState, 'BusinessZip' => $mResponse->BusinessZip, 'BusinessCountry' => $mResponse->BusinessCountry, 'BusinessJobTitle' => $mResponse->BusinessJobTitle, 'BusinessDepartment' => $mResponse->BusinessDepartment, 'BusinessOffice' => $mResponse->BusinessOffice, 'BusinessPhone' => $mResponse->BusinessPhone, 'BusinessMobile' => $mResponse->BusinessMobile, 'BusinessFax' => $mResponse->BusinessFax, 'BusinessWeb' => $mResponse->BusinessWeb, 'OtherEmail' => $mResponse->OtherEmail, 'Notes' => $mResponse->Notes, 'BirthdayDay' => $mResponse->BirthdayDay, 'BirthdayMonth' => $mResponse->BirthdayMonth, 'BirthdayYear' => $mResponse->BirthdayYear, 'ReadOnly' => $mResponse->ReadOnly, 'ETag' => $mResponse->ETag, 'SharedToAll' => $mResponse->SharedToAll));
                                                                     } else {
                                                                         if ('CGroup' === $sClassName) {
                                                                             $aContacts = $this->ApiContacts()->getContactItems($mResponse->IdUser, \EContactSortField::Name, \ESortOrder::ASC, 0, 299, '', '', $mResponse->IdGroup);
                                                                             $mResult = array_merge($this->objectWrapper($oAccount, $mResponse, $sParent, $aParameters), array('IdUser' => $mResponse->IdUser, 'IdGroup' => $mResponse->IdGroup, 'IdGroupStr' => $mResponse->IdGroupStr, 'Name' => $mResponse->Name, 'IsOrganization' => $mResponse->IsOrganization, 'Email' => $mResponse->Email, 'Company' => $mResponse->Company, 'Street' => $mResponse->Street, 'City' => $mResponse->City, 'State' => $mResponse->City, 'Zip' => $mResponse->Zip, 'Country' => $mResponse->Country, 'Phone' => $mResponse->Phone, 'Fax' => $mResponse->Fax, 'Web' => $mResponse->Web, 'Contacts' => $this->responseObject($oAccount, $aContacts, $sParent, $aParameters)));
                                                                         } else {
                                                                             if ($mResponse instanceof \MailSo\Base\Collection) {
                                                                                 $aCollection = $mResponse->GetAsArray();
                                                                                 if (150 < \count($aCollection) && $mResponse instanceof \MailSo\Mime\EmailCollection) {
                                                                                     $aCollection = \array_slice($aCollection, 0, 150);
                                                                                 }
                                                                                 $mResult = $this->responseObject($oAccount, $aCollection, $sParent, $aParameters);
                                                                                 unset($aCollection);
                                                                             } else {
开发者ID:Git-Host,项目名称:email,代码行数:67,代码来源:ActionsBase.php


注:本文中的CApi::isExpandMimeTypeSupported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。