[dev] Patch for Zip and Rar Mime Viewers

Michael M Slusarz slusarz@bigworm.colorado.edu
Sun, 16 Jun 2002 11:32:47 -0600


Quoting Chuck Hagenbuch <chuck@horde.org>:

| Quoting Michael M Slusarz <slusarz@bigworm.colorado.edu>:
| > The new ZIP MIME_Viewer has been added to HEAD - I'll do the other two 
| > later.  The zip extraction code will appear in an IMP specific
| > MIME_Viewer - thus the reason I abstracted Mike's render() code in his 
| > patch to several different functions in MIME_Viewer_zip::.
| 
| That's a shame - it could be _very_ useful in other places, like in
| Gollem. 
| Can you say why it needs to be this way?

It's a matter of a UI problem - how to tell the MIME Viewer you don't want 
to list (the default output) but rather you want to extract.  How do you 
pass this preference to the MIME Viewer, along with the file you want 
extracted?

With IMP it's easy because, in the MIME Viewer, you add links to the list 
output that will load view.php.  Additionally, you can pass various 
parameters and know that you will be able to access them.  However, with a 
generic driver in Horde, how is this possible?  I am not familiar with 
gollem, but gollem might not have a seperate script (like view.php) to use 
so its links will be different.

I guess a compromise is to put the code that generates the links into the 
Horde viewer.  This function (it could be render()) could accept, as a 
parameter, a callback function that will handle the link production.  Then, 
an application specific Viewer would need only to define this callback to 
handle link production and then call parent::render().  This sounds like a 
viable alternative... any comments?

michael

______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder