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