mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
25 lines
474 B
PHP
25 lines
474 B
PHP
<?php
|
|
|
|
class CommentsGridField extends GridField
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function newRow($total, $index, $record, $attributes, $content)
|
|
{
|
|
if (!isset($attributes['class'])) {
|
|
$attributes['class'] = '';
|
|
}
|
|
|
|
if ($record->IsSpam) {
|
|
$attributes['class'] .= ' spam';
|
|
}
|
|
|
|
return FormField::create_tag(
|
|
'tr',
|
|
$attributes,
|
|
$content
|
|
);
|
|
}
|
|
}
|