All globals removed. hmmmm .... fasten seat belts ....
[squirrelmail.git] / src / addrbook_search_html.php
index 51d2b538e77d27c168dfe862c3e325363fa9f9a9..98cbe4ca35188386e39109d7c61115d8acf8a6a4 100644 (file)
@@ -23,6 +23,7 @@ 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');
 
 /* Insert hidden data */
 function addr_insert_hidden() {
@@ -30,8 +31,9 @@ function addr_insert_hidden() {
            $identity;
 
    echo '<input type=hidden value="';
-   if (substr($body, 0, 1) == "\r")
+   if (substr($body, 0, 1) == "\r") {
        echo "\n";
+   }
    echo htmlspecialchars($body) . '" name=body>' . "\n" .
         '<input type=hidden value="' . htmlspecialchars($subject) .
         '" name=subject>' . "\n" .
@@ -77,11 +79,11 @@ function addr_display_result($res, $includesource = true) {
         if ($line % 2) { echo ' bgcolor="' . $color[0] . '"'; }
         echo ' nowrap><td nowrap align=center width="5%">' .
              '<input type=checkbox name="send_to_search[T' . $line . ']" value = "' .
-             htmlspecialchars($row['email']) . '">&nbsp;To&nbsp;' .
+             htmlspecialchars($row['email']) . '">&nbsp;' . _("To") . '&nbsp;' .
              '<input type=checkbox name="send_to_search[C' . $line . ']" value = "' .
-             htmlspecialchars($row['email']) . '">&nbsp;Cc&nbsp;' .
+             htmlspecialchars($row['email']) . '">&nbsp;' . _("Cc") . '&nbsp;' .
              '<input type=checkbox name="send_to_search[B' . $line . ']" value = "' .
-             htmlspecialchars($row['email']) . '">&nbsp;Bcc&nbsp;' . 
+             htmlspecialchars($row['email']) . '">&nbsp;' . _("Bcc") . '&nbsp;' . 
              '</td><td nowrap>&nbsp;' . $row['name'] . '&nbsp;</td>' .
              '<td nowrap>&nbsp;' . $row['email'] . '&nbsp;</td>' .
              '<td nowrap>&nbsp;' . $row['label'] . '&nbsp;</td>';
@@ -184,10 +186,13 @@ if ($addrquery == '' || !empty($listall)) {
     }
     exit;
 
+    if ( !empty( $listall ) ){
+        $addrquery = '*';
+    }
 } else {
 
     /* Do the search */
-    if (!empty($addrquery) && empty($listall)) {
+    if (!empty($addrquery)) {
 
         if ($backend == -1) {
             $res = $abook->s_search($addrquery);
@@ -220,4 +225,4 @@ if ($addrquery == '' || sizeof($res) == 0) {
 }
 
 ?>
-</body></html>
+</body></html>
\ No newline at end of file