suggested.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * List suggested groups
  4. */
  5. gatekeeper();
  6. // for consistency with other tabs
  7. elgg_push_breadcrumb(elgg_echo("groups"));
  8. // only register title button if allowed
  9. if ((elgg_get_plugin_setting("limited_groups", "groups") != "yes") || elgg_is_admin_logged_in()) {
  10. elgg_register_title_button();
  11. }
  12. $selected_tab = "suggested";
  13. // limit to 9 so we can have a nice 3 x 3 grid
  14. $groups = group_tools_get_suggested_groups(elgg_get_logged_in_user_entity(), 9);
  15. if ($groups) {
  16. // list suggested groups
  17. $content = elgg_view("output/text", array("value" => elgg_echo("group_tools:suggested_groups:info")));
  18. $content .= elgg_view("group_tools/suggested", array("groups" => $groups));
  19. } else {
  20. $content = elgg_echo("group_tools:suggested_groups:none");
  21. }
  22. $filter = elgg_view("groups/group_sort_menu", array("selected" => $selected_tab));
  23. $sidebar = elgg_view("groups/sidebar/find");
  24. //$sidebar .= elgg_view("groups/sidebar/featured");
  25. $params = array(
  26. "content" => $content,
  27. "sidebar" => $sidebar,
  28. "filter" => $filter,
  29. );
  30. $body = elgg_view_layout("content", $params);
  31. echo elgg_view_page(elgg_echo("group_tools:groups:sorting:suggested"), $body);