/** * Present a form for adding a new comment to this item or editing an existing comment. */ public function form_add($item_id) { $item = ORM::factory("item", $item_id); access::required("view", $item); if (!comment::can_comment()) { access::forbidden(); } print comment::prefill_add_form(comment::get_add_form($item)); }
<span class="ui-icon ui-icon-comment"></span> <?php echo t("Add a comment"); ?> </a> <?php } ?> <div id="g-comment-detail"> <?php if (!$comments->count()) { ?> <p class="g-no-comments"> <?php if (comment::can_comment()) { ?> <?php echo t("No comments yet. Be the first to <a %attrs>comment</a>!", array("attrs" => html::mark_clean("href=\"" . url::site("form/add/comments/{$item->id}") . "\" class=\"showCommentForm\""))); ?> <?php } else { ?> <?php echo t("No comments yet."); ?> <?php } ?> </p> <ul>