list.php 297 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. * JSON list view
  4. *
  5. * @uses $vars['items']
  6. */
  7. $items = $vars['items'];
  8. $list = '[';
  9. if (is_array($items) && sizeof($items) > 0) {
  10. foreach ($items as $item) {
  11. $list .= elgg_view_list_item($item, $vars);
  12. $list .= ',';
  13. }
  14. $list = rtrim($list, ',');
  15. }
  16. $list .= ']';
  17. echo $list;