]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7434 all images that convey information should have alt text to convey that infor...
authorskodak <skodak>
Sat, 25 Nov 2006 18:09:33 +0000 (18:09 +0000)
committerskodak <skodak>
Sat, 25 Nov 2006 18:09:33 +0000 (18:09 +0000)
enrol/paypal/enrol.html
files/index.php
filter/algebra/filter.php
filter/tex/filter.php
lang/en_utf8/enrol_paypal.php
lang/en_utf8/moodle.php
lib/tablelib.php
lib/weblib.php
message/history.php
user/view.php

index 793e6bc87ec60ce2fbb8588444a855d44e51760c..d289d3d0c6b00f92f8c814bb0aba272fd8341501 100644 (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';
index f055aa1f920fb27693cbcadc858d901a926ea8fa..9fc4586a334f00e42d9908713a454f0a1526ab19 100644 (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>";
 
index 3cc2d9ff13cedc3e3506d3b8ad8352ea9d90e88b..1f6739c5a74783bf2db556dad7a8679905652f41 100644 (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 {
index aacca52e3079596fe7cbf823d1850ec9d1b7e7e3..6e1ba73fd20ab9bd256f9c04d75bf9d8727e91cd 100644 (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 {
index 7005b80e9df21b2cac201d6bf4027a6552514cb3..096500d1650be748da570534cb47eaca8eb2451c 100644 (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';
 
 ?>
index b7a70f6b7b4b49f5f0e65720bdb5db5bc759537a..cff38335207159bd9561519a933f393bd0551467 100644 (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';
index 3a38aae3e3e8189449680253c23e87435be14a5a..a481e4ad88bd61eee5c4cf2135e7f3ad64dfddd0 100644 (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>';
index 5dd4099a7203a21389add7b9562f4312e291bfc8..342a0d8162ae16fc156f5d8158c5c9a6768246b3 100644 (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;
 }
index b5cd97ee96c1d045114d6c0d27e91c3de88f310c..68fc4929e58e1262aeaad7669629323f39692ac6 100644 (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 />';
index b156472ccf70ed85768861cb8e3fc617e5cf4859..825c4eb3972e9ed68d8a02cdd9eaabb0524f55f2 100644 (file)
             }
             $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
 
     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'])) {