diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index b428f451b..ec321c589 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -105,7 +105,7 @@ // 미설치시에는 act값을 강제로 변경 if($this->module=="install") { - if(!$xml_info->action->{$this->act}) $this->act = $xml_info->default_index_act; + if(!$this->act || !$xml_info->action->{$this->act}) $this->act = $xml_info->default_index_act; } // 현재 요청된 act가 있으면 $xml_info에서 type을 찾음, 없다면 기본 action을 이용 diff --git a/classes/module/ModuleObject.class.php b/classes/module/ModuleObject.class.php index 1b07eeaa8..747a65b88 100644 --- a/classes/module/ModuleObject.class.php +++ b/classes/module/ModuleObject.class.php @@ -266,7 +266,7 @@ $xml_info = $oModuleModel->getModuleActionXml($forward->module); $oModule->setAct($forward->act); $oModule->init(); - $oModule->setModuleInfo(null, $xml_info); + $oModule->setModuleInfo($this->module_info, $xml_info); $output = call_user_method($forward->act, $oModule); $this->setTemplatePath($oModule->getTemplatePath()); diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index c2b940e71..3a1d04782 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -221,61 +221,6 @@ } } - /** - * @brief 첨부파일 삭제 - * 에디터에서 개별 파일 삭제시 사용 - **/ - function procBoardDeleteFile() { - // 기본적으로 필요한 변수인 upload_target_srl, module_srl을 설정 - $upload_target_srl = Context::get('upload_target_srl'); - $module_srl = $this->module_srl; - $file_srl = Context::get('file_srl'); - - // file class의 controller 객체 생성 - $oFileController = &getController('file'); - if($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager); - - // 첨부파일의 목록을 java script로 출력 - $oFileController->printUploadedFileList($upload_target_srl); - } - - /** - * @brief 첨부파일 업로드 - * - * editor에서는 upload_target_srl을 넘겨주고 게시판에서는 document_srl을 upload_target_srl로 설정해 놓은 상태이다. - **/ - function procBoardUploadFile() { - // 업로드 권한이 없거나 정보가 없을시 종료 - if(!Context::isUploaded() || !$this->grant->fileupload) exit(); - - // 기본적으로 필요한 변수 설정 - $upload_target_srl = Context::get('upload_target_srl'); - $module_srl = $this->module_srl; - - // file class의 controller 객체 생성 - $oFileController = &getController('file'); - $output = $oFileController->insertFile($module_srl, $upload_target_srl); - - // 첨부파일의 목록을 java script로 출력 - $oFileController->printUploadedFileList($upload_target_srl); - } - - /** - * @brief 첨부파일 다운로드 - * 직접 요청을 받음\n - * file_srl : 파일의 sequence\n - * sid : db에 저장된 비교 값, 틀리면 다운로드 하지 낳음\n - **/ - function procBoardDownloadFile() { - // 다운로드에 필요한 변수 체크 - $file_srl = Context::get('file_srl'); - $sid = Context::get('sid'); - - // document module 객체 생성후 해당 파일의 정보를 체크 - $oFileModel = &getModel('file'); - $oFileModel->procDownload($file_srl, $sid); - } - /** * @brief 권한 추가 **/ diff --git a/modules/board/board.view.php b/modules/board/board.view.php index f7e0f1191..06c144be4 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -192,8 +192,8 @@ Context::set('document', $document); // 에디터 모듈의 getEditor를 호출하여 세팅 - $oEditorView = &getView('editor'); - $editor = $oEditorView->getEditor($document_srl, $this->grant->fileupload, true); + $oEditorModel = &getModel('editor'); + $editor = $oEditorModel->getEditor($document_srl, $this->grant->fileupload, true); Context::set('editor', $editor); $this->setTemplateFile('write_form'); @@ -425,8 +425,8 @@ } // 에디터 모듈의 getEditor를 호출하여 세팅 - $oEditorView = &getView('editor'); - $comment_editor = $oEditorView->getEditor($comment_srl, $this->grant->fileupload); + $oEditorModel = &getModel('editor'); + $comment_editor = $oEditorModel->getEditor($comment_srl, $this->grant->fileupload); Context::set('comment_editor', $comment_editor); } diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php index 6eea07ee9..79841e916 100644 --- a/modules/editor/editor.model.php +++ b/modules/editor/editor.model.php @@ -7,6 +7,45 @@ class editorModel extends editor { + /** + * @brief 에디터를 return + **/ + function getEditor($upload_target_srl, $allow_fileupload = false, $enable_autosave = false) { + // 저장된 임시본이 있는지 검사 + if($enable_autosave) { + $saved_doc = $this->getSavedDoc($upload_target_srl); + Context::set('saved_doc', $saved_doc); + } + Context::set('enable_autosave', $enable_autosave); + + // 업로드를 위한 변수 설정 + Context::set('upload_target_srl', $upload_target_srl); + Context::set('allow_fileupload', $allow_fileupload); + + // 에디터 컴포넌트를 구함 + if(!Context::get('component_list')) { + $component_list = $this->getComponentList(); + Context::set('component_list', $component_list); + } + + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return + $tpl_path = $this->module_path.'tpl'; + $tpl_file = 'editor.html'; + + // editor_path를 지정 + Context::set('editor_path', $tpl_path); + + // 만약 allow_fileupload == true 이면 upload_target_srl에 upload가능하다고 설정 + if($allow_fileupload) { + $oFileController = &getController('file'); + $oFileController->setUploadEnable($upload_target_srl); + } + require_once("./classes/template/TemplateHandler.class.php"); + $oTemplate = new TemplateHandler(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** * @brief 자동저장되어 있는 정보를 가져옴 **/ diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index b9783f67f..3fc32a5e8 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -91,40 +91,5 @@ $this->setLayoutFile("popup_layout"); } - /** - * @brief 에디터를 return - **/ - function getEditor($upload_target_srl, $allow_fileupload = false, $enable_autosave = false) { - $oEditorModel = &getModel('editor'); - - // 저장된 임시본이 있는지 검사 - if($enable_autosave) { - $saved_doc = $oEditorModel->getSavedDoc($upload_target_srl); - Context::set('saved_doc', $saved_doc); - } - Context::set('enable_autosave', $enable_autosave); - - // 업로드를 위한 변수 설정 - Context::set('upload_target_srl', $upload_target_srl); - Context::set('allow_fileupload', $allow_fileupload); - - // 에디터 컴포넌트를 구함 - if(!Context::get('component_list')) { - $component_list = $oEditorModel->getComponentList(); - Context::set('component_list', $component_list); - } - - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->module_path.'tpl'; - $tpl_file = 'editor.html'; - - // editor_path를 지정 - Context::set('editor_path', $tpl_path); - - require_once("./classes/template/TemplateHandler.class.php"); - $oTemplate = new TemplateHandler(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - } ?> diff --git a/modules/editor/tpl/editor.html b/modules/editor/tpl/editor.html index c9a498000..23f812108 100644 --- a/modules/editor/tpl/editor.html +++ b/modules/editor/tpl/editor.html @@ -102,7 +102,7 @@
