From 6de470125b4fe2058a59a47a87f83bc89fb27f07 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Sat, 21 Dec 2013 17:05:37 +1300 Subject: [PATCH] Link to comment parent page. (Fixes: #13) --- code/CommentAdmin.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/CommentAdmin.php b/code/CommentAdmin.php index dc7e242..a47d31a 100644 --- a/code/CommentAdmin.php +++ b/code/CommentAdmin.php @@ -39,7 +39,7 @@ class CommentAdmin extends LeftAndMain { $commentsConfig = GridFieldConfig::create()->addComponents( new GridFieldFilterHeader(), - new GridFieldDataColumns(), + $columns = new GridFieldDataColumns(), new GridFieldSortableHeader(), new GridFieldPaginator(25), new GridFieldDeleteAction(), @@ -59,6 +59,16 @@ class CommentAdmin extends LeftAndMain { ) ); + $columns->setFieldFormatting(array( + 'ParentTitle' => function($value, &$item) { + return sprintf( + '%s', + Convert::raw2xml($item->Link()), + Convert::raw2xml($value) + ); + } + )); + $needs = new GridField( 'Comments', _t('CommentsAdmin.NeedsModeration', 'Needs Moderation'),