Ejemplo n.º 1
0
 /**
  * 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));
 }
Ejemplo n.º 2
0
 static function photo_bottom($theme)
 {
     $block = new Block();
     $block->css_id = "gComments";
     $block->title = t("Comments");
     $view = new View("comments.html");
     $view->comments = ORM::factory("comment")->where("item_id", $theme->item()->id)->where("state", "published")->orderby("created", "ASC")->find_all();
     $block->content = $view;
     $block->content .= comment::get_add_form($theme->item())->render("form.html");
     return $block;
 }
Ejemplo n.º 3
0
 /**
  * Present a form for adding a new comment to this item or editing an existing comment.
  *  @see REST_Controller::form_add($resource)
  */
 public function _form_add($item_id)
 {
     $item = ORM::factory("item", $item_id);
     access::required("view", $item);
     print comment::get_add_form($item);
 }