Source for file addressbook.php

Documentation is available at addressbook.php

  1. <?php
  2.  
  3. /**
  4.  * addressbook.php
  5.  *
  6.  * Manage personal address book.
  7.  *
  8.  * @copyright 1999-2014 The SquirrelMail Project Team
  9.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.  * @version $Id: addressbook.php 14422 2014-01-01 20:59:43Z pdontthink $
  11.  * @package squirrelmail
  12.  * @subpackage addressbook
  13.  */
  14.  
  15. /** This is the addressbook page */
  16. define('PAGE_NAME''addressbook');
  17.  
  18. /**
  19.  * Path for SquirrelMail required files.
  20.  * @ignore
  21.  */
  22. define('SM_PATH','../');
  23.  
  24. /** SquirrelMail required files. */
  25. require_once(SM_PATH 'include/validate.php');
  26. require_once(SM_PATH 'functions/global.php');
  27. require_once(SM_PATH 'functions/display_messages.php');
  28. require_once(SM_PATH 'functions/addressbook.php');
  29. require_once(SM_PATH 'functions/strings.php');
  30. require_once(SM_PATH 'functions/html.php');
  31. require_once(SM_PATH 'functions/forms.php');
  32.  
  33. /** lets get the global vars we may need */
  34. if (!sqgetGlobalVar('smtoken',$submitted_tokenSQ_POST)) {
  35.     $submitted_token '';
  36. }
  37. sqgetGlobalVar('key',       $key,           SQ_COOKIE);
  38.  
  39. sqgetGlobalVar('username',  $username,      SQ_SESSION);
  40. sqgetGlobalVar('onetimepad',$onetimepad,    SQ_SESSION);
  41. sqgetGlobalVar('base_uri',  $base_uri,      SQ_SESSION);
  42. sqgetGlobalVar('delimiter'$delimiter,     SQ_SESSION);
  43.  
  44. /* From the address form */
  45. sqgetGlobalVar('addaddr',    $addaddr,    SQ_POST);
  46. sqgetGlobalVar('editaddr',   $editaddr,   SQ_POST);
  47. sqgetGlobalVar('deladdr',    $deladdr,    SQ_POST);
  48. sqgetGlobalVar('compose_to'$compose_toSQ_POST);
  49. sqgetGlobalVar('sel',        $sel,        SQ_POST);
  50. // renumber $sel array
  51. if (!empty($sel)) $sel array_merge($selarray());
  52. sqgetGlobalVar('oldnick',    $oldnick,    SQ_POST);
  53. sqgetGlobalVar('backend',    $backend,    SQ_POST);
  54. sqgetGlobalVar('doedit',     $doedit,     SQ_POST);
  55.  
  56. /* Get sorting order */
  57. $abook_sort_order get_abook_sort();
  58.  
  59. /**
  60.  * Make an input field
  61.  * @param string $label 
  62.  * @param string $field 
  63.  * @param string $name 
  64.  * @param string $size 
  65.  * @param array $values 
  66.  * @param string $add 
  67.  */
  68. function addressbook_inp_field($label$field$name$size$values$add{
  69.     global $color;
  70.     $value isset($values[$field]$values[$field'');
  71.  
  72.     $td_str addInput($name.'['.$field.']'$value$size)
  73.         . $add ;
  74.  
  75.     return html_tag'tr' ,
  76.             html_tag'td'$label ':''right'$color[4].
  77.             html_tag'td'$td_str'left'$color[4])
  78.             )
  79.         . "\n";
  80. }
  81.  
  82. /**
  83.  * Output form to add and modify address data
  84.  */
  85. function address_form($name$submittext$values array()) {
  86.     global $color$squirrelmail_language;
  87.  
  88.     if ($squirrelmail_language == 'ja_JP'{
  89.         echo html_tag'table',
  90.                 addressbook_inp_field(_("Nickname"),     'nickname'$name15$values,
  91.                     ' <small>' _("Must be unique"'</small>'.
  92.                 addressbook_inp_field(_("E-mail address"),  'email'$name45$values''.
  93.                 addressbook_inp_field(_("Last name"),    'lastname'$name45$values''.
  94.                 addressbook_inp_field(_("First name"),  'firstname'$name45$values''.
  95.                 addressbook_inp_field(_("Additional info")'label'$name45$values''.
  96.                 list_writable_backends($name.
  97.                 html_tag'tr',
  98.                     html_tag'td',
  99.                         addSubmit($submittext$name.'[SUBMIT]'),
  100.                         'center'$color[4]'colspan="2"')
  101.                     )
  102.                 'center''''border="0" cellpadding="1" width="90%"'."\n";
  103.     else {
  104.         echo html_tag'table',
  105.                 addressbook_inp_field(_("Nickname"),     'nickname'$name15$values,
  106.                     ' <small>' _("Must be unique"'</small>'.
  107.                 addressbook_inp_field(_("E-mail address"),  'email'$name45$values''.
  108.                 addressbook_inp_field(_("First name"),  'firstname'$name45$values''.
  109.                 addressbook_inp_field(_("Last name"),    'lastname'$name45$values''.
  110.                 addressbook_inp_field(_("Additional info")'label'$name45$values''.
  111.                 list_writable_backends($name.
  112.                 html_tag'tr',
  113.                     html_tag'td',
  114.                         addSubmit($submittext$name.'[SUBMIT]',
  115.                         'center'$color[4]'colspan="2"')
  116.                     )
  117.                 'center''''border="0" cellpadding="1" width="90%"'."\n";
  118.     }
  119. }
  120.  
  121.  
  122. /**
  123.  * Provides list of writeable backends.
  124.  * Works only when address is added ($name='addaddr')
  125.  * @param string $name name of form
  126.  * @return string html formated backend field (select or hidden)
  127.  */
  128. function list_writable_backends($name{
  129.     global $color$abook;
  130.     if $name != 'addaddr' return}
  131.     $writeable_abook 1;
  132.     if $abook->numbackends {
  133.         $backends $abook->get_backend_list();
  134.         $writeable_abooks=array();
  135.         while (list($undef,$veach($backends)) {
  136.             if ($v->writeable{
  137.                 // add each backend to array
  138.                 $writeable_abooks[$v->bnum]=$v->sname;
  139.                 // save backend number
  140.                 $writeable_abook=$v->bnum;
  141.             }
  142.         }
  143.         if (count($writeable_abooks)>1{
  144.             // we have more than one writeable backend
  145.             $ret=addSelect('backend',$writeable_abooks,null,true);
  146.             return html_tag'tr',
  147.                              html_tag'td'_("Add to:"),'right'$color[4.
  148.                              html_tag'td'$ret'left'$color[4)) "\n";
  149.         }
  150.     }
  151.     // Only one backend exists or is writeable.
  152.     return html_tag'tr',
  153.                      html_tag'td',
  154.                                addHidden('backend'$writeable_abook),
  155.                                'center'$color[4]'colspan="2"')) "\n";
  156. }
  157.  
  158. // Create page header before addressbook_init in order to
  159. // display error messages correctly, unless we might be
  160. // redirecting the browser to the compose page. 
  161. //
  162. if ((empty($compose_to)) || sizeof($sel1
  163.     displayPageHeader($color'None');
  164.  
  165. /* Open addressbook, with error messages on but without LDAP (the *
  166.  * second "true"). Don't need LDAP here anyway                    */
  167. $abook addressbook_init(truetrue);
  168. if($abook->localbackend == 0{
  169.             _("No personal address book is defined. Contact administrator."),
  170.             $color);
  171.     exit();
  172. }
  173.  
  174. $defdata   array();
  175. $formerror '';
  176. $abortform false;
  177. $showaddrlist true;
  178. $defselected  array();
  179. $form_url 'addressbook.php';
  180.  
  181.  
  182. /* Handle user's actions */
  183. if(sqgetGlobalVar('REQUEST_METHOD'$req_methodSQ_SERVER&& $req_method == 'POST'{
  184.  
  185.     // first, validate security token
  186.     sm_validate_security_token($submitted_token-1TRUE);
  187.  
  188.     /**************************************************
  189.      * Add new address                                *
  190.      **************************************************/
  191.     if (isset($addaddr)) {
  192.         if (isset($backend)) {
  193.             $r $abook->add($addaddr$backend);
  194.         else {
  195.             $r $abook->add($addaddr$abook->localbackend);
  196.         }
  197.  
  198.         /* Handle error messages */
  199.         if (!$r{
  200.             /* Remove backend name from error string */
  201.             $errstr $abook->error;
  202.             $errstr preg_replace('/^\[.*\] */'''$errstr);
  203.  
  204.             $formerror $errstr;
  205.             $showaddrlist false;
  206.             $defdata $addaddr;
  207.         }
  208.     else {
  209.  
  210.         /************************************************
  211.          * Delete address(es)                           *
  212.          ************************************************/
  213.         if ((!empty($deladdr)) && sizeof($sel0{
  214.             $orig_sel $sel;
  215.             sort($sel);
  216.  
  217.             /* The selected addresses are identidied by "backend:nickname". *
  218.              * Sort the list and process one backend at the time            */
  219.             $prevback  = -1;
  220.             $subsel    array();
  221.             $delfailed false;
  222.  
  223.             for ($i (($i sizeof($sel)) && !$delfailed$i++{
  224.                 list($sbackend$snickexplode(':'$sel[$i]2);
  225.  
  226.                 /* When we get to a new backend, process addresses in *
  227.                  * previous one.                                      */
  228.                 if ($prevback != $sbackend && $prevback != -1{
  229.  
  230.                     $r $abook->remove($subsel$prevback);
  231.                     if (!$r{
  232.                         $formerror $abook->error;
  233.                         $i sizeof($sel);
  234.                         $delfailed true;
  235.                         break;
  236.                     }
  237.                     $subsel   array();
  238.                 }
  239.  
  240.                 /* Queue for processing */
  241.                 array_push($subsel$snick);
  242.                 $prevback $sbackend;
  243.             }
  244.  
  245.             if (!$delfailed{
  246.                 $r $abook->remove($subsel$prevback);
  247.                 if (!$r/* Handle errors */
  248.                     $formerror $abook->error;
  249.                     $delfailed true;
  250.                 }
  251.             }
  252.  
  253.             if ($delfailed{
  254.                 $showaddrlist true;
  255.                 $defselected  $orig_sel;
  256.             }
  257.  
  258.         /************************************************
  259.          * Compose to selected address(es)              *
  260.          ************************************************/
  261.         else if ((!empty($compose_to)) && sizeof($sel0{
  262.             $orig_sel $sel;
  263.             sort($sel);
  264.  
  265.             // The selected addresses are identidied by "backend:nickname"
  266.             $lookup_failed false;
  267.             $send_to '';
  268.  
  269.             for ($i (($i sizeof($sel)) && !$lookup_failed$i++{
  270.                 list($sbackend$snickexplode(':'$sel[$i]2);
  271.  
  272.                 $data $abook->lookup($snick$sbackend);
  273.  
  274.                 if (!$data{
  275.                     $formerror $abook->error;
  276.                     $lookup_failed true;
  277.                     break;
  278.                 else {
  279.                     $addr $abook->full_address($data);
  280.                     if (!empty($addr))
  281.                         $send_to .= $addr ', ';
  282.                 }
  283.             }
  284.  
  285.  
  286.             if ($lookup_failed || empty($send_to)) {
  287.                 $showaddrlist true;
  288.                 $defselected  $sel;
  289.  
  290.                 // we skipped the page header above for this functionality, so add it here
  291.                 displayPageHeader($color'None');
  292.             }
  293.  
  294.  
  295.             // send off to compose screen
  296.             else {
  297.                 $send_to trim($send_to', ');
  298.                 header('Location: ' $base_uri 'src/compose.php?send_to=' rawurlencode($send_to));
  299.                 exit;
  300.             }
  301.  
  302.         else {
  303.  
  304.             /***********************************************
  305.              * Update/modify address                       *
  306.              ***********************************************/
  307.             if (!empty($editaddr)) {
  308.  
  309.                 /* Stage one: Copy data into form */
  310.                 if (isset($sel&& sizeof($sel0{
  311.                     if(sizeof($sel1{
  312.                         $formerror _("You can only edit one address at the time");
  313.                         $showaddrlist true;
  314.                         $defselected $sel;
  315.                     else {
  316.                         $abortform true;
  317.                         list($ebackend$enickexplode(':'$sel[0]2);
  318.                         $olddata $abook->lookup($enick$ebackend);
  319.  
  320.                         /* Display the "new address" form */
  321.                         echo addForm($form_url'post'''''''''TRUE).
  322.                             html_tag'table',
  323.                                     html_tag'tr',
  324.                                         html_tag'td',
  325.                                             "\n"'<strong>' _("Update address"'</strong>' ."\n",
  326.                                             'center'$color[0)
  327.                                         ),
  328.                                     'center''''width="100%" ' );
  329.                         address_form("editaddr"_("Update address")$olddata);
  330.                         echo addHidden('oldnick'$olddata['nickname']).
  331.                             addHidden('backend'$olddata['backend']).
  332.                             addHidden('doedit''1').
  333.                             '</form>';
  334.                     }
  335.                 elseif ($doedit == 1{
  336.                     /* Stage two: Write new data */
  337.                     $newdata $editaddr;
  338.                     $r $abook->modify($oldnick$newdata$backend);
  339.  
  340.                     /* Handle error messages */
  341.                     if (!$r{
  342.                         /* Display error */
  343.                         echo html_tag'table',
  344.                                  html_tag'tr',
  345.                                      html_tag'td',
  346.                                                "\n"'<strong><font color="' $color[2.
  347.                                                '">' _("ERROR"': ' sm_encode_html_special_chars($abook->error'</font></strong>' ."\n",
  348.                                                'center' )
  349.                                            ),
  350.                                        'center''''width="100%"' );
  351.  
  352.                         /* Display the "new address" form again */
  353.                         echo addForm($form_url'post'''''''''TRUE).
  354.                             html_tag'table',
  355.                                 html_tag'tr',
  356.                                     html_tag'td',
  357.                                               "\n"'<strong>' _("Update address"'</strong>' ."\n",
  358.                                               'center'$color[0)
  359.                                           ),
  360.                                       'center''''width="100%"' );
  361.                         address_form("editaddr"_("Update address")$newdata);
  362.                         echo 
  363.                             addHidden('oldnick'$oldnick).
  364.                             addHidden('backend'$backend).
  365.                             addHidden('doedit',  '1').
  366.                             "\n" '</form>';
  367.                         $abortform true;
  368.                     }
  369.                 else {
  370.                     /**
  371.                      * $editaddr is set, but $sel (address selection in address listing)
  372.                      * and $doedit (address edit form) are not set.
  373.                      * Assume that user clicked on "Edit address" without selecting any address.
  374.                      */
  375.                     $formerror _("Please select address that you want to edit");
  376.                     $showaddrlist true;
  377.                 /* end of edit stage detection */
  378.             /* !empty($editaddr)                     - Update/modify address */
  379.         /* (!empty($deladdr)) && sizeof($sel) > 0    - Delete address(es)
  380.           or (!empty($compose_to)) && sizeof($sel) > 0 - Compose to address(es) */
  381.     /* !empty($addaddr['nickname'])                  - Add new address */
  382.  
  383.     // Some times we end output before forms are printed
  384.     if($abortform{
  385.         echo "</body></html>\n";
  386.         exit();
  387.     }
  388. }
  389.  
  390.  
  391. /* =================================================================== *
  392.  * The following is only executed on a GET request, or on a POST when  *
  393.  * a user is added, or when "delete" or "modify" was successful.       *
  394.  * =================================================================== */
  395.  
  396. /* Display error messages */
  397. if (!empty($formerror)) {
  398.     echo html_tag'table',
  399.             html_tag'tr',
  400.                 html_tag'td',
  401.                     "\n"'<br /><strong><font color="' $color[2.
  402.                     '">' _("ERROR"': ' sm_encode_html_special_chars($formerror'</font></strong>' ."\n",
  403.                     'center' )
  404.                 ),
  405.             'center''''width="100%"' );
  406. }
  407.  
  408.  
  409. /* Display the address management part */
  410. if ($showaddrlist{
  411.     /* Get and sort address list */
  412.     $alist $abook->list_addr();
  413.     if(!is_array($alist)) {
  414.         $abook->error sm_encode_html_special_chars($abook->error);
  415.         plain_error_message($abook->error$color);
  416.         exit;
  417.     }
  418.  
  419.     usort($alist,'alistcmp');
  420.  
  421.     // filter listing as needed
  422.     $hook_return do_hook_function('abook_list_filter'$alist);
  423.     if (!empty($hook_return)) $alist $hook_return;
  424.  
  425.     $prevbackend = -1;
  426.     $headerprinted false;
  427.  
  428.     $compose_to_in_new_window_javascript ' onclick="var send_to = \'\'; var f = document.forms.length; var i = 0; var grab_next_hidden = \'\'; while (i < f) { var e = document.forms[i].elements.length; var j = 0; while (j < e) { if (document.forms[i].elements[j].type == \'checkbox\' && document.forms[i].elements[j].checked) { var pos = document.forms[i].elements[j].value.indexOf(\':\'); if (pos >= 1) { grab_next_hidden = document.forms[i].elements[j].value; } } else if (document.forms[i].elements[j].type == \'hidden\' && grab_next_hidden == document.forms[i].elements[j].name) { if (send_to != \'\') { send_to += \', \'; } send_to += document.forms[i].elements[j].value; } j++; } i++; } if (send_to != \'\') { comp_in_new(\''$base_uri 'src/compose.php?send_to=\' + send_to); } return false;"';
  429.  
  430.     echo html_tag'div''<a href="#AddAddress">' _("Add address"'</a>''center' "\n";
  431.  
  432.     /* List addresses */
  433.     if (count($alist0{
  434.         echo addForm($form_url'post''address_book_form'''''''TRUE);
  435.         if ($abook->add_extra_field{
  436.             $abook_fields 6;
  437.         else {
  438.             $abook_fields 5;
  439.         }
  440.         $count 0;
  441.         while(list($undef,$roweach($alist)) {
  442.  
  443.             /* New table header for each backend */
  444.             if($prevbackend != $row['backend']{
  445.                 if($prevbackend 0{
  446.                     echo html_tag'table',
  447.                             html_tag'tr',
  448.                                 html_tag'td',
  449.                                     addSubmit(_("Edit selected")'editaddr').
  450.                                     addSubmit(_("Delete selected")'deladdr').
  451.                                     addSubmit(_("Compose to selected")'compose_to',
  452.                                               ($javascript_on && $compose_new_win $compose_to_in_new_window_javascript '')),
  453.                                     'center'''"colspan=\"$abook_fields\")
  454.                                 .
  455.                             html_tag'tr',
  456.                                 html_tag'td''&nbsp;<br />''center''''colspan="5"' )
  457.                                 ),
  458.                             'center' );
  459.                 }
  460.  
  461.                 echo html_tag'table',
  462.                         html_tag'tr',
  463.                             html_tag'td'"\n" '<strong>' $row['source''</strong>' "\n"'center'$color[0]'colspan="2"' )
  464.                             ).
  465.                             concat_hook_function('address_book_header'$row),
  466.                         'center''''width="95%"' ."\n".
  467.                     html_tag'table''''center''''border="0" cellpadding="1" cellspacing="0" width="90%"' .
  468.                     html_tag'tr'"\n" .
  469.                             html_tag'th''&nbsp;''left''''width="1%"' .
  470.                             html_tag'th'_("Nickname"
  471.                                       show_abook_sort_button($abook_sort_order_("sort by nickname")01),
  472.                                       'left''''width="10%"' .
  473.                             html_tag'th'_("Name".
  474.                                       show_abook_sort_button($abook_sort_order_("sort by name")23),
  475.                                       'left''''width="10%"' .
  476.                             html_tag'th'_("E-mail").
  477.                                       show_abook_sort_button($abook_sort_order_("sort by email")45),
  478.                                       'left''''width="10%"' .
  479.                             html_tag'th'_("Info").
  480.                                       show_abook_sort_button($abook_sort_order_("sort by info")67),
  481.                                       'left''''width="10%"' .
  482.                             ($abook->add_extra_field html_tag'th''&nbsp;','left''''width="1%0"')''),
  483.                             ''$color[9"\n";
  484.  
  485.                 $line 0;
  486.                 $headerprinted true;
  487.             /* End of header */
  488.  
  489.             $prevbackend $row['backend'];
  490.  
  491.             /* Print one row, with alternating color */
  492.             if ($line 2{
  493.                 $tr_bgcolor $color[12];
  494.             else {
  495.                 $tr_bgcolor $color[4];
  496.             }
  497.  
  498.             // Print special message if that's what we have
  499.             // here instead of an actual address entry
  500.             if (!empty($row['special_message'])) {
  501.                 echo html_tag('tr'''''$tr_bgcolor)
  502.                    . html_tag('td'$row['special_message']'center''''colspan="5"')
  503.                    . "</tr>\n";
  504.                 $line++;
  505.                 continue;
  506.             }
  507.  
  508.             /* Check if this user is selected */
  509.             $selected in_array($row['backend'':' $row['nickname']$defselected);
  510.  
  511.             if ($squirrelmail_language == 'ja_JP'{
  512.                 echo html_tag'tr'''''$tr_bgcolor);
  513.                 if ($abook->backends[$row['backend']]->writeable{
  514.                     echo html_tag'td',
  515.                             '<small>' .
  516.                             addCheckBox('sel[' $count ']'$selected$row['backend'].':'.$row['nickname']' id="' $row['backend''_' urlencode($row['nickname']'"').
  517.                             '</small>' ,
  518.                             'center''''valign="top" width="1%"' );
  519.                 else {
  520.                     echo html_tag'td',
  521.                             '&nbsp;' ,
  522.                             'center''''valign="top" width="1%"' );
  523.                 }
  524.                 echo html_tag'td''&nbsp;<label for="' $row['backend''_' urlencode($row['nickname']'">' sm_encode_html_special_chars($row['nickname']'</label>&nbsp;''left''''valign="top" width="10%" nowrap' 
  525.                     html_tag'td''&nbsp;<label for="' $row['backend''_' urlencode($row['nickname']'">' sm_encode_html_special_chars($row['lastname']' ' sm_encode_html_special_chars($row['firstname']'</label>&nbsp;''left''''valign="top" width="10%" nowrap' .
  526.                     html_tag'td''''left''''valign="top" width="10%" nowrap' '&nbsp;';
  527.             else {
  528.                 echo html_tag'tr'''''$tr_bgcolor);
  529.                 if ($abook->backends[$row['backend']]->writeable{
  530.                     echo html_tag'td',
  531.                             '<small>' .
  532.                             addCheckBox('sel[' $count ']'$selected$row['backend'':' $row['nickname']' id="' $row['backend''_' urlencode($row['nickname']'"').
  533.                             '</small>' ,
  534.                             'center''''valign="top" width="1%"' );
  535.                 else {
  536.                     echo html_tag'td',
  537.                             '&nbsp;' ,
  538.                             'center''''valign="top" width="1%"' );
  539.                 }
  540.                 echo html_tag'td''&nbsp;<label for="' $row['backend''_' urlencode($row['nickname']'">' sm_encode_html_special_chars($row['nickname']'</label>&nbsp;''left''''valign="top" width="10%" nowrap' .
  541.                     html_tag'td''&nbsp;<label for="' $row['backend''_' urlencode($row['nickname']'">' sm_encode_html_special_chars($row['name']'</label>&nbsp;''left''''valign="top" width="10%" nowrap' .
  542.                     html_tag'td''''left''''valign="top" width="10%" nowrap' '&nbsp;';
  543.             }
  544.             $email $abook->full_address($row);
  545.             echo addHidden($row['backend'':' $row['nickname']rawurlencode($email))
  546.                . makeComposeLink('src/compose.php?send_to='.rawurlencode($email),
  547.                     sm_encode_html_special_chars($row['email'])).
  548.                 '&nbsp;</td>'."\n".
  549.                 html_tag'td''&nbsp;<label for="' $row['backend''_' urlencode($row['nickname']'">' sm_encode_html_special_chars($row['label']'</label>&nbsp;''left''''valign="top" width="10%"' );
  550.  
  551.             // add extra column if third party backend needs it
  552.             if ($abook->add_extra_field{
  553.                 echo html_tag'td',
  554.                                '&nbsp;' (isset($row['extra']$row['extra''''&nbsp;',
  555.                                'left''''valign="top" width="10%"' );
  556.             }
  557.  
  558.             echo "</tr>\n";
  559.             $line++;
  560.             $count++;
  561.         }
  562.  
  563.         /* End of list. Close table. */
  564.         if ($headerprinted{
  565.             echo html_tag'tr',
  566.                     html_tag'td',
  567.                         addSubmit(_("Edit selected")'editaddr'.
  568.                         addSubmit(_("Delete selected")'deladdr').
  569.                         addSubmit(_("Compose to selected")'compose_to',
  570.                                   ($javascript_on && $compose_new_win $compose_to_in_new_window_javascript '')),
  571.                         'center'''"colspan=\"$abook_fields\")
  572.                     );
  573.         }
  574.         echo '</table></form>';
  575.     }
  576. /* end of addresslist */
  577.  
  578.  
  579. /* Display the "new address" form */
  580. echo '<a name="AddAddress"></a>' "\n" .
  581.     addForm($form_url'post''f_add'''''''TRUE).
  582.     html_tag'table',  
  583.         html_tag'tr',
  584.             html_tag'td'"\n"'<strong>' sprintf(_("Add to %s")$abook->localbackendname'</strong>' "\n",
  585.                 'center'$color[0]
  586.                 )
  587.             )
  588.         'center''''width="95%"' ."\n";
  589. address_form('addaddr'_("Add address")$defdata);
  590. echo "</form>\n";
  591.  
  592. /* Add hook for anything that wants on the bottom */
  593. do_hook('addressbook_bottom');
  594. ?>
  595. </body></html>

Documentation generated on Wed, 01 Oct 2014 04:20:21 +0200 by phpDocumentor 1.4.3