From ccffd41265c149fa5de73005ad3126e4559b2de7 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 4 Jan 2007 21:39:47 +0000 Subject: [PATCH] fixed potential problems with undefined $USER->screenreader --- course/lib.php | 2 +- mod/chat/view.php | 4 ++-- mod/resource/type/file/resource.class.php | 2 +- mod/resource/type/repository/resource.class.php | 2 +- question/type/multianswer/questiontype.php | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/course/lib.php b/course/lib.php index 0b6f90cac1..ae8133bcac 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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 = ''; diff --git a/mod/chat/view.php b/mod/chat/view.php index edba6aee3c..4d8a65d83d 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -106,7 +106,7 @@ 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"; @@ -117,7 +117,7 @@ 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", diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 1ba435270d..254952927c 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -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 "\n"; echo "\n"; diff --git a/mod/resource/type/repository/resource.class.php b/mod/resource/type/repository/resource.class.php index 248e78cc10..06c0b9b388 100644 --- a/mod/resource/type/repository/resource.class.php +++ b/mod/resource/type/repository/resource.class.php @@ -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 "\n"; echo "\n"; echo ''; diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index 6f28fc8698..2ee7543688 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -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 "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 " "; - if (!empty($feedback) && $USER->screenreader) { + if (!empty($feedback) && !empty($USER->screenreader)) { echo "pixpath/i/feedback.gif\" alt=\"$feedback\" />"; } echo $feedbackimg; @@ -314,7 +314,7 @@ class embedded_cloze_qtype extends default_questiontype { echo "'; - if (!empty($feedback) && $USER->screenreader) { + if (!empty($feedback) && !empty($USER->screenreader)) { echo "pixpath/i/feedback.gif\" alt=\"$feedback\" />"; } echo $feedbackimg; -- 2.39.5