mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Various little fixes to remove warnings (usually about empty variables)
when error_reporting is turned up to 15 or so ... more of these to come ...
This commit is contained in:
parent
a900458749
commit
9c9f7d7790
28 changed files with 1600 additions and 65 deletions
|
@ -57,9 +57,14 @@
|
|||
}
|
||||
$due = userdate($assignment->timedue);
|
||||
$link = "<A HREF=\"view.php?id=$assignment->coursemodule\">$assignment->name</A>";
|
||||
if ($assignment->section) {
|
||||
$section = "$assignment->section";
|
||||
} else {
|
||||
$section = "";
|
||||
}
|
||||
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$table->data[] = array ($assignment->section, $link, $due, $submitted);
|
||||
$table->data[] = array ($section, $link, $due, $submitted);
|
||||
} else {
|
||||
$table->data[] = array ($link, $due, $submitted);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
$navmiddle = "<A HREF=\"../forum/index.php?id=$course->id\">".get_string("forums", "forum")."</A> -> <A HREF=\"../forum/view.php?f=$forum->id\">$forum->name</A>";
|
||||
|
||||
$searchform = forum_print_search_form($course, $search, true, "plain");
|
||||
$searchform = forum_print_search_form($course, "", true, "plain");
|
||||
|
||||
if ($course->category) {
|
||||
print_header("$course->shortname: $discussion->name", "$course->fullname",
|
||||
|
|
|
@ -1071,7 +1071,7 @@ function forum_set_return() {
|
|||
function forum_go_back_to($default) {
|
||||
global $SESSION;
|
||||
|
||||
if ($SESSION->fromdiscussion) {
|
||||
if (!empty($SESSION->fromdiscussion)) {
|
||||
$returnto = $SESSION->fromdiscussion;
|
||||
unset($SESSION->fromdiscussion);
|
||||
save_session("SESSION");
|
||||
|
@ -1467,7 +1467,7 @@ function forum_print_latest_discussions($forum_id=0, $forum_numdiscussions=5, $f
|
|||
echo get_string("olderdiscussions", "forum")."</A> ...</P>";
|
||||
break;
|
||||
}
|
||||
if ($replies[$discussion->discussion]) {
|
||||
if (!empty($replies[$discussion->discussion])) {
|
||||
$discussion->replies = $replies[$discussion->discussion]->replies;
|
||||
} else {
|
||||
$discussion->replies = 0;
|
||||
|
@ -1624,7 +1624,7 @@ function forum_set_display_mode($mode=0) {
|
|||
if ($mode) {
|
||||
$USER->mode = $mode;
|
||||
save_session("USER");
|
||||
} else if (!$USER->mode) {
|
||||
} else if (empty($USER->mode)) {
|
||||
$USER->mode = $FORUM_DEFAULT_DISPLAY_MODE;
|
||||
save_session("USER");
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
$onsubmit = "onsubmit=\"copyrichtext(theform.message);\"";
|
||||
} else {
|
||||
$defaultformat = FORMAT_MOODLE;
|
||||
$onsubmit = "";
|
||||
}
|
||||
|
||||
|
||||
|
@ -271,6 +272,10 @@
|
|||
$navtail = "$toppost->subject";
|
||||
}
|
||||
|
||||
if (empty($post->edit)) {
|
||||
$post->edit = "";
|
||||
}
|
||||
|
||||
$strforums = get_string("modulenameplural", "forum");
|
||||
|
||||
|
||||
|
@ -278,13 +283,17 @@
|
|||
|
||||
$cm = get_coursemodule_from_instance("forum", $forum->id, $course->id);
|
||||
|
||||
if (empty($discussion->name)) {
|
||||
$discussion->name = $forum->name;
|
||||
}
|
||||
|
||||
if ($course->category) {
|
||||
print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname",
|
||||
"<A HREF=../../course/view.php?id=$course->id>$course->shortname</A> ->
|
||||
$navmiddle -> $navtail", "$forumstart", "", true, "", navmenu($course, $cm));
|
||||
$navmiddle -> $navtail", "$formstart", "", true, "", navmenu($course, $cm));
|
||||
} else {
|
||||
print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname",
|
||||
"$navmiddle -> $navtail", "");
|
||||
"$navmiddle -> $navtail", "$formstart", "", true, "", navmenu($course, $cm));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
foreach ($journals as $journal) {
|
||||
|
||||
$entrytext = get_field("journal_entries", "text", "userid", $USER->id, "journal", $journal->id");
|
||||
$entrytext = get_field("journal_entries", "text", "userid", $USER->id, "journal", $journal->id);
|
||||
|
||||
$journal->timestart = $course->startdate + (($journal->section - 1) * 608400);
|
||||
if ($journal->daysopen) {
|
||||
|
@ -66,8 +66,13 @@
|
|||
} else {
|
||||
$text .= "$strview</A></P>";
|
||||
}
|
||||
if ($journal->section) {
|
||||
$section = "$journal->section";
|
||||
} else {
|
||||
$section = "";
|
||||
}
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$table->data[] = array ("$journal->section",
|
||||
$table->data[] = array ($section,
|
||||
text_to_html($journal->intro),
|
||||
$text);
|
||||
} else {
|
||||
|
|
|
@ -62,8 +62,14 @@
|
|||
|
||||
$bestgrade = quiz_get_best_grade($quiz->id, $USER->id);
|
||||
|
||||
if ($quiz->section) {
|
||||
$section = "$quiz->section";
|
||||
} else {
|
||||
$section = "";
|
||||
}
|
||||
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$table->data[] = array ($quiz->section, $link, "$bestgrade / $quiz->grade");
|
||||
$table->data[] = array ($section, $link, "$bestgrade / $quiz->grade");
|
||||
} else {
|
||||
$table->data[] = array ($link, "$bestgrade / $quiz->grade");
|
||||
}
|
||||
|
|
|
@ -182,6 +182,8 @@ function quiz_print_recent_activity(&$logs, $isteacher=false) {
|
|||
|
||||
global $CFG, $COURSE_TEACHER_COLOR;
|
||||
|
||||
$content = "";
|
||||
|
||||
return $content; // True if anything was printed, otherwise false
|
||||
}
|
||||
|
||||
|
|
|
@ -49,8 +49,13 @@
|
|||
} else {
|
||||
$ss = $strnotdone;
|
||||
}
|
||||
if ($survey->section) {
|
||||
$section = "$survey->section";
|
||||
} else {
|
||||
$section = "";
|
||||
}
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$table->data[] = array ("$survey->section",
|
||||
$table->data[] = array ($section,
|
||||
"<A HREF=\"view.php?id=$survey->coursemodule\">$survey->name</A>",
|
||||
"<A HREF=\"view.php?id=$survey->coursemodule\">$ss</A>");
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue