[imp] customize To: field in Imp 4.2

Paul Caldwell paulcaldwell90 at gmail.com
Fri Oct 17 16:14:22 UTC 2008


On Fri, Oct 17, 2008 at 12:54 AM, Michael M Slusarz <slusarz at horde.org>wrote:

> Paul Caldwell wrote:
> > On Thu, Oct 16, 2008 at 12:40 AM, Paul Caldwell <
> paulcaldwell90 at gmail.com>wrote:
> >
> >
> >> Hi all,
> >>
> >> In Imp 4.2, we need to customize imp/templates/compose/compose.html and
> >> access addr.input_value.  It is an array that loops over the To field
> and
> >> the CC field, but we want to address its value for the To field without
> >> looping.  Could some more knowledgeable shed a light on the grammar to
> >> address that single value?  I tried <tag:addr[0].input_value /> , to no
> >> luck.
> >>
> >> For the curious, we modified Horde Imp a bit so that when the user sends
> an
> >> email, he can choose to send To three destinations: list, support,
> himself,
> >> through a pull-down menu (he cannot type To address any more).  This
> worked
> >> well with 4.1.4, and our hack is attached in the end.  Now we are trying
> to
> >> upgrade to 4.2, but found the codes changed drastically that I can't
> figure
> >> out how to hack it now.  Our hack for 4.1.4 was in
> >> imp/imp/templates/compose/compose.inc :
> >>
> >>   <tr>
> >>     <td class="light rightAlign"><strong><?php echo Horde::label('to',
> >> _("_To")) ?>&nbsp;</strong></td>
> >>     <td class="item">
> >>       <table width="100%">
> >>         <tr width="100%">
> >>                 <td class="leftAlign">
> >>                   <select name="to">
> >>                     <option value="list"<?php if($header['to']=="list")
> >> echo 'selected="selected"' ?>><?php echo _("list") ?></option>
> >>                     <option value="support"<?php
> >> if($header['to']=="support") echo 'selected="selected"' ?>><?php echo
> >> _("support") ?></option>
> >>                     <option value="<?php echo htmlspecialchars($from)
> >> ?>"<?php if($header['to']==$from) echo 'selected="selected"' ?>><?php
> echo
> >> _("self_address") ?>(<?php echo htmlspecialchars($from) ?>)</option>
> >>                   </select>
> >>                 </td>
> >>           <td class="rightAlign"><?php echo Help::link('imp',
> 'compose-to')
> >> ?>&nbsp;</td>
> >>         </tr>
> >>       </table>
> >>     </td>
> >>   </tr>
> >>
> >> Thanks, Paul
> >>
> >>
> >
> >
> > To be more specific, imp/templates/compose/compose.html appears to employ
> > homemade syntax, such as looping, if, and arrays in this "html" file.
>  But I
> > can't find syntax definition of these structures anywhere, especially how
> to
> > address an array element without looping in this "html".  Anyone has any
> > suggestion of decipher it?
> >
> >
> http://wiki.horde.org/Doc/Dev/TemplatePackage
>
> michael
>

That's exactly what I needed!  It does say that no array member can be
accessed without looping in the template. But armed with the documentation I
could copy that particular array member to another variable in the php
(imp/compose.php), and pass it to the html template file
(imp/templates/compose/compose.html).  Problem solved!

Thanks so much for your help,

Paul


More information about the imp mailing list