diff options
author | friendica <redmatrix@redmatrix.me> | 2015-04-06 22:36:46 -0700 |
---|---|---|
committer | friendica <redmatrix@redmatrix.me> | 2015-04-06 22:36:46 -0700 |
commit | 5bc7c0e7988765998d44f005a9e7121848888660 (patch) | |
tree | 6e918268bda874e13112b60e70e78192fccb9fd5 /mod/viewconnections.php | |
parent | 3c05af6553ae1bef3a59c5f58aa7551021e34363 (diff) | |
download | volse-hubzilla-5bc7c0e7988765998d44f005a9e7121848888660.tar.gz volse-hubzilla-5bc7c0e7988765998d44f005a9e7121848888660.tar.bz2 volse-hubzilla-5bc7c0e7988765998d44f005a9e7121848888660.zip |
add endless scroll to viewconnections module
Diffstat (limited to 'mod/viewconnections.php')
-rw-r--r-- | mod/viewconnections.php | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/mod/viewconnections.php b/mod/viewconnections.php index ee68c2149..ef6681e64 100644 --- a/mod/viewconnections.php +++ b/mod/viewconnections.php @@ -28,6 +28,10 @@ function viewconnections_content(&$a) { return; } + if(! $_REQUEST['aj']) + $_SESSION['return_url'] = $a->query_string; + + $is_owner = ((local_channel() && local_channel() == $a->profile['uid']) ? true : false); $abook_flags = ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF; @@ -54,7 +58,7 @@ function viewconnections_content(&$a) { intval($a->pager['start']) ); - if(! $r) { + if((! $r) && (! $_REQUEST['aj'])) { info( t('No connections.') . EOL ); return $o; } @@ -81,13 +85,30 @@ function viewconnections_content(&$a) { } - $tpl = get_markup_template("viewcontact_template.tpl"); - $o .= replace_macros($tpl, array( - '$title' => t('View Connections'), - '$contacts' => $contacts, - '$paginate' => paginate($a), - )); + if($_REQUEST['aj']) { + if($contacts) { + $o = replace_macros(get_markup_template('viewcontactsajax.tpl'),array( + '$contacts' => $contacts + )); + } + 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>"; + $tpl = get_markup_template("viewcontact_template.tpl"); + $o .= replace_macros($tpl, array( + '$title' => t('View Connections'), + '$contacts' => $contacts, +// '$paginate' => paginate($a), + )); + } + if(! $contacts) + $o .= '<div id="content-complete"></div>'; return $o; } |