Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 333 Rev 334
Línea 353... Línea 353...
353
                    //$target_size = $this->config['leaderslinked.image_sizes.knowledge_area'];
353
                    //$target_size = $this->config['leaderslinked.image_sizes.knowledge_area'];
354
                    //list($target_width, $target_height) = explode('x', $target_size);
354
                    //list($target_width, $target_height) = explode('x', $target_size);
Línea 355... Línea 355...
355
 
355
 
-
 
356
 
-
 
357
                    $image = Image::getInstance($this->config);
-
 
358
                    $storage = Storage::getInstance($this->config, $this->adapter);
356
 
359
                    
Línea 357... Línea 360...
357
                    $image = Image::getInstance($this->config);
360
                    
Línea 358... Línea 361...
358
                    $target_path = $image->getStorage()->getPathKnowledgeArea();
361
                    $target_path = $storage->getPathKnowledgeArea();
359
                    
362
                    
360
 
363
 
361
 
364
 
-
 
365
                    $files = $this->getRequest()->getFiles()->toArray();
-
 
366
 
362
                    $files = $this->getRequest()->getFiles()->toArray();
367
 
363
 
368
                    if (isset($files['image']) && empty($files['image']['error'])) {
-
 
369
                        $tmp_filename  = $files['image']['tmp_name'];
364
 
370
                        $filename      = explode('.',  $files['image']['name']);
365
                    if (isset($files['image']) && empty($files['image']['error'])) {
371
                        $filename       = Functions::normalizeString(uniqid() . '-' . $filename[0] . '.png');
366
                        $tmp_filename  = $files['image']['tmp_name'];
372
                     
-
 
373
                        
367
                        $filename      = explode('.',  $files['image']['name']);
374
                        $full_tmp_filename = $image->uploadProcessWithOutChangeSize($tmp_filename, $filename);
-
 
375
                        
-
 
376
                        if($full_tmp_filename) {
368
                        $filename       = Functions::normalizeString(uniqid() . '-' . $filename[0] . '.png');
377
                            if($storage->putFile($target_path, $knowledgeAreaCategory->uuid,  $full_tmp_filename)) {
Línea 369... Línea 378...
369
                        $unlink_source = true;
378
                                $knowledgeAreaContent->image = $filename;
370
 
379
                                $knowledgeAreaContentMapper->update($knowledgeAreaContent);
371
                        if($image->uploadImageRaw($tmp_filename, $target_path, $knowledgeAreaCategory->uuid, $filename, $unlink_source)) {
380
                            }
Línea 641... Línea 650...
641
                    //$target_size = $this->config['leaderslinked.image_sizes.knowledge_area'];
650
                    //$target_size = $this->config['leaderslinked.image_sizes.knowledge_area'];
642
                    //list($target_width, $target_height) = explode('x', $target_size);
651
                    //list($target_width, $target_height) = explode('x', $target_size);
Línea 643... Línea 652...
643
 
652
 
-
 
653
 
644
 
654
                    $image = Image::getInstance($this->config);
Línea 645... Línea 655...
645
                    $image = Image::getInstance($this->config);
655
                    $storage = Storage::getInstance($this->config, $this->adapter);
Línea 657... Línea 667...
657
 
667
 
658
 
668
 
659
                        $tmp_filename  = $files['image']['tmp_name'];
669
                        $tmp_filename  = $files['image']['tmp_name'];
660
                        $filename      = explode('.',  $files['image']['name']);
-
 
-
 
670
                        $filename      = explode('.',  $files['image']['name']);
Línea -... Línea 671...
-
 
671
                        $filename       = Functions::normalizeString(uniqid() . '-' . $filename[0] . '.png');
-
 
672
             
-
 
673
                        
661
                        $filename       = Functions::normalizeString(uniqid() . '-' . $filename[0] . '.png');
674
                        $full_tmp_filename = $image->uploadProcessWithOutChangeSize($tmp_filename, $filename);
662
                        $unlink_source = true;
675
                        
663
                        
676
                        if($full_tmp_filename) {
-
 
677
                            if($storage->putFile($target_path, $knowledgeAreaCategory->uuid,  $full_tmp_filename)) {
664
                        if($image->uploadImageRaw($tmp_filename, $target_path, $knowledgeAreaCategory->uuid, $filename, $unlink_source)) {
678
                                $knowledgeAreaContent->image = $filename;
-
 
679
                                $knowledgeAreaContentMapper->update($knowledgeAreaContent);
665
                            $knowledgeAreaContent->image = $filename;
680
                            }
Línea 666... Línea 681...
666
                            $knowledgeAreaContentMapper->update($knowledgeAreaContent);
681
                        }
667
                        }
682
          
668
                    }
683
                    }