Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 6513 Rev 6514
Línea 992... Línea 992...
992
                                error_log($e->getTraceAsString());
992
                                error_log($e->getTraceAsString());
993
                            }
993
                            }
994
                        }
994
                        }
Línea 995... Línea 995...
995
                        
995
                        
-
 
996
                        if($slide->type == CompanyMicrolearningSlide::TYPE_IMAGE) {
-
 
997
                                $fileBase64Content = $this->params()->fromPost('file');
-
 
998
 
-
 
999
                            try {
-
 
1000
                            
-
 
1001
                                $fileBase64Content = base64_decode($fileBase64Content);
-
 
1002
                                $filename      = 'slide-' .uniqid() . '.png';
-
 
1003
                                $tmp_filename = 'data' . DIRECTORY_SEPARATOR . 'tmp';
-
 
1004
                                $target_path = $this->config['leaderslinked.fullpath.microlearning_slide'] .  $slide->uuid;
-
 
1005
                                if(!file_exists($target_path)) {
-
 
1006
                                    mkdir($target_path, 0755, true);
-
 
1007
                                }
-
 
1008
                                $tmp_filename = 'data' . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . $filename;
-
 
1009
                                    file_put_contents($tmp_filename, $fileBase64Content);
-
 
1010
                                
-
 
1011
                                list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
-
 
1012
        
-
 
1013
                                $crop_to_dimensions = true;
-
 
1014
                                if(Image::uploadImage($tmp_filename, $target_path, $filename, $target_width, $target_height, $crop_to_dimensions )) {
-
 
1015
                                    $slide->file = basename($filename);
-
 
1016
                                    $slideMapper->update($slide);
-
 
1017
                                }
-
 
1018
                            } catch(\Throwable $e) {
-
 
1019
                                error_log($e->getTraceAsString());
-
 
1020
                            }     
996
                        if($slide->type == CompanyMicrolearningSlide::TYPE_IMAGE) {
1021
                            /*
997
                            try {
1022
                            try {
Línea 998... Línea 1023...
998
                                list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
1023
                                list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
999
                                
1024
                                
Línea 1003... Línea 1028...
1003
                                    $slide->file = $filename;
1028
                                    $slide->file = $filename;
1004
                                    $slideMapper->update($slide);
1029
                                    $slideMapper->update($slide);
1005
                                }
1030
                                }
1006
                            } catch(\Throwable $e) {
1031
                            } catch(\Throwable $e) {
1007
                                error_log($e->getTraceAsString());
1032
                                error_log($e->getTraceAsString());
1008
                            }
1033
                            }*/
1009
                        }
1034
                        }
1010
                    }
1035
                    }
Línea 1011... Línea 1036...
1011
                    
1036
                    
1012
                    if(isset($files['background']) && empty($files['background']['error'])) {
1037
                    if(isset($files['background']) && empty($files['background']['error'])) {