canEdit()) { if ($featured) { $featured_groups = get_entities_from_metadata("featured", "1", "group", ""); if (is_array($featured_groups) && sizeof($featured_groups) > 0) { foreach($featured_groups as $item) { $item->featured = 0; $item->save(); } } $group->featured = 1; $group->save(); /*translation:Group %s is now a featured group.*/ system_message(sprintf(elgg_echo("koolielu:message_group_is_featured"), $group->name)); forward($group->getURL()); } } else { /*translation:Not enough privileges.*/ register_error(elgg_echo('koolielu:error_insufficient_privileges')); } ?>