diff options
author | friendica <info@friendica.com> | 2014-09-10 23:08:24 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-09-10 23:08:24 -0700 |
commit | 4c8036f53064549cbfa797bba5c6462f5e36b072 (patch) | |
tree | 3fc37e355c9d7b95ea9db6d6cd538d9de43d0b66 /mod | |
parent | 10f6f355d43ee2fea61e1bae9ae257219f0196ee (diff) | |
download | volse-hubzilla-4c8036f53064549cbfa797bba5c6462f5e36b072.tar.gz volse-hubzilla-4c8036f53064549cbfa797bba5c6462f5e36b072.tar.bz2 volse-hubzilla-4c8036f53064549cbfa797bba5c6462f5e36b072.zip |
endless scroll on connections page
Diffstat (limited to 'mod')
-rw-r--r-- | mod/connections.php | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/mod/connections.php b/mod/connections.php index 028889647..0dfcfebf1 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -369,7 +369,7 @@ function connections_content(&$a) { if($rr['xchan_url']) { $contacts[] = array( 'img_hover' => sprintf( t('%1$s [%2$s]'),$rr['xchan_name'],$rr['xchan_url']), - 'edit_hover' => t('Edit contact'), + 'edit_hover' => t('Edit connection'), 'id' => $rr['abook_id'], 'alt_text' => $alt_text, 'dir_icon' => $dir_icon, @@ -378,6 +378,7 @@ function connections_content(&$a) { 'username' => $rr['xchan_name'], 'classes' => (($rr['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? 'archived' : ''), 'link' => z_root() . '/connedit/' . $rr['abook_id'], + 'edit' => t('Edit'), 'url' => chanlink_url($rr['xchan_url']), 'network' => network_to_name($rr['network']), ); @@ -385,20 +386,40 @@ function connections_content(&$a) { } } - $o .= replace_macros(get_markup_template('connections.tpl'),array( - '$header' => t('Connections') . (($head) ? ' - ' . $head : ''), - '$tabs' => $t, - '$total' => $total, - '$search' => $search_hdr, - '$desc' => t('Search your connections'), - '$finding' => (($searching) ? t('Finding: ') . "'" . $search . "'" : ""), - '$submit' => t('Find'), - '$edit' => t('Edit'), - '$cmd' => $a->cmd, - '$contacts' => $contacts, - '$paginate' => paginate($a), - - )); - + + if($_REQUEST['aj']) { + if($contacts) { + $o = replace_macros(get_markup_template('contactsajax.tpl'),array( + '$contacts' => $contacts, + '$edit' => t('Edit'), + )); + } + else { + $o = '<div id="content-complete"></div>'; + } + echo $o; + killme(); + } + else { + $o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>"; + $o .= replace_macros(get_markup_template('connections.tpl'),array( + '$header' => t('Connections') . (($head) ? ' - ' . $head : ''), + '$tabs' => $t, + '$total' => $total, + '$search' => $search_hdr, + '$desc' => t('Search your connections'), + '$finding' => (($searching) ? t('Finding: ') . "'" . $search . "'" : ""), + '$submit' => t('Find'), + '$edit' => t('Edit'), + '$cmd' => $a->cmd, + '$contacts' => $contacts, + '$paginate' => paginate($a), + + )); + } + + if(! $contacts) + $o .= '<div id="content-complete"></div>'; + return $o; } |