/** AJAX IMAGE EDITING **/ public function crop() { $this->use_layout = false; if ($id = Request::get('id')) { $this->model = new $this->model_class($id); if ($data = Request::post('crop')) { $location = PUBLIC_DIR . $this->model->url(); File::crop_image($location, $location, $data['x1'], $data['y1'], $data['w'], $data['h']); File::clear_image_cache($id); } } else { exit; } }