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


PHP Horde_Mime_Part::getParts方法代码示例

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


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

示例1: armorToPart

 /**
  * Converts armored input into a Horde_Mime_Part object.
  *
  * @param mixed $input  Armored input.
  * @param array $opts   Additional options:
  *   - charset: (string) Charset of the armored input.
  *
  * @return mixed  Either null if no PGP data was found, or a
  *                Horde_Mime_Part object.
  */
 public function armorToPart($input, array $opts = array())
 {
     $opts = array_merge(array('charset' => 'UTF-8'), $opts);
     $armor = Horde_Pgp_Armor::create($input);
     $new_part = new Horde_Mime_Part();
     $new_part->setType('multipart/mixed');
     foreach ($armor as $val) {
         switch (get_class($val)) {
             case 'Horde_Pgp_Element_Text':
                 $part = new Horde_Mime_Part();
                 $part->setType('text/plain');
                 $part->setCharset($opts['charset']);
                 $part->setContents($val->message[0]->data);
                 $new_part[] = $part;
                 break;
             case 'Horde_Pgp_Element_PrivateKey':
             case 'Horde_Pgp_Element_PublicKey':
                 $part = new Horde_Mime_Part();
                 $part->setType('application/pgp-keys');
                 $part->setContents(strval($val));
                 $new_part[] = $part;
                 break;
             case 'Horde_Pgp_Element_Message':
                 // TODO: Message can also be text or signature
                 $part = $this->_encryptBase($val);
                 $part->setMetadata(self::PGP_ARMOR, true);
                 $part['2']->setMetadata(self::PGP_CHARSET, isset($val->headers['Charset']) ? $val->headers['Charset'] : 'UTF-8');
                 $new_part[] = $part;
                 break;
             case 'Horde_Pgp_Element_SignedMessage':
                 $part = $this->_signPart($val->text, $val->signature);
                 $new_part[] = $part;
                 break;
         }
     }
     return count($new_part->getParts()) ? $new_part : null;
 }
开发者ID:horde,项目名称:horde,代码行数:47,代码来源:Mime.php

示例2: handleMultiPartMessage

 /**
  * @param \Horde_Mime_Part $part
  * @param int $partNo
  */
 private function handleMultiPartMessage($part, $partNo)
 {
     $i = 1;
     foreach ($part->getParts() as $p) {
         $this->getPart($p, "{$partNo}.{$i}");
         $i++;
     }
 }
开发者ID:jakobsack,项目名称:mail,代码行数:12,代码来源:message.php

示例3: subMimeStructToFlatStruct

 /**
  *
  * @param unknown $struct
  * @param unknown $partno
  * @param unknown $outStruct
  */
 public function subMimeStructToFlatStruct(Horde_Mime_Part $struct, &$outStruct)
 {
     $partno = $struct->getMimeId();
     $outStruct[$partno] = array();
     $outStruct[$partno]['type'] = $struct->getType(false);
     $outStruct[$partno]['subtype'] = $struct->getSubType();
     $outStruct[$partno]['content'] = $struct->getContents(array('stream' => false));
     if ($v = $struct->getCharset()) {
         $outStruct[$partno]['charset'] = $v;
     }
     if ($v = $struct->getName(false)) {
         $outStruct[$partno]['name'] = $v;
     }
     if ($v = $struct->getSize(false)) {
         $outStruct[$partno]['bytes'] = $v;
     }
     if ($v = $struct->getContentId()) {
         $outStruct[$partno]['id'] = $v;
     }
     foreach ($struct->getParts() as $sStruct) {
         $this->subMimeStructToFlatStruct($sStruct, $outStruct);
     }
 }
开发者ID:micoli,项目名称:qd_mail,代码行数:29,代码来源:QDImapHORDE.php

示例4: _addTreeNodes

 /**
  * Adds MIME parts to the tree instance.
  *
  * @param Horde_Tree_Renderer_Base tree   A tree instance.
  * @param Horde_Mime_Part $part           The MIME part to add to the
  *                                        tree, including its sub-parts.
  * @param string $parent                  The parent part's MIME id.
  */
 protected function _addTreeNodes($tree, $part, $parent = null)
 {
     $mimeid = $part->getMimeId();
     $summary_mask = self::SUMMARY_ICON_RAW | self::SUMMARY_DESCRIP_LINK | self::SUMMARY_SIZE | self::SUMMARY_DOWNLOAD;
     if ($GLOBALS['prefs']->getValue('strip_attachments')) {
         $summary_mask += self::SUMMARY_STRIP;
     }
     $summary = $this->getSummary($mimeid, $summary_mask);
     $tree->addNode(array('id' => $mimeid, 'parent' => $parent, 'label' => sprintf('%s (%s) %s %s', $summary['description'], $summary['size'], $summary['download'], $summary['strip']), 'params' => array('class' => 'partsTreeDiv', 'icon' => $summary['icon'])));
     foreach ($part->getParts() as $part) {
         $this->_addTreeNodes($tree, $part, $mimeid);
     }
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:21,代码来源:Contents.php


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