getSubtype() == "tool" && $tool->canEdit()) { $featured_count = get_entities_from_metadata("featured", "1", "object", "tool", 0, 5, 0, "", 0, true); if ($featured_count < 5 && !empty($make)) { $tool->featured = 1; $tool->save(); /*translation:This tool is now featured.*/ system_message(elgg_echo("koolielu:message_tool_set_featured")); } elseif ($featured_count >= 5) { /*translation:Featured tool limit is full. You need to unset some of the tools first.*/ register_error(elgg_echo("koolielu:error_featured_tools_limit_full")); } if ($revert) { $tool->featured = 0; $tool->save(); /*translation:This tool is not longer featured.*/ system_message(elgg_echo("koolielu:message_tool_unset_featured")); } } forward($_SERVER['HTTP_REFERER']); ?>