Merge branch 'wip-MDL-40634-m26' of git://github.com/samhemelryk/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 16 Jul 2013 22:58:26 +0000 (00:58 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 16 Jul 2013 22:58:26 +0000 (00:58 +0200)
lib/outputcomponents.php

index df1ec17..f29e35b 100644 (file)
@@ -1347,15 +1347,12 @@ class html_writer {
      * @return string
      */
     public static function alist(array $items, array $attributes = null, $tag = 'ul') {
-        $output = '';
-
+        $output = html_writer::start_tag($tag, $attributes)."\n";
         foreach ($items as $item) {
-            $output .= html_writer::start_tag('li') . "\n";
-            $output .= $item . "\n";
-            $output .= html_writer::end_tag('li') . "\n";
+            $output .= html_writer::tag('li', $item)."\n";
         }
-
-        return html_writer::tag($tag, $output, $attributes);
+        $output .= html_writer::end_tag($tag);
+        return $output;
     }
 
     /**