MDL-7434 all images that convey information should have alt text to convey that information - part 2
This commit is contained in:
+12
-10
@@ -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.'&wdir='.$fileurl.'&choose='.$choose.'"><img src="'.$CFG->pixpath.'/f/parent.gif" height="16" width="16" alt="'.get_string('parentfolder').'" /></a> <a href="index.php?id='.$id.'&wdir='.$fileurl.'&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.'&wdir='.$fileurl.'&choose='.$choose.'"><img src="'.$CFG->pixpath.'/f/parent.gif" height="16" width="16" alt=" " /> '.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&wdir=$fileurl&choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id=$id&wdir=$fileurl&choose=$choose\">".htmlspecialchars($dir)."</a>", 'name');
|
||||
print_cell("left", "<a href=\"index.php?id=$id&wdir=$fileurl&choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"$strfolder\" /> ".htmlspecialchars($dir)."</a>", 'name');
|
||||
print_cell("right", $filesize, 'size');
|
||||
print_cell("right", $filedate, 'date');
|
||||
print_cell("right", "<a href=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=rename&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 ' ';
|
||||
link_to_popup_window ($ffurl, "display",
|
||||
htmlspecialchars($file),
|
||||
"<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" alt=\"$strfile\" /> ".htmlspecialchars($file),
|
||||
480, 640);
|
||||
echo "</td>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user