featured.php 599 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Feature a group
  4. *
  5. * @package ElggGroups
  6. */
  7. $group_guid = get_input('group_guid');
  8. $action = get_input('action_type');
  9. $group = get_entity($group_guid);
  10. if (!elgg_instanceof($group, 'group')) {
  11. register_error(elgg_echo('groups:featured_error'));
  12. forward(REFERER);
  13. }
  14. //get the action, is it to feature or unfeature
  15. if ($action == "feature") {
  16. $group->featured_group = "yes";
  17. system_message(elgg_echo('groups:featuredon', array($group->name)));
  18. } else {
  19. $group->featured_group = "no";
  20. system_message(elgg_echo('groups:unfeatured', array($group->name)));
  21. }
  22. forward(REFERER);