From: moodler <moodler> Date: Wed, 8 Jan 2003 09:08:05 +0000 (+0000) Subject: Some small robustness things, and a new style for quiz feedback text X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c897eac5e42ca27ded487f73db9533e5c5c7eedc;p=moodle.git Some small robustness things, and a new style for quiz feedback text --- diff --git a/files/index.php b/files/index.php index 11fc1d8af6..aa5d8fc7d1 100644 --- a/files/index.php +++ b/files/index.php @@ -654,7 +654,7 @@ function displaydir ($wdir) { echo "</FORM>"; echo "<TD ALIGN=center>"; - if (($USER->fileop == "move") && $USER->filesource <> $wdir) { + if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) { echo "<FORM ACTION=index.php METHOD=get>"; echo " <INPUT TYPE=hidden NAME=id VALUE=$id>"; echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">"; diff --git a/files/mimetypes.php b/files/mimetypes.php index f4091332d7..7ecfc86997 100644 --- a/files/mimetypes.php +++ b/files/mimetypes.php @@ -27,7 +27,7 @@ function mimeinfo($element, $filename) { $result = $mimeinfo[strtolower($match[1])][$element]; } - if ($result) { + if (!empty($result)) { return $result; } else { return $mimeinfo["xxx"][$element]; // By default diff --git a/mod/choice/index.php b/mod/choice/index.php index bd901b1aaa..6e043dc742 100644 --- a/mod/choice/index.php +++ b/mod/choice/index.php @@ -15,6 +15,8 @@ if ($course->category) { $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; + } else { + $navigation = ""; } $strchoice = get_string("modulename", "choice"); diff --git a/mod/choice/view.php b/mod/choice/view.php index ed8e75075c..dc255b8afa 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -57,6 +57,8 @@ if ($course->category) { $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; + } else { + $navigation = ""; } print_header("$course->shortname: $choice->name", "$course->fullname", "$navigation <A HREF=index.php?id=$course->id>$strchoices</A> -> $choice->name", "", "", true, diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index 8830a5606e..4cec88a611 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -310,7 +310,7 @@ function quiz_get_attempt_responses($attempt) { function quiz_print_comment($text) { global $THEME; - echo "<FONT COLOR=\"$THEME->cellheading2\">".text_to_html($text, true, false)."</FONT>"; + echo "<SPAN CLASS=feedbacktext>".text_to_html($text, true, false)."</SPAN>"; } function quiz_print_correctanswer($text) { diff --git a/theme/standard/styles.php b/theme/standard/styles.php index 2500203a2f..d6ade57eaf 100644 --- a/theme/standard/styles.php +++ b/theme/standard/styles.php @@ -187,3 +187,6 @@ form { .generalboxcontent { } +.feedbacktext { + color: <?PHP echo $THEME->cellheading2?>; +} diff --git a/theme/standardblue/styles.php b/theme/standardblue/styles.php index 2500203a2f..d6ade57eaf 100644 --- a/theme/standardblue/styles.php +++ b/theme/standardblue/styles.php @@ -187,3 +187,6 @@ form { .generalboxcontent { } +.feedbacktext { + color: <?PHP echo $THEME->cellheading2?>; +} diff --git a/theme/standardgreen/styles.php b/theme/standardgreen/styles.php index 2500203a2f..d6ade57eaf 100644 --- a/theme/standardgreen/styles.php +++ b/theme/standardgreen/styles.php @@ -187,3 +187,6 @@ form { .generalboxcontent { } +.feedbacktext { + color: <?PHP echo $THEME->cellheading2?>; +} diff --git a/theme/standardlogo/styles.php b/theme/standardlogo/styles.php index 2500203a2f..d6ade57eaf 100644 --- a/theme/standardlogo/styles.php +++ b/theme/standardlogo/styles.php @@ -187,3 +187,6 @@ form { .generalboxcontent { } +.feedbacktext { + color: <?PHP echo $THEME->cellheading2?>; +} diff --git a/theme/standardred/styles.php b/theme/standardred/styles.php index 2500203a2f..d6ade57eaf 100644 --- a/theme/standardred/styles.php +++ b/theme/standardred/styles.php @@ -187,3 +187,6 @@ form { .generalboxcontent { } +.feedbacktext { + color: <?PHP echo $THEME->cellheading2?>; +} diff --git a/theme/standardwhite/styles.php b/theme/standardwhite/styles.php index 2500203a2f..d6ade57eaf 100644 --- a/theme/standardwhite/styles.php +++ b/theme/standardwhite/styles.php @@ -187,3 +187,6 @@ form { .generalboxcontent { } +.feedbacktext { + color: <?PHP echo $THEME->cellheading2?>; +}