Index: branches/RC/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r10103 -r10110 --- branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 10103) +++ branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 10110) @@ -377,10 +377,10 @@ $id_field = (isset($params['id_field'])) ? $params['id_field'] : $this->Application->getUnitOption($this->Prefix, 'IDField'); - if ($columns>1 && $direction=="V") { + if ($columns > 1 && $direction == 'V') { + $records_left = array_splice($list->Records, $list->SelectedCount); // because we have 1 more record for "More..." link detection (don't need to sort it) $list->Records = $this->LinearToVertical($list->Records, $columns, $list->GetPerPage()); - $list->SelectedCount=count($list->Records); - ksort($list->Records); // this is issued twice, maybe need to be removed + $list->Records = array_merge($list->Records, $records_left); } $list->GoFirst(); @@ -438,7 +438,13 @@ $o.= $this->Application->ParseBlock($block_params, 1); array_push($displayed, $list->GetDBField($id_field)); - if (($i+1) % $columns == 0) { + if($direction == 'V' && $list->SelectedCount % $columns > 0 && $column_number == ($columns - 1) && ceil(($i + 1) / $columns) > $list->SelectedCount % ceil($list->SelectedCount / $columns)) { + // if vertical output, then draw empty cells vertically, not horizontally + $o .= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : ' '; + $i++; + } + + if (($i + 1) % $columns == 0) { // record in next iteration is first in row too, then close this row $o.= $block_end_row_params['name'] ? $this->Application->ParseBlock($block_end_row_params, 1) : @@ -492,9 +498,8 @@ */ function PrepareListElementParams(&$object, &$block_params) { -// $fields_hash =& $object->Records[$this->CurrentIndex]; -// -// $object->Records[$this->CurrentIndex] =& $fields_hash; +// $fields_hash =& $object->getCurrentRecord(); + } function MoreLink($params)