Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 6085 Rev 6086
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 {
-
 
461
                        if($topic->image) {
460
                    try {
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
                            }
-
 
469
                        }
461
                        
470
                        $fileBase64Content = base64_decode($fileBase64Content);
462
                        $fileBase64Content = base64_decode($fileBase64Content);
471
                        $target_path = $this->config['leaderslinked.fullpath.microlearning_topic'] . $topic->uuid;
463
                        $target_path = $this->config['leaderslinked.fullpath.microlearning_topic'] . $topic->uuid;
472
                        $topic_filename      = 'topic-' .uniqid() . '.png';
464
                        $topic_filename      = 'topic-' .uniqid() . '.png';
473
                        $topic_tmp_filename = 'data' . DIRECTORY_SEPARATOR . 'tmp';
465
                        $topic_tmp_filename = 'data' . DIRECTORY_SEPARATOR . 'tmp';