mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +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
|
@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue