$row[] = $organizer->intro; $cm = get_coursemodule_from_instance('organizer', $organizer->id, $course->id, false, MUST_EXIST); $context = context_module::instance($cm->id, MUST_EXIST); if (has_capability('mod/organizer:viewregistrations', $context)) { $a = organizer_get_counters($organizer); if ($organizer->isgrouporganizer) { $reg = get_string('mymoodle_registered_group_short', 'organizer', $a); $att = get_string('mymoodle_attended_group_short', 'organizer', $a); $str = '<p>' . $reg . '</p><p>' . $att . '</p>'; } else { $reg = get_string('mymoodle_registered_short', 'organizer', $a); $att = get_string('mymoodle_attended_short', 'organizer', $a); $str = '<p>' . $reg . '</p><p>' . $att . '</p>'; } $row[] = $str; $row[] = '-'; } else { $row[] = organizer_get_overview_student($organizer, true); $app = organizer_get_last_user_appointment($organizer, null, false); if ($app) { $row[] = organizer_display_grade($organizer, $app->grade); } else { $row[] = '-'; } } $table->data[] = $row; } echo $OUTPUT->heading(get_string('modulenameplural', 'organizer'), 2); echo html_writer::table($table); echo $OUTPUT->footer(); die;
function organizer_print_overview($courses, &$htmlarray) { global $USER; if (empty($courses) || !is_array($courses) || count($courses) == 0) { return array(); } if (!($organizers = get_all_instances_in_courses('organizer', $courses))) { return; } foreach ($organizers as $organizer) { if (organizer_is_student_in_course($organizer->course, $USER->id)) { $str = organizer_get_overview_student($organizer); } else { $str = organizer_get_overview_teacher($organizer); } if (empty($htmlarray[$organizer->course]['organizer'])) { $htmlarray[$organizer->course]['organizer'] = $str; } else { $htmlarray[$organizer->course]['organizer'] .= $str; } } }