/** * List search results * @param array $res Array of search results * @param bool $includesource [Default=true] * @return void */ function display_result($res, $includesource = true) { global $oTemplate, $oErrorHandler; if (sizeof($res) <= 0) { return; } $oTemplate->assign('compose_addr_pop', true); $oTemplate->assign('include_abook_name', $includesource); $oTemplate->assign('addresses', formatAddressList($res)); $oTemplate->display('addrbook_search_list.tpl'); }
/** * List search results * @param array $res Array containing results of search * @param bool $includesource If true, adds backend column to address listing */ function addr_display_result($res, $includesource = true) { global $PHP_SELF, $oTemplate, $oErrorHandler; //FIXME: no HTML output from core echo addForm($PHP_SELF, 'post', 'addressbook', '', '', array(), TRUE) . addHidden('html_addr_search_done', 'true'); addr_insert_hidden(); $oTemplate->assign('compose_addr_pop', false); $oTemplate->assign('include_abook_name', $includesource); $oTemplate->assign('addresses', formatAddressList($res)); $oTemplate->display('addrbook_search_list.tpl'); echo '</form>'; }
/* Display the address management part */ $addresses = array(); while (list($k, $backend) = each($abook->backends)) { $a = array(); $a['BackendID'] = $backend->bnum; $a['BackendSource'] = $backend->sname; $a['BackendWritable'] = $backend->writeable; $a['Addresses'] = array(); // don't do address lookup if we are not viewing that backend // if ($backend->bnum == $current_backend) { $alist = $abook->list_addr($backend->bnum); /* check return (array with data or boolean false) */ if (is_array($alist)) { usort($alist, 'alistcmp'); $a['Addresses'] = formatAddressList($alist); $addresses[$backend->bnum] = $a; } else { // list_addr() returns boolean plain_error_message(nl2br(sm_encode_html_special_chars($abook->error))); } } else { $addresses[$backend->bnum] = $a; } } $current_page_args = array('abook_sort_order' => $abook_sort_order, 'new_bnum' => $current_backend, 'page_number' => $page_number); // note that plugins can add to $current_page_args as well as // filter the address list // $temp = array(&$addresses, &$current_backend, &$page_number, &$current_page_args); do_hook('abook_list_filter', $temp);