-/**
- * \brief Call this right before wDumpContent() on any page which requires the address book popup
- */
-void address_book_popup(void) {
- /* Open a new div, hidden initially, for address book popups. */
- wprintf("</div>\n"); /* End of 'content' div */
- wprintf("<div id=\"address_book_popup\" style=\"display:none;\">");
- wprintf("<div id=\"address_book_popup_container_div\">");
- wprintf("<div id=\"address_book_popup_middle_div\"></div>");
- wprintf("<div id=\"address_book_inner_div\"></div>");
- wprintf("</div>");
- /* The 'address_book_popup' div will be closed by wDumpContent() */
-}
-
-/**
- * \brief Address book popup window
- */
-void display_address_book_middle_div(void) {
- char buf[256];
- long len;
- char *Name, *Namee;
- HashList *List;
- HashPos *it;
-
- begin_ajax_response();
-
- wprintf("<table border=0 width=100%%><tr valign=middle>");
- wprintf("<td align=left><img src=\"static/viewcontacts_32x.gif\"></td>");
- wprintf("<td align=center>");
-
- wprintf("<form>"
- "<select class=\"address_book_popup_title\" size=1 id=\"which_addr_book\" "
- " onChange=\"PopulateAddressBookInnerDiv($('which_addr_book').value,'%s')\">",
- bstr("target_input")
- );
-
- wprintf("<option value=\"__LOCAL_USERS__\">");
- escputs(serv_info.serv_humannode);
- wprintf("</option>\n");
-
-
- List = NewHash();
- serv_puts("LKRA");
- serv_getln(buf, sizeof buf);
- if (buf[0] == '1') while(len = serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- if (extract_int(buf, 6) == VIEW_ADDRESSBOOK) {
- Name = (char*) malloc(len + 1);
- len = extract_token(Name, buf, 0, '|', len);
- Put(List, Name, len, Name, NULL);
- }
- }
-
- SortByHashKey(List);
- it = GetNewHashPos();
- while (GetNextHashPos(List, it, &len, &Name, (void**)&Namee)) {
- wprintf("<option value=\"");
- urlescputs(Namee);
- wprintf("\">");
- escputs(Namee);
- wprintf("</option>\n");
- }
- DeleteHashPos(&it);
- DeleteHash(&List);
- wprintf("</select></form>");
-
- wprintf("</td>");
- wprintf("<td align=right "
- "onclick=\"javascript:$('address_book_popup').style.display='none';\" "
- "><img src=\"static/closewindow.gif\">");
- wprintf("</td></tr></table>");
-
- wprintf("<script type=\"text/javascript\">"
- "PopulateAddressBookInnerDiv($('which_addr_book').value,'%s');"
- "</script>\n",
- bstr("target_input")
- );
-
- end_ajax_response();
-}
-
-
-
-/**
- * \brief Address book popup results