Link to comment parent page. (Fixes: #13)

This commit is contained in:
Will Rossiter 2013-12-21 17:05:37 +13:00
parent 8e7fadafd2
commit 6de470125b

View File

@ -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(
'<a href="%s" class="cms-panel-link external-link action" target="_blank">%s</a>',
Convert::raw2xml($item->Link()),
Convert::raw2xml($value)
);
}
));
$needs = new GridField(
'Comments',
_t('CommentsAdmin.NeedsModeration', 'Needs Moderation'),