Browse Source

Fix some coding guideline things.

MOODLE_36_STABLE
Dan Marsden 7 years ago
parent
commit
72a33ff88f
  1. 2
      classes/event/course_module_instance_list_viewed.php
  2. 8
      index.php

2
classes/event/course_module_instance_list_viewed.php

@ -43,7 +43,7 @@ class course_module_instance_list_viewed extends \core\event\course_module_insta
$params = array( $params = array(
'context' => \context_course::instance($course->id) 'context' => \context_course::instance($course->id)
); );
$event = \mod_attendance\event\course_module_instance_list_viewed::create($params); $event = self::create($params);
$event->add_record_snapshot('course', $course); $event->add_record_snapshot('course', $course);
return $event; return $event;
} }

8
index.php

@ -47,14 +47,14 @@ $context = context_course::instance($course->id);
require_capability('mod/attendance:view', $context); require_capability('mod/attendance:view', $context);
if (! $atts = get_all_instances_in_course("attendance", $course)) { if (! $atts = get_all_instances_in_course("attendance", $course)) {
$url = new moodle_url('/course/view.php', array('id'=>$course->id)); $url = new moodle_url('/course/view.php', array('id' => $course->id));
notice(get_string('thereareno', 'moodle', $strplural), $url); notice(get_string('thereareno', 'moodle', $strplural), $url);
die; die;
} }
$usesections = course_format_uses_sections($course->format); $usesections = course_format_uses_sections($course->format);
// Print the list of instances, // Print the list of instances.
$timenow = time(); $timenow = time();
$strname = get_string("name"); $strname = get_string("name");
@ -71,8 +71,8 @@ if ($usesections) {
} }
foreach ($atts as $att) { foreach ($atts as $att) {
//get the responses of each feedback // Get the responses of each attendance.
$viewurl = new moodle_url('/mod/attendance/view.php', array('id'=>$att->coursemodule)); $viewurl = new moodle_url('/mod/attendance/view.php', array('id' => $att->coursemodule));
$dimmedclass = $att->visible ? '' : 'class="dimmed"'; $dimmedclass = $att->visible ? '' : 'class="dimmed"';
$link = '<a '.$dimmedclass.' href="'.$viewurl->out().'">'.$att->name.'</a>'; $link = '<a '.$dimmedclass.' href="'.$viewurl->out().'">'.$att->name.'</a>';

Loading…
Cancel
Save