From 5a86df5e9f772899f7d61d7399e6133aa2ea9228 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Mon, 27 Nov 2006 07:23:12 +0000 Subject: [PATCH] fix for MDL-7487, addin guser setting for screen reader, MDL-7435, add new field for alt tag for user picture --- lang/en_utf8/moodle.php | 5 +++++ lib/weblib.php | 12 +++++++----- user/edit.html | 18 +++++++++++++++--- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index 102162033b..36c01abe00 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -695,6 +695,7 @@ $string['htmlformat'] = 'Pretty HTML format'; $string['icqnumber'] = 'ICQ number'; $string['idnumber'] = 'ID number'; $string['idnumbercourse'] = 'Course ID number'; +$string['imagealt'] = 'Picture description'; $string['import'] = 'Import'; $string['importactivities'] = 'Import activities from another course'; $string['importdata'] = 'Import course data'; @@ -1053,6 +1054,7 @@ $string['paymentthanks'] = 'Thank you for your payment! You are now enrolled in $string['people'] = 'People'; $string['periodending'] = 'Period ending ($a)'; $string['personalprofile'] = 'Personal profile'; +$string['pictureof'] = 'Picture of $a'; $string['phone'] = 'Phone'; $string['phpinfo'] = 'PHP info'; $string['pleaseclose'] = 'Please close this window now.'; @@ -1160,6 +1162,9 @@ $string['scalesstandard'] = 'Standard scales'; $string['scalestip'] = 'To create custom scales, use the \'Scales...\' link in your course administration menu.'; $string['schedule'] = 'Schedule'; $string['scheduledbackupstatus'] = 'Scheduled backup status'; +$string['screenreaderuse'] = 'Screen reader'; +$string['screenreaderno'] = 'No'; +$string['screenreaderyes'] = 'Yes'; $string['screenshot'] = 'Screenshot'; $string['search'] = 'Search'; $string['searchagain'] = 'Search again'; diff --git a/lib/weblib.php b/lib/weblib.php index 7cfca9d38c..c74f4c4f1f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3041,13 +3041,15 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $return=false $class .= " defaultuserpic"; $src = "$CFG->pixpath/u/$file.png\""; } - if ($user = get_record('user', 'username', 'guest')) { - $username = fullname($user); - } else { - $username = get_string('none'); + if ($user = get_record('user','id',$userid)) { + if (!empty($user->imagealt)) { + $imagealt = $user->imagealt; + } else { + $imagealt = get_string('pictureof','',fullname($user)); + } } $output .= "\"".s(get_string('user').'"; + " border=\"0\" width=\"$size\" height=\"$size\" alt=\"".$imagealt."\" />"; if ($link) { $output .= ''; } diff --git a/user/edit.html b/user/edit.html index 60f9c0f557..26a731aec8 100644 --- a/user/edit.html +++ b/user/edit.html @@ -278,11 +278,18 @@ if (has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM, SI ?> + + : + screenreader, '', '', 0, false) ?> + + " /> - -
: @@ -327,7 +334,12 @@ if (has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM, SI - + + : + + " maxlength="100" value="imagealt) ?>" /> + + : " maxlength="255" value="url) ?>" /> -- 2.39.5