X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search.php;h=a403ca7461f175a12fabf1e595e3449466c98bd0;hb=8e530924279d64d4fda7263d18846c678fc308f3;hp=7357e8d0044d076033cec38798d1c9c38ea91b83;hpb=625c8b787b79d07a1e53ba05213f66451d73651e;p=squirrelmail.git diff --git a/src/addrbook_search.php b/src/addrbook_search.php index 7357e8d0..a403ca74 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -1,237 +1,99 @@ - -\n"; + $oTemplate->assign('use_js', true); + $oTemplate->assign('include_abook_name', $includesource); + $oTemplate->assign('addresses', formatAddressList($res)); - while (list($undef, $row) = each($res)) { - $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 | " . - 'Cc | " . - '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 html_tag( 'td', ' ' . $row['source'], 'left', '', 'valign="top" nowrap' ); - } - - echo "\n"; - $line++; - } - echo ''; + $oTemplate->display('addrbook_search_list.tpl'); } /* ================= End of functions ================= */ - -require_once('../functions/strings.php'); -require_once('../functions/addressbook.php'); - -displayHtmlHeader(); - -/* 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"; +/** 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(); /* Empty search */ -if (empty($query) && empty($show) && empty($listall)) { - echo html_tag( 'p', '