Skip to content

Commit

Permalink
Merge pull request #31 from krolow/develop
Browse files Browse the repository at this point in the history
Merging develop
  • Loading branch information
krolow committed Aug 27, 2014
2 parents 1a2d130 + 80c40d9 commit 8d89d69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Model/Behavior/UploadBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => ''
);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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']
Expand Down
10 changes: 5 additions & 5 deletions View/Helper/AttachHelper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Attachment Model
*
*
* PHP Version 5.3+
*
* @version 1.0
Expand All @@ -14,7 +14,7 @@ class AttachHelper extends AppHelper {

/**
* Load Helpers
*
*
* @var array
*/
public $helpers = array(
Expand All @@ -23,14 +23,14 @@ class AttachHelper extends AppHelper {

/**
* Render image
*
*
* @throws RunTimeException When no model is set in data or class does not exists
*
*
* @return string
*/
public function image($attach, $type = null, $options = array()) {
if (!isset($attach['model'])) {
throw new RunTimeException('Seems that the given attac is not really from the Attachment model');
throw new RunTimeException('Seems that the given attach is not really from the Attachment model');
}

if (!class_exists($attach['model'])) {
Expand Down

0 comments on commit 8d89d69

Please sign in to comment.