Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 7115 Rev 7236
Línea 456... Línea 456...
456
 
456
 
457
                if($topicMapper->update($topic)) {
457
                if($topicMapper->update($topic)) {
458
                    $topic = $topicMapper->fetchOne($topic->id);
458
                    $topic = $topicMapper->fetchOne($topic->id);
459
                    $fileBase64Content = $this->params()->fromPost('file');
459
                    $fileBase64Content = $this->params()->fromPost('file');
-
 
460
                    try {
460
                    try {
461
                        if($topic->image) {
-
 
462
                                
-
 
463
                            if(!image ::delete($target_path, $topic->image)) {
-
 
464
                                return new JsonModel([
-
 
465
                                    'success'   => false,
-
 
466
                                    'data'   =>  'ERROR_THERE_WAS_AN_ERROR'
-
 
467
                                ]);
-
 
468
                            }
461
                        
469
                        }
462
                        $fileBase64Content = base64_decode($fileBase64Content);
470
                        $fileBase64Content = base64_decode($fileBase64Content);
463
                        $target_path = $this->config['leaderslinked.fullpath.microlearning_topic'] . $topic->uuid;
471
                        $target_path = $this->config['leaderslinked.fullpath.microlearning_topic'] . $topic->uuid;
464
                        $topic_filename      = 'topic-' .uniqid() . '.jpg';
472
                        $topic_filename      = 'topic-' .uniqid() . '.jpg';
465
                        $topic_tmp_filename = 'data' . DIRECTORY_SEPARATOR . 'tmp';
473
                        $topic_tmp_filename = 'data' . DIRECTORY_SEPARATOR . 'tmp';