]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3290: Fluid gallery w/o tables -- working great for fixed-width content
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 26 Apr 2011 17:28:54 +0000 (17:28 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 26 Apr 2011 17:28:54 +0000 (17:28 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@9027 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/page/components/gallery.php

index 1ba8968364ec7ee2936b42fd9f6fb8386a79b75b..e86b9f885b04e3b42b4d76c0fb33a39e28956f01 100644 (file)
@@ -3,8 +3,6 @@
  * Gallery view
  *
  * @uses $vars['items']
- *
- * @todo not complete - number of columns
  */
 
 $items = $vars['items'];
@@ -21,8 +19,6 @@ $pagination = elgg_extract('pagination', $vars, true);
 $offset_key = elgg_extract('offset_key', $vars, 'offset');
 $position = elgg_extract('position', $vars, 'after');
 
-$num_columns = 4;
-
 if ($pagination && $count) {
        $nav .= elgg_view('navigation/pagination', array(
                'offset' => $offset,
@@ -37,33 +33,15 @@ if ($position == 'before' || $position == 'both') {
 }
 
 ?>
-<table class="elgg-gallery">
-<?php
-
-$col = 0;
-foreach ($items as $item) {
-       if ($col == 0) {
-               echo '<tr>';
-       }
-       $col++;
-
-       echo '<td>';
-       echo elgg_view_list_item($item, $vars);
-       echo "</td>";
-
-       if ($col == $num_columns) {
-               echo '</tr>';
-               $col = 0;
-       }
-}
-
-if ($col > 0) {
-       echo '</tr>';
-}
-
-?>
-
-</table>
+<ul class="elgg-gallery">
+       <?php
+               foreach ($items as $item) {
+                       echo '<li>';
+                       echo elgg_view_list_item($item, $vars);
+                       echo "</li>";
+               }
+       ?>
+</ul>
 
 <?php
 if ($position == 'after' || $position == 'both') {