diff --git a/Model/Behavior/UploadBehavior.php b/Model/Behavior/UploadBehavior.php index 5a42a17..e637612 100644 --- a/Model/Behavior/UploadBehavior.php +++ b/Model/Behavior/UploadBehavior.php @@ -87,7 +87,7 @@ protected function _setRelationModel(Model $model, $type) { 'dependent' => true, 'conditions' => array( 'Attachment' . $type . '.model' => $model->alias, - 'Attachment' . $type . '.type' => strtolower($type)), + 'Attachment' . $type . '.type' => Inflector::underscore($type)), 'fields' => '', 'order' => '' ); @@ -642,11 +642,11 @@ public function createThumbs(Model $model, $type, $file) { * * @return void */ - public function createThumb($file, $name, $width, $height, $crop = false) { - $imagine = $this->getImagine(); + public function createThumb(Model $model, $file, $name, $width, $height, $crop = false) { + $imagine = $this->getImagine($model); $image = $imagine->open($file); - $this->__generateThumb( + $this->_generateThumb( array( 'w' => $width, 'h' => $height, @@ -696,7 +696,7 @@ protected function _generateThumb($thumb, $image, $crop = false) { $mode = Imagine\Image\ImageInterface::THUMBNAIL_INSET; } - $thumbnail = $image->thumbnail( + $thumbnail = $image->thumbnail( new Imagine\Image\Box( $thumb['w'], $thumb['h'] diff --git a/View/Helper/AttachHelper.php b/View/Helper/AttachHelper.php index 6520ae1..86fc31e 100644 --- a/View/Helper/AttachHelper.php +++ b/View/Helper/AttachHelper.php @@ -1,7 +1,7 @@