} $orderby = ''; if (empty($tsort) or $tsort == 'sortlast') { $orderby = "u.lastname, u.firstname"; } elseif ($tsort == 'sortfirst') { $orderby = "u.firstname, u.lastname"; } //todo:fix this so it pages correctly. $perpage = 25; $context = get_context_instance(CONTEXT_COURSE, $course->id); $allpersons = sharing_get_users($context, 'moodle/course:view', 'u.id, u.lastname, u.firstname', $orderby, $page * $perpage, $perpage, $groupid, '', false); print_paging_bar($allpersons->usercount, $page, $perpage, $CFG->wwwroot . "/blocks/file_manager/sharing.php?id={$id}&groupid={$groupid}&linkid={$linkid}&from='{$from}'&rootdir={$rootdir}&tsort={$tsort}&"); if ($allpersons->usercount > $perpage) { print_table(fm_print_share_course_members($course->id, $linkid, $type, $groupid, $allpersons->users, true)); } else { print_table(fm_print_share_course_members($course->id, $linkid, $type, $groupid, $allpersons->users, false)); } // Stores $cb id's if ($cb != NULL) { foreach ($cb as $c) { echo "<input type=\"hidden\" name=\"cb[]\" value=\"{$c}\" />"; } } echo "<center>"; echo "<input type=\"submit\" value=\"" . get_string('btnshare', 'block_file_manager') . "\" name=\"share\" />"; echo " <input type=\"submit\" value=\"" . get_string('btncancel', 'block_file_manager') . "\" name=\"cancel\" />"; echo "</center></form>"; /* // If no groups...wont display any group info if ($course->groupmode == NOGROUPS) { print_footer();
redirect("view.php?id={$id}&groupid={$groupid}&rootdir={$rootdir}", 3); } print_heading(get_string('msgsharetoothers', 'block_file_manager')); echo '<br/>'; // Warns that sharing more than one file will delete all their other shared properties if (count($cb) > 1) { $msg = text_to_html(get_string('msgsharemulti', 'block_file_manager')); } $msg = text_to_html(get_string('msgshare', 'block_file_manager')) . $msg; print_simple_box($msg, 'center'); echo '<br/>'; echo "<form name=\"shareform\" action=\"sharing.php?id={$id}&groupid={$groupid}&linkid={$linkid}&from={$from}&rootdir={$rootdir}\" method=\"post\">"; if (count($cb) == 1) { $linkid = $cb[0]; } print_table(fm_print_share_course_members($course->id, $linkid, $type, $groupid)); // Stores $cb id's if ($cb != NULL) { foreach ($cb as $c) { echo "<input type=\"hidden\" name=\"cb[]\" value=\"{$c}\" />"; } } echo "<center>"; echo "<input type=\"submit\" value=\"" . get_string('btnshare', 'block_file_manager') . "\" name=\"share\" />"; echo " <input type=\"submit\" value=\"" . get_string('btncancel', 'block_file_manager') . "\" name=\"cancel\" />"; echo "</center></form>"; /* // If no groups...wont display any group info if ($course->groupmode == NOGROUPS) { print_footer(); die();