add.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Form body for editing or adding a friend collection
  4. *
  5. * @package Elgg
  6. * @subpackage Core
  7. *
  8. * @uses $vars['collection'] Optionally, the collection to edit
  9. */
  10. // Set title, form destination
  11. if (isset($vars['collection'])) {
  12. $title = $vars['collection']->name;
  13. $highlight = 'default';
  14. } else {
  15. $title = "";
  16. $highlight = 'all';
  17. }
  18. echo "<div class=\"mtm\"><label>" . elgg_echo("friends:collectionname") . "<br/>";
  19. echo elgg_view("input/text", array(
  20. "name" => "collection_name",
  21. "value" => $title,
  22. ));
  23. echo "</label></div>";
  24. echo "<div>";
  25. if ($vars['collection_members']) {
  26. echo elgg_echo("friends:collectionfriends") . "<br />";
  27. foreach ($vars['collection_members'] as $mem) {
  28. echo elgg_view_entity_icon($mem, 'tiny');
  29. echo $mem->name;
  30. }
  31. }
  32. echo "</div>";
  33. echo "<div><label>" . elgg_echo("friends:addfriends") . "</label>";
  34. echo elgg_view('input/friendspicker', array(
  35. 'entities' => $vars['friends'],
  36. 'name' => 'friends_collection',
  37. 'highlight' => $highlight,
  38. ));
  39. echo "</div>";
  40. echo '<div class="elgg-foot">';
  41. if (isset($vars['collection'])) {
  42. echo elgg_view('input/hidden', array(
  43. 'name' => 'collection_id',
  44. 'value' => $vars['collection']->id,
  45. ));
  46. }
  47. echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('save')));
  48. echo '</div>';