From fe7bc5b2fa63f4b8562a961cf3910db1f3b8f7a1 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 15 Mar 2014 15:07:03 -0300 Subject: Squashed 'mod/infinite_scroll/' content from commit 68db72a git-subtree-dir: mod/infinite_scroll git-subtree-split: 68db72a726e9ccd3603acbf59914c2017276b0ed --- views/default/infinite_scroll/css.php | 18 ++++++ views/default/infinite_scroll/initialize_js.php | 5 ++ views/default/infinite_scroll/list.php | 83 +++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 views/default/infinite_scroll/css.php create mode 100644 views/default/infinite_scroll/initialize_js.php create mode 100644 views/default/infinite_scroll/list.php (limited to 'views/default/infinite_scroll') diff --git a/views/default/infinite_scroll/css.php b/views/default/infinite_scroll/css.php new file mode 100644 index 000000000..7a116dbba --- /dev/null +++ b/views/default/infinite_scroll/css.php @@ -0,0 +1,18 @@ +.elgg-infinite-scroll-ajax-loading { + background-image: url("/_graphics/ajax_loader.gif"); + background-position: center center; + background-repeat: no-repeat; +} + +.elgg-infinite-scroll-bottom { + color: #666; + text-align: center; + padding: 1.5em; +} + +.elgg-gallery + .elgg-infinite-scroll-bottom { + width: 100%; + margin-top: 15px; + border-top: dotted 1px #CCCCCC; + border-bottom: dotted 1px #CCCCCC; +} diff --git a/views/default/infinite_scroll/initialize_js.php b/views/default/infinite_scroll/initialize_js.php new file mode 100644 index 000000000..2d78819cf --- /dev/null +++ b/views/default/infinite_scroll/initialize_js.php @@ -0,0 +1,5 @@ +guid; + } + $guids = array_unique($guids); + foreach (array_keys($guids) as $i) { + $json[$i] = $buggy[$i]; + } + } + break; + case 'annotation': + foreach ($json as $child) { + $json = $child; + } + $json = elgg_get_annotations(array( + 'items' => $json->guid, + 'offset' => get_input('offset'), + 'limit' => 25, + )); + break; + case 'river': + $json = $json->activity; + break; +} + +if (!is_array($json)) { + exit(); +} + +$items = array(); +foreach($json as $item) { + switch(get_input('items_type')) { + case 'entity': + $type_class = array( + 'site' => 'ElggSite', + 'user' => 'ElggUser', + 'group' => 'ElggGroup', + 'object' => 'ElggObject' + ); + $items[] = new $type_class[$item->type]($item); + break; + case 'annotation': + $items = $json; + break; + case 'river': + $items[] = new ElggRiverItem($item); + break; + } +} + +header('Content-type: text/plain'); + +elgg_set_viewtype('default'); +echo elgg_view("page/components/$list_type", array("items" => $items)); -- cgit v1.2.3