]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes bug MDL-11994, Accessibility: "Users tagged with ..." should be marked up as...
authornfreear <nfreear>
Thu, 1 Nov 2007 12:32:58 +0000 (12:32 +0000)
committernfreear <nfreear>
Thu, 1 Nov 2007 12:32:58 +0000 (12:32 +0000)
tag/lib.php
theme/standard/styles_layout.css

index 630fabc23a86be807aecb7abb482c1ef371dd8a1..4e8113ea721545b53cb735c07204f9c5c0d576d6 100644 (file)
@@ -1280,9 +1280,11 @@ function print_user_list($userlist, $return=false) {
 
     $output = '';
 
+    $output .= '<ul class="inline-list">';
     foreach ($userlist as $user){
-        $output .= print_user_box( $user , true);
+        $output .= '<li>'. print_user_box( $user , true) ."</li>\n";
     }
+    $output .= "</ul>\n";
 
     if ($return) {
         return $output;
@@ -1315,15 +1317,18 @@ function print_user_box($user, $return=false) {
 
     $output .= print_box_start('user-box', 'user'.$user->id, true);
 
+    $fullname = fullname($user);
+    $alt = '';
     if (!empty($profilelink)) {
         $output .= '<a href="'.$profilelink.'">';
+        $alt = $fullname;
     }
 
-    //print user image
+    //print user image - if image is only content of link it needs ALT text!
     if ($user->picture) {
-        $output .= '<img alt="" class="user-image" src="'. $CFG->wwwroot .'/user/pix.php/'. $user->id .'/f1.jpg"'.'/>';
+        $output .= '<img alt="'.$alt.'" class="user-image" src="'. $CFG->wwwroot .'/user/pix.php/'. $user->id .'/f1.jpg"'.'/>';
     } else {
-        $output .= '<img alt="" class="user-image" src="'. $CFG->wwwroot .'/pix/u/f1.png"'.'/>';
+        $output .= '<img alt="'.$alt.'" class="user-image" src="'. $CFG->wwwroot .'/pix/u/f1.png"'.'/>';
     }
 
     $output .= '<br />';
@@ -1332,7 +1337,6 @@ function print_user_box($user, $return=false) {
         $output .= '</a>';
     }
 
-    $fullname = fullname($user);
     //truncate name if it's too big
     if ($textlib->strlen($fullname) > 26) $fullname = $textlib->substr($fullname,0,26) . '...';
 
index 0d63f2fa61145e2a3137ecafc097d8c6ed626bf8..2fa8caa6a908af45530836b1ca0b58ab92db57b6 100644 (file)
@@ -1307,8 +1307,8 @@ a.skip:focus, a.skip:active {
   clear: left;
 }
 
-.sideblock .content .inline-list li {
-  display:inline;
+.sideblock .content .inline-list li, .inline-list li {
+  display: inline;
 }
 
 .sideblock .content ul.list li.listentry {