From 4213137651d63b28128dd3eb7824fa3dfca5c270 Mon Sep 17 00:00:00 2001
From: nfreear <nfreear>
Date: Mon, 15 Oct 2007 12:31:39 +0000
Subject: [PATCH] Fixes MDL-11430, Flickr & Youtube tag blocks should use list
 markup.

---
 blocks/tag_flickr/block_tag_flickr.php   | 14 +++++++-------
 blocks/tag_youtube/block_tag_youtube.php | 17 ++++++-----------
 2 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/blocks/tag_flickr/block_tag_flickr.php b/blocks/tag_flickr/block_tag_flickr.php
index a035a16322..23a9eea810 100644
--- a/blocks/tag_flickr/block_tag_flickr.php
+++ b/blocks/tag_flickr/block_tag_flickr.php
@@ -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;
diff --git a/blocks/tag_youtube/block_tag_youtube.php b/blocks/tag_youtube/block_tag_youtube.php
index 856f5d532a..91ae2bdc93 100644
--- a/blocks/tag_youtube/block_tag_youtube.php
+++ b/blocks/tag_youtube/block_tag_youtube.php
@@ -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;
     }
-- 
2.39.5