r2l by Yoav
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Jun 2002 10:28:24 +0000 (10:28 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Jun 2002 10:28:24 +0000 (10:28 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2995 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/addrbook_search.php
src/addressbook.php

index 8051122a078662e024720d27c9cc4c510559218e..0f9b4bacb13698968250e807545f04223f9d3eec 100644 (file)
@@ -17,6 +17,7 @@
 
 require_once('../src/validate.php');
 require_once('../functions/strings.php');
+require_once('../functions/html.php');
 
 /* Function to include JavaScript code */
 function insert_javascript() {
@@ -93,40 +94,44 @@ function display_result($res, $includesource = true) {
     insert_javascript();
         
     $line = 0;
-    echo '<TABLE BORDER="0" WIDTH="98%" ALIGN=center>' .
-         '<TR BGCOLOR="' . $color[9] . '"><TH ALIGN=left>&nbsp;' .
-         '<TH ALIGN=left>&nbsp;' . _("Name") .
-         '<TH ALIGN=left>&nbsp;' . _("E-mail") .
-         '<TH ALIGN=left>&nbsp;' . _("Info");
+    echo html_tag( 'table', '', 'center', '', 'border="0" width="98%"' ) .
+    html_tag( 'tr', '', '', $color[9] ) .
+    html_tag( 'th', '&nbsp;', 'left' ) .
+    html_tag( 'th', '&nbsp;' . _("Name"), 'left' ) .
+    html_tag( 'th', '&nbsp;' . _("E-mail"), 'left' ) .
+    html_tag( 'th', '&nbsp;' . _("Info"), 'left' );
 
     if ($includesource) {
-        echo '<TH ALIGN=left WIDTH="10%">&nbsp;' . _("Source");
+        echo html_tag( 'th', '&nbsp;' . _("Source"), 'left', 'width="10%"' );
     }    
-    echo "</TR>\n";
+    echo "</tr>\n";
     
     while (list($undef, $row) = each($res)) {
-        echo '<tr';
-        if ($line % 2) { echo ' bgcolor="' . $color[0] . '"'; }
-        echo ' nowrap><td valign=top nowrap align=center width="5%">' .
+        $tr_bgcolor = '';
+        if ($line % 2) { $tr_bgcolor = $color[0]; }
+        echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
+        html_tag( 'td',
              '<small><a href="javascript:to_address(' . 
                                        "'" . $row['email'] . "');\">To</A> | " .
              '<a href="javascript:cc_address(' . 
                                        "'" . $row['email'] . "');\">Cc</A> | " .
              '<a href="javascript:bcc_address(' . 
-                                 "'" . $row['email'] . "');\">Bcc</A></small>" .
-             '<td nowrap valign=top>&nbsp;' .
-                                 $row['name'] . '<td valign=top>' .
+                                 "'" . $row['email'] . "');\">Bcc</A></small>",
+        'center', '', 'valign="top" width="5%" nowrap' ) .
+        html_tag( 'td', '&nbsp;' . $row['name'], 'left', '', 'valign="top" nowrap' ) .
+        html_tag( 'td', '&nbsp;' .
              '<a href="javascript:to_and_close(' .
-                 "'" . $row['email'] . "');\">" . $row['email'] . '</A>' .
-             '<td valign=top nowrap>' . $row['label'];
+                 "'" . $row['email'] . "');\">" . $row['email'] . '</A>'
+        , 'left', '', 'valign="top"' ) .
+        html_tag( 'td', $row['label'], 'left', '', 'valign="top" nowrap' );
         if ($includesource) {
-            echo '<td nowrap valign=top>&nbsp;' . $row['source'];
+            echo html_tag( 'td', '&nbsp;' . $row['source'], 'left', '', 'valign="top" nowrap' );
         }
 
-        echo "</TR>\n";
+        echo "</tr>\n";
         $line++;
     }
-    echo '</TABLE>';
+    echo '</table>';
 }
 
 /* ================= End of functions ================= */
@@ -156,9 +161,10 @@ if ($show == 'form' && !isset($listall)) {
 
 /* Empty search */
 if (empty($query) && empty($show) && empty($listall)) {
-    echo '<P ALIGN=center><BR>' .
-          _("No persons matching your search was found") .
-          "</P>\n</BODY></HTML>\n",
+    echo html_tag( 'p', '<br>' .
+                      _("No persons matching your search was found"),
+            'center' ) .
+          "\n</BODY></HTML>\n",
     exit;
 }
 
@@ -169,11 +175,12 @@ $abook = addressbook_init();
 if ($show == 'form' && empty($listall)) {
     echo '<FORM NAME=sform TARGET=abookres ACTION="addrbook_search.php'. 
          '" METHOD="POST">' . "\n" .
-         '<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%">' .
-         '<TR><TD NOWRAP VALIGN=middle align=left width=10%>' . "\n" .
-         '  <STRONG>' . _("Search for") . "</STRONG>\n" .
-         '  </TD><TD align=left><INPUT TYPE=text NAME=query VALUE="' . htmlspecialchars($query) .
-         "\" SIZE=28>\n";
+         html_tag( 'table', '', '', '', 'border="0" width="100%" height="100%"' ) .
+         html_tag( 'tr' ) .
+         html_tag( 'td', '  <strong>' . _("Search for") . "</strong>\n", 'left', '', 'nowrap valign="middle" width="10%"' ) .
+         html_tag( 'td', '', 'left', '', '' ) .
+                 '<INPUT TYPE=text NAME=query VALUE="' . htmlspecialchars($query) .
+                 "\" SIZE=28>\n";
 
     /* List all backends to allow the user to choose where to search */
     if ($abook->numbackends > 1) {
@@ -188,13 +195,18 @@ if ($show == 'form' && empty($listall)) {
         echo '<INPUT TYPE=hidden NAME=backend VALUE=-1>' . "\n";
     }
         
-    echo '</TD></TR><TR><TD></TD><TD align=left>'.
-         '<INPUT TYPE=submit VALUE="' . _("Search") . '" NAME=show>' .
-         '&nbsp;|&nbsp;<INPUT TYPE=submit VALUE="' . _("List all") .
-         '" NAME=listall>' . "\n" .
-         '&nbsp;|&nbsp;<INPUT TYPE=button VALUE="' . _("Close") .
-         '" onclick="parent.close();">' . "\n" .
-         '</TD></TR></TABLE></FORM>' . "\n";
+    echo '</td></tr>' .
+    html_tag( 'tr',
+                    html_tag( 'td', '', 'left' ) .
+                    html_tag( 'td',
+                            '<INPUT TYPE=submit VALUE="' . _("Search") . '" NAME=show>' .
+                            '&nbsp;|&nbsp;<INPUT TYPE=submit VALUE="' . _("List all") .
+                            '" NAME=listall>' . "\n" .
+                            '&nbsp;|&nbsp;<INPUT TYPE=button VALUE="' . _("Close") .
+                            '" onclick="parent.close();">' . "\n" ,
+                    'left' )
+            ) .
+         '</table></form>' . "\n";
 } else {
 
     /* Show personal addressbook */
@@ -210,10 +222,10 @@ if ($show == 'form' && empty($listall)) {
                 usort($res,'alistcmp');
                 display_result($res, false);
             } else {
-                echo '<P ALIGN=center><STRONG>' .
-                     sprintf(_("Unable to list addresses from %s"),
-                         $abook->backends[$backend]->sname) .
-                     '</STRONG></P>' . "\n";
+                echo html_tag( 'p', '<strong>' .
+                                 sprintf(_("Unable to list addresses from %s"),
+                                     $abook->backends[$backend]->sname) . '</strong>' ,
+                       'center' ) . "\n";
             }
         } else {
             $res = $abook->list_addr();
@@ -236,16 +248,19 @@ if ($show == 'form' && empty($listall)) {
             }
         
             if (!is_array($res)) {
-                echo '<P ALIGN=center><B><BR>' .
-                     _("Your search failed with the following error(s)") .
-                     ':<br>' . $abook->error . "</B></P>\n</BODY></HTML>\n";
+                echo html_tag( 'p', '<b><br>' .
+                                 _("Your search failed with the following error(s)") .
+                                 ':<br>' . $abook->error . "</b>\n" ,
+                       'center' ) .
+                "\n</BODY></HTML>\n";
                 exit;
             }
         
             if (sizeof($res) == 0) {
-                echo '<P ALIGN=center><BR><B>' .
-                     _("No persons matching your search was found") .
-                     ".</B></P>\n</BODY></HTML>\n";
+                echo html_tag( 'p', '<br><b>' .
+                                 _("No persons matching your search was found") . "</b>\n" ,
+                       'center' ) .
+                "\n</BODY></HTML>\n";
                 exit;
             }
         
index 2284886cd0031c4ce38d97b7d8f8f39256827db0..f81ae4eff092c11772a5eca868f1410a8c92bebd 100644 (file)
@@ -16,37 +16,40 @@ require_once('../functions/array.php');
 require_once('../functions/display_messages.php');
 require_once('../functions/addressbook.php');
 require_once('../functions/strings.php');
+require_once('../functions/html.php');
 
 /* Make an input field */
 function adressbook_inp_field($label, $field, $name, $size, $values, $add) {
     global $color;
-    echo '<TR><TD BGCOLOR="' . $color[4] . '" ALIGN=RIGHT>' .
-         $label . ':</TD>' .
-         '<TD BGCOLOR="' . $color[4] . '" ALIGN=left>' .
-         '<INPUT NAME="' . $name . '[' . $field . ']" SIZE="' . $size . '" VALUE="';
+    $td_str = '<INPUT NAME="' . $name . '[' . $field . ']" SIZE="' . $size . '" VALUE="';
     if (isset($values[$field])) {
-        echo htmlspecialchars($values[$field]);
+        $td_str .= htmlspecialchars($values[$field]);
     }
-    echo '">' . $add . '</TD></TR>' . "\n";
+    $td_str .= '">' . $add . '';
+    return html_tag( 'tr' ,
+        html_tag( 'td', $label . ':', 'right', $color[4]) .
+        html_tag( 'td', $td_str, 'left', $color[4])
+        )
+    . "\n";
 }
 
 /* Output form to add and modify address data */
 function address_form($name, $submittext, $values = array()) {
     global $color;
-
-    echo '<TABLE BORDER=0 CELLPADDING=1 COLS=2 WIDTH="90%" ALIGN=center>' ."\n";
-
-    adressbook_inp_field(_("Nickname"),     'nickname', $name, 15, $values,
-        '<SMALL>' . _("Must be unique") . '</SMALL>');
-    adressbook_inp_field(_("E-mail address"),  'email', $name, 45, $values, '');
-    adressbook_inp_field(_("First name"),  'firstname', $name, 45, $values, '');
-    adressbook_inp_field(_("Last name"),    'lastname', $name, 45, $values, '');
-    adressbook_inp_field(_("Additional info"), 'label', $name, 45, $values, '');
-
-    echo '<TR><TD COLSPAN=2 BGCOLOR="' . $color[4] . '" ALIGN=center>' . "\n" .
-         '<INPUT TYPE=submit NAME="' . $name . '[SUBMIT]" VALUE="' .
-         $submittext . '"></TD></TR>' .
-         "\n</TABLE>\n";
+    echo html_tag( 'table',
+                       adressbook_inp_field(_("Nickname"),     'nickname', $name, 15, $values,
+                           '<SMALL>' . _("Must be unique") . '</SMALL>') .
+                       adressbook_inp_field(_("E-mail address"),  'email', $name, 45, $values, '') .
+                       adressbook_inp_field(_("First name"),  'firstname', $name, 45, $values, '') .
+                       adressbook_inp_field(_("Last name"),    'lastname', $name, 45, $values, '') .
+                       adressbook_inp_field(_("Additional info"), 'label', $name, 45, $values, '') .
+                       html_tag( 'tr',
+                           html_tag( 'td',
+                                       '<INPUT TYPE=submit NAME="' . $name . '[SUBMIT]" VALUE="' .
+                                       $submittext . '">',
+                                   'center', $color[4], 'colspan="2"')
+                       )
+    , 'center', '', 'border="0" cellpadding="1" cols="2" width="90%"') ."\n";
 }
 
 
@@ -162,11 +165,13 @@ if($REQUEST_METHOD == 'POST') {
                         /* Display the "new address" form */
                         echo '<FORM ACTION="' . $PHP_SELF . '" METHOD="POST">' .
                              "\n" .
-                             '<TABLE WIDTH="100%" COLS=1 ALIGN=CENTER>' . "\n" .
-                             '<TR><TD BGCOLOR="' . $color[0] .
-                             '" ALIGN=CENTER>' . "\n" . '<STRONG>' .
-                             _("Update address") .
-                             "</STRONG>\n</TD></TR>\n</TABLE>\n";
+                             html_tag( 'table',
+                                html_tag( 'tr',
+                                   html_tag( 'td',
+                                      "\n". '<strong>' . _("Update address") . '</strong>' ."\n",
+                                      'center', $color[0] )
+                                   ),
+                             'center', '', 'width="100%" cols="1"' ) .
                         address_form("editaddr", _("Update address"), $olddata);
                         echo '<INPUT TYPE=hidden NAME=oldnick VALUE="' . 
                              htmlspecialchars($olddata["nickname"]) . "\">\n" .
@@ -185,20 +190,25 @@ if($REQUEST_METHOD == 'POST') {
                         /* Handle error messages */
                         if (!$r) {
                             /* Display error */
-                            echo '<TABLE WIDTH="100%" COLS=1 ALIGN=CENTER>' .
-                                 "\n" . '<TR><TD ALIGN=CENTER>' . "\n" .
-                                 '<br><STRONG><FONT COLOR="' . $color[2] .
-                                 '">' . _("ERROR") . ": " . $abook->error .
-                                 '</FONT></STRONG>' . "\n</TD></TR>\n</TABLE>\n";
+                             echo html_tag( 'table',
+                                html_tag( 'tr',
+                                   html_tag( 'td',
+                                      "\n". '<br><strong><font color="' . $color[2] .
+                                      '">' . _("ERROR") . ': ' . $abook->error . '</font></strong>' ."\n",
+                                      'center' )
+                                   ),
+                             'center', '', 'width="100%" cols="1"' );
 
                             /* Display the "new address" form again */
                             echo '<FORM ACTION="' . $PHP_SELF .
                                  '" METHOD="POST">' . "\n" .
-                                 '<TABLE WIDTH="100%" COLS=1 ALIGN=CENTER>' .
-                                 "\n" . '<TR><TD BGCOLOR="' . $color[0] .
-                                 '" ALIGN=CENTER>' . "\n" . '<STRONG>' .
-                                 _("Update address") .
-                                 "</STRONG>\n</TD></TR>\n</TABLE>\n";
+                                 html_tag( 'table',
+                                     html_tag( 'tr',
+                                         html_tag( 'td',
+                                                    "\n". '<br><strong>' . _("Update address") . '</strong>' ."\n",
+                                         'center', $color[0] )
+                                     ),
+                                 'center', '', 'width="100%" cols="1"' ) .
                             address_form("editaddr", _("Update address"), $newdata);
                             echo '<INPUT TYPE=hidden NAME=oldnick VALUE="' .
                                  htmlspecialchars($oldnick) . "\">\n" .
@@ -234,10 +244,14 @@ if($REQUEST_METHOD == 'POST') {
 
 /* Display error messages */
 if (!empty($formerror)) {
-    echo '<TABLE WIDTH="100%" COLS=1 ALIGN=CENTER>' . "\n" .
-         '<TR><TD ALIGN=CENTER>' . "\n" . '<br><STRONG>' .
-         '<FONT COLOR="' . $color[2]. '">' . _("ERROR") . ': ' . $formerror .
-         '</FONT></STRONG>' . "\n</TD></TR>\n</TABLE>\n";
+    echo html_tag( 'table',
+        html_tag( 'tr',
+            html_tag( 'td',
+                   "\n". '<br><strong><font color="' . $color[2] .
+                   '">' . _("ERROR") . ': ' . $formerror . '</font></strong>' ."\n",
+            'center' )
+        ),
+    'center', '', 'width="100%" cols="1"' );
 }
 
 
@@ -254,8 +268,7 @@ if ($showaddrlist) {
     $prevbackend = -1;
     $headerprinted = false;
 
-    echo '<p align=center><a href="#AddAddress">' .
-         _("Add address") . "</a></p>\n";
+    echo html_tag( 'p', '<a href="#AddAddress">' . _("Add address") . '</a>', 'center' ) . "\n";
 
     /* List addresses */
     if (count($alist) > 0) {
@@ -265,26 +278,34 @@ if ($showaddrlist) {
             /* New table header for each backend */
             if($prevbackend != $row['backend']) {
                 if($prevbackend < 0) {
-                    echo '<TR><TD COLSPAN=5 ALIGN=center>' . "\n" .
-                         '<INPUT TYPE=submit NAME=editaddr VALUE="' . 
-                         _("Edit selected") . "\">\n" .
-                         '<INPUT TYPE=submit NAME=deladdr VALUE="' .
-                         _("Delete selected") . "\">\n</tr>\n" .
-                         '<TR><TD COLSPAN="5" ALIGN=center>' .
-                         '&nbsp;<BR></TD></TR></TABLE>' . "\n";
+                    echo html_tag( 'table',
+                                    html_tag( 'tr',
+                                          html_tag( 'td',
+                                                     '<INPUT TYPE=submit NAME=editaddr VALUE="' . 
+                                                     _("Edit selected") . "\">\n" .
+                                                     '<INPUT TYPE=submit NAME=deladdr VALUE="' .
+                                                     _("Delete selected") . "\">\n",
+                                          'center', '', 'colspan="5"' )
+                                    ) .
+                                    html_tag( 'tr',
+                                          html_tag( 'td', '&nbsp;<br>', 'center', '', 'colspan="5"' )
+                                    ) ,
+                             'center' );
                 }
     
-                echo '<TABLE WIDTH="95%" COLS=1 ALIGN=CENTER>' . "\n" .
-                     '<TR><TD BGCOLOR="' . $color[0] . '" ALIGN=CENTER>' . "\n" .
-                     '<STRONG>' . $row['source'] .
-                     "</STRONG>\n</TD></TR>\n</TABLE>\n" .
-                     '<TABLE COLS="5" BORDER="0" CELLPADDING="1" CELLSPACING="0"' .
-                     ' WIDTH="90%" ALIGN="center">' .
-                     '<TR BGCOLOR="' . $color[9] .
-                     '"><TH ALIGN=left WIDTH="1%">&nbsp;<TH ALIGN=left WIDTH="1%">' .
-                     _("Nickname") . '<TH ALIGN=left WIDTH="1%">' . _("Name") .
-                     '<TH ALIGN=left WIDTH="1%">' . _("E-mail") .
-                     '<TH ALIGN=left WIDTH="%">' . _("Info") . "</TR>\n";
+                echo html_tag( 'table',
+                                html_tag( 'tr',
+                                    html_tag( 'td', "\n" . '<strong>' . $row['source'] . '</strong>' . "\n", 'center', $color[0] )
+                                ) ,
+                        'center', '', 'width="95%" cols="1"' ) ."\n"
+                . html_tag( 'table', '', 'center', '', 'cols="5" border="0" cellpadding="1" cellspacing="0" width="90%"' ) .
+                      html_tag( 'tr', "\n" .
+                          html_tag( 'th', '&nbsp;', 'left', '', 'width="1%"' ) .
+                          html_tag( 'th', _("Nickname"), 'left', '', 'width="1%"' ) .
+                          html_tag( 'th', _("Name"), 'left', '', 'width="1%"' ) .
+                          html_tag( 'th', _("E-mail"), 'left', '', 'width="1%"' ) .
+                          html_tag( 'th', _("Info"), 'left', '', 'width="1%"' ) ,
+                      '', $color[9] ) . "\n";
     
                 $line = 0;
                 $headerprinted = true;
@@ -300,49 +321,55 @@ if ($showaddrlist) {
             }
     
             /* Print one row */
-            echo '<TR';
-            if ($line % 2) { echo ' bgcolor="' . $color[0]. '"'; }
-            echo '><TD VALIGN=top ALIGN=center WIDTH="1%"><SMALL>' .
-                 '<INPUT TYPE=checkbox ' . $selected . ' NAME="sel[]" VALUE="' .
-                 $row['backend'] . ':' . $row['nickname'] . '"></SMALL></TD>' .
-                 '<TD VALIGN=top NOWRAP WIDTH="1%">&nbsp;' . $row['nickname'] .
-                 '&nbsp;</TD>' .
-                 '<TD VALIGN=top NOWRAP WIDTH="1%">&nbsp;' . $row['name'] .
-                 '&nbsp;</TD>',
-                 '<TD VALIGN=top NOWRAP WIDTH="1%">&nbsp;'; 
-                if ($compose_new_win == '1') {
-                    echo '<a href="javascript:void(0)" onclick=comp_in_new(false,"compose.php?send_to='.rawurlencode($row['email']).'")>';
-                }
-                else {
-                 echo '<A HREF="compose.php?send_to=' . rawurlencode($row['email']).'">';
-                }
-                echo $row['email'] . '</A>&nbsp;</TD>'."\n",
-                 '<TD VALIGN=top WIDTH="1%">&nbsp;' . $row['label'] . '&nbsp;</TD>' .
-                 "</TR>\n";
+            $tr_bgcolor = '';
+            if ($line % 2) { $tr_bgcolor = $color[0]; }
+            echo html_tag( 'tr', '') .
+            html_tag( 'td',
+                '<SMALL>' .
+                '<INPUT TYPE=checkbox ' . $selected . ' NAME="sel[]" VALUE="' .
+                $row['backend'] . ':' . $row['nickname'] . '"></SMALL>' ,
+                'center', '', 'valign="top" width="1%"' ) .
+            html_tag( 'td', '&nbsp;' . $row['nickname'] . '&nbsp;', 'left', '', 'valign="top" width="1%" nowrap' ) .
+            html_tag( 'td', '&nbsp;' . $row['name'] . '&nbsp;', 'left', '', 'valign="top" width="1%" nowrap' ) .
+            html_tag( 'td', '', 'left', '', 'valign="top" width="1%" nowrap' ) . '&nbsp;';
+            if ($compose_new_win == '1') {
+                echo '<a href="javascript:void(0)" onclick=comp_in_new(false,"compose.php?send_to='.rawurlencode($row['email']).'")>';
+            }
+            else {
+                echo '<A HREF="compose.php?send_to=' . rawurlencode($row['email']).'">';
+            }
+            echo $row['email'] . '</A>&nbsp;</td>'."\n".
+            html_tag( 'td', '&nbsp;' . $row['label'] . '&nbsp;', 'left', '', 'valign="top" width="1%"' ) .
+            "</tr>\n";
             $line++;
         }
     
         /* End of list. Close table. */
         if ($headerprinted) {
-            echo '<TR><TD COLSPAN=5 ALIGN=center>' . "\n" .
-                 '<INPUT TYPE=submit NAME=editaddr VALUE="' . _("Edit selected") .
-                 "\">\n" .
-                 '<INPUT TYPE=submit NAME=deladdr VALUE="' . _("Delete selected") .
-                 "\">\n" . '</TR></TABLE>';
+            echo html_tag( 'tr',
+                        html_tag( 'td',
+                                '<INPUT TYPE="submit" NAME="editaddr" VALUE="' . _("Edit selected") .
+                                "\">\n" .
+                                '<INPUT TYPE="submit" NAME="deladdr" VALUE="' . _("Delete selected") .
+                                "\">\n",
+                         'center', '', 'colspan="5"' )
+                    );
         }
-        echo '</FORM>';
+        echo '</table></FORM>';
     }
 } /* end of addresslist */
 
 
 /* Display the "new address" form */
 echo '<a name="AddAddress"></a>' . "\n" .
-     '<FORM ACTION="' . $PHP_SELF . '" NAME=f_add METHOD="POST">' . "\n" .
-     '<TABLE WIDTH="100%" COLS=1 ALIGN=CENTER>' . "\n" .
-     '<TR><TD BGCOLOR="' . $color[0] . '" ALIGN=CENTER>' . "\n" . '<STRONG>',
-     sprintf(_("Add to %s"), $abook->localbackendname) .
-     "</STRONG>\n</TD></TR>\n" .
-     "</TABLE>\n";
+    '<FORM ACTION="' . $PHP_SELF . '" NAME=f_add METHOD="POST">' . "\n" .
+    html_tag( 'table',
+        html_tag( 'tr',
+            html_tag( 'td', "\n". '<strong>' . sprintf(_("Add to %s"), $abook->localbackendname) . '</strong>' . "\n",
+                'center', $color[0]
+            )
+        )
+    , 'center', '', 'width="100%" cols="1"' ) ."\n";
 address_form('addaddr', _("Add address"), $defdata);
 echo '</FORM>';