]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes MDL-6548 "... block should use lists" - blocks: blog tags, news items, recent...
authornfreear <nfreear>
Thu, 1 Mar 2007 11:13:37 +0000 (11:13 +0000)
committernfreear <nfreear>
Thu, 1 Mar 2007 11:13:37 +0000 (11:13 +0000)
blocks/blog_tags/block_blog_tags.php
blocks/news_items/block_news_items.php
mod/forum/lib.php

index ed94a3d9034ce71129cbc70ef1d9245e374f9489..f69aa8bc55ba4cae17958203ac52e9363ac22702 100644 (file)
@@ -121,6 +121,8 @@ class block_blog_tags extends block_base {
             usort($etags, "blog_tags_sort");
 
         /// Finally we create the output
+        /// Accessibility: markup as a list.
+            $this->content->text .= "\n<ul class='inline-list'>\n";
             foreach ($etags as $tag) {
                 switch ($CFG->bloglevel) {
                     case BLOG_USER_LEVEL:
@@ -154,11 +156,12 @@ class block_blog_tags extends block_base {
                 }
 
                 $link = $CFG->wwwroot.'/blog/index.php?filtertype='.$filtertype.'&amp;filterselect='.$filterselect.'&amp;tagid='.$tag->id;
-                $this->content->text .= '<a href="'.$link.'" '.
+                $this->content->text .= '<li><a href="'.$link.'" '.
                                         'class="'.$tag->class.'" '.
                                         'title="'.get_string('numberofentries','blog',$tag->ct).'">'.
-                                        $tag->text.'</a> ';
+                                        $tag->text.'</a></li> ';
             }
+            $this->content->text .= "\n</ul>\n";
 
         }
         return $this->content;
index 03a81946cd2559c4a07307128e0c04dab63befea..a95612bbb819d852831aef307756194d73801844 100644 (file)
@@ -79,21 +79,24 @@ class block_news_items extends block_base {
             $strftimerecent = get_string('strftimerecent');
             $strmore = get_string('more', 'forum');
 
+        /// Accessibility: markup as a list.
+            $text .= "\n<ul class='unlist'>\n";
             foreach ($discussions as $discussion) {
 
                 $discussion->subject = $discussion->name;
 
                 $discussion->subject = format_string($discussion->subject, true, $forum->course);
 
-                $text .= '<div class="post">'.
+                $text .= '<li class="post">'.
                          '<div class="head">'.
                          '<div class="date">'.userdate($discussion->modified, $strftimerecent).'</div>'.
                          '<div class="name">'.fullname($discussion).'</div></div>'.
                          '<div class="info">'.$discussion->subject.' '.
                          '<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$discussion->discussion.'">'.
                          $strmore.'...</a></div>'.
-                         '</div>';
+                         "</li>\n";
             }
+            $text .= "</ul>\n";
 
             $this->content->text = $text;
 
index 3137e7e8f7103d543e970e1c5d071c05788ae1ae..d0e356b265076e7063887ef25d00182b34b002d9 100644 (file)
@@ -869,10 +869,12 @@ function forum_print_recent_activity($course, $isteacher, $timestart) {
     $mygroupid = mygroupid($course->id);
     $groupmode = array();   /// To cache group modes
 
+    $count = 0;
     foreach ($logs as $log) {
         //Get post info, I'll need it later
         if ($post = forum_get_post_from_log($log)) {
             //Create a temp valid module structure (course,id)
+            $tempmod = new object;
             $tempmod->course = $log->course;
             $tempmod->id = $post->forum;
             //Obtain the visible property from the instance
@@ -905,7 +907,7 @@ function forum_print_recent_activity($course, $isteacher, $timestart) {
             }
 
             if (! $heading) {
-                print_headline(get_string('newforumposts', 'forum').':');
+                print_headline(get_string('newforumposts', 'forum').':', 3);
                 $heading = true;
                 $content = true;
             }
@@ -913,7 +915,12 @@ function forum_print_recent_activity($course, $isteacher, $timestart) {
 
             $subjectclass = ($log->action == 'add discussion') ? ' bold' : '';
 
-            echo '<div class="head">'.
+            //Accessibility: markup as a list.
+            if ($count < 1) {
+                echo "\n<ul class='unlist'>\n";
+            }
+            $count++;
+            echo '<li><div class="head">'.
                    '<div class="date">'.$date.'</div>'.
                    '<div class="name">'.fullname($post, has_capability('moodle/site:viewfullnames', $coursecontext)).'</div>'.
                  '</div>';
@@ -921,9 +928,10 @@ function forum_print_recent_activity($course, $isteacher, $timestart) {
             echo '"<a href="'.$CFG->wwwroot.'/mod/forum/'.str_replace('&', '&amp;', $log->url).'">';
             $post->subject = break_up_long_words(format_string($post->subject,true));
             echo $post->subject;
-            echo '</a>"</div>';
+            echo "</a>\"</div></li>\n";
         }
     }
+    echo "</ul>\n";
     return $content;
 }
 
@@ -4645,4 +4653,4 @@ function forum_convert_to_roles($forum, $forummodid, $teacherroles=array(),
 
 
 
-?>
+?>
\ No newline at end of file