edit.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * settings for the group news widget
  4. */
  5. $widget = $vars["entity"];
  6. $blog_count = sanitise_int($widget->blog_count);
  7. if ($blog_count < 1) {
  8. $blog_count = 5;
  9. }
  10. $options_values = array("" => elgg_echo("widgets:group_news:settings:no_project"));
  11. $options = array(
  12. "type" => "group",
  13. "limit" => false,
  14. "joins" => array("JOIN " . elgg_get_config("dbprefix") . "groups_entity ge ON e.guid = ge.guid"),
  15. "order_by" => "ge.name ASC"
  16. );
  17. $batch = new ElggBatch("elgg_get_entities", $options);
  18. foreach ($batch as $group) {
  19. $options_values[$group->getGUID()] = $group->name;
  20. }
  21. for ($i = 1; $i < 6; $i++) {
  22. $metadata_name = "project_" . $i;
  23. echo "<div>";
  24. echo elgg_echo("widgets:group_news:settings:project") . " ";
  25. echo elgg_view("input/dropdown", array("options_values" => $options_values, "name" => "params[" . $metadata_name . "]", "value" => $widget->$metadata_name));
  26. echo "</div>";
  27. }
  28. echo "<div>";
  29. echo elgg_echo("widgets:group_news:settings:blog_count") . " ";
  30. echo elgg_view("input/dropdown", array("options" => array(1,2,3,4,5,6,7,8,9,10,15,20), "name" => "params[blog_count]", "value" => $blog_count));
  31. echo "</div>";
  32. echo "<div>";
  33. echo elgg_echo("widgets:group_news:settings:group_icon_size") . " ";
  34. echo elgg_view("input/dropdown", array("options_values" => array("medium" => elgg_echo("widgets:group_news:settings:group_icon_size:medium"), "small" => elgg_echo("widgets:group_news:settings:group_icon_size:small")), "name" => "params[group_icon_size]", "value" => $widget->group_icon_size));
  35. echo "</div>";