X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Faddrbook_search.php;h=53f81c9bf3eb71c69976b1cd953896ad157403a3;hp=fca02aff45349c7f7a9da7f6426acfc4aa2ad7ad;hb=0b97a708e71c931153cd1ceee1495c9f4e1e209b;hpb=db48e3f5d3a7dfaeb19e9e87b9d6a8f6effe11dc diff --git a/src/addrbook_search.php b/src/addrbook_search.php index fca02aff..53f81c9b 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -15,8 +15,30 @@ * $Id$ */ -require_once('../src/validate.php'); -require_once('../functions/strings.php'); +/* Path for SquirrelMail required files. */ +define('SM_PATH','../'); + +/* SquirrelMail required files. */ +require_once(SM_PATH . 'include/validate.php'); +require_once(SM_PATH . 'functions/strings.php'); +require_once(SM_PATH . 'functions/html.php'); + +/* lets get the global vars we may need */ +$key = $_COOKIE['key']; +$username = $_SESSION['username']; +$onetimepad = $_SESSION['onetimepad']; +$base_uri = $_SESSION['base_uri']; + +sqextractGlobalVar('show'); +if ( isset($_POST['query']) ) { + $query = $_POST['query']; +} +if ( isset($_POST['listall']) ) { + $listall = $_POST['listall']; +} +if ( isset($_POST['backend'] ) ) { + $backend = $_POST['backend']; +} /* Function to include JavaScript code */ function insert_javascript() { @@ -93,40 +115,45 @@ function display_result($res, $includesource = true) { insert_javascript(); $line = 0; - echo '
' . - ' | ' . _("Name") . - ' | ' . _("E-mail") . - ' | ' . _("Info"); + echo html_tag( 'table', '', 'center', '', 'border="0" width="98%"' ) . + html_tag( 'tr', '', '', $color[9] ) . + html_tag( 'th', ' ', 'left' ) . + html_tag( 'th', ' ' . _("Name"), 'left' ) . + html_tag( 'th', ' ' . _("E-mail"), 'left' ) . + html_tag( 'th', ' ' . _("Info"), 'left' ); if ($includesource) { - echo ' | ' . _("Source"); + echo html_tag( 'th', ' ' . _("Source"), 'left', 'width="10%"' ); } - echo " |
---|---|---|---|---|
' . + $tr_bgcolor = ''; + $email = htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES); + if ($line % 2) { $tr_bgcolor = $color[0]; } + echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) . + html_tag( 'td', 'To | " . + "'" . $email . "');\">To | " . 'Cc | " . + "'" . $email . "');\">Cc | " . 'Bcc" . - ' | ' . - $row['name'] . ' | ' . - ' " . $row['email'] . ' ' . - ' | ' . $row['label'] . ' '; + "'" . $email . "');\">Bcc", + 'center', '', 'valign="top" width="5%" nowrap' ) . + html_tag( 'td', ' ' . htmlspecialchars($row['name']), 'left', '', 'valign="top" nowrap' ) . + html_tag( 'td', ' ' . + '" . htmlspecialchars($row['email']) . '' + , 'left', '', 'valign="top"' ) . + html_tag( 'td', htmlspecialchars($row['label']), 'left', '', 'valign="top" nowrap' ); if ($includesource) { - echo ' | ' . $row['source']; + echo html_tag( 'td', ' ' . $row['source'], 'left', '', 'valign="top" nowrap' ); } - echo " |