edit.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Group activity widget settings
  4. */
  5. // once autocomplete is working use that
  6. $groups = elgg_get_logged_in_user_entity()->getGroups(array('limit' => 0));
  7. $mygroups = array();
  8. if (!$vars['entity']->group_guid) {
  9. $mygroups[0] = '';
  10. }
  11. foreach ($groups as $group) {
  12. $mygroups[$group->guid] = $group->name;
  13. }
  14. $params = array(
  15. 'name' => 'params[group_guid]',
  16. 'value' => $vars['entity']->group_guid,
  17. 'options_values' => $mygroups,
  18. );
  19. $group_dropdown = elgg_view('input/select', $params);
  20. ?>
  21. <div>
  22. <?php echo elgg_echo('groups:widget:group_activity:edit:select'); ?>:
  23. <?php echo $group_dropdown; ?>
  24. </div>
  25. <?php
  26. // set default value for number to display
  27. if (!isset($vars['entity']->num_display)) {
  28. $vars['entity']->num_display = 8;
  29. }
  30. $params = array(
  31. 'name' => 'params[num_display]',
  32. 'value' => $vars['entity']->num_display,
  33. 'options' => array(5, 8, 10, 12, 15, 20),
  34. );
  35. $num_dropdown = elgg_view('input/select', $params);
  36. ?>
  37. <div>
  38. <?php echo elgg_echo('widget:numbertodisplay'); ?>:
  39. <?php echo $num_dropdown; ?>
  40. </div>
  41. <?php
  42. $title_input = elgg_view('input/hidden', array('name' => 'title'));
  43. echo $title_input;