Add expand to dashboard-comment
temporary, to be replaced with a nice solution, same like for the normal comment view
This commit is contained in:
parent
1e8d3a58e4
commit
eadc5bc027
@ -28,8 +28,18 @@ $comments = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPref
|
||||
ORDER BY c.id DESC LIMIT 5");
|
||||
if (count($comments) > 1) {
|
||||
foreach ($comments as &$comment) {
|
||||
$entrylink = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
|
||||
$comment['entrylink'] = $entrylink;
|
||||
$comment['entrylink'] = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
|
||||
|
||||
$comment['fullBody'] = $comment['body'];
|
||||
$comment['summary'] = serendipity_mb('substr', $comment['body'], 0, 100);
|
||||
|
||||
if (strlen($comment['fullBody']) > strlen($comment['summary']) ) {
|
||||
$comment['excerpt'] = true;
|
||||
|
||||
// When summary is not the full body, strip HTML tags from summary, as it might break and leave unclosed HTML.
|
||||
$comment['fullBody'] = nl2br(htmlspecialchars($comment['fullBody']));
|
||||
$comment['summary'] = nl2br(strip_tags($comment['summary']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,15 @@
|
||||
<li><div class="comment_summary">
|
||||
<b><a href="{$comment.entrylink}" title="Comment to {$comment.title}">#{$comment.id}</a></b> - {$comment.body|truncate:100:"…"}
|
||||
</div>
|
||||
<div id="c{$comment.id}_full" class="comment_full additional_info">{$comment.fullBody}</div>
|
||||
|
||||
<ul class="plainList actions">
|
||||
<li><a class="button_link" href="{$comment.entrylink}" title="{$CONST.VIEW}"><span class="icon-zoom-in"></span><span class="visuallyhidden"> {$CONST.VIEW}</span></a></li>
|
||||
<li><a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=edit&serendipity[id]={$comment.id}&serendipity[entry_id]={$comment.entry_id}&{$urltoken}" title="{$CONST.EDIT}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a></li>
|
||||
<li><a class="button_link comments_reply" href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=reply&serendipity[id]={$comment.id}&serendipity[entry_id]={$comment.entry_id}&serendipity[noBanner]=true&serendipity[noSidebar]=true&{$urltoken}" title="{$CONST.REPLY}"><span class="icon-chat"></span><span class="visuallyhidden"> {$CONST.REPLY}</span></a></li>
|
||||
{if $comment.excerpt}
|
||||
<li><button class="button_link toggle_comment_full" type="button" data-href="#c{$comment.id}_full" title="{$CONST.TOGGLE_ALL}"><span class="icon-plus"></span><span class="visuallyhidden"> {$CONST.TOGGLE_ALL}</span></button></li>
|
||||
{/if}
|
||||
{if ($comment.status == 'pending') || ($comment.status == 'confirm')}
|
||||
<li><a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=comments&serendipity[adminAction]=approve&serendipity[id]={$comment.id}&{$urltoken}" title="{$CONST.APPROVE}"><span class="icon-lock-open"></span><span class="visuallyhidden">{$CONST.APPROVE}</span></a></li>
|
||||
{/if}
|
||||
|
Loading…
x
Reference in New Issue
Block a user