INNER JOIN {interaction_forum_post} pt ON (pt.topic = p.topic AND pt.parent IS NULL) WHERE i.group = ? AND i.deleted = 0 AND t.deleted = 0 AND p.deleted = 0 ORDER BY p.ctime DESC LIMIT 5; ', array($group->id)); } $smarty = smarty(); $smarty->assign('group', $group); $smarty->assign('groupid', $group->id); $smarty->assign('foruminfo', $foruminfo); $smarty->assign('membercount', count_records('group_member', 'group', $group->id)); $smarty->assign('viewcount', count_records('view', 'group', $group->id)); $smarty->assign('filecount', $filecounts->files); $smarty->assign('foldercount', $filecounts->folders); if ($role) { // For group members, display a list of views that others have // shared to the group $viewdata = View::get_sharedviews_data(null, 0, $group->id); $smarty->assign('sharedviews', $viewdata->data); if (group_user_can_assess_submitted_views($group->id, $USER->get('id'))) { // Display a list of views submitted to the group $smarty->assign('submittedviews', View::get_submitted_views($group->id)); } } $smarty->assign('role', $role); $smarty->display('group/view.tpl');
protected static function get_data($groupid) { global $USER; if (!defined('GROUP')) { define('GROUP', $groupid); } // get the currently requested group $group = group_current_group(); $role = group_user_access($group->id); if ($role) { // For group members, display a list of views that others have // shared to the group $data['sharedviews'] = View::get_sharedviews_data(null, 0, $group->id); if (group_user_can_assess_submitted_views($group->id, $USER->get('id'))) { // Display a list of views submitted to the group $data['allsubmittedviews'] = View::get_submitted_views($group->id); } } if (group_allows_submission($group->grouptype) && ($userviewdata = View::get_user_views())) { // A user can submit more than one view to the same group, but no view can be // submitted to more than one group. // Display a list of views this user has submitted to this group, and a submission // form containing drop-down of their unsubmitted views. $data['mysubmittedviews'] = View::get_submitted_views($group->id, $USER->get('id')); if (!empty($data['mysubmittedviews'])) { foreach ($data['mysubmittedviews'] as &$v) { $url = get_config('wwwroot') . 'view/view.php?id=' . $v['id']; if ($v['submittedtime']) { $v['strsubmitted'] = get_string('youhavesubmittedon', 'view', $url, $v['title'], format_date($v['submittedtime'])); } else { $v['strsubmitted'] = get_string('youhavesubmitted', 'view', $url, $v['title']); } } } $data['group_view_submission_form'] = group_view_submission_form($group->id, $userviewdata); } $data['group'] = $group; return $data; }