Same name and namespace in other branches
  1. 4.6.x modules/comment.module \comment_edit()
  2. 4.7.x modules/comment.module \comment_edit()
  3. 6.x modules/comment/comment.pages.inc \comment_edit()
1 string reference to 'comment_edit'
comment_menu in modules/comment/comment.module
Implementation of hook_menu().

File

modules/comment/comment.module, line 585
Enables users to comment on published content.

Code

function comment_edit($cid) {
  global $user;
  $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d', $cid));
  $comment = drupal_unpack($comment);
  $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
  if (comment_access('edit', $comment)) {
    return comment_form_box((array) $comment);
  }
  else {
    drupal_access_denied();
  }
}