[dev] Patch to allow optional display of images inline - good stuff! :-)))

Conor Kerr conor at dev.ceon.net
Sat Mar 1 22:50:10 PST 2003


Hi,

I said to Chuck about a year ago that I would add this... :)

This patch allows the inline display of images.  Hotmail, yahoo etc. all
have this feature which I and others find very useful.

As this uses the Horde/IMP's existing MIME code images are only
displayed in the browser if the driver is set to 'inline' and if the
browser supports the display of the respective type.  I.E. No annoying
"File Open" requestors will appear.

To allow for the availability of this functionality on a per-user basis
I have also added an option in "Other Options->Display Options" =
"Display image attachments inline?"

Please let me know if this is going to be committed and if so please let
the necessary people know that a translation of the preference setting's
text is required.

Thanks!  All the best...

Conor



===================================================================
RCS file: /repository/horde/lib/MIME/Contents.php,v
retrieving revision 1.55
diff -r1.55 Contents.php
77a78,84
>      * Whether to display images inline or not
>      *
>      * @var boolean $_displayImagesInline
>      */
>     var $_displayImagesInline = false;
>
>     /**
115a123
>         $this->_displayImagesInline = $prefs->getValue('image_attachment_inline');
379,380c387,389
<         /* Check to see if the driver is set to inline -AND- the MIME headers
<            allow the part to be inlined. */
---
>         /* Check to see if the driver is set to inline -AND- EITHER the MIME headers
>            allow the part to be inlined -OR- the attachment is an image and images
>            are to be displayed inline. */
382c391,392
<                 ($mime_part->getDisposition() == 'inline'));
---
>                 (($mime_part->getDisposition() == 'inline')
>               || (($mime_part->getPrimaryType() == 'image') && ($this->_displayImagesInline))));



===================================================================
RCS file: /repository/imp/config/prefs.php.dist,v
retrieving revision 1.149
diff -r1.149 prefs.php.dist
105c105,106
<                        'highlight_text', 'dim_signature', 'attachment_display'));
---
>                        'highlight_text', 'dim_signature', 'attachment_display',
>                        'image_attachment_inline'));
786a788,795
>
> // Are image attachments displayed inline?
> $_prefs['image_attachment_inline'] = array(
>     'value' => '1',
>     'locked' => false,
>     'shared' => false,
>     'type' => 'checkbox',
>     'desc' => _("Display image attachments inline?"));



--
Conor Kerr
Amiga Developer, Ceon Ltd., Northern Ireland
www.ceon.net  conor at dev.ceon.net




More information about the dev mailing list