2015-04-09 03:50:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2015-05-09 16:33:12 +02:00
|
|
|
* Adds Blog specific behaviour to Comment.
|
2015-04-09 03:50:41 +02:00
|
|
|
*/
|
|
|
|
class BlogCommentExtension extends DataExtension {
|
|
|
|
/**
|
|
|
|
* Extra CSS classes for styling different comment types.
|
2015-05-09 16:33:12 +02:00
|
|
|
*
|
2015-04-09 03:50:41 +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-04-09 03:50:41 +02:00
|
|
|
}
|
2015-05-09 16:33:12 +02:00
|
|
|
|
|
|
|
return '';
|
2015-04-09 03:50:41 +02:00
|
|
|
}
|
|
|
|
}
|