]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes MDL-11430, Flickr & Youtube tag blocks should use list markup.
authornfreear <nfreear>
Mon, 15 Oct 2007 12:31:39 +0000 (12:31 +0000)
committernfreear <nfreear>
Mon, 15 Oct 2007 12:31:39 +0000 (12:31 +0000)
blocks/tag_flickr/block_tag_flickr.php
blocks/tag_youtube/block_tag_youtube.php

index a035a16322905f013822a0f288f160d60b60efe7..23a9eea810046ba7b58325c6e04fb354986cc39f 100644 (file)
@@ -94,13 +94,13 @@ class block_tag_flickr extends block_base {
 
         if(strcmp($search['stat'], 'ok') != 0) return; //if no results were returned, exit...
 
-        //render the list of photos
-        $text = '';
-        foreach ($photos as $photo) {
-            $text .= '<a href="http://www.flickr.com/photos/' . $photo['owner'] . '/' . $photo['id'] . '/">';
-            $text .= '<img title="'.s($photo['title']).'" alt="'.s($photo['title']).'" class="flickr-photos" src="' . $this->build_photo_url($photo, 'square') . '" /></a>' ;
-        }
-
+        //Accessibility: render the list of photos
+        $text = '<ul class="inline-list">';
+         foreach ($photos as $photo) {
+            $text .= '<li><a href="http://www.flickr.com/photos/' . $photo['owner'] . '/' . $photo['id'] . '/" title="'.s($photo['title']).'">';
+            $text .= '<img alt="'.s($photo['title']).'" class="flickr-photos" src="'. $this->build_photo_url($photo, 'square') ."\" /></a></li>\n";
+         }
+        $text .= "</ul>\n";
 
         $this->content = new stdClass;
         $this->content->text = $text;
index 856f5d532a58963197417fc206635187bb59d0f2..91ae2bdc9336ea31713a16cdf0a3516bfd511bf7 100644 (file)
@@ -150,24 +150,19 @@ class block_tag_youtube extends block_base {
     function render_video_list($xmlobj){
 
         $text = '';
-        $text .= '<table class="yt-video-entry">';
+        $text .= '<ul class="yt-video-entry unlist img-text">';
         $videos = $xmlobj['ut_response']['video_list']['video'];
 
         foreach($videos as $video){
-            $text .= '<tr>';
-            $text .= '<td>';
+            $text .= '<li>';
             $text .= '<a href="'. s($video['url']) . '">';
-            $text .= '<img alt="'.s($video['title']).'" class="youtube-thumb" title="'.s($video['title']).'" style="padding:3px;" src="' . $video['thumbnail_url'] . '"/>' ;
-            $text .= "</a>";
-            $text .= "</td>";
-            $text .= '<td>';
-            $text .= '<a href="'. s($video['url']) . '">'.s($video['title']). '</a>';
+            $text .= '<img alt="" class="youtube-thumb" style="padding:3px;" src="'. $video['thumbnail_url'] .'" /> <span>';
+            $text .= s($video['title']). '</span></a>';
             $text .= '<br/>';
             $text .= format_time($video['length_seconds']);
-            $text .= '</td>';
-            $text .= '</tr>';
+            $text .= "</li>\n";
         }
-        $text .= '</table>';
+        $text .= "</ul>\n";
 
         return $text;
     }