IMP_Contents_Message::getInlineOutput PHP Method

getInlineOutput() public method

Get the inline display output for a message.
public getInlineOutput ( string $mimeid = null ) : array
$mimeid string Restrict output to this MIME ID (and children).
return array An array with the following keys: - atc_parts: (array) The list of attachment MIME IDs. - display_ids: (array) The list of display MIME IDs. - metadata: (array) A list of metadata. - msgtext: (string) The rendered HTML code. - one_part: (boolean) If true, the message only consists of one part.
    public function getInlineOutput($mimeid = null)
    {
        global $registry;
        switch ($registry->getView()) {
            case $registry::VIEW_MINIMAL:
            case $registry::VIEW_SMARTMOBILE:
                $contents_mask = 0;
                break;
            default:
                $contents_mask = IMP_Contents::SUMMARY_BYTES | IMP_Contents::SUMMARY_SIZE | IMP_Contents::SUMMARY_ICON | IMP_Contents::SUMMARY_DESCRIP_LINK | IMP_Contents::SUMMARY_DOWNLOAD | IMP_Contents::SUMMARY_PRINT_STUB;
                break;
        }
        return $this->_getInlineOutput(array('mask' => $contents_mask, 'mimeid' => $mimeid));
    }

Usage Example

Example #1
0
 /**
  * AJAX action: Return the inline display text for a given MIME ID of
  * a message.
  *
  * See the list of variables needed for IMP_Ajax_Application#changed() and
  * IMP_Ajax_Application#checkUidvalidity(). Mailbox/indices form
  * parameters needed. Additional variables used:
  *   - mimeid: (string) The MIME ID to return.
  *
  * @return object  An object with the following entries:
  * <pre>
  *   - md: (array) Metadata information.
  *   - mimeid: (string) The base MIME ID of the text.
  *   - puids: (array) See IMP_Ajax_Application#previewUids().
  *   - text: (string) Inline Message text of the part.
  * </pre>
  */
 public function inlineMessageOutput()
 {
     $result = new stdClass();
     $show_msg = new IMP_Contents_Message($this->_base->indices);
     $msg_output = $show_msg->getInlineOutput($this->vars->mimeid);
     $result = new stdClass();
     $result->md = $msg_output['metadata'];
     $result->mimeid = $this->vars->mimeid;
     $result->puids = $this->_base->previewUids();
     $result->text = $msg_output['msgtext'];
     return $result;
 }