X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Faddrbook_search_html.php;h=71e7d0c9cae41780b388c98e27cf65d17e141454;hp=3b128f9264dc66067c994c3659e8eb27de706181;hb=c4faef335b2362c81b8ebf026d4066c12d70536c;hpb=39bfea8fa9fd939da9766a79381f68ea4b725c23
diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php
index 3b128f92..71e7d0c9 100644
--- a/src/addrbook_search_html.php
+++ b/src/addrbook_search_html.php
@@ -1,40 +1,40 @@
entities)
+ echo addHidden('attachments', urlencode(serialize($composeMessage->entities)));
echo addHidden('session', $session).
+ addHidden('smaction', $action).
addHidden('subject', $subject).
addHidden('send_to', $send_to).
addHidden('send_to_bcc', $send_to_bcc).
addHidden('send_to_cc', $send_to_cc).
+ addHidden('mailprio', $mailprio).
+ addHidden('request_mdn', $request_mdn).
+ addHidden('request_dr', $request_dr).
addHidden('identity', $identity).
addHidden('mailbox', $mailbox).
addHidden('from_htmladdr_search', 'true');
@@ -65,103 +74,24 @@ function addr_insert_hidden() {
/**
* List search results
* @param array $res Array containing results of search
- * @param bool $includesource UNDOCUMENTED [Default=true]
+ * @param bool $includesource If true, adds backend column to address listing
*/
function addr_display_result($res, $includesource = true) {
- global $color, $javascript_on, $PHP_SELF, $squirrelmail_language;
-
- if (sizeof($res) <= 0) return;
+ global $PHP_SELF, $oTemplate, $oErrorHandler;
+
- echo addForm($PHP_SELF, 'POST', 'addrbook').
+//FIXME: no HTML output from core
+ echo addForm($PHP_SELF, 'post', 'addressbook', '', '', array(), TRUE).
addHidden('html_addr_search_done', 'true');
addr_insert_hidden();
- $line = 0;
-
-if ($javascript_on) {
- print
- '\n";
- $chk_all = '' . _("All") . ' To'.
- ' '.
- '' . _("All") . ' Cc'.
- ' '.
- '' . _("All") . '';
- }
- 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 html_tag( 'th', ' ' . _("Source"), 'left', '', 'width="10%"' );
- }
-
- echo "\n";
-
- foreach ($res as $row) {
- $email = AddressBook::full_address($row);
- if ($line % 2) {
- $tr_bgcolor = $color[12];
- } else {
- $tr_bgcolor = $color[4];
- }
- if ($squirrelmail_language == 'ja_JP')
- {
- echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
- html_tag( 'td',
- ' ' . _("To") . ' ' .
- ' ' . _("Cc") . ' ' .
- ' ' . _("Bcc") . ' ' ,
- 'center', '', 'width="5%" nowrap' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . ' ', 'left', '', 'nowrap' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['email']) . ' ', 'left', '', 'nowrap' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'nowrap' );
- } else {
- echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
- html_tag( 'td',
- addCheckBox('send_to_search[T'.$line.']', FALSE, $email).
- ' ' . _("To") . ' ' .
- addCheckBox('send_to_search[C'.$line.']', FALSE, $email).
- ' ' . _("Cc") . ' ' .
- addCheckBox('send_to_search[B'.$line.']', FALSE, $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 html_tag( 'td', ' ' . $row['source'] . ' ', 'left', '', 'nowrap' );
- }
- echo "\n";
- $line ++;
- }
- if ($includesource) { $td_colspan = '5'; } else { $td_colspan = '4'; }
- echo html_tag( 'tr',
- html_tag( 'td',
- '' ,
- 'center', '', 'colspan="'. $td_colspan .'"' )
- ) .
- '' .
- addHidden('html_addr_search_done', '1').
- '';
+
+ $oTemplate->assign('compose_addr_pop', false);
+ $oTemplate->assign('include_abook_name', $includesource);
+ $oTemplate->assign('addresses', formatAddressList($res));
+
+ $oTemplate->display('addrbook_search_list.tpl');
+
+ echo '';
}
/* --- End functions --- */
@@ -172,84 +102,45 @@ if ($compose_new_win == '1') {
else {
displayPageHeader($color, $mailbox);
}
-/* Initialize addressbook */
-$abook = addressbook_init();
+/** set correct value of $default_charset */
+set_my_charset();
-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"' );
+/* Initialize addressbook */
+$abook = addressbook_init();
/* Search form */
-echo '