1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-18 20:41:16 +02:00

Improve support for fields that can be placed in custom header of CommentList class

This commit is contained in:
Ryan Cramer
2018-05-18 10:15:04 -04:00
parent 0fbd5a5882
commit 9c38d29402

View File

@@ -180,6 +180,14 @@ class CommentList extends Wire implements CommentListInterface {
$header = str_replace(array('{cite}', '{created}'), array($cite, $created), $this->options['commentHeader']);
if(strpos($header, '{votes}') !== false) $header = str_replace('{votes}', $this->renderVotes($comment), $header);
if(strpos($header, '{stars}') !== false) $header = str_replace('{stars}', $this->renderStars($comment), $header);
if(strpos($header, '{url}') !== false) {
$header = str_replace('{url}', $comment->getPage()->url() . '#Comment' . $comment->id, $header);
}
if(strpos($header, '{page.') !== false) {
$page = $comment->getPage();
$header = str_replace('{page.', '{', $header);
$header = $page->getMarkup($header);
}
}
$liClass = '';