Example #1
0
function group_get_groupinfo_data($group)
{
    safe_require('artefact', 'file');
    safe_require('interaction', 'forum');
    $group->admins = group_get_admins(array($group->id));
    $group->settingsdescription = group_display_settings($group);
    if (get_config('allowgroupcategories')) {
        $group->categorytitle = $group->category ? get_field('group_category', 'title', 'id', $group->category) : '';
    }
    if (group_can_list_members($group, group_user_access($group->id))) {
        $group->membercount = count_records('group_member', 'group', $group->id);
    }
    $group->viewcount = count_records('view', 'group', $group->id);
    $group->filecounts = ArtefactTypeFileBase::count_user_files(null, $group->id, null);
    $group->forumcounts = PluginInteractionForum::count_group_forums($group->id);
    $group->topiccounts = PluginInteractionForum::count_group_topics($group->id);
    $group->postcounts = PluginInteractionForum::count_group_posts($group->id);
    return $group;
}