silverstripe-comments/src/Admin/CommentsGridField.php

30 lines
581 B
PHP
Raw Normal View History

2015-04-17 02:36:15 +02:00
<?php
namespace SilverStripe\Comments\Admin;
use SilverStripe\Forms\GridField\GridField;
2017-09-18 04:16:24 +02:00
use SilverStripe\View\HTML;
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
);
}
}