Пример #1
0
 public function form_edit($photo_id)
 {
     $photo = ORM::factory("item", $photo_id);
     access::required("view", $photo);
     access::required("edit", $photo);
     print photo::get_edit_form($photo);
 }
Пример #2
0
 public function form_edit($id)
 {
     $item = model_cache::get("item", $id);
     access::required("view", $item);
     access::required("edit", $item);
     if ($item->is_album()) {
         $form = album::get_edit_form($item);
     } else {
         $form = photo::get_edit_form($item);
     }
     print $form;
 }
Пример #3
0
 /**
  *  @see REST_Controller::_form_edit($resource)
  */
 public function _form_edit($photo)
 {
     access::required("view", $photo);
     access::required("edit", $photo);
     print photo::get_edit_form($photo);
 }
Пример #4
0
 public function form_edit($id)
 {
     $item = model_cache::get("item", $id);
     access::required("view", $item);
     access::required("edit", $item);
     switch ($item->type) {
         case "album":
             $form = album::get_edit_form($item);
             break;
         case "photo":
             $form = photo::get_edit_form($item);
             break;
         case "movie":
             $form = movie::get_edit_form($item);
             break;
     }
     // Pass on the source item where this form was generated, so we have an idea where to return to.
     $form->hidden("from_id")->value((int) Input::instance()->get("from_id", 0));
     print $form;
 }
Пример #5
0
 public function form_edit($id)
 {
     $item = ORM::factory("item", $id);
     access::required("edit", $item);
     $form = photo::get_edit_form($item);
     print $form;
 }
Пример #6
0
 public function form_edit($id)
 {
     $item = model_cache::get("item", $id);
     access::required("view", $item);
     access::required("edit", $item);
     switch ($item->type) {
         case "album":
             return print album::get_edit_form($item);
         case "photo":
             return print photo::get_edit_form($item);
         case "movie":
             return print movie::get_edit_form($item);
     }
 }
Пример #7
0
 public function form_edit($id)
 {
     $item = ORM::factory("item", $id);
     access::required("edit", $item);
     if ($item->is_album()) {
         $form = album::get_edit_form($item);
     } else {
         $form = photo::get_edit_form($item);
     }
     print $form;
 }