silverstripe-blog/code/extensions/BlogCommentExtension.php
Christopher Pitt 787c02a19d Clean up
2015-05-11 10:11:21 +12:00

24 lines
427 B
PHP

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