diff --git a/_config/comments.yml b/_config/comments.yml new file mode 100644 index 0000000..54ed4fa --- /dev/null +++ b/_config/comments.yml @@ -0,0 +1,8 @@ +--- +Name: blogcommentsconfig +Only: + moduleexists: comments +--- +Comment: + extensions: + - BlogCommentExtension diff --git a/_config/config.yml b/_config/config.yml index 2bf9426..0d399de 100755 --- a/_config/config.yml +++ b/_config/config.yml @@ -1,3 +1,6 @@ +--- +Name: blogconfig +--- Member: extensions: - - BlogMemberExtension \ No newline at end of file + - BlogMemberExtension diff --git a/code/extensions/BlogCommentExtension.php b/code/extensions/BlogCommentExtension.php new file mode 100644 index 0000000..8b2db4a --- /dev/null +++ b/code/extensions/BlogCommentExtension.php @@ -0,0 +1,23 @@ +owner->getParent(); + + // Make sure we're dealing with a BlogPost. + if ( ($blogPost instanceof BlogPost) + && $blogPost->isAuthor($this->owner->Author()) + ) { + return 'author-comment'; + } + } +}