$content = false;
$assignments = NULL;
- foreach ($logs as $log) {
- if ($log->module == "assignment" and $log->action == "upload") {
- //Create a temp valid module structure (course,id)
- $tempmod->course = $log->course;
- $tempmod->id = $log->info;
- //Obtain the visible property from the instance
- $modvisible = instance_is_visible($log->module,$tempmod);
-
- //Only if the mod is visible
- if ($modvisible) {
- $assignments[$log->info] = assignment_log_info($log);
- $assignments[$log->info]->time = $log->time;
- $assignments[$log->info]->url = $log->url;
+ foreach ($logs as $key => $log) {
+ if ($log->module == "assignment") {
+ if ($log->action == "upload") {
+ //Create a temp valid module structure (course,id)
+ $tempmod->course = $log->course;
+ $tempmod->id = $log->info;
+ //Obtain the visible property from the instance
+ $modvisible = instance_is_visible($log->module,$tempmod);
+
+ //Only if the mod is visible
+ if ($modvisible) {
+ $assignments[$log->info] = assignment_log_info($log);
+ $assignments[$log->info]->time = $log->time;
+ $assignments[$log->info]->url = $log->url;
+ }
}
+ unset($logs[$key]); // No longer need this record
}
}
$strftimerecent = get_string("strftimerecent");
- foreach ($logs as $log) {
+ foreach ($logs as $key => $log) {
if ($log->module == "forum") {
- //Get post info, I'll need it later
- $post = forum_get_post_from_log($log);
-
- //Create a temp valid module structure (course,id)
- $tempmod->course = $log->course;
- $tempmod->id = $post->forum;
- //Obtain the visible property from the instance
- $modvisible = instance_is_visible($log->module,$tempmod);
-
- //Only if the mod is visible
- if ($modvisible) {
- if ($post) {
- $teacheronly = "";
- if ($forum = get_record("forum", "id", $post->forum) ) {
- if ($forum->type == "teacher") {
- if ($isteacher) {
- $teacheronly = "class=\"teacheronly\"";
- } else {
- continue;
+ if ($log->action == "add post" or $log->action == "add discussion") {
+ //Get post info, I'll need it later
+ $post = forum_get_post_from_log($log);
+
+ //Create a temp valid module structure (course,id)
+ $tempmod->course = $log->course;
+ $tempmod->id = $post->forum;
+ //Obtain the visible property from the instance
+ $modvisible = instance_is_visible($log->module,$tempmod);
+
+ //Only if the mod is visible
+ if ($modvisible) {
+ if ($post) {
+ $teacheronly = "";
+ if ($forum = get_record("forum", "id", $post->forum) ) {
+ if ($forum->type == "teacher") {
+ if ($isteacher) {
+ $teacheronly = "class=\"teacheronly\"";
+ } else {
+ continue;
+ }
}
}
+ if (! $heading) {
+ print_headline(get_string("newforumposts", "forum").":");
+ $heading = true;
+ $content = true;
+ }
+ $date = userdate($post->modified, $strftimerecent);
+ echo "<p $teacheronly><font size=1>$date - $post->firstname $post->lastname<br>";
+ echo "\"<a href=\"$CFG->wwwroot/mod/forum/$log->url\">";
+ if ($log->action == "add discussion") {
+ echo "<b>$post->subject</b>";
+ } else {
+ echo "$post->subject";
+ }
+ echo "</a>\"</font></p>";
}
- if (! $heading) {
- print_headline(get_string("newforumposts", "forum").":");
- $heading = true;
- $content = true;
- }
- $date = userdate($post->modified, $strftimerecent);
- echo "<p $teacheronly><font size=1>$date - $post->firstname $post->lastname<br>";
- echo "\"<a href=\"$CFG->wwwroot/mod/forum/$log->url\">";
- if ($log->action == "add") {
- echo "<b>$post->subject</b>";
- } else {
- echo "$post->subject";
- }
- echo "</a>\"</font></p>";
}
}
+ unset($logs[$key]); // No longer need this record
}
}
return $content;
$content = false;
$journals = NULL;
- foreach ($logs as $log) {
+ foreach ($logs as $key => $log) {
if ($log->module == "journal") {
if ($log->action == "add entry" or $log->action == "update entry") {
///Get journal info. I'll need it later
}
}
}
+ unset($logs[$key]); // No longer need this record
}
}
$content = false;
$surveys = NULL;
- foreach ($logs as $log) {
- if ($log->module == "survey" and $log->action == "submit") {
- //Create a temp valid module structure (course,id)
- $tempmod->course = $log->course;
- $tempmod->id = $log->info;
- //Obtain the visible property from the instance
- $modvisible = instance_is_visible($log->module,$tempmod);
-
- //Only if the mod is visible
- if ($modvisible) {
- $surveys[$log->id] = survey_log_info($log);
- $surveys[$log->id]->time = $log->time;
- $surveys[$log->id]->url = $log->url;
+ foreach ($logs as $key => $log) {
+ if ($log->module == "survey") {
+ if ($log->action == "submit") {
+ //Create a temp valid module structure (course,id)
+ $tempmod->course = $log->course;
+ $tempmod->id = $log->info;
+ //Obtain the visible property from the instance
+ $modvisible = instance_is_visible($log->module,$tempmod);
+
+ //Only if the mod is visible
+ if ($modvisible) {
+ $surveys[$log->id] = survey_log_info($log);
+ $surveys[$log->id]->time = $log->time;
+ $surveys[$log->id]->url = $log->url;
+ }
}
+ unset($logs[$key]); // No longer need this record
}
}