]> git.mjollnir.org Git - moodle.git/commitdiff
fixed potential problems with undefined $USER->screenreader
authorskodak <skodak>
Thu, 4 Jan 2007 21:39:47 +0000 (21:39 +0000)
committerskodak <skodak>
Thu, 4 Jan 2007 21:39:47 +0000 (21:39 +0000)
course/lib.php
mod/chat/view.php
mod/resource/type/file/resource.class.php
mod/resource/type/repository/resource.class.php
question/type/multianswer/questiontype.php

index 0b6f90cac1525599052950cbd0b2935b92bf100f..ae8133bcacc15766371b1e3ac4047e7b412b48db 100644 (file)
@@ -1383,7 +1383,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
 
                 } else { // Normal activity
                 
-                    if ($USER->screenreader) {
+                    if (!empty($USER->screenreader)) {
                         $typestring = '('.get_string('modulename',$mod->modname).') ';
                     } else {
                         $typestring = '';
index edba6aee3c283feb10db6e2fed692347cb8772da..4d8a65d83d10d87e7988ae4479c9a4f6d1297c92 100644 (file)
         print_simple_box_start('center');
         // users with screenreader set, will only see 1 link, to the manual refresh page
         // for better accessibility
-        if ($USER->screenreader) {
+        if (!empty($USER->screenreader)) {
             $chattarget = "/mod/chat/gui_basic/index.php?id=$chat->id$groupparam";
         } else {
             $chattarget = "/mod/chat/gui_$CFG->chat_method/index.php?id=$chat->id$groupparam"; 
         print_simple_box_end();
         
         // if user is using screen reader, then there is no need to display this link again
-        if ($CFG->chat_method == 'header_js' && !$USER->screenreader) {
+        if ($CFG->chat_method == 'header_js' && empty($USER->screenreader)) {
             // show frame/js-less alternative
             print_simple_box_start('center');
             link_to_popup_window ("/mod/chat/gui_basic/index.php?id=$chat->id$groupparam",
index 1ba435270d683db2235699fa1013a8f9f2b1b46c..254952927c120a48ae5135fd241c482577ac3a2b 100644 (file)
@@ -349,7 +349,7 @@ function display() {
     /// Now check whether we need to display a frameset
 
     $frameset = optional_param( 'frameset','' );
-    if (empty($frameset) and !$embedded and !$inpopup and ($resource->options == "frame") and !$USER->screenreader) {
+    if (empty($frameset) and !$embedded and !$inpopup and ($resource->options == "frame") and empty($USER->screenreader)) {
         @header('Content-Type: text/html; charset=utf-8');
         echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
         echo "<html dir=\"ltr\">\n";
index 248e78cc10c37c3cac34de6f53dbbb5d39e98252..06c0b9b38836b5187344fee12660c178365db615 100644 (file)
@@ -333,7 +333,7 @@ function display() {
 
     /// Now check whether we need to display a frameset
 
-    if (empty($_GET['frameset']) and !$embedded and !$inpopup and $resource->options == "frame" and !$USER->screenreader) {
+    if (empty($_GET['frameset']) and !$embedded and !$inpopup and $resource->options == "frame" and empty($USER->screenreader)) {
         echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
         echo "<html dir=\"ltr\">\n";
         echo '<head>';
index 6f28fc8698c733e968556a003d660fa905e6473c..2ee754368847b8ea8ed001eda5fb904215cba6be 100644 (file)
@@ -200,7 +200,7 @@ class embedded_cloze_qtype extends default_questiontype {
         
         // adding an icon with alt to warn user this is a fill in the gap question
         // MDL-7497
-        if ($USER->screenreader) {
+        if (!empty($USER->screenreader)) {
             echo "<img src=\"$CFG->wwwroot/question/type/$question->qtype/icon.gif\" ".
                 "height=\"16\" width=\"16\" alt=\"".get_string('clozeaid','qtype_multichoice')."\" />  ";
         }
@@ -291,7 +291,7 @@ class embedded_cloze_qtype extends default_questiontype {
                 case 'numerical':
                     echo " <input $style $readonly $popup name=\"$inputname\"
                             type=\"text\" value=\"".s($response)."\" size=\"12\" /> ";
-                    if (!empty($feedback) && $USER->screenreader) {
+                    if (!empty($feedback) && !empty($USER->screenreader)) {
                         echo "<img src=\"$CFG->pixpath/i/feedback.gif\" alt=\"$feedback\" />";
                     }
                     echo $feedbackimg;
@@ -314,7 +314,7 @@ class embedded_cloze_qtype extends default_questiontype {
                     echo "<span $style><select $popup $readonly $style name=\"$inputname\">";
                     echo $outputoptions;
                     echo '</select></span>';
-                    if (!empty($feedback) && $USER->screenreader) {
+                    if (!empty($feedback) && !empty($USER->screenreader)) {
                         echo "<img src=\"$CFG->pixpath/i/feedback.gif\" alt=\"$feedback\" />";
                     }
                     echo $feedbackimg;