function comment_edit
6.x comment.pages.inc | comment_edit($cid) |
Form builder; generate a comment editing form.
Parameters
$cid: ID of the comment to be edited.
Related topics
2 string references to 'comment_edit'
- comment_links in drupal-6.x/
modules/ comment/ comment.module - Build command links for a comment (e.g.\ edit, reply, delete) with respect to the current user's access permissions.
- comment_menu in drupal-6.x/
modules/ comment/ comment.module - Implementation of hook_menu().
File
- drupal-6.x/
modules/ comment/ comment.pages.inc, line 15 - User page callbacks for the comment module.
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();
}
}