silverstripe-comments/code/admin/CommentsGridField.php

25 lines
474 B
PHP
Raw Normal View History

2015-04-17 02:36:15 +02:00
<?php
2016-02-19 01:48:25 +01:00
class CommentsGridField extends GridField
{
/**
* {@inheritdoc}
*/
protected function newRow($total, $index, $record, $attributes, $content)
{
if (!isset($attributes['class'])) {
$attributes['class'] = '';
}
2015-04-17 02:36:15 +02:00
2016-02-19 01:48:25 +01:00
if ($record->IsSpam) {
$attributes['class'] .= ' spam';
}
2015-04-17 02:36:15 +02:00
2016-02-19 01:48:25 +01:00
return FormField::create_tag(
'tr',
$attributes,
$content
);
}
}