comment_edit($cid)
drupal/modules/comment/comment.pages.inc, line 15
Form builder; generate a comment editing form.
$cid ID of the comment to be edited.
| Name | Description |
|---|---|
| Form builder functions | Functions that build an abstract representation of a HTML form. |
function comment_edit($cid) {
global $user;
$comment = db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comment} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = :cid', array(':cid'=>$cid) )->fetchObject();
$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();
}
}