use same width as other tables on src/addressbook.php
[squirrelmail.git] / src / addressbook.php
index 09a5a41bb85587744bdd393633066fea870b9441..de712e846d9665d98e4a0a612ac4c0dce4b2584c 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * addressbook.php
  *
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Manage personal address book.
@@ -45,10 +45,15 @@ sqgetGlobalVar('doedit',    $doedit,    SQ_POST);
 /* Get sorting order */
 $abook_sort_order = get_abook_sort();
 
+/* Create page header before addressbook_init in order to  display error messages correctly. */
+displayPageHeader($color, 'None');
+
 /* Open addressbook with error messages on.
  remote backends (LDAP) are enabled because they can be used. (list_addr function)
 */
 $abook = addressbook_init(true, false);
+
+// FIXME: do we have to stop use of address book, when localbackend is not present.
 if($abook->localbackend == 0) {
     plain_error_message(
             _("No personal address book is defined. Contact administrator."),
@@ -56,7 +61,6 @@ if($abook->localbackend == 0) {
     exit();
 }
 
-displayPageHeader($color, 'None');
 
 $defdata   = array();
 $formerror = '';
@@ -320,9 +324,9 @@ if ($showaddrlist) {
                             ' ' ,
                             'center', '', 'valign="top" width="1%"' );
                 }
-                echo html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
-                    html_tag( 'td', ' ' . $row['lastname'] . ' ' . $row['firstname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
-                    html_tag( 'td', '', 'left', '', 'valign="top" width="1%" nowrap' ) . ' ';
+                echo html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" style="white-space: nowrap;"' ) .
+                    html_tag( 'td', ' ' . $row['lastname'] . ' ' . $row['firstname'] . ' ', 'left', '', 'valign="top" width="1%" style="white-space: nowrap;"' ) .
+                    html_tag( 'td', '', 'left', '', 'valign="top" width="1%" style="white-space: nowrap;"' ) . ' ';
             } else {
                 echo html_tag( 'tr', '', '', $tr_bgcolor);
                 if ($abook->backends[$row['backend']]->writeable) {
@@ -336,9 +340,9 @@ if ($showaddrlist) {
                             ' ' ,
                             'center', '', 'valign="top" width="1%"' );
                 }
-                echo html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
-                    html_tag( 'td', ' ' . $row['name'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
-                    html_tag( 'td', '', 'left', '', 'valign="top" width="1%" nowrap' ) . ' ';
+                echo html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" style="white-space: nowrap;"' ) .
+                    html_tag( 'td', ' ' . $row['name'] . ' ', 'left', '', 'valign="top" width="1%" style="white-space: nowrap;"' ) .
+                    html_tag( 'td', '', 'left', '', 'valign="top" width="1%" style="white-space: nowrap;"' ) . ' ';
             }
             $email = $abook->full_address($row);
             echo makeComposeLink('src/compose.php?send_to='.rawurlencode($email),