silverstripe-blog/code/extensions/BlogCommentExtension.php

24 lines
427 B
PHP
Raw Normal View History

<?php
/**
2015-05-09 16:33:12 +02:00
* Adds Blog specific behaviour to Comment.
*/
class BlogCommentExtension extends DataExtension {
/**
* Extra CSS classes for styling different comment types.
2015-05-09 16:33:12 +02:00
*
* @return string
*/
public function getExtraClass() {
$blogPost = $this->owner->getParent();
2015-05-09 16:33:12 +02:00
if($blogPost instanceof BlogPost) {
if($blogPost->isAuthor($this->owner->Author())) {
return 'author-comment';
}
}
2015-05-09 16:33:12 +02:00
return '';
}
}