aboutsummaryrefslogtreecommitdiffstats
path: root/include/picture_comment.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2009-06-23 13:44:58 +0000
committernikrou <nikrou@piwigo.org>2009-06-23 13:44:58 +0000
commit9245227e7095ce46272df8ff2990586e43a915c8 (patch)
tree468819f8b412c91e26512e99a4aa2653566919fc /include/picture_comment.inc.php
parent5b524425892c99aed47fce58023e1f66300d516e (diff)
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
Diffstat (limited to 'include/picture_comment.inc.php')
-rw-r--r--include/picture_comment.inc.php38
1 files changed, 29 insertions, 9 deletions
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 = '';