diff --git a/modules/admin/admin.model.php b/modules/admin/admin.model.php index 0aa352ef6..a8628f6b9 100644 --- a/modules/admin/admin.model.php +++ b/modules/admin/admin.model.php @@ -13,55 +13,5 @@ function init() { } - /** - * @brief 모듈의 종류와 정보를 구함 - **/ - function getModuleList() { - // module model 객체 생성 - $oModuleModel = &getModel('module'); - - // DB 객체 생성 - $oDB = &DB::getInstance(); - - // 다운받은 모듈과 설치된 모듈의 목록을 구함 - $downloaded_list = FileHandler::readDir('./files/modules'); - $installed_list = FileHandler::readDir('./modules'); - $searched_list = array_merge($downloaded_list, $installed_list); - $searched_count = count($searched_list); - if(!$searched_count) return; - - for($i=0;$i<$searched_count;$i++) { - // 모듈의 이름 - $module_name = $searched_list[$i]; - - // 모듈의 경로 (files/modules가 우선) - $path = ModuleHandler::getModulePath($module_name); - - // schemas내의 테이블 생성 xml파일수를 구함 - $tmp_files = FileHandler::readDir($path."schemas"); - $table_count = count($tmp_files); - - // 테이블이 설치되어 있는지 체크 - $created_table_count = 0; - for($j=0;$jisTableExists($table_name)) $created_table_count ++; - } - - // 해당 모듈의 정보를 구함 - $info = $oModuleModel->getModuleInfoXml($module_name); - unset($obj); - - $info->module = $module_name; - $info->created_table_count = $created_table_count; - $info->table_count = $table_count; - $info->path = $path; - $info->admin_index_act = $info->admin_index_act; - - $list[] = $info; - } - return $list; - } - } ?> diff --git a/modules/admin/admin.view.php b/modules/admin/admin.view.php index 8c5fd3249..2f46703ab 100644 --- a/modules/admin/admin.view.php +++ b/modules/admin/admin.view.php @@ -66,12 +66,12 @@ * @brief 모듈의 목록을 보여줌 **/ function dispModuleList() { - // 모듈 목록을 세팅 - $oAdminModel = &getModel('admin'); - $module_list = $oAdminModel->getModuleList(); - Context::set('module_list', $module_list); + // moduleView::dispModuleList()를 실행하고 템플릿 파일을 구해옴 + $oModuleView = &getView('module'); + $oModuleView->dispModuleList(); - $this->setTemplateFile('module_list'); + $this->setTemplatePath($oModuleView->getTemplatePath()); + $this->setTemplateFile($oModuleView->getTemplateFile()); } /** diff --git a/modules/admin/tpl/module_list.html b/modules/admin/tpl/module_list.html deleted file mode 100644 index eb047fe7c..000000000 --- a/modules/admin/tpl/module_list.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
{$lang->module_name}{$lang->version}{$lang->author}{$lang->date}{$lang->table_count}{$lang->installed_path}
- - {$val->title}
({$val->module}) - - {$val->title}
- ({$val->module}) - -
{$val->version}{$val->author->name}{$val->author->date} - - - - - - {$val->created_table_count}/{$val->table_count} - - {$val->path}
- {nl2br($val->author->description)} -
diff --git a/modules/module/lang/ko.lang.php b/modules/module/lang/ko.lang.php index f26196766..118c3cb28 100644 --- a/modules/module/lang/ko.lang.php +++ b/modules/module/lang/ko.lang.php @@ -4,4 +4,8 @@ * @author zero (zero@nzeo.com) * @brief 한국어 언어팩 **/ + + $lang->module_list = "모듈 목록"; + $lang->module_config = "설정"; + ?> diff --git a/modules/module/module.model.php b/modules/module/module.model.php index a9310ff23..36d1742a6 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -392,5 +392,52 @@ return $output->data; } + /** + * @brief 모듈의 종류와 정보를 구함 + **/ + function getModuleList() { + // DB 객체 생성 + $oDB = &DB::getInstance(); + + // 다운받은 모듈과 설치된 모듈의 목록을 구함 + $downloaded_list = FileHandler::readDir('./files/modules'); + $installed_list = FileHandler::readDir('./modules'); + $searched_list = array_merge($downloaded_list, $installed_list); + $searched_count = count($searched_list); + if(!$searched_count) return; + + for($i=0;$i<$searched_count;$i++) { + // 모듈의 이름 + $module_name = $searched_list[$i]; + + // 모듈의 경로 (files/modules가 우선) + $path = ModuleHandler::getModulePath($module_name); + + // schemas내의 테이블 생성 xml파일수를 구함 + $tmp_files = FileHandler::readDir($path."schemas"); + $table_count = count($tmp_files); + + // 테이블이 설치되어 있는지 체크 + $created_table_count = 0; + for($j=0;$jisTableExists($table_name)) $created_table_count ++; + } + + // 해당 모듈의 정보를 구함 + $info = $this->getModuleInfoXml($module_name); + unset($obj); + + $info->module = $module_name; + $info->created_table_count = $created_table_count; + $info->table_count = $table_count; + $info->path = $path; + $info->admin_index_act = $info->admin_index_act; + + $list[] = $info; + } + return $list; + } + } ?> diff --git a/modules/module/module.view.php b/modules/module/module.view.php index 9d72f60b1..17419e8c5 100644 --- a/modules/module/module.view.php +++ b/modules/module/module.view.php @@ -16,19 +16,25 @@ } /** - * @brief 모듈 관리자의 index + * @brief 모듈 관리자 페이지 **/ function dispContent() { - // 모듈모델 객체를 구함 - $oModuleModel = &getModel('module'); - - // 등록된 모듈의 목록을 구해옴 - //$installed_module_list = $oModuleModel->getModulesInfo(); - Context::set('installed_module_list', $installed_module_list); - // 템플릿 파일 지정 $this->setTemplateFile('index'); } + /** + * @brief 모듈 목록 출력 + **/ + function dispModuleList() { + // 모듈 목록을 구해서 + $oModuleModel = &getModel('module'); + $module_list = $oModuleModel->getModuleList(); + Context::set('module_list', $module_list); + + // 템플릿 파일 지정 + $this->setTemplateFile('module_list'); + } + } ?> diff --git a/modules/module/tpl.admin/admin_index.html b/modules/module/tpl.admin/config.html similarity index 99% rename from modules/module/tpl.admin/admin_index.html rename to modules/module/tpl.admin/config.html index f444bf7c1..34846c829 100644 --- a/modules/module/tpl.admin/admin_index.html +++ b/modules/module/tpl.admin/config.html @@ -1,4 +1,5 @@ +
diff --git a/modules/module/tpl.admin/header.html b/modules/module/tpl.admin/header.html new file mode 100644 index 000000000..5ea158aa1 --- /dev/null +++ b/modules/module/tpl.admin/header.html @@ -0,0 +1,4 @@ +
+ style="font-weight:bold">[{$lang->module_list}] + style="font-weight:bold">[{$lang->module_config}] +
diff --git a/modules/module/tpl.admin/index.html b/modules/module/tpl.admin/index.html index ca3cd2939..ede2ff9be 100644 --- a/modules/module/tpl.admin/index.html +++ b/modules/module/tpl.admin/index.html @@ -1,20 +1,41 @@ -
+ +
- - - - - - + + + + + + - + - - - - - - + + + + + + + + +
{$lang->no}{$lang->module_name}{$lang->module_version}{$lang->module_table_count}{$lang->module_installed_path}{$lang->author}{$lang->module_name}{$lang->version}{$lang->author}{$lang->date}{$lang->table_count}{$lang->installed_path}
{$no+1}{$module_obj->title}{$module_obj->version}{$module_obj->created_table_count} / {$module_obj->table_count}{$module_obj->path}{$module_obj->author->name} + + {$val->title}
({$val->module}) + + {$val->title}
+ ({$val->module}) + +
{$val->version}{$val->author->name}{$val->author->date} + + + + + + {$val->created_table_count}/{$val->table_count} + + {$val->path}
+ {nl2br($val->author->description)} +