X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search_html.php;h=2865b9a925c0456aa0da810bab2bf7f474ddd05d;hb=97ffe9633390a5b33b69dd2882abb6c9ab2592b1;hp=0112e7dfb7439cac02d13ea2e31b0ee7db9233f1;hpb=6a12032e88e04ed9449e3640c934b41e45b065c2;p=squirrelmail.git diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index 0112e7df..2865b9a9 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -10,20 +10,32 @@ * * This file is included from compose.php * - * NOTE: A lot of this code is similar to the code in - * addrbook_search.html -- If you change one, change - * the other one too! - * * $Id$ */ -require_once('../src/validate.php'); -require_once('../functions/date.php'); -require_once('../functions/smtp.php'); -require_once('../functions/display_messages.php'); -require_once('../functions/addressbook.php'); -require_once('../functions/plugin.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/date.php'); +require_once(SM_PATH . 'functions/display_messages.php'); +require_once(SM_PATH . 'functions/addressbook.php'); +require_once(SM_PATH . 'functions/plugin.php'); +require_once(SM_PATH . 'functions/strings.php'); +require_once(SM_PATH . 'functions/html.php'); + +$session = $_POST['session']; +$mailbox = $_POST['mailbox']; +if ( isset($_POST['addrquery']) ) { + $addrquery = $_POST['addrquery']; +} +if ( isset($_POST['listall']) ) { + $listall = $_POST['listall']; +} +if ( isset($_POST['backend'] ) ) { + $backend = $_POST['backend']; +} /* Insert hidden data */ function addr_insert_hidden() { @@ -83,43 +95,49 @@ if ($javascript_on) { '  '. '' . _("All") . ''; } - echo '' . - '' . - '' . - '' . - ''; - - + echo html_tag( 'table', '', 'center', '', 'border="0" width="98%"' ) . + html_tag( 'tr', '', '', $color[9] ) . + html_tag( 'th', ' ' . $chk_all, 'left' ) . + html_tag( 'th', ' ' . _("Name"), 'left' ) . + html_tag( 'th', ' ' . _("E-mail"), 'left' ) . + html_tag( 'th', ' ' . _("Info"), 'left' ); if ($includesource) { - echo ''; + echo html_tag( 'th', ' ' . _("Source"), 'left', '', 'width="10%"' ); } - echo "\n"; + echo "\n"; foreach ($res as $row) { - echo '' . - '' . - ''; + htmlspecialchars($email) . '"> ' . _("Bcc") . ' ' , + 'center', '', 'width="5%" nowrap' ) . + html_tag( 'td', ' ' . htmlspecialchars($row['name']) . ' ', 'left', '', 'nowrap' ) . + html_tag( 'td', ' ' . htmlspecialchars($row['email']) . ' ', 'left', '', 'nowrap' ) . + html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'nowrap' ); + if ($includesource) { - echo ''; + echo html_tag( 'td', ' ' . $row['source'] . ' ', 'left', '', 'nowrap' ); } echo "\n"; $line ++; } - echo '' . + if ($includesource) { $td_colspan = '5'; } else { $td_colspan = '4'; } + echo html_tag( 'tr', + html_tag( 'td', + '' , + 'center', '', 'colspan="'. $td_colspan .'"' ) + ) . '
 ' . $chk_all . ' ' . _("Name") . ' ' . _("E-mail") . ' ' . _("Info") . ' ' . _("Source"). '
' . + $tr_bgcolor = ''; + $email = AddressBook::full_address($row); + if ($line % 2) { $tr_bgcolor = $color[0]; } + echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) . + html_tag( 'td', ' ' . _("To") . ' ' . + htmlspecialchars($email) . '"> ' . _("To") . ' ' . ' ' . _("Cc") . ' ' . + htmlspecialchars($email) . '"> ' . _("Cc") . ' ' . ' ' . _("Bcc") . ' ' . - ' ' . $row['name'] . '  ' . $row['email'] . '  ' . $row['label'] . '  ' . $row['source'] . ' 
' . '' . ''; @@ -127,7 +145,6 @@ if ($javascript_on) { /* --- End functions --- */ -global $mailbox; if ($compose_new_win == '1') { compose_Header($color, $mailbox); } @@ -137,21 +154,23 @@ else { /* Initialize addressbook */ $abook = addressbook_init(); -?> -
- -
-
-
+echo '
' . +html_tag( 'table', + html_tag( 'tr', + html_tag( 'td', '' . _("Address Book Search") . '', 'center', $color[0] ) + ) , +'center', '', 'width="95%" cellpadding="2" cellspacing="2" border="0"' ); -\n
\n" . - '
' . "\n
\n" . - ' ' . _("Search for") . "\n"; +echo '
' . + html_tag( 'table', '', 'center', '', 'border="0"' ) . + html_tag( 'tr' ) . + html_tag( 'td', '', 'left', '', 'nowrap valign="middle"' ) . "\n" . + '' . "\n
\n" . + ' ' . _("Search for") . "\n"; addr_insert_hidden(); if (! isset($addrquery)) $addrquery = ''; @@ -184,7 +203,7 @@ echo '' . '" NAME=listall>' . "\n" . '
' . "\n"; addr_insert_hidden(); -echo ''; +echo ''; do_hook('addrbook_html_search_below'); /* End search form */ @@ -209,10 +228,10 @@ if ($addrquery == '' && empty($listall)) { usort($res,'alistcmp'); addr_display_result($res, false); } else { - echo '

' . + echo html_tag( 'p', '
' . sprintf(_("Unable to list addresses from %s"), - $abook->backends[$backend]->sname) . - "

\n"; + $abook->backends[$backend]->sname) . "\n" , + 'center' ); } } else { @@ -234,14 +253,17 @@ else { } if (!is_array($res)) { - echo '


' . - _("Your search failed with the following error(s)") . ':
' . - $abook->error . "

\n\n"; + echo html_tag( 'p', '
' . + _("Your search failed with the following error(s)") . + ':
' . $abook->error . "
\n" , + 'center' ) . + "\n\n"; } else { if (sizeof($res) == 0) { - echo '


' . - _("No persons matching your search was found") . - ".

\n\n"; + echo html_tag( 'p', '
' . + _("No persons matching your search was found") . "\n" , + 'center' ) . + "\n\n"; } else { addr_display_result($res); }