silverstripe-comments/code/admin/CommentsGridField.php

22 lines
371 B
PHP
Raw Normal View History

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