Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 6182 Rev 6185
Línea 481... Línea 481...
481
                    
481
                    
Línea 482... Línea 482...
482
                    $files = $this->getRequest()->getFiles()->toArray();
482
                    $files = $this->getRequest()->getFiles()->toArray();
483
                    
483
                    
484
                    $fileBase64Content = $this->params()->fromPost('file');
-
 
485
                    if(isset($fileBase64Content)){
484
                    $fileBase64Content = $this->params()->fromPost('file');
Línea 486... Línea 485...
486
                        if($slide->type == CompanyMicrolearningSlide::TYPE_IMAGE) {
485
                    if(isset($fileBase64Content)){
487
                            try {
486
                            try {
488
                        
487
                        
Línea 498... Línea 497...
498
                                
497
                                
Línea 499... Línea 498...
499
                                list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
498
                                list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
500
        
499
        
501
                                $crop_to_dimensions = false;
500
                                $crop_to_dimensions = false;
502
                                if(Image::uploadImage($tmp_filename, $target_path, $filename, $target_width, $target_height, $crop_to_dimensions )) {
501
                                if(Image::uploadImage($tmp_filename, $target_path, $filename, $target_width, $target_height, $crop_to_dimensions )) {
503
                                    $topic->image = basename($filename);
502
                                    $slide->image = basename($filename);
504
                                    $topicMapper->update($topic);
503
                                    $slideMapper->update($slide);
505
                                }
504
                                }
506
                            } catch(\Throwable $e) {
505
                            } catch(\Throwable $e) {
Línea 507... Línea 506...
507
                                error_log($e->getTraceAsString());
506
                                error_log($e->getTraceAsString());
Línea 508... Línea 507...
508
                            }       
507
                            }       
509
                           
508
                           
510
                            $this->logger->info('Se agrego el tópico ' . $topic->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
509
                            $this->logger->info('Se agrego el slide ' . $slide->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
511
                            
510
                            
Línea 524... Línea 523...
524
                                    $slideMapper->update($slide);
523
                                    $slideMapper->update($slide);
525
                                }
524
                                }
526
                            } catch(\Throwable $e) {
525
                            } catch(\Throwable $e) {
527
                                error_log($e->getTraceAsString());
526
                                error_log($e->getTraceAsString());
528
                            }*/
527
                            }*/
529
 
-
 
530
                        }
-
 
531
                    }
528
                    }
532
                    $target_path = $this->config['leaderslinked.fullpath.microlearning_slide'] .  $slide->uuid;
529
                    $target_path = $this->config['leaderslinked.fullpath.microlearning_slide'] .  $slide->uuid;
533
                    if(!file_exists($target_path)) {
530
                    if(!file_exists($target_path)) {
534
                        mkdir($target_path, 0755, true);
531
                        mkdir($target_path, 0755, true);
535
                    }
532
                    }