make it possible to attache selected messages to a new message
[squirrelmail.git] / src / addrbook_search_html.php
index 585680dc018a97fca25e5353d740929272afd36d..81cb0bc4ebf2c91ed53db422f61334ff5ca33802 100644 (file)
@@ -23,7 +23,7 @@ require_once('../functions/smtp.php');
 require_once('../functions/display_messages.php');
 require_once('../functions/addressbook.php');
 require_once('../functions/plugin.php');
-include_once('../functions/strings.php');
+require_once('../functions/strings.php');
 
 /* Insert hidden data */
 function addr_insert_hidden() {
@@ -31,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" .
@@ -78,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>';
@@ -104,8 +105,12 @@ function addr_display_result($res, $includesource = true) {
 /* --- End functions --- */
 
 global $mailbox;
-displayPageHeader($color, $mailbox);
-
+if ($compose_new_win == '1') {
+    compose_Header($color, $mailbox);
+}
+else {
+    displayPageHeader($color, $mailbox);
+}
 /* Initialize addressbook */
 $abook = addressbook_init();
 
@@ -157,7 +162,12 @@ do_hook('addrbook_html_search_below');
 /* End search form */
 
 /* Show personal addressbook */
-if ($addrquery == '' || !empty($listall)) {
+
+if ( !empty( $listall ) ){
+    $addrquery = '*';
+}
+
+if ($addrquery == '' && empty($listall)) {
 
     if (! isset($backend) || $backend != -1 || $addrquery == '') {
         if ($addrquery == '') {
@@ -184,11 +194,11 @@ if ($addrquery == '' || !empty($listall)) {
         addr_display_result($res, true);
     }
     exit;
-
-else {
+}
+else {
 
     /* Do the search */
-    if (!empty($addrquery) && empty($listall)) {
+    if (!empty($addrquery)) {
 
         if ($backend == -1) {
             $res = $abook->s_search($addrquery);