| @@ -221,15 +221,15 @@ | ||
| 221 | 221 | <?php endif ?> | 
| 222 | 222 | <?php endforeach ?> | 
| 223 | 223 | |
| 224 | - <?php foreach( $product->getAttributeItems( 'custom' ) as $attribute) : ?> | |
| 224 | + <?php foreach( $product->getAttributeItems( 'custom' ) as $attribute ) : ?> | |
| 225 | 225 | <?php if( $attribute->getCode() === 'upload' ) : ?> | 
| 226 | 226 | <div class="attr-list attr-type-<?= $enc->attr( $attribute ) ?>"> | 
| 227 | 227 | <span class="name"><?= $attribute->getName() ?></span> | 
| 228 | 228 | <span class="value"> | 
| 229 | 229 | <span class="image-uploads"> | 
| 230 | - <?php foreach( $attribute->getValue() as $upload) : ?> | |
| 230 | + <?php foreach( $attribute->getValue() as $upload ) : ?> | |
| 231 | 231 | <span class="image-upload"> | 
| 232 | - <img src="<?= $enc->attr( $this->content($upload) ) ?>" alt="upload-image" /> | |
| 232 | + <img src="<?= $enc->attr( $this->content( $upload ) ) ?>" alt="upload-image" /> | |
| 233 | 233 | </span> | 
| 234 | 234 | <?php endforeach ?> | 
| 235 | 235 | </span> | 
| @@ -465,11 +465,11 @@ discard block | ||
| 465 | 465 | |
| 466 | 466 | $attrIds[] = \Aimeos\MShop::create( $this->getContext(), 'attribute' )->find( 'file', [], 'product', 'upload' )->getId(); | 
| 467 | 467 | |
| 468 | - $fs = $this->getContext()->fs( 'fs' ); | |
| 468 | + $fs = $this->getContext()->fs( 'fs' ); | |
| 469 | 469 | |
| 470 | -        if( !$fs->has('basket-upload' ) ) { | |
| 471 | - $fs->mkdir( 'basket-upload' ); | |
| 472 | - } | |
| 470 | +		if( !$fs->has('basket-upload' ) ) { | |
| 471 | + $fs->mkdir( 'basket-upload' ); | |
| 472 | + } | |
| 473 | 473 | |
| 474 | 474 | $context = $this->getContext(); | 
| 475 | 475 | $domains = ['attribute', 'media', 'price', 'product', 'text', 'custom']; | 
| @@ -496,7 +496,7 @@ discard block | ||
| 496 | 496 | $entries = (array) $view->param( 'b_prod', [] ); | 
| 497 | 497 | |
| 498 | 498 |  			for($i = 0; $i < count($entries); ++$i) { | 
| 499 | - $paths = []; | |
| 499 | + $paths = []; | |
| 500 | 500 |  				foreach ($attrIds as $attrId) { | 
| 501 | 501 |  					if (isset($entries[$i]['attrcustid'][$attrId]) && is_array($entries[$i]['attrcustid'][$attrId])) { | 
| 502 | 502 | /** @var UploadedFile $file */ | 
| @@ -517,7 +517,7 @@ discard block | ||
| 517 | 517 | $list[] = $entries[$i]['prodid']; | 
| 518 | 518 | } | 
| 519 | 519 | } | 
| 520 | - } | |
| 520 | + } | |
| 521 | 521 | |
| 522 | 522 | foreach( $entries as $values ) | 
| 523 | 523 |  			{ | 
| @@ -467,7 +467,7 @@ discard block | ||
| 467 | 467 | |
| 468 | 468 | $fs = $this->getContext()->fs( 'fs' ); | 
| 469 | 469 | |
| 470 | -        if( !$fs->has('basket-upload' ) ) { | |
| 470 | +        if( !$fs->has( 'basket-upload' ) ) { | |
| 471 | 471 | $fs->mkdir( 'basket-upload' ); | 
| 472 | 472 | } | 
| 473 | 473 | |
| @@ -495,25 +495,25 @@ discard block | ||
| 495 | 495 | $list = []; | 
| 496 | 496 | $entries = (array) $view->param( 'b_prod', [] ); | 
| 497 | 497 | |
| 498 | -			for($i = 0; $i < count($entries); ++$i) { | |
| 498 | +			for( $i = 0; $i < count( $entries ); ++$i ) { | |
| 499 | 499 | $paths = []; | 
| 500 | -				foreach ($attrIds as $attrId) { | |
| 501 | -					if (isset($entries[$i]['attrcustid'][$attrId]) && is_array($entries[$i]['attrcustid'][$attrId])) { | |
| 500 | +				foreach( $attrIds as $attrId ) { | |
| 501 | +					if( isset( $entries[$i]['attrcustid'][$attrId] ) && is_array( $entries[$i]['attrcustid'][$attrId] ) ) { | |
| 502 | 502 | /** @var UploadedFile $file */ | 
| 503 | -						foreach ($entries[$i]['attrcustid'][$attrId] as $file) { | |
| 504 | - $filepath = 'basket-upload/' . md5($file->getFilename() . microtime(true)) . '.' . $file->extension(); | |
| 503 | +						foreach( $entries[$i]['attrcustid'][$attrId] as $file ) { | |
| 504 | + $filepath = 'basket-upload/' . md5( $file->getFilename() . microtime( true ) ) . '.' . $file->extension(); | |
| 505 | 505 |  							try { | 
| 506 | - $stream = fopen($file->getRealPath(), 'r+'); | |
| 507 | - $fs->writes($filepath, $stream); | |
| 508 | - fclose($stream); | |
| 509 | -							} catch (\Exception $ex) { | |
| 510 | - Log::error($ex->getMessage()); | |
| 506 | + $stream = fopen( $file->getRealPath(), 'r+' ); | |
| 507 | + $fs->writes( $filepath, $stream ); | |
| 508 | + fclose( $stream ); | |
| 509 | +							} catch( \Exception $ex ) { | |
| 510 | + Log::error( $ex->getMessage() ); | |
| 511 | 511 | } | 
| 512 | 512 | $paths[] = $filepath; | 
| 513 | 513 | } | 
| 514 | 514 | $entries[$i]['attrcustid'][$attrId] = $paths; | 
| 515 | 515 | } | 
| 516 | -					if (isset($entries[$i]['prodid'])) { | |
| 516 | +					if( isset( $entries[$i]['prodid'] ) ) { | |
| 517 | 517 | $list[] = $entries[$i]['prodid']; | 
| 518 | 518 | } | 
| 519 | 519 | } | 
| @@ -219,7 +219,7 @@ discard block | ||
| 219 | 219 | |
| 220 | 220 | <?php foreach( $this->productItem->getRefItems( 'attribute', null, 'custom' ) as $id => $attribute ) : $key = $attribute->getType() . '-' . $attribute->getCode() ?> | 
| 221 | 221 | <li class="select-item <?= $enc->attr( $key ) ?>"> | 
| 222 | -            <?php if ( $attribute->getType() !== 'upload' ) { ?> | |
| 222 | +            <?php if( $attribute->getType() !== 'upload' ) { ?> | |
| 223 | 223 | <label for="select-<?= $enc->attr( $this->productItem->getId() . '-' . $key ) ?>" class="select-name"><?= $enc->html( $this->translate( 'client/code', $attribute->getName() ) ) ?></label> | 
| 224 | 224 | <?php } ?> | 
| 225 | 225 | |
| @@ -238,7 +238,7 @@ discard block | ||
| 238 | 238 | > | 
| 239 | 239 | <?php break; case 'date': ?> | 
| 240 | 240 | <input id="select-<?= $enc->attr( $this->productItem->getId() . '-' . $key ) ?>" class="form-control" type="date" name="<?= $enc->attr( $this->formparam( ['b_prod', 0, 'attrcustid', $id] ) ) ?>"> | 
| 241 | - <?php break;case 'upload': ?> | |
| 241 | + <?php break; case 'upload': ?> | |
| 242 | 242 | <div class="upload-wrapper"> | 
| 243 | 243 | <div class="upload-view" | 
| 244 | 244 | data-title="<?= $enc->html( $this->translate( 'client/code', $attribute->getName() ) ) ?> Klicken zum hinzufügen." |