}
echo "</TABLE>";
- if ($news or $course->showrecent) {
+ if (!empty($news) or !empty($course->showrecent)) {
echo "</TD><TD WIDTH=210>";
// Print all the news items.
- if ($news) {
+ if (!empty($news)) {
print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews");
echo "<FONT SIZE=\"-2\">";
forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "DESC", false);
}
// Print all the recent activity
- if ($course->showrecent) {
+ if (!empty($course->showrecent)) {
print_side_block_start(get_string("recentactivity"), 210, "sideblockrecentactivity");
print_recent_activity($course);
print_side_block_end();
'$url',
'$info')");
- if (!$result) {
+ if (!$result and ($CFG->debug > 7)) {
echo "<P>Error: Could not insert a new entry to the Moodle log</P>"; // Don't throw an error
}
}
function can_use_richtext_editor() {
/// Is the richedit editor enabled?
global $USER, $CFG;
- if ($USER->htmleditor and $CFG->htmleditor) {
+ if (!empty($USER->htmleditor) and !empty($CFG->htmleditor)) {
return check_browser_version("MSIE", 5.5);
}
return false;
/// good_referer is not specified, use qualified_me as the good_referer
global $CFG;
- if ($CFG->buggy_referer) {
+ if (!empty($CFG->buggy_referer)) {
return true;
}
- if ($good_referer == "") {
+ if (empty($good_referer)) {
$good_referer = qualified_me();
}
return $good_referer == get_referer();
}
function assignment_print_submission($assignment, $user, $submission, $teachers, $grades) {
- global $THEME;
+ global $THEME, $USER;
echo "\n<TABLE BORDER=1 CELLSPACING=0 valign=top cellpadding=10 align=center>";
echo "<DIV ALIGN=CENTER>";
echo "<FORM ENCTYPE=\"multipart/form-data\" METHOD=\"POST\" ACTION=upload.php>";
- echo " <INPUT TYPE=hidden NAME=MAX_FILE_SIZE value=\"$assignment->maxfilesize\">";
+ echo " <INPUT TYPE=hidden NAME=MAX_FILE_SIZE value=\"$assignment->maxbytes\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=\"$assignment->id\">";
echo " <INPUT NAME=\"newfile\" TYPE=\"file\" size=\"50\">";
echo " <INPUT TYPE=submit NAME=save VALUE=\"".get_string("uploadthisfile")."\">";
if (empty($form->resubmit)) {
$form->resubmit = "";
}
- if (empty($form->grade)) {
- $form->grade = "";
+ if (!isset($form->grade)) {
+ $form->grade = 100;
}
if (empty($form->maxbytes)) {
$form->maxbytes = "";
if ($data = data_submitted()) {
$feedback = array();
- $data = (array)$data;
// Peel out all the data from variable names.
foreach ($data as $key => $val) {
foreach ($feedback as $num => $vals) {
$submission = $submissions[$num];
// Only update entries where feedback has actually changed.
- if (($vals[g] <> $submission->grade) || ($vals[c] <> addslashes($submission->comment))) {
+ if (($vals['g'] <> $submission->grade) || ($vals['c'] <> addslashes($submission->comment))) {
unset($newsubmission);
- $newsubmission->grade = $vals[g];
- $newsubmission->comment = $vals[c];
+ $newsubmission->grade = $vals['g'];
+ $newsubmission->comment = $vals['c'];
$newsubmission->teacher = $USER->id;
$newsubmission->timemarked = $timenow;
$newsubmission->mailed = 0; // Make sure mail goes out (again, even)
} else {
$aa = "";
}
+ if (!empty($choice->section)) {
+ $section = "$choice->section";
+ } else {
+ $section = "";
+ }
if ($course->format == "weeks" || $course->format == "topics") {
- $table->data[] = array ("$choice->section",
+ $table->data[] = array ($section,
"<A HREF=\"view.php?id=$choice->coursemodule\">$choice->name</A>",
- "$aa");
+ $aa);
} else {
$table->data[] = array ("<A HREF=\"view.php?id=$choice->coursemodule\">$choice->name</A>",
- "$aa");
+ $aa);
}
}
echo "<BR>";
+<?PHP
+ if (empty($user->htmleditor)) {
+ $user->htmleditor = 1;
+ }
+ if (empty($user->lang)) {
+ $user->lang = $CFG->lang;
+ }
+
+?>
+
<FORM METHOD="post" ENCTYPE="multipart/form-data" action="edit.php">
<table cellpadding=9 cellspacing=0 >
<?