$metadata_name) { $group = get_entity($guid); if (!empty($group) && elgg_instanceof($group, "group")) { $configured_projects[] = $group; } } } if (!empty($configured_projects)) { if (elgg_is_xhr()) { echo ""; } else { elgg_require_js("group_tools/group_news"); } $blog_count = sanitise_int($widget->blog_count); if ($blog_count < 1) { $blog_count = 5; } $group_icon_size = $widget->group_icon_size; if ($group_icon_size !== "small") { $group_icon_size = "medium"; } echo "
"; foreach ($configured_projects as $key => $group) { $body = "

" . $group->name . "

"; $icon = elgg_view_entity_icon($group, $group_icon_size); $group_news = elgg_get_entities(array( "type" => "object", "subtype" => "blog", "container_guid" => $group->getGUID(), "limit" => $blog_count )); if (!empty($group_news)) { $body .= ""; } else { $body .= elgg_echo("widgets:group_news:no_news"); } $class = "widget_group_news_" . ($key + 1) . "_" . $group->getGUID(); if ($key !== 0) { $class .= " hidden"; } echo elgg_view_image_block($icon, $body, array("class" => $class)); } echo "
"; $configured_projects = array_values($configured_projects); echo "
"; foreach ($configured_projects as $key => $group) { $class = ""; if ($key == 0) { $class = " class='active'"; } echo "" . ($key + 1) . ""; } echo "
"; } else { echo elgg_echo("widgets:group_news:no_projects"); }