-
- // 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" .
- "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>" .
- _("Nickname") . ' : </TD>'.
- "<TD BGCOLOR=\"$color[4]\" ALIGN=left>".
- "<INPUT NAME=\"$name[nickname]\" SIZE=15 VALUE=\"";
- if (isset($values['nickname']))
- echo htmlspecialchars($values['nickname']);
- echo '">'.
- " <SMALL>" . _("Must be unique") . "</SMALL></TD></TR>\n";
- printf("<TR><TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
- _("E-mail address"));
- printf("<TD BGCOLOR=\"%s\" ALIGN=left>".
- "<INPUT NAME=\"%s[email]\" SIZE=45 VALUE=\"%s\"></TD></TR>\n",
- $color[4], $name,
- (isset($values["email"]))?
- htmlspecialchars($values["email"]):"");
- printf("<TR><TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
- _("First name"));
- printf("<TD BGCOLOR=\"%s\" ALIGN=left>".
- "<INPUT NAME=\"%s[firstname]\" SIZE=45 VALUE=\"%s\"></TD></TR>\n",
- $color[4], $name,
- (isset($values["firstname"]))?
- htmlspecialchars($values["firstname"]):"");
- printf("<TR><TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
- _("Last name"));
- printf("<TD BGCOLOR=\"%s\" ALIGN=left>".
- "<INPUT NAME=\"%s[lastname]\" SIZE=45 VALUE=\"%s\"></TD></TR>\n",
- $color[4], $name,
- (isset($values["lastname"]))?
- htmlspecialchars($values["lastname"]):"");
- printf("<TR><TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>%s:</TD>",
- _("Additional info"));
- printf("<TD BGCOLOR=\"%s\" ALIGN=left>".
- "<INPUT NAME=\"%s[label]\" SIZE=45 VALUE=\"%s\"></TD></TR>\n",
- $color[4], $name,
- (isset($values["label"]))?
- htmlspecialchars($values["label"]):"");
-
- printf("<TR><TD COLSPAN=2 BGCOLOR=\"%s\" ALIGN=center>\n".
- "<INPUT TYPE=submit NAME=\"%s[SUBMIT]\" VALUE=\"%s\"></TD></TR>\n",
- $color[4], $name, $submittext);
-
- print "</TABLE>\n";
- }
-
-
- // Open addressbook, with error messages on but without LDAP (the
- // second "true"). Don't need LDAP here anyway
- $abook = addressbook_init(true, true);
- if($abook->localbackend == 0) {
- plain_error_message(_("No personal address book is defined. Contact administrator."), $color);
- exit();
- }
-
- displayPageHeader($color, 'None');
-
-
- $defdata = array();
- $formerror = '';
- $abortform = false;
- $showaddrlist = true;
- $defselected = array();
-
-
- // Handle user's actions
- if($REQUEST_METHOD == 'POST') {
-
- // ***********************************************
- // Add new address
- // ***********************************************
- if(!empty($addaddr['nickname'])) {
+ $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 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" width="90%"') ."\n";
+}
+
+
+/* Open addressbook, with error messages on but without LDAP (the *
+ * second "true"). Don't need LDAP here anyway */
+$abook = addressbook_init(true, true);
+if($abook->localbackend == 0) {
+ plain_error_message(
+ _("No personal address book is defined. Contact administrator."),
+ $color);
+ exit();
+}
+
+displayPageHeader($color, 'None');
+
+
+$defdata = array();
+$formerror = '';
+$abortform = false;
+$showaddrlist = true;
+$defselected = array();
+
+
+/* Handle user's actions */
+if($REQUEST_METHOD == 'POST') {
+
+ /**************************************************
+ * Add new address *
+ **************************************************/
+ if (!empty($addaddr['nickname'])) {