Revision: 100
http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=100&view=rev
Author: christian_boltz
Date: 2007-09-27 16:46:59 -0700 (Thu, 27 Sep 2007)
Log Message:
-----------
- fix: edit links contained <span ...>...</span> from search highlighting.
(see forum post: https://sourceforge.net/forum/message.php?msg_id=4540915)
Now using separate variables for highlighting in strings that end up in links.
Modified Paths:
--------------
trunk/templates/search.tpl
Modified: trunk/templates/search.tpl
===================================================================
--- trunk/templates/search.tpl 2007-09-27 23:24:48 UTC (rev 99)
+++ trunk/templates/search.tpl 2007-09-27 23:46:59 UTC (rev 100)
@@ -61,13 +61,14 @@
{
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
//highlight search string
- if (stristr($tAlias[$i]['address'],$fSearch))
+ $tAlias[$i]['display_address'] = $tAlias[$i]['address'];
+ if (stristr($tAlias[$i]['display_address'],$fSearch))
{
$new_address = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" .
- $fSearch . "</span>", $tAlias[$i]['address']);
- $tAlias[$i]['address'] = $new_address;
+ $fSearch . "</span>", $tAlias[$i]['display_address']);
+ $tAlias[$i]['display_address'] = $new_address;
}
- print " <td>" . $tAlias[$i]['address'] . "</td>\n";
+ print " <td>" . $tAlias[$i]['display_address'] . "</td>\n";
if (stristr($tAlias[$i]['goto'],$fSearch))
{
$new_goto = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" .
@@ -137,13 +138,14 @@
if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0))
{
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
- if (stristr($tMailbox[$i]['username'],$fSearch))
+ $tMailbox[$i]['display_username'] = $tMailbox[$i]['username'];
+ if (stristr($tMailbox[$i]['display_username'],$fSearch))
{
$new_name = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" .
- $fSearch . "</span>", $tMailbox[$i]['username']);
- $tMailbox[$i]['username'] = $new_name;
+ $fSearch . "</span>", $tMailbox[$i]['display_username']);
+ $tMailbox[$i]['display_username'] = $new_name;
}
- print " <td>" . $tMailbox[$i]['username'] . "</td>\n";
+ print " <td>" . $tMailbox[$i]['display_username'] . "</td>\n";
if (stristr($tMailbox[$i]['name'],$fSearch))
{
$new_name = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|