collections.php 841 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Elgg friends collections
  4. * Lists a user's friends collections
  5. *
  6. * @package Elgg
  7. * @subpackage Core
  8. *
  9. * @uses $vars['collections'] The array of friends collections
  10. */
  11. if (is_array($vars['collections']) && sizeof($vars['collections'])) {
  12. echo "<ul id=\"friends_collections_accordian\">";
  13. $friendspicker = 0;
  14. foreach ($vars['collections'] as $collection) {
  15. $friendspicker++;
  16. echo elgg_view('core/friends/collection', array(
  17. 'collection' => $collection,
  18. 'friendspicker' => $friendspicker,
  19. ));
  20. }
  21. echo "</ul>";
  22. } else {
  23. echo elgg_echo("friends:nocollections");
  24. }
  25. ?>
  26. <?php //@todo JS 1.8: no ?>
  27. <script>
  28. $(function(){
  29. $('#friends_collections_accordian h2').click(function () {
  30. $(this.parentNode).children("[class=friends-picker-main-wrapper]").slideToggle("fast");
  31. //return false;
  32. });
  33. });
  34. </script>