patch for search (Was Re: [imp] Search, then select,
doesn't do anything to the last item)
Sheeri Kritzer
sheeri.kritzer@tufts.edu
Tue, 23 Jul 2002 16:04:57 -0400
So, the "patch" for having a popup return instead of a blank window (note, this is a hack; it still does a bunch of processing, but because of the way it's written, this was the fastest solution. Basically, instead of saying "no matches to your search" in mailbox.php, I redirect to search.php, and I added a javascript popup to that. This is awful, but it makes our users happy -- additions and revisions are more than welcome. Known bugs: if you click on search when you're within a search it will say "no matches" because the "patch" just looks if you're coming from the search page. As I said, better patches are welcome.)
in templates/search/javascript.inc
add:
<?php echo ($imp['mailbox'] == '**search') ? _("alert('There were no matches to
your search')") : "" ?>
to the top, right after
<script language="JavaScript" type="text/javascript">
<!--
and just before:
function toggleAll(checked)
AND
change templates/mailbox/empty_mailbox.inc to:
<tr>
<td class="text"> </td>
<td class="text" colspan="6">
<i><?php echo ($imp['mailbox'] == '**search') ? _( header('Location: ' . Horde::applicationUrl('search.php', true)) ) :_ ("There are no messages in this mailbox.") ?></i>
</td>
</tr>
Sheeri Kritzer
University Systems Group
Tufts University
617-627-3925
sheeri.kritzer@tufts.edu
> > Also, is there an easy way to have a popup window instead of a whole web
> > page if a search returns no results? Our users do not want to have to
> wait
> > for a web page to load and then click on something else just because their
> > search failed.