X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Faddrbook_search.php;h=14a2f477599c7b45e644a692f5f3b73ce4933b20;hp=a1c0b7be3b7df331a15a80e058e9d4d3539e9503;hb=19285e85333dd389c3fc3f291bc568afe2e31771;hpb=6dda64534206bf0aa35c57e826605573809176e7 diff --git a/src/addrbook_search.php b/src/addrbook_search.php index a1c0b7be..14a2f477 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -1,114 +1,31 @@ - -\n"; - - while (list($undef, $row) = each($res)) { - $email = htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES); - if ($line % 2) { - $tr_bgcolor = $color[12]; - } else { - $tr_bgcolor = $color[4]; - } - echo html_tag( 'tr', '', '', $tr_bgcolor, 'style="white-space: nowrap;"' ) . - html_tag( 'td', - '"._("To")." | " . - '"._("Cc")." | " . - '"._("Bcc")."", - 'center', '', 'valign="top" width="5%" style="white-space: nowrap;"' ) . - html_tag( 'td', ' ' . htmlspecialchars($row['name']), 'left', '', 'valign="top" style="white-space: nowrap;"' ) . - html_tag( 'td', ' ' . - '" . htmlspecialchars($row['email']) . '' - , 'left', '', 'valign="top"' ) . - html_tag( 'td', htmlspecialchars($row['label']), 'left', '', 'valign="top" style="white-space: nowrap;"' ); - if ($includesource) { - echo html_tag( 'td', ' ' . $row['source'], 'left', '', 'valign="top" style="white-space: nowrap;"' ); - } - - echo "\n"; - $line++; - } - echo ''; + $oTemplate->assign('use_js', true); + $oTemplate->assign('include_abook_name', $includesource); + $oTemplate->assign('addresses', formatAddressList($res)); + + $oTemplate->display('addrbook_search_list.tpl'); } /* ================= End of functions ================= */ -require_once('../functions/strings.php'); -require_once('../functions/addressbook.php'); +/** lets get the global vars we may need */ + +if (! sqgetGlobalVar('show' , $show)) { + $show = ''; +} +if (! sqgetGlobalVar('query', $query, SQ_POST)) { + $query = ''; +} +if (! sqgetGlobalVar('listall', $listall, SQ_POST)) { + unset($listall); +} +if (! sqgetGlobalVar('backend', $backend, SQ_POST)) { + $backend = ''; +} displayHtmlHeader(); +echo "
\n"; /** set correct value of $default_charset */ -global $default_charset; set_my_charset(); -/* Initialize vars */ -if (!isset($query)) { $query = ''; } -if (!isset($show)) { $show = ''; } -if (!isset($backend)) { $backend = ''; } - -/* Choose correct colors for top and bottom frame */ -if ($show == 'form' && !isset($listall)) { - echo ''; -} else { - echo '\n"; -} - /* Empty search */ -if (empty($query) && empty($show) && empty($listall)) { - echo html_tag( 'p', '