comment_edit
Definition
comment_edit($cid)
modules/comment/comment.pages.inc, line 15
Description
Form builder; generate a comment editing form.
Parameters
$cid ID of the comment to be edited.
Related topics
| Name | Description |
|---|---|
| Form builder functions | Functions that build an abstract representation of a HTML form. |
Code
<?php
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();
}
}
?> 