tablesort_cell
includes/tablesort.inc, строка 108
- Версии
- 5 – 6
tablesort_cell($cell, $header, $ts, $i)
Format a table cell.
Adds a class attribute to all cells in the currently active column.
Параметры
$cell
The cell to format.
$header
Массив заголовков столбцов в формате, описанном в theme_table().
$ts
The current table sort context as returned from tablesort_init().
$i
The index of the cell's table column.
Возвращаемое значение
A properly formatted cell, ready for _theme_table_cell().
Код
<?php
function tablesort_cell($cell, $header, $ts, $i) {
if (isset($header[$i]) && $header[$i]['data'] == $ts['name'] && $header[$i]['field']) {
if (is_array($cell)) {
if (isset($cell['class'])) {
$cell['class'] .= ' active';
}
else {
$cell['class'] = 'active';
}
}
else {
$cell = array('data' => $cell, 'class' => 'active');
}
}
return $cell;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии