[imp] MIME viewer download

Michael M Slusarz slusarz at horde.org
Thu Oct 9 16:47:31 UTC 2008


Quoting "Chris St. Pierre" <stpierre at NebrWesleyan.edu>:

> On Wed, 8 Oct 2008, Michael M Slusarz wrote:
>
>> Quoting "Chris St. Pierre" <stpierre at NebrWesleyan.edu>:
>>
>>> In the thread at
>>> http://groups.google.com/group/mailing.www.horde-imp/browse_thread/thread/c8e595e0a49ae2b3/82f0cbb5af8d494c,
>>> Michael notes that "Clicking on the filename *should*, if a viewer is
>>> configured, open up a HTML-rendered viewer, not display the file.  For
>>> files without a MIME Viewer, this link should be identical to the
>>> download link."
>>>
>>> On my Horde 3.2/IMP 4.3 install, that is not the case.  For files
>>> without a MIME Viewer, the filename is not a link at all.  How do I
>>> get it to Do The Right Thing?
>>
>> Well, this used to be the case.  Now that I am thinking about it, I  
>> might be confusing this with the old behavior we had with  
>> MIME_Magic guesses where we gave users 2 links - one for the  
>> guessed type and one to the original type.
>>
>> In either case, I was probably wrong.
>
> Dang.  I was really counting on you being right, and my setup being
> wrong.
>
> So, is it possible to get this behavior, without hacking the code
> proper?  I find that behavior much more intuitive than what's
> currently there.  Is it possible, e.g., to define a default MIME
> Viewer that just downloads the file?

There is a default viewer already.  The code in MIME_Contents just  
checks for it and if it is being used, doesn't display a linked name.   
You can alter this behavior by removing the '**' line below:

         /* Name/text part column. */
         if (!$this->_links ||
             (!$attachment && empty($bytes))  ||
             !isset($this->_viewID['view']) ||
**          is_a($viewer, 'MIME_Viewer_default')) {
             $summary[] = htmlspecialchars($description);
         } else {
             $summary[] = $this->linkViewJS($mime_part,  
$this->_viewID['view'], htmlspecialchars($description),  
sprintf(_("View %s [%s]"), $description, $mime_type), null,  
$param_array);
         }

This appears on line 985 in the current HEAD version of  
framework/MIME/MIME/Contents.php

michael

-- 
___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the imp mailing list