Refactor generic tables and page index classes #26
@ -126,20 +126,12 @@ class GenericTable
|
|||||||
{
|
{
|
||||||
foreach ($rows as $i => $row)
|
foreach ($rows as $i => $row)
|
||||||
{
|
{
|
||||||
$className = $i & 1 ? 'even' : 'odd';
|
|
||||||
if (isset($options['row_classifier']))
|
|
||||||
$className .= $options['row_classifier']($row);
|
|
||||||
|
|
||||||
$newRow = [
|
$newRow = [
|
||||||
'class' => $className,
|
|
||||||
'cells' => [],
|
'cells' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($options['columns'] as $column)
|
foreach ($options['columns'] as $column)
|
||||||
{
|
{
|
||||||
if (isset($column['enabled']) && $column['enabled'] == false)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// The hard way?
|
// The hard way?
|
||||||
if (isset($column['parse']))
|
if (isset($column['parse']))
|
||||||
{
|
{
|
||||||
@ -207,7 +199,6 @@ class GenericTable
|
|||||||
|
|
||||||
// Append the cell to the row.
|
// Append the cell to the row.
|
||||||
$newRow['cells'][] = [
|
$newRow['cells'][] = [
|
||||||
'width' => !empty($column['cell_width']) && is_int($column['cell_width']) ? $column['cell_width'] : null,
|
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user