From 6d182b6d114bde4344bf2d4b83b2bfc483f85e80 Mon Sep 17 00:00:00 2001 From: howtoxe Date: Wed, 24 May 2017 11:44:27 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BB=A4=EB=B2=84=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=20=EC=84=A0=ED=83=9D=20=EC=B7=A8=EC=86=8C=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CK에디터 파일업로드의 커버이미지 선택을 취소할 수 있도록 하는 기능 --- modules/file/file.controller.php | 42 ++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 7d9c9d1cc..01cc7bc58 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -1125,24 +1125,40 @@ class fileController extends file $oDB = &DB::getInstance(); $oDB->begin(); - $args->cover_image = 'N'; - $output = executeQuery('file.updateClearCoverImage', $args); - if(!$output->toBool()) - { - $oDB->rollback(); - return $output; - } + if($file_info->cover_image != 'Y') { + + $args->cover_image = 'N'; + $output = executeQuery('file.updateClearCoverImage', $args); + if(!$output->toBool()) + { + $oDB->rollback(); + return $output; + } + + $args->cover_image = 'Y'; + $output = executeQuery('file.updateCoverImage', $args); + if(!$output->toBool()) + { + $oDB->rollback(); + return $output; + } + + }else{ + + $args->cover_image = 'N'; + $output = executeQuery('file.updateClearCoverImage', $args); + if(!$output->toBool()) + { + $oDB->rollback(); + return $output; + } - $args->cover_image = 'Y'; - $output = executeQuery('file.updateCoverImage', $args); - if(!$output->toBool()) - { - $oDB->rollback(); - return $output; } $oDB->commit(); + $this->add('is_cover',$args->cover_image); + // 썸네일 삭제 $thumbnail_path = sprintf('files/thumbnails/%s', getNumberingPath($upload_target_srl, 3)); Filehandler::removeFilesInDir($thumbnail_path);