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


PHP Horde_Mime_Part::getMimeId方法代码示例

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


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

示例1: __construct

 /**
  * Constructor.
  *
  * @param Horde_Mime_Part $mime_part  A MIME part object. Must be of
  *                                    type multipart/related.
  */
 public function __construct(Horde_Mime_Part $mime_part)
 {
     if ($mime_part->getType() != 'multipart/related') {
         throw new InvalidArgumentException('MIME part must be of type multipart/related');
     }
     $ids = array_keys($mime_part->contentTypeMap());
     $related_id = $mime_part->getMimeId();
     $id = null;
     /* Build a list of parts -> CIDs. */
     foreach ($ids as $val) {
         if (strcmp($related_id, $val) !== 0 && ($cid = $mime_part->getPart($val)->getContentId())) {
             $this->_cids[$val] = $cid;
         }
     }
     /* Look at the 'start' parameter to determine which part to start
      * with. If no 'start' parameter, use the first part (RFC 2387
      * [3.1]). */
     $start = $mime_part->getContentTypeParameter('start');
     if (!empty($start)) {
         $id = $this->cidSearch($start);
     }
     if (empty($id)) {
         reset($ids);
         $id = next($ids);
     }
     $this->_start = $id;
 }
开发者ID:netcon-source,项目名称:apps,代码行数:33,代码来源:Related.php

示例2: addMimeAction

 /**
  * Adds a MIME Viewer action to the status text.
  *
  * @param string $action  Action ID.
  * @param string $text    Action description.
  * @param array $attr     Additional attributes.
  */
 public function addMimeAction($action, $text, array $attr = array())
 {
     $attr['mimevieweraction'] = $action;
     if (!is_null($this->_part)) {
         $attr['mimeviewerid'] = $this->_part->getMimeId();
     }
     $url = new Horde_Url('#');
     $this->addText($url->link($attr) . $text . '</a>');
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:16,代码来源:Status.php

示例3: _getBodyPart

 /**
  * Build the data needed for the BodyPart part.
  *
  * @param  Horde_Imap_Client_Data_Fetch $data  The FETCH results.
  * @param  Horde_Mime_Part $mime  The plaintext MIME part.
  * @param boolean $to_html        If true, $id is assumed to be a text/plain
  *                                part and is converted to html.
  *
  * @return array  The BodyPart data.
  *     - charset:  (string)   The charset of the text.
  *     - body: (string)       The body text.
  *     - truncated: (boolean) True if text was truncated.
  *     - size: (integer)      The original part size, in bytes.
  */
 protected function _getBodyPart(Horde_Imap_Client_Data_Fetch $data, Horde_Mime_Part $mime, $to_html)
 {
     $id = $mime->getMimeId();
     $text = $data->getBodyPart($id);
     if (!$data->getBodyPartDecode($id)) {
         $mime->setContents($text);
         $text = $mime->getContents();
     }
     if ($to_html) {
         $text = Horde_Text_Filter::filter($text, 'Text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => $mime->getCharset()));
         $size = strlen($text);
     } else {
         $size = !is_null($data->getBodyPartSize($id)) ? $data->getBodyPartSize($id) : strlen($text);
     }
     if (!empty($this->_options['bodypartprefs']['truncationsize'])) {
         $text = Horde_String::substr($text, 0, $this->_options['bodypartprefs']['truncationsize'], $mime->getCharset());
     }
     return array('charset' => $mime->getCharset(), 'body' => $text, 'truncated' => $size > strlen($text), 'size' => $size);
 }
开发者ID:horde,项目名称:horde,代码行数:33,代码来源:MessageBodyData.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.
  */
 protected function _addTreeNodes($tree, $part)
 {
     $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' => is_null($part->parent) ? null : $part->parent->getMimeId(), 'label' => sprintf('%s (%s) %s %s', $summary['description'], $summary['size'], $summary['download'], $summary['strip']), 'params' => array('class' => 'partsTreeDiv', 'icon' => $summary['icon'])));
 }
开发者ID:horde,项目名称:horde,代码行数:16,代码来源:Contents.php

示例5: 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

示例6: _renderReturn

 /**
  * Internal helper function to create render data array for a MIME Part
  * object that only has a single part.
  *
  * @param string $data  The rendered data.
  * @param string $type  The rendered type.
  *
  * @return array  See render().
  */
 protected function _renderReturn($data = null, $type = null)
 {
     return array($this->_mimepart->getMimeId() => array('data' => is_null($data) ? $this->_mimepart->getContents() : $data, 'status' => array(), 'type' => is_null($type) ? $this->_mimepart->getType() : $type));
 }
开发者ID:horde,项目名称:horde,代码行数:13,代码来源:Base.php


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