Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6872 | Rev 6933 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6872 Rev 6931
Línea 397... Línea 397...
397
                    $fileBase64Content2 = $this->params()->fromPost('marketplace'); 
397
                    $fileBase64Content2 = $this->params()->fromPost('marketplace'); 
398
                    try {
398
                    try {
Línea 399... Línea 399...
399
                        
399
                        
400
                        $fileBase64Content2 = base64_decode($fileBase64Content2);
400
                        $fileBase64Content2 = base64_decode($fileBase64Content2);
401
                        $target_path = $this->config['leaderslinked.fullpath.microlearning_capsule'] . $capsule->uuid;
401
                        $target_path = $this->config['leaderslinked.fullpath.microlearning_capsule'] . $capsule->uuid;
402
                        $capsule_filename  = 'marketplace-' .uniqid() . '.jpg';
402
                        $capsule_filename2  = 'marketplace-' .uniqid() . '.jpg';
403
                        $capsule_tmp_filename = 'data' . DIRECTORY_SEPARATOR . 'tmp';
403
                        $capsule_tmp_filename2 = 'data' . DIRECTORY_SEPARATOR . 'tmp';
404
                        if(!file_exists($capsule_tmp_filename)) {
404
                        if(!file_exists($capsule_tmp_filename2)) {
405
                            mkdir($capsule_tmp_filename, 0755, true);
405
                            mkdir($capsule_tmp_filename2, 0755, true);
406
                        }
406
                        }
407
                        $capsule_tmp_filename = 'data' . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . $capsule_filename;
407
                        $capsule_tmp_filename2 = 'data' . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . $capsule_filename2;
408
                            file_put_contents($capsule_tmp_filename, $fileBase64Content2);
-
 
-
 
408
                            file_put_contents($capsule_tmp_filename2, $fileBase64Content2);
409
                        
409
                            return new JsonModel($target_width.' '.$target_height);
Línea 410... Línea 410...
410
                            list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.marketplace']);
410
                            list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.marketplace']);
411
 
411
 
412
                        $crop_to_dimensions = false;
412
                        $crop_to_dimensions = false;
413
                        if(Image::uploadImage($capsule_tmp_filename, $target_path, $capsule_filename, $target_width, $target_height, $crop_to_dimensions )) {
413
                        if(Image::uploadImage($capsule_tmp_filename2, $target_path2, $capsule_filename2, $target_width, $target_height, $crop_to_dimensions )) {
414
                            $capsule->marketplace = basename($capsule_filename);
414
                            $capsule->marketplace = basename($capsule_filename2);
415
                            $capsuleMapper->update($capsule);
415
                            $capsuleMapper->update($capsule);
416
                        }
416
                        }
417
                    } catch(\Throwable $e) {
417
                    } catch(\Throwable $e) {