MDL-39814 html_writer: Remove superfluous new lines from html_writer::alist
authorSam Hemelryk <sam@moodle.com>
Fri, 12 Jul 2013 01:59:42 +0000 (13:59 +1200)
committerSam Hemelryk <sam@moodle.com>
Sun, 14 Jul 2013 22:24:05 +0000 (10:24 +1200)
lib/outputcomponents.php

index 344d4df..7109b1d 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;
     }
 
     /**