Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 17002 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 17002 Rev 17018
Línea 135... Línea 135...
135
                $microlearningTopicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
135
                $microlearningTopicMapper = MicrolearningTopicMapper::getInstance($this->adapter);
Línea 136... Línea 136...
136
 
136
 
Línea 137... Línea 137...
137
                $paginator = $microlearningTopicMapper->fetchAllDataTableByCompanyId($currentCompany->id, $search, $page, $records_x_page, $order_field, $order_direction);
137
                $paginator = $microlearningTopicMapper->fetchAllDataTableByCompanyId($currentCompany->id, $search, $page, $records_x_page, $order_field, $order_direction);
138
 
138
 
Línea 139... Línea 139...
139
                
139
                
Línea 140... Línea 140...
140
                $storage = Storage::getInstance($this->config);
140
                $storage = Storage::getInstance($this->config, $this->adapter);
Línea 255... Línea 255...
255
                    
255
                    
256
                    
256
                    
257
                    $files = $this->getRequest()->getFiles()->toArray();
257
                    $files = $this->getRequest()->getFiles()->toArray();
258
                    if(isset($files['file']) && empty($files['file']['error'])) {
258
                    if(isset($files['file']) && empty($files['file']['error'])) {
Línea 259... Línea 259...
259
                        $tmp_filename  = $files['file']['tmp_name'];
259
                        $tmp_filename  = $files['file']['tmp_name'];
260
                       // $filename      = $this->normalizeString($files['file']['name']);
260
                        // $filename      = $\LeadersLinked\Library\Functions::normalizeStringFilename($files['file']['name']);
Línea 261... Línea 261...
261
                        
261
                        
262
                        try {
262
                        try {
263
                            list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
263
                            list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
Línea 264... Línea 264...
264
                            
264
                            
265
                            $filename = 'topic-' .uniqid() . '.png';
265
                            $filename = 'topic-' .uniqid() . '.png';
266
                            $crop_to_dimensions = false;
266
                            $crop_to_dimensions = false;
267
                            $unlink_source = true;
267
                            $unlink_source = true;
268
                            
268
                            
269
                            if($image->uploadImageChangeSize($tmp_filename, $target_path, $topic->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
269
                            if($image->uploadProcessChangeSize($tmp_filename, $target_path, $topic->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
Línea 366... Línea 366...
366
            
366
            
367
            $result = $topicMapper->delete($topic);
367
            $result = $topicMapper->delete($topic);
368
            if($result) {
368
            if($result) {
Línea 369... Línea 369...
369
                $this->logger->info('Se borro el tópico : ' .  $topic->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
369
                $this->logger->info('Se borro el tópico : ' .  $topic->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
370
                
370
                
Línea 371... Línea 371...
371
                $storage = Storage::getInstance($this->config);
371
                $storage = Storage::getInstance($this->config, $this->adapter);
Línea 429... Línea 429...
429
            ]);
429
            ]);
430
        }
430
        }
Línea 431... Línea 431...
431
        
431
        
Línea 432... Línea 432...
432
        if($request->isGet()) {
432
        if($request->isGet()) {
433
            
433
            
Línea 434... Línea 434...
434
            $storage = Storage::getInstance($this->config);
434
            $storage = Storage::getInstance($this->config, $this->adapter);
435
            $path = $storage->getPathMicrolearningTopic();
435
            $path = $storage->getPathMicrolearningTopic();
436
            
436
            
Línea 468... Línea 468...
468
                    
468
                    
469
                    
469
                    
470
                    $files = $this->getRequest()->getFiles()->toArray();
470
                    $files = $this->getRequest()->getFiles()->toArray();
471
                    if(isset($files['file']) && empty($files['file']['error'])) {
471
                    if(isset($files['file']) && empty($files['file']['error'])) {
Línea 472... Línea 472...
472
                        $tmp_filename  = $files['file']['tmp_name'];
472
                        $tmp_filename  = $files['file']['tmp_name'];
473
                        //$filename      = $this->normalizeString($files['file']['name']);
473
                        //$filename      = \LeadersLinked\Library\Functions::normalizeStringFilename($files['file']['name']);
Línea 474... Línea 474...
474
                        
474
                        
Línea 487... Línea 487...
487
                            
487
                            
488
                            $filename = 'topic-' .uniqid() . '.png';
488
                            $filename = 'topic-' .uniqid() . '.png';
489
                            $crop_to_dimensions = false;
489
                            $crop_to_dimensions = false;
Línea 490... Línea 490...
490
                            $unlink_source = true;
490
                            $unlink_source = true;
491
                            
491
                            
492
                            if($image->uploadImageChangeSize($tmp_filename, $target_path, $topic->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
492
                            if($image->uploadProcessChangeSize($tmp_filename, $target_path, $topic->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
493
                                $topic->image = $filename;
493
                                $topic->image = $filename;
494
                                $topicMapper->update($topic);
494
                                $topicMapper->update($topic);
495
                            }
495
                            }