[Xapian-discuss] For more UI functionality: OmegaScript, C++ or other?

xapian at catcons.co.uk xapian at catcons.co.uk
Tue May 10 13:36:45 BST 2011


> Date: Mon, 9 May 2011 23:08:52 +0100
> From: Olly Betts <olly at survex.com>
> Subject: Re: [Xapian-discuss] For more UI functionality: OmegaScript,
> 	C++	or other?
> To: xapian at catcons.co.uk
> Cc: xapian-discuss at lists.xapian.org
> Message-ID: <20110509220852.GQ4381 at survex.com>
> Content-Type: text/plain; charset=us-ascii
> 
> On Thu, May 05, 2011 at 06:18:58PM +0530, xapian at catcons.co.uk wrote:
[snip]
> 
> There's no real need to set the elements to zero - if they aren't set,
> then $opt{} returns an empty string - so you could just use:
> 
> $if{$cgilist{B},$map{$cgilist{B},$setmap{BE,$substr{$_,1},1}},
> $setmap{BE,ods,1,pdf,1,xls,1}}
> Extensions: 
> ods:<INPUT TYPE=checkbox NAME=B VALUE=Eods $if{$opt{BE,ods},CHECKED}>
> pdf:<INPUT TYPE=checkbox NAME=B VALUE=Epdf $if{$opt{BE,pdf},CHECKED}>
> xls:<INPUT TYPE=checkbox NAME=B VALUE=Exls $if{$opt{BE,xls},CHECKED}>
> 
> Or factor out the list of extensions, which makes it much simpler to
> modify the list in the future:
> 
> $set{EXTS,$split{Eods Epdf Exls}}
> $map{$or{$cgilist{B},$opt{EXTS}},$setmap{BE,$_,1}}
> Extensions:
> $map{$opt{EXTS},
> $substr{$_,1}:<INPUT TYPE=checkbox NAME=B VALUE=$_ 
> $if{$eq{$opt{BE,$_},1},CHECKED}>}
> 
> Cheers,
>     Olly

Thanks Olly :-)

That's much neater -- the difference between simply making it work and doing
so elegantly.

Thanks also for your explanation about multiple &COLLAPSEs and the final
"-1" on the &xFILTERS value.

Best

Charles




More information about the Xapian-discuss mailing list