edit.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Friend widget options
  4. *
  5. */
  6. $num_display = sanitize_int($vars['entity']->num_display, false);
  7. // set default value for display number
  8. if (!$num_display) {
  9. $num_display = 12;
  10. }
  11. $params = array(
  12. 'name' => 'params[num_display]',
  13. 'value' => $num_display,
  14. 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 50, 100),
  15. );
  16. $display_dropdown = elgg_view('input/select', $params);
  17. // handle upgrade to 1.7.2 from previous versions
  18. if ($vars['entity']->icon_size == 1) {
  19. $vars['entity']->icon_size = 'small';
  20. } elseif ($vars['entity']->icon_size == 2) {
  21. $vars['entity']->icon_size = 'tiny';
  22. }
  23. // set default value for icon size
  24. if (!isset($vars['entity']->icon_size)) {
  25. $vars['entity']->icon_size = 'small';
  26. }
  27. $params = array(
  28. 'name' => 'params[icon_size]',
  29. 'value' => $vars['entity']->icon_size,
  30. 'options_values' => array(
  31. 'small' => elgg_echo('friends:small'),
  32. 'tiny' => elgg_echo('friends:tiny'),
  33. ),
  34. );
  35. $size_dropdown = elgg_view('input/select', $params);
  36. ?>
  37. <p>
  38. <?php echo elgg_echo('friends:num_display'); ?>:
  39. <?php echo $display_dropdown; ?>
  40. </p>
  41. <p>
  42. <?php echo elgg_echo('friends:icon_size'); ?>:
  43. <?php echo $size_dropdown; ?>
  44. </p>