MDL-7434 all images that convey information should have alt text to convey that information - part 2

This commit is contained in:
skodak
2006-11-25 18:09:33 +00:00
parent d0e35419c5
commit 2bbaf749c8
10 changed files with 42 additions and 30 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<p><?php print_string("paymentrequired") ?></p>
<p><b><?php echo get_string("cost").": $CFG->enrol_currency $cost"; ?></b></p>
<p><img alt="PayPal" src="https://www.paypal.com/en_US/i/logo/PayPal_mark_60x38.gif" /></p>
<p><img alt="<?php print_string('paypalaccepted', 'enrol_paypal') ?>" src="https://www.paypal.com/en_US/i/logo/PayPal_mark_60x38.gif" /></p>
<p><?php print_string("paymentinstant") ?></p>
<?php
$paypalurl = empty($CFG->usepaypalsandbox) ? 'https://www.paypal.com/cgi-bin/webscr' : 'https://www.sandbox.paypal.com/cgi-bin/webscr';
+12 -10
View File
@@ -618,9 +618,12 @@ function clearfilelist() {
function printfilelist($filelist) {
global $CFG, $basedir;
$strfolder = get_string("folder");
$strfile = get_string("file");
foreach ($filelist as $file) {
if (is_dir($basedir.'/'.$file)) {
echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" alt=\"\" /> $file<br />";
echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" alt=\"$strfolder\" /> $file<br />";
$subfilelist = array();
$currdir = opendir($basedir.'/'.$file);
while (false !== ($subfile = readdir($currdir))) {
@@ -632,7 +635,7 @@ function printfilelist($filelist) {
} else {
$icon = mimeinfo("icon", $file);
echo "<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" alt=\"\" /> $file<br />";
echo "<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" alt=\"$strfile\" /> $file<br />";
}
}
}
@@ -688,7 +691,9 @@ function displaydir ($wdir) {
$strunzip = get_string("unzip");
$strlist = get_string("list");
$strrestore= get_string("restore");
$strchoose = get_string("choose");
$strchoose = get_string("choose");
$strfolder = get_string("folder");
$strfile = get_string("file");
echo "<form action=\"index.php\" method=\"post\" name=\"dirform\">";
@@ -717,7 +722,8 @@ function displaydir ($wdir) {
if ($dir == '..') {
$fileurl = rawurlencode(dirname($wdir));
print_cell();
print_cell('left', '<a href="index.php?id='.$id.'&amp;wdir='.$fileurl.'&amp;choose='.$choose.'"><img src="'.$CFG->pixpath.'/f/parent.gif" height="16" width="16" alt="'.get_string('parentfolder').'" /></a> <a href="index.php?id='.$id.'&amp;wdir='.$fileurl.'&amp;choose='.$choose.'">'.get_string('parentfolder').'</a>', 'name');
// alt attribute intentionally empty to prevent repetition in screen reader
print_cell('left', '<a href="index.php?id='.$id.'&amp;wdir='.$fileurl.'&amp;choose='.$choose.'"><img src="'.$CFG->pixpath.'/f/parent.gif" height="16" width="16" alt=" " />&nbsp;'.get_string('parentfolder').'</a>', 'name');
print_cell();
print_cell();
print_cell();
@@ -730,7 +736,7 @@ function displaydir ($wdir) {
$filesize = display_size(get_directory_size("$fullpath/$dir"));
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />", 'checkbox');
print_cell("left", "<a href=\"index.php?id=$id&amp;wdir=$fileurl&amp;choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id=$id&amp;wdir=$fileurl&amp;choose=$choose\">".htmlspecialchars($dir)."</a>", 'name');
print_cell("left", "<a href=\"index.php?id=$id&amp;wdir=$fileurl&amp;choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"$strfolder\" />&nbsp;".htmlspecialchars($dir)."</a>", 'name');
print_cell("right", $filesize, 'size');
print_cell("right", $filedate, 'date');
print_cell("right", "<a href=\"index.php?id=$id&amp;wdir=$wdir&amp;file=$filesafe&amp;action=rename&amp;choose=$choose\">$strrename</a>", 'commands');
@@ -766,11 +772,7 @@ function displaydir ($wdir) {
$ffurl = str_replace('//', '/', "/file.php?file=/$id/$fileurl");
}
link_to_popup_window ($ffurl, "display",
"<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" alt=\"File\" />",
480, 640);
echo '&nbsp;';
link_to_popup_window ($ffurl, "display",
htmlspecialchars($file),
"<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" alt=\"$strfile\" />&nbsp;".htmlspecialchars($file),
480, 640);
echo "</td>";
+2 -1
View File
@@ -52,6 +52,7 @@ function string_file_picture_algebra($imagefile, $tex= "", $height="", $width=""
global $CFG;
$output = "";
$origtex = $tex;
if ($tex) {
$tex = str_replace('&','&amp;',$tex);
$tex = str_replace('<','&lt;',$tex);
@@ -76,7 +77,7 @@ function string_file_picture_algebra($imagefile, $tex= "", $height="", $width=""
$output .= urlencode($tex) . "', 'popup', 'menubar=0,location=0,scrollbars,";
$output .= "resizable,width=300,height=240', 0);\">";
}
$output .= "<img border=\"0\" $title $height $width alt=\"\" src=\"";
$output .= "<img border=\"0\" $title $height $width alt=\"".s($origtex)."\" src=\"";
if ($CFG->slasharguments) { // Use this method if possible for better caching
$output .= "$CFG->wwwroot/$CFG->algebrafilterdir/pix.php/$imagefile";
} else {
+2 -1
View File
@@ -45,6 +45,7 @@ function string_file_picture_tex($imagefile, $tex= "", $height="", $width="", $a
global $CFG;
$output = "";
$origtex = $tex;
if ($tex) {
$tex = str_replace('&','&amp;',$tex);
$tex = str_replace('<','&lt;',$tex);
@@ -69,7 +70,7 @@ function string_file_picture_tex($imagefile, $tex= "", $height="", $width="", $a
$output .= urlencode($tex) . "', 'popup', 'menubar=0,location=0,scrollbars,";
$output .= "resizable,width=300,height=240', 0);\">";
}
$output .= "<img class=\"texrender\" border=\"0\" $title $height $width alt=\"\" src=\"";
$output .= "<img class=\"texrender\" border=\"0\" $title $height $width alt=\"".s($origtex)."\" src=\"";
if ($CFG->slasharguments) { // Use this method if possible for better caching
$output .= "$CFG->wwwroot/$CFG->texfilterdir/pix.php/$imagefile";
} else {
+1
View File
@@ -6,6 +6,7 @@ $string['business'] = 'The email address of your business PayPal account';
$string['costorkey'] = 'Please choose one of the following methods of enrolment.';
$string['description'] = 'The PayPal module allows you to set up paid courses. If the cost for any course is zero, then students are not asked to pay for entry. There is a site-wide cost that you set here as a default for the whole site and then a course setting that you can set for each course individually. The course cost overrides the site cost.';
$string['enrolname'] = 'PayPal';
$string['paypalaccepted'] = 'PayPal payments accepted';
$string['sendpaymentbutton'] = 'Send payment via PayPal';
?>
+1
View File
@@ -554,6 +554,7 @@ $string['findmorecourses'] = 'Find more courses...';
$string['firstdayofweek'] = '0';
$string['firstname'] = 'First name';
$string['firsttime'] = 'Is this your first time here?';
$string['folder'] = 'Folder';
$string['folderclosed'] = 'Closed folder';
$string['folderopened'] = 'Opened folder';
$string['followingoptional'] = 'The following items are optional';
+8 -8
View File
@@ -447,10 +447,10 @@ class flexible_table {
if($this->is_collapsible) {
if(!empty($this->sess->collapse[$column])) {
$icon_hide = ' <a href="'.$this->baseurl.$this->request[TABLE_VAR_SHOW].'='.$column.'"><img src="'.$CFG->pixpath.'/t/switch_plus.gif" title="'.get_string('show').' '.$this->headers[$index].'" /></a>';
$icon_hide = ' <a href="'.$this->baseurl.$this->request[TABLE_VAR_SHOW].'='.$column.'"><img src="'.$CFG->pixpath.'/t/switch_plus.gif" title="'.get_string('show').' '.$this->headers[$index].'" alt="'.get_string('show').'" /></a>';
}
else if($this->headers[$index] !== NULL) {
$icon_hide = ' <a href="'.$this->baseurl.$this->request[TABLE_VAR_HIDE].'='.$column.'"><img src="'.$CFG->pixpath.'/t/switch_minus.gif" title="'.get_string('hide').' '.$this->headers[$index].'" /></a>';
$icon_hide = ' <a href="'.$this->baseurl.$this->request[TABLE_VAR_HIDE].'='.$column.'"><img src="'.$CFG->pixpath.'/t/switch_minus.gif" title="'.get_string('hide').' '.$this->headers[$index].'" alt="'.get_string('hide').'" /></a>';
}
}
@@ -468,18 +468,18 @@ class flexible_table {
$icon_sort_first = $icon_sort_last = '';
if($primary_sort_column == 'firstname') {
if($primary_sort_order == SORT_ASC) {
$icon_sort_first = ' <img src="'.$CFG->pixpath.'/t/down.gif" />';
$icon_sort_first = ' <img src="'.$CFG->pixpath.'/t/down.gif" alt="'.get_string('asc').'" />';
}
else {
$icon_sort_first = ' <img src="'.$CFG->pixpath.'/t/up.gif" />';
$icon_sort_first = ' <img src="'.$CFG->pixpath.'/t/up.gif" alt="'.get_string('desc').'" />';
}
}
else if($primary_sort_column == 'lastname') {
if($primary_sort_order == SORT_ASC) {
$icon_sort_last = ' <img src="'.$CFG->pixpath.'/t/down.gif" />';
$icon_sort_last = ' <img src="'.$CFG->pixpath.'/t/down.gif" alt="'.get_string('asc').'" />';
}
else {
$icon_sort_last = ' <img src="'.$CFG->pixpath.'/t/up.gif" />';
$icon_sort_last = ' <img src="'.$CFG->pixpath.'/t/up.gif" alt="'.get_string('desc').'" />';
}
}
$this->headers[$index] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=firstname">'.get_string('firstname').'</a> '.$icon_sort_first.' / '.
@@ -495,10 +495,10 @@ class flexible_table {
if($this->is_sortable) {
if($primary_sort_column == $column) {
if($primary_sort_order == SORT_ASC) {
$icon_sort = ' <img src="'.$CFG->pixpath.'/t/down.gif" />';
$icon_sort = ' <img src="'.$CFG->pixpath.'/t/down.gif" alt="'.get_string('asc').'" />';
}
else {
$icon_sort = ' <img src="'.$CFG->pixpath.'/t/up.gif" />';
$icon_sort = ' <img src="'.$CFG->pixpath.'/t/up.gif" alt="'.get_string('desc').'" />';
}
}
$this->headers[$index] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'='.$column.'">'.$this->headers[$index].'</a>';
+11 -5
View File
@@ -3041,8 +3041,13 @@ 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');
}
$output .= "<img class=\"$class\" align=\"middle\" src=\"$src".
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
" border=\"0\" width=\"$size\" height=\"$size\" alt=\"".s(get_string('user').' '.$username)."\" />";
if ($link) {
$output .= '</a>';
}
@@ -3222,10 +3227,10 @@ function print_group_picture($group, $courseid, $large=false, $return=false, $li
if ($group->picture) { // Print custom group picture
if ($CFG->slasharguments) { // Use this method if possible for better caching
$output .= '<img class="grouppicture" align="middle" src="'.$CFG->wwwroot.'/user/pixgroup.php/'.$group->id.'/'.$file.'.jpg"'.
' border="0" width="'.$size.'" height="'.$size.'" alt="" title="'.s($group->name).'"/>';
' border="0" width="'.$size.'" height="'.$size.'" alt="'.s(get_string('group').' '.$group->name).'" title="'.s($group->name).'"/>';
} else {
$output .= '<img class="grouppicture" align="middle" src="'.$CFG->wwwroot.'/user/pixgroup.php?file=/'.$group->id.'/'.$file.'.jpg"'.
' border="0" width="'.$size.'" height="'.$size.'" alt="" title="'.s($group->name).'"/>';
' border="0" width="'.$size.'" height="'.$size.'" alt="'.s(get_string('group').' '.$group->name).'" title="'.s($group->name).'"/>';
}
}
if ($link or has_capability('moodle/site:accessallgroups', $context)) {
@@ -4225,7 +4230,7 @@ function navmenulist($course, $sections, $modinfo, $strsection, $strjumpto, $wid
$class = 'activity '.$mod->mod;
$class .= ($cmid == $mod->cm) ? ' selected' : '';
$menu[] = '<li class="'.$class.'">'.
'<img src="'.$CFG->modpixpath.'/'.$mod->mod.'/icon.gif" border="0" />'.
'<img src="'.$CFG->modpixpath.'/'.$mod->mod.'/icon.gif" border="0" alt=""/>'.
'<a href="'.$CFG->wwwroot.'/mod/'.$url.'">'.$mod->name.'</a></li>';
$previousmod = $mod;
}
@@ -5359,7 +5364,8 @@ function page_doc_link($text='', $iconpath='') {
$iconpath = $CFG->wwwroot . '/pix/docs.gif';
}
$str .= '<img src="' .$iconpath. '" alt="Docs" />' .$text. '</a>';
// alt left blank intentionally to prevent repetition in screenreaders
$str .= '<img src="' .$iconpath. '" alt=" " />' .$text. '</a>';
return $str;
}
+2 -2
View File
@@ -46,8 +46,8 @@
echo fullname($user1);
echo '</td>';
echo '<td align="center">';
echo '<img src="'.$CFG->wwwroot.'/pix/t/left.gif">';
echo '<img src="'.$CFG->wwwroot.'/pix/t/right.gif">';
echo '<img src="'.$CFG->wwwroot.'/pix/t/left.gif" alt="'.get_string('from').'">';
echo '<img src="'.$CFG->wwwroot.'/pix/t/right.gif" alt="'.get_string('to').'">';
echo '</td>';
echo '<td align="center">';
echo print_user_picture($user2->id, SITEID, $user2->picture, 100, true, true, 'userwindow').'<br />';
+2 -2
View File
@@ -240,7 +240,7 @@
}
$emailswitch = "&nbsp;<a title=\"$switchclick\" ".
"href=\"view.php?id=$user->id&amp;course=$course->id&amp;$switchparam=1\">".
"<img border=\"0\" width=\"11\" height=\"11\" src=\"$CFG->pixpath/t/$switchpix\" alt=\"\" /></a>";
"<img border=\"0\" width=\"11\" height=\"11\" src=\"$CFG->pixpath/t/$switchpix\" alt=\"$switchclick\" /></a>";
} else if ($currentuser) { /// Can only re-enable an email this way
if ($user->emailstop) { // Include link that tells how to re-enable their email
@@ -266,7 +266,7 @@
if ($user->skype && !isset($hiddenfields['skypeid'])) {
print_row(get_string('skypeid').':','<a href="callto:'.urlencode($user->skype).'">'.s($user->skype).
' <img src="http://mystatus.skype.com/smallicon/'.urlencode($user->skype).'" alt="status" '.
' <img src="http://mystatus.skype.com/smallicon/'.urlencode($user->skype).'" alt="'.get_string('status').'" '.
' height="16" width="16" /></a>');
}
if ($user->yahoo && !isset($hiddenfields['yahooid'])) {