fixed potential problems with undefined $USER->screenreader

This commit is contained in:
skodak
2007-01-04 21:39:47 +00:00
parent b7dc225654
commit ccffd41265
5 changed files with 8 additions and 8 deletions
+1 -1
View 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 = '';
+2 -2
View File
@@ -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",
+1 -1
View 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";
@@ -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>';
+3 -3
View 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;