Index: trunk/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r4947 -r4962 --- trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4947) +++ trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4962) @@ -333,30 +333,37 @@ if ($i % $columns == 0) { // record in this iteration is first in row, then open row $column_number = 1; - $o.= $block_start_row_params['name'] ? $this->Application->ParseBlock($block_start_row_params, 1) : ''; + $o .= $block_start_row_params['name'] ? $this->Application->ParseBlock($block_start_row_params, 1) : ''; } - - if (!$list->getCurrentRecord()){ - // doesn't add empty cell, by the fact it should add that much empty cells, - // how much elements are missing in last row, but not on cell as for now - $o.= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : ' '; - } else { - $block_params['column_number'] = $column_number; - $o.= $this->Application->ParseBlock($block_params, 1); $column_number++; - array_push($displayed, $list->GetDBField($id_field)); } + + $block_params['column_number'] = $column_number; + $o .= $this->Application->ParseBlock($block_params, 1); + array_push($displayed, $list->GetDBField($id_field)); 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) : ''; + $o .= $block_end_row_params['name'] ? $this->Application->ParseBlock($block_end_row_params, 1) : ''; } $list->GoNext(); - $i++; } + + // append empty cells in place of missing cells in last row + while ($i % $columns != 0) { + // until next cell will be in new row append empty cells + $o .= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : ' '; + + 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) : ''; + } + $i++; + } + $cur_displayed = $this->Application->GetVar($this->Prefix.'_displayed_ids'); if (!$cur_displayed) { $cur_displayed = Array(); Index: branches/unlabeled/unlabeled-1.54.2/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r4948 -r4962 --- branches/unlabeled/unlabeled-1.54.2/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4948) +++ branches/unlabeled/unlabeled-1.54.2/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4962) @@ -335,28 +335,35 @@ $column_number = 1; $o.= $block_start_row_params['name'] ? $this->Application->ParseBlock($block_start_row_params, 1) : ''; } - - if (!$list->getCurrentRecord()){ - // doesn't add empty cell, by the fact it should add that much empty cells, - // how much elements are missing in last row, but not on cell as for now - $o.= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : ' '; - } else { + $column_number++; + } + $block_params['column_number'] = $column_number; $o.= $this->Application->ParseBlock($block_params, 1); - $column_number++; array_push($displayed, $list->GetDBField($id_field)); - } 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) : ''; } $list->GoNext(); - $i++; } + + // append empty cells in place of missing cells in last row + while ($i % $columns != 0) { + // until next cell will be in new row append empty cells + $o .= $block_empty_cell_params['name'] ? $this->Application->ParseBlock($block_empty_cell_params, 1) : ' '; + + 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) : ''; + } + $i++; + } + $cur_displayed = $this->Application->GetVar($this->Prefix.'_displayed_ids'); if (!$cur_displayed) { $cur_displayed = Array();