Skip to content

Commit

Permalink
Do summary generation in _getInlineOutput()
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Mar 18, 2015
1 parent d0acce0 commit efd3054
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions imp/lib/Contents/Message.php
Expand Up @@ -584,7 +584,7 @@ protected function _getInlineOutput(array $options)

if ($contents_mask) {
$msgtext[$mime_id] = array(
'text' => $this->_formatSummary($mime_id, $contents_mask, true)
'text' => $this->_formatSummary($this->contents->getSummary($mime_id, $contents_mask), true)
);
}
}
Expand All @@ -603,7 +603,7 @@ protected function _getInlineOutput(array $options)
if ($contents_mask &&
IMP_Mime_Attachment::isAttachment($part)) {
$msgtext[$mime_id] = array(
'text' => $this->_formatSummary($mime_id, $contents_mask, true)
'text' => $this->_formatSummary($this->contents->getSummary($mime_id, $contents_mask), true)
);
}
continue;
Expand All @@ -618,7 +618,7 @@ protected function _getInlineOutput(array $options)
}

$part_text = ($contents_mask && empty($info['nosummary']))
? $this->_formatSummary($id, $contents_mask, !empty($info['attach']))
? $this->_formatSummary($this->contents->getSummary($id, $contents_mask), !empty($info['attach']))
: '';

if (empty($info['attach'])) {
Expand Down Expand Up @@ -714,17 +714,14 @@ protected function _getInlineOutput(array $options)
/**
* 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 boolean $atc Is this an attachment?
* @param array $summary Summary information.
* @param boolean $atc Is this an attachment?
*
* @return string The formatted summary string.
*/
protected function _formatSummary($id, $mask, $atc = false)
protected function _formatSummary($summary, $atc = false)
{
$display = array('icon', 'description', 'size', 'download', 'print');
$summary = $this->contents->getSummary($id, $mask);
$tmp_summary = array();

foreach ($display as $val) {
Expand Down

0 comments on commit efd3054

Please sign in to comment.