edit.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * settings for the index group widget
  4. */
  5. $widget = $vars["entity"];
  6. $count = sanitise_int($widget->group_count, false);
  7. if (empty($count)) {
  8. $count = 8;
  9. }
  10. $noyes_options = array(
  11. "no" => elgg_echo("option:no"),
  12. "yes" => elgg_echo("option:yes")
  13. );
  14. // filter based on tag fields
  15. $tag_fields = array();
  16. $profile_fields = elgg_get_config("group");
  17. if (!empty($profile_fields)) {
  18. foreach ($profile_fields as $name => $type) {
  19. if ($type == "tags") {
  20. $lan_key = "groups:" . $name;
  21. $label = $name;
  22. if (elgg_echo($lan_key) != $lan_key) {
  23. $label = elgg_echo($lan_key);
  24. }
  25. $tag_fields[$name] = $label;
  26. }
  27. }
  28. }
  29. $sorting_options = array(
  30. "newest" => elgg_echo("groups:newest"),
  31. "popular" => elgg_echo("groups:popular"),
  32. "ordered" => elgg_echo("group_tools:groups:sorting:ordered")
  33. );
  34. $sorting_value = $widget->sorting;
  35. if (empty($sorting_value) && ($widget->apply_sorting == "yes")) {
  36. $sorting_value = "ordered";
  37. }
  38. ?>
  39. <div>
  40. <?php echo elgg_echo("widget:numbertodisplay"); ?><br />
  41. <?php echo elgg_view("input/text", array("name" => "params[group_count]", "value" => $count, "size" => "4", "maxlength" => "4")); ?>
  42. </div>
  43. <div>
  44. <?php
  45. echo elgg_echo("widgets:index_groups:show_members");
  46. echo "&nbsp;" . elgg_view("input/dropdown", array("name" => "params[show_members]", "options_values" => $noyes_options, "value" => $widget->show_members));
  47. ?>
  48. </div>
  49. <div>
  50. <?php
  51. echo elgg_echo("widgets:index_groups:featured");
  52. echo "&nbsp;" . elgg_view("input/dropdown", array("name" => "params[featured]", "options_values" => $noyes_options, "value" => $widget->featured));
  53. ?>
  54. </div>
  55. <?php if (!empty($tag_fields)) { ?>
  56. <div>
  57. <?php
  58. $tag_fields = array_reverse($tag_fields);
  59. $tag_fields[""] = elgg_echo("widgets:index_groups:filter:no_filter");
  60. $tag_fields = array_reverse($tag_fields);
  61. echo elgg_echo("widgets:index_groups:filter:field");
  62. echo "&nbsp" . elgg_view("input/dropdown", array("name" => "params[filter_name]", "value" => $widget->filter_name, "options_values" => $tag_fields));
  63. echo "<br />";
  64. echo elgg_echo("widgets:index_groups:filter:value");
  65. echo elgg_view("input/tags", array("name" => "params[filter_value]", "value" => $widget->filter_value));
  66. ?>
  67. </div>
  68. <?php } ?>
  69. <div>
  70. <?php
  71. echo elgg_echo("widgets:index_groups:sorting");
  72. echo "&nbsp;" . elgg_view("input/dropdown", array("name" => "params[sorting]", "options_values" => $sorting_options, "value" => $sorting_value));
  73. ?>
  74. </div>