Пример #1
0
 /**
  * Image upload
  * @param $group
  * @param bool $multi
  */
 protected function image_upload($group, $multi = true)
 {
     $id = $this->request->param('param');
     if ($multi) {
         $fu = new Fileuploaders($group, $this->user->id, $id);
         if ($fu->image_upload()) {
             $this->json = View::factory('backend/v_image_multi', $fu->get_data());
         } else {
             $this->json = Message::view(Message::ERROR, $fu->errors());
         }
     } else {
         $fu = new Fileuploader($group, $this->user->id, $id);
         if ($fu->image_upload()) {
             $this->json = View::factory('backend/v_image_single', $fu->get_data());
         } else {
             $this->json = Message::view(Message::ERROR, $fu->errors());
         }
     }
 }