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));