2015-04-17 02:36:15 +02:00
|
|
|
<?php
|
|
|
|
|
2017-01-16 20:57:37 +01:00
|
|
|
namespace SilverStripe\Comments\Admin;
|
|
|
|
|
|
|
|
use SilverStripe\Forms\GridField\GridField;
|
2017-09-18 04:16:24 +02:00
|
|
|
use SilverStripe\View\HTML;
|
2017-01-16 20:57:37 +01:00
|
|
|
|
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
|
|
|
|
2017-09-18 04:16:24 +02:00
|
|
|
return HTML::createTag(
|
2016-02-19 01:48:25 +01:00
|
|
|
'tr',
|
|
|
|
$attributes,
|
|
|
|
$content
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|