cvs: pear /Structures_DataGrid/DataGrid/Renderer HTMLTable.php

From: Date: Sat, 25 Feb 2006 09:55:22 +0000
Subject: cvs: pear /Structures_DataGrid/DataGrid/Renderer HTMLTable.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38592@lists.php.net to get a copy of this message
wiesemann Sat Feb 25 09:55:22 2006 UTC Modified files: /pear/Structures_DataGrid/DataGrid/Renderer HTMLTable.php Log: - some final minor CS fixes - fix detection of starting row in <tbody> (this also makes the empty line addition more consistent with the data row behaviour) http://cvs.php.net/viewcvs.cgi/pear/Structures_DataGrid/DataGrid/Renderer/HTMLTable.php?r1=1.79&r2=1.80&diff_format=u Index: pear/Structures_DataGrid/DataGrid/Renderer/HTMLTable.php diff -u pear/Structures_DataGrid/DataGrid/Renderer/HTMLTable.php:1.79 pear/Structures_DataGrid/DataGrid/Renderer/HTMLTable.php:1.80 --- pear/Structures_DataGrid/DataGrid/Renderer/HTMLTable.php:1.79 Fri Feb 24 13:40:29 2006 +++ pear/Structures_DataGrid/DataGrid/Renderer/HTMLTable.php Sat Feb 25 09:55:22 2006 @@ -18,7 +18,7 @@ // | Mark Wiesemann <wiesemann@php.net> | // +----------------------------------------------------------------------+ // -// $Id: HTMLTable.php,v 1.79 2006/02/24 13:40:29 wiesemann Exp $ +// $Id: HTMLTable.php,v 1.80 2006/02/25 09:55:22 wiesemann Exp $ require_once 'Structures/DataGrid/Renderer/Common.php'; require_once 'HTML/Table.php'; @@ -49,12 +49,12 @@ * form: array(attribute => value, ...) * - headerAttributes : column cells attributes. This is an array of the form : * array(fieldName => array(attribute => value, ...) ... ) - * - convertEntities : wether or not to convert html entities. Default: true + * - convertEntities : whether or not to convert html entities. Default: true * This calls htmlspecialchars(). * - encoding : the content encoding. Default: ISO-8859-1 * * - * @version $Revision: 1.79 $ + * @version $Revision: 1.80 $ * @author Andrew S. Nagy <asnagy@webitecture.org> * @author Olivier Guilyardi <olivier@samalyse.com> * @author Mark Wiesemann <wiesemann@php.net> @@ -328,7 +328,7 @@ $label = $this->_columns[$col]['label']; // Define Content - if (!in_array ($field, $this->_options['disableColumnSorting'])) { + if (!in_array($field, $this->_options['disableColumnSorting'])) { // Determine Direction if ($this->_currentSortField == $field && $this->_currentSortDirection == 'ASC') { @@ -348,12 +348,12 @@ $url = $this->_options['selfPath'] . '?'; // Merge common and column-specific GET variables - $url .= http_build_query (array_merge ($common, $get)); - + $url .= http_build_query(array_merge($common, $get)); + // Build HTML Link $str = "<a href=\"$url\">$label"; $iconVar = "sortIcon" . - (is_null ($this->_currentSortDirection) ? 'ASC' : $this->_currentSortDirection); + (is_null($this->_currentSortDirection) ? 'ASC' : $this->_currentSortDirection); if (($this->_options[$iconVar] != '') && ($this->_currentSortField == $field)) { $str .= ' ' . $this->_options[$iconVar]; @@ -384,7 +384,8 @@ function buildBody() { $startRow = $this->_tableBody->getRowCount(); - for ($row = $startRow; $row < $this->_recordsNum; $row++) { + for ($row = 0; $row < $this->_recordsNum; $row++) { + $recordRow = $row + $startRow; for ($col = 0; $col < $this->_columnsNum; $col++) { $value = $this->_records[$row][$col]; $field = $this->_columns[$col]['field']; @@ -401,19 +402,20 @@ } // Set Content in HTML_Table - $this->_tableBody->setCellContents($row, $col, $value); + $this->_tableBody->setCellContents($recordRow, $col, $value); if ($attributes) { - $this->_tableBody->setCellAttributes($row, $col, $attributes); + $this->_tableBody->setCellAttributes($recordRow, $col, $attributes); } } } // output empty rows if ($this->_options['fillWithEmptyRows'] && !is_null($this->_pageLimit)) { - for ($row = $startRow + $this->_recordsNum; $row < $this->_pageLimit; $row++) { + for ($row = $this->_recordsNum; $row < $this->_pageLimit; $row++) { + $recordRow = $row + $startRow; for ($col = 0; $col < $this->_columnsNum; $col++) { - $this->_tableBody->setCellAttributes($row, $col, $this->_options['emptyRowAttributes']); - $this->_tableBody->setCellContents($row, $col, '&nbsp;'); + $this->_tableBody->setCellAttributes($recordRow, $col, $this->_options['emptyRowAttributes']); + $this->_tableBody->setCellContents($recordRow, $col, '&nbsp;'); } } }

« previous php.pear.cvs (#38592) next »