Browse Source

Merge pull request #20 from ppv1979/master

Changed deprecated get_context_instance()
MOODLE_26_STABLE
Dan Marsden 11 years ago
parent
commit
84c9af5851
  1. 6
      renderer.php

6
renderer.php

@ -103,7 +103,7 @@ class mod_attendance_renderer extends plugin_renderer_base {
$group = $fcontrols->pageparams->group; $group = $fcontrols->pageparams->group;
} }
$totalusers = count_enrolled_users(get_context_instance(CONTEXT_MODULE, $fcontrols->cm->id), 'mod/attendance:canbelisted', $group); $totalusers = count_enrolled_users(context_module::instance($fcontrols->cm->id), 'mod/attendance:canbelisted', $group);
$usersperpage = $fcontrols->pageparams->perpage; $usersperpage = $fcontrols->pageparams->perpage;
if (empty($fcontrols->pageparams->page) || !$fcontrols->pageparams->page || !$totalusers || !$usersperpage) { if (empty($fcontrols->pageparams->page) || !$fcontrols->pageparams->page || !$totalusers || !$usersperpage) {
return $paging_controls; return $paging_controls;
@ -367,13 +367,13 @@ class mod_attendance_renderer extends plugin_renderer_base {
} else { } else {
$groups = $group; $groups = $group;
} }
$users = get_users_by_capability(get_context_instance(CONTEXT_MODULE, $takedata->cm->id), 'mod/attendance:canbelisted', $users = get_users_by_capability(context_module::instance($takedata->cm->id), 'mod/attendance:canbelisted',
'u.id, u.firstname, u.lastname, u.email', 'u.id, u.firstname, u.lastname, u.email',
'', '', '', $groups, '', '', '', $groups,
'', false, true); '', false, true);
$totalusers = count($users); $totalusers = count($users);
} else { } else {
$totalusers = count_enrolled_users(get_context_instance(CONTEXT_MODULE, $takedata->cm->id), 'mod/attendance:canbelisted', $group); $totalusers = count_enrolled_users(context_module::instance($takedata->cm->id), 'mod/attendance:canbelisted', $group);
} }
$usersperpage = $takedata->pageparams->perpage; $usersperpage = $takedata->pageparams->perpage;
if (!empty($takedata->pageparams->page) && $takedata->pageparams->page && $totalusers && $usersperpage) { if (!empty($takedata->pageparams->page) && $takedata->pageparams->page && $totalusers && $usersperpage) {

Loading…
Cancel
Save