Skip to content

Commit

Permalink
Merge branch 'MDL-40515' of git://github.com/aolley/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Nov 4, 2013
2 parents 42fb49a + 7893297 commit 92dc72a
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions report/log/locallib.php
Expand Up @@ -224,12 +224,14 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0,
$modinfo = get_fast_modinfo($course);
if (!empty($modinfo->cms)) {
$section = 0;
$thissection = array();
foreach ($modinfo->cms as $cm) {
if (!$cm->uservisible || !$cm->has_view()) {
continue;
}
if ($cm->sectionnum > 0 and $section <> $cm->sectionnum) {
$activities["section/$cm->sectionnum"] = '--- '.get_section_name($course, $cm->sectionnum).' ---';
$activities[] = $thissection;
$thissection = array();
}
$section = $cm->sectionnum;
$modname = strip_tags($cm->get_formatted_name());
Expand All @@ -239,12 +241,19 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0,
if (!$cm->visible) {
$modname = "(".$modname.")";
}
$activities["$cm->id"] = $modname;
$key = get_section_name($course, $cm->sectionnum);
if (!isset($thissection[$key])) {
$thissection[$key] = array();
}
$thissection[$key][$cm->id] = $modname;

if ($cm->id == $modid) {
$selectedactivity = "$cm->id";
}
}
if (!empty($thissection)) {
$activities[] = $thissection;
}
}

if (has_capability('report/log:view', $sitecontext) && !$course->category) {
Expand Down Expand Up @@ -478,12 +487,14 @@ function report_log_print_selector_form($course, $selecteduser=0, $selecteddate=
$modinfo = get_fast_modinfo($course);
if (!empty($modinfo->cms)) {
$section = 0;
$thissection = array();
foreach ($modinfo->cms as $cm) {
if (!$cm->uservisible || !$cm->has_view()) {
continue;
}
if ($cm->sectionnum > 0 and $section <> $cm->sectionnum) {
$activities["section/$cm->sectionnum"] = '--- '.get_section_name($course, $cm->sectionnum).' ---';
$activities[] = $thissection;
$thissection = array();
}
$section = $cm->sectionnum;
$modname = strip_tags($cm->get_formatted_name());
Expand All @@ -493,12 +504,19 @@ function report_log_print_selector_form($course, $selecteduser=0, $selecteddate=
if (!$cm->visible) {
$modname = "(".$modname.")";
}
$activities["$cm->id"] = $modname;
$key = get_section_name($course, $cm->sectionnum);
if (!isset($thissection[$key])) {
$thissection[$key] = array();
}
$thissection[$key][$cm->id] = $modname;

if ($cm->id == $modid) {
$selectedactivity = "$cm->id";
}
}
if (!empty($thissection)) {
$activities[] = $thissection;
}
}

if (has_capability('report/log:view', $sitecontext) && ($course->id == SITEID)) {
Expand Down

0 comments on commit 92dc72a

Please sign in to comment.