View File Name : Contents.php
';
}
if (!empty($part['wrap'])) {
$text_out .= '
';
$wrap_ids[] = $id;
}
$text_out .= '
' . $part['text'] . '
';
}
$text_out .= str_repeat('
', count($wrap_ids));
if (!strlen($text_out)) {
$text_out = strval(new IMP_Mime_Status(_("There are no parts that can be shown inline.")));
}
$atc_parts = ($show_parts == 'all')
? array_keys($parts_list)
: array_keys($atc_parts);
return array(
'atc_parts' => $atc_parts,
'display_ids' => array_keys($display_ids),
'js_onload' => $js_onload,
'msgtext' => $text_out,
'one_part' => (count($parts_list) == 1)
);
}
/**
* Prints out a MIME summary (in HTML).
*
* @param string $id The MIME ID.
* @param integer $mask A bitmask indicating what summary information to
* return.
* @param array $display The fields to display (in this order).
* @param boolean $atc Is this an attachment?
*
* @return string The formatted summary string.
*/
protected function _formatSummary($id, $mask, $display, $atc = false)
{
$summary = $this->getSummary($id, $mask);
$tmp_summary = array();
foreach ($display as $val) {
if (isset($summary[$val])) {
switch ($val) {
case 'description':
$summary[$val] = '
' . $summary[$val] . '';
break;
case 'size':
$summary[$val] = '
(' . $summary[$val] . ')';
break;
}
$tmp_summary[] = $summary[$val];
}
}
return '
' .
implode(' ', $tmp_summary) .
'
';
}
/**
* Get FETCH data from IMAP server for this message.
*
* @param Horde_Imap_Client_Fetch_Query $query Search query.
*
* @return Horde_Imap_Client_Data_Fetch Fetch data for the message.
*/
protected function _fetchData(Horde_Imap_Client_Fetch_Query $query)
{
try {
$mbox = $this->getMailbox();
$imp_imap = $mbox->imp_imap;
return $imp_imap->fetch($mbox, $query, array(
'ids' => $imp_imap->getIdsOb($this->getUid())
))->first();
} catch (Horde_Imap_Client_Exception $e) {
return new Horde_Imap_Client_Data_Fetch();
}
}
/**
* Return the view cache object for this message.
*
* @return object View object.
*/
public function getViewCache()
{
if (!isset($this->_viewcache)) {
$this->_viewcache = new stdClass;
}
return $this->_viewcache;
}
}