From a0074e83112b508ca1db3e47d8879903de1157a9 Mon Sep 17 00:00:00 2001 From: zero Date: Fri, 13 Apr 2007 12:03:41 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1133 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/board/board.view.php | 1 - modules/editor/editor.model.php | 6 ++++++ modules/editor/tpl/editor.html | 3 +-- modules/file/conf/module.xml | 2 ++ modules/file/file.class.php | 5 +++++ modules/file/file.controller.php | 13 ++++++++++++ modules/file/file.model.php | 13 ++++++++++++ modules/file/file.view.php | 13 ++++++++++++ modules/file/lang/ko.lang.php | 6 ++++++ modules/file/tpl/file_config.html | 26 +++++++++++++++++++++++ modules/file/tpl/filter/insert_config.xml | 7 ++++++ modules/file/tpl/header.html | 6 ++++++ modules/module/tpl/module_list.html | 2 +- 13 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 modules/file/tpl/file_config.html create mode 100644 modules/file/tpl/filter/insert_config.xml create mode 100644 modules/file/tpl/header.html diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 09e5cf58f..c76b94cf5 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -448,7 +448,6 @@ $this->setTemplateFile('board_config'); } - /** * @brief 선택된 게시판의 정보 출력 **/ diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php index 7a29e98b7..b0feec550 100644 --- a/modules/editor/editor.model.php +++ b/modules/editor/editor.model.php @@ -28,6 +28,12 @@ Context::set('component_list', $component_list); } + // 첨부파일 모듈의 정보를 구함 + $oModuleModel = &getModel('module'); + $file_config = $oModuleModel->getModuleConfig('file'); + $file_config->allowed_filesize = $file_config->allowed_filesize * 1024; + Context::set('file_config',$file_config); + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return $tpl_path = $this->module_path.'tpl'; $tpl_file = 'editor.html'; diff --git a/modules/editor/tpl/editor.html b/modules/editor/tpl/editor.html index 9872d30c2..547c48f79 100644 --- a/modules/editor/tpl/editor.html +++ b/modules/editor/tpl/editor.html @@ -1,7 +1,6 @@ - diff --git a/modules/file/conf/module.xml b/modules/file/conf/module.xml index bedb14258..2a2f53113 100644 --- a/modules/file/conf/module.xml +++ b/modules/file/conf/module.xml @@ -3,10 +3,12 @@ + + diff --git a/modules/file/file.class.php b/modules/file/file.class.php index 43dd342fe..c2fdf6705 100644 --- a/modules/file/file.class.php +++ b/modules/file/file.class.php @@ -18,6 +18,11 @@ $oModuleController->insertActionForward('file', 'controller', 'procFileDelete'); $oModuleController->insertActionForward('file', 'controller', 'procFileDownload'); //$oModuleController->insertActionForward('file', 'controller', 'procFileAdminDeleteChecked'); + + // 첨부파일의 기본 설정 저장 + $config->allowed_filesize = '2'; + $config->allowed_filetypes = '*.*'; + $oModuleController->insertModuleConfig('file', $config); // file 모듈에서 사용할 디렉토리 생성 FileHandler::makeDir('./files/attach/images'); diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 5712fa7a3..822b8b620 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -324,5 +324,18 @@ fpassthru($fp); } + /** + * @brief 파일 기본 정보의 추가 + **/ + function procFileAdminInsertConfig() { + // 기본 정보를 받음 + $args = Context::gets('allowed_filesize','allowed_filetypes'); + + // module Controller 객체 생성하여 입력 + $oModuleController = &getController('module'); + $output = $oModuleController->insertModuleConfig('file',$args); + return $output; + } + } ?> diff --git a/modules/file/file.model.php b/modules/file/file.model.php index 2c2073fd7..b4ec0ed55 100644 --- a/modules/file/file.model.php +++ b/modules/file/file.model.php @@ -29,6 +29,19 @@ return "./?module=file&act=procFileDownload&file_srl=".$file_srl."&sid=".$sid; } + /** + * @brief 파일 설정 정보를 구함 + **/ + function getFileConfig() { + // 설정 정보를 받아옴 (module model 객체를 이용) + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('file'); + + if(!$config->allowed_filesize) $config->allowed_filesize = '2'; + if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*'; + return $config; + } + /** * @brief 파일 정보를 구함 **/ diff --git a/modules/file/file.view.php b/modules/file/file.view.php index d62fc143d..d7e6ab1a8 100644 --- a/modules/file/file.view.php +++ b/modules/file/file.view.php @@ -60,5 +60,18 @@ $this->setTemplateFile('file_list'); } + /** + * @brief 첨부파일 정보 설정 (관리자용) + **/ + function dispFileAdminConfig() { + $oFileModel = &getModel('file'); + $config = $oFileModel->getFileConfig(); + Context::set('config',$config); + + // 템플릿 파일 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('file_config'); + } + } ?> diff --git a/modules/file/lang/ko.lang.php b/modules/file/lang/ko.lang.php index 1f51a1882..fdc1db0a7 100644 --- a/modules/file/lang/ko.lang.php +++ b/modules/file/lang/ko.lang.php @@ -11,6 +11,12 @@ $lang->status = '상태'; $lang->is_valid = '유효'; $lang->is_stand_by = '대기'; + $lang->file_list = '첨부 파일 목록'; + $lang->allowed_filesize = '허용 첨부 용량'; + $lang->allowed_filetypes = '허용 첨부 파일 확장자'; + + $lang->about_allowed_filesize = '관리자를 제외한 사용자는 정하신 용량만 첨부할 수 있습니다'; + $lang->about_allowed_filetypes = '관리자를 제외한 사용자는 정하신 확장자만 첨부할 수 있습니다.
( *.jpg;*.gif; 와 같이 정하시면 됩니다)'; $lang->cmd_delete_checked_file = '선택항목 삭제'; $lang->cmd_move_to_document = '문서로 이동'; diff --git a/modules/file/tpl/file_config.html b/modules/file/tpl/file_config.html new file mode 100644 index 000000000..542e71718 --- /dev/null +++ b/modules/file/tpl/file_config.html @@ -0,0 +1,26 @@ + + + +
+ + + + + + + + + + + + + + + + + + +
{$lang->allowed_filesize}MB
{$lang->about_allowed_filesize}
{$lang->allowed_filetypes}
{$lang->about_allowed_filetypes}
+ +
+
diff --git a/modules/file/tpl/filter/insert_config.xml b/modules/file/tpl/filter/insert_config.xml new file mode 100644 index 000000000..205c29d4f --- /dev/null +++ b/modules/file/tpl/filter/insert_config.xml @@ -0,0 +1,7 @@ + +
+ + + + + diff --git a/modules/file/tpl/header.html b/modules/file/tpl/header.html new file mode 100644 index 000000000..760529619 --- /dev/null +++ b/modules/file/tpl/header.html @@ -0,0 +1,6 @@ + + +
+ style="font-weight:bold">[{$lang->file_list}] + style="font-weight:bold">[{$lang->cmd_module_config}] +
diff --git a/modules/module/tpl/module_list.html b/modules/module/tpl/module_list.html index 88853b6c1..1fae2b7e9 100644 --- a/modules/module/tpl/module_list.html +++ b/modules/module/tpl/module_list.html @@ -22,7 +22,7 @@ - {$val->title}
({$val->module}) + {$val->title}
({$val->module}) {$val->title}
({$val->module})