| | |
| | | $_SESSION['addressbooks_count'] = count($js_list); |
| | | $_SESSION['addressbooks_count_writeable'] = $writeable; |
| | | |
| | | if (!strlen($source)) |
| | | $source = strval(key($js_list)); |
| | | |
| | | $CONTACTS = rcmail_contact_source($source, true); |
| | | } |
| | | |
| | |
| | | |
| | | // currently selected source |
| | | $current = get_input_value('_source', RCUBE_INPUT_GPC); |
| | | if (!strlen($current) || !isset($sources[$source])) |
| | | $current = strval(key($sources)); |
| | | |
| | | foreach ($sources as $j => $source) { |
| | | $id = strval($source['id'] ? $source['id'] : $j); |
| | |
| | | } |
| | | |
| | | |
| | | // return the message list as HTML table |
| | | // return the contacts list as HTML table |
| | | function rcmail_contacts_list($attrib) |
| | | { |
| | | global $CONTACTS, $OUTPUT; |
| | |
| | | // define list of cols to be displayed |
| | | $a_show_cols = array('name'); |
| | | |
| | | // count contacts for this user |
| | | $result = $CONTACTS->list_records($a_show_cols); |
| | | |
| | | // add id to message list table if not specified |
| | | if (!strlen($attrib['id'])) |
| | | $attrib['id'] = 'rcmAddressList'; |
| | | |
| | | // create XHTML table |
| | | $out = rcube_table_output($attrib, $result->records, $a_show_cols, $CONTACTS->primary_key); |
| | | $out = rcube_table_output($attrib, array(), $a_show_cols, $CONTACTS->primary_key); |
| | | |
| | | // set client env |
| | | $OUTPUT->add_gui_object('contactslist', $attrib['id']); |
| | | $OUTPUT->set_env('current_page', (int)$CONTACTS->list_page); |
| | | $OUTPUT->set_env('pagecount', ceil($result->count/$CONTACTS->page_size)); |
| | | $OUTPUT->include_script('list.js'); |
| | | |
| | | // add some labels to client |
| | |
| | | |
| | | $OUTPUT->add_gui_object('countdisplay', $attrib['id']); |
| | | |
| | | return html::span($attrib, rcmail_get_rowcount_text()); |
| | | return html::span($attrib, rcube_label('loading')); |
| | | } |
| | | |
| | | |
| | |
| | | // read nr of contacts |
| | | if (!$result) { |
| | | $result = $CONTACTS->get_result(); |
| | | } |
| | | if (!$result) { |
| | | $result = $CONTACTS->count(); |
| | | } |
| | | |
| | | if ($result->count == 0) |