From 9245227e7095ce46272df8ff2990586e43a915c8 Mon Sep 17 00:00:00 2001 From: nikrou Date: Tue, 23 Jun 2009 13:44:58 +0000 Subject: Feature 1026 : Modify / delete comments for users + update config table content + minor modification of Sylvia theme + need refactoring git-svn-id: http://piwigo.org/svn/trunk@3445 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/picture_comment.inc.php | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'include/picture_comment.inc.php') diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php index 9a120e355..5dd4c6033 100644 --- a/include/picture_comment.inc.php +++ b/include/picture_comment.inc.php @@ -151,16 +151,35 @@ $validated_clause.' 'CONTENT' => trigger_event('render_comment_content',$row['content']), ); - if (is_admin()) + if (can_manage_comment('delete', $row['author'])) { $tpl_comment['U_DELETE'] = - add_url_params( - $url_self, - array( - 'action'=>'delete_comment', - 'comment_to_delete'=>$row['id'] - ) - ); + add_url_params($url_self, + array( + 'action'=>'delete_comment', + 'comment_to_delete'=>$row['id'] + ) + ); + } + if (can_manage_comment('edit', $row['author'])) + { + $tpl_comment['U_EDIT'] = + add_url_params($url_self, + array( + 'action'=>'edit_comment', + 'comment_to_edit'=>$row['id'] + ) + ); + if (isset($edit_comment) and ($row['id'] == $edit_comment)) + { + $tpl_comment['IN_EDIT'] = true; + $key = get_comment_post_key($page['image_id']); + $tpl_comment['KEY'] = $key; + $tpl_comment['CONTENT'] = $row['content']; + } + } + if (is_admin()) + { if ($row['validated'] != 'true') { $tpl_comment['U_VALIDATE'] = @@ -176,7 +195,8 @@ $validated_clause.' } if (!is_a_guest() - or (is_a_guest() and $conf['comments_forall'])) + or (is_a_guest() and $conf['comments_forall']) + and (isset($edit_comment) and ($edit_comment != null))) { $key = get_comment_post_key($page['image_id']); $content = ''; -- cgit v1.2.3