diff --git a/layouts/sample_blog/layout.html b/layouts/sample_blog/layout.html index f1b17c9f3..671ee368d 100644 --- a/layouts/sample_blog/layout.html +++ b/layouts/sample_blog/layout.html @@ -47,7 +47,7 @@
- {$lang->cmd_layout_management} + {$lang->cmd_layout_management}
diff --git a/layouts/sample_layout_js_menu/layout.html b/layouts/sample_layout_js_menu/layout.html index 39eba088a..36c328303 100644 --- a/layouts/sample_layout_js_menu/layout.html +++ b/layouts/sample_layout_js_menu/layout.html @@ -61,7 +61,7 @@ xe_layout_menu['bottom_menu'][1][{$first_key}] = { "text":"{htmlspecialchars($fi
- {$lang->cmd_layout_management} + {$lang->cmd_layout_management}
diff --git a/layouts/sample_layout_php_menu/layout.html b/layouts/sample_layout_php_menu/layout.html index 99d7d0ddb..bf22f69eb 100644 --- a/layouts/sample_layout_php_menu/layout.html +++ b/layouts/sample_layout_php_menu/layout.html @@ -70,7 +70,7 @@
- {$lang->cmd_layout_management} + {$lang->cmd_layout_management}
diff --git a/modules/admin/admin.class.php b/modules/admin/admin.class.php index 767bb573f..341917383 100644 --- a/modules/admin/admin.class.php +++ b/modules/admin/admin.class.php @@ -16,11 +16,12 @@ $oAdminController->insertShortCut('board'); $oAdminController->insertShortCut('page'); - $oAdminController->insertShortCut('member'); - $oAdminController->insertShortCut('module'); + $oAdminController->insertShortCut('menu'); $oAdminController->insertShortCut('layout'); $oAdminController->insertShortCut('addon'); $oAdminController->insertShortCut('plugin'); + $oAdminController->insertShortCut('member'); + $oAdminController->insertShortCut('module'); return new Object(); } diff --git a/modules/layout/conf/module.xml b/modules/layout/conf/module.xml index d43f47355..372f4ea09 100644 --- a/modules/layout/conf/module.xml +++ b/modules/layout/conf/module.xml @@ -3,7 +3,9 @@ + + diff --git a/modules/layout/layout.class.php b/modules/layout/layout.class.php index d5abe6f1b..b8b1349ac 100644 --- a/modules/layout/layout.class.php +++ b/modules/layout/layout.class.php @@ -15,6 +15,7 @@ $oModuleController = &getController('module'); $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminContent'); $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInsert'); + $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminModify'); $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminDownloadedList'); $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInfo'); diff --git a/modules/layout/layout.view.php b/modules/layout/layout.view.php index bf9df2297..9c74ce318 100644 --- a/modules/layout/layout.view.php +++ b/modules/layout/layout.view.php @@ -41,7 +41,7 @@ /** * @brief 레이아웃 세부 정보 입력 **/ - function dispLayoutAdminMenu() { + function dispLayoutAdminModify() { // 선택된 레이아웃의 정보르 구해서 세팅 $layout_srl = Context::get('layout_srl'); @@ -54,7 +54,19 @@ Context::set('layout_info', $layout_info); - $this->setTemplateFile('layout_info'); + $this->setTemplateFile('layout_modify'); + } + + /** + * @brief 레이아웃 목록을 보여줌 + **/ + function dispLayoutAdminDownloadedList() { + // 레이아웃 목록을 세팅 + $oLayoutModel = &getModel('layout'); + $layout_list = $oLayoutModel->getDownloadedLayoutList(); + Context::set('layout_list', $layout_list); + + $this->setTemplateFile('downloaded_layout_list'); } /** @@ -72,17 +84,5 @@ // 템플릿 파일 지정 $this->setTemplateFile('layout_detail_info'); } - - /** - * @brief 레이아웃 목록을 보여줌 - **/ - function dispLayoutAdminDownloadedList() { - // 레이아웃 목록을 세팅 - $oLayoutModel = &getModel('layout'); - $layout_list = $oLayoutModel->getDownloadedLayoutList(); - Context::set('layout_list', $layout_list); - - $this->setTemplateFile('downloaded_layout_list'); - } } ?> diff --git a/modules/layout/tpl/index.html b/modules/layout/tpl/index.html index 5c7f4dfb9..5dcc2be58 100644 --- a/modules/layout/tpl/index.html +++ b/modules/layout/tpl/index.html @@ -26,7 +26,7 @@ {$no+1} {$val->layout} - {htmlspecialchars($val->title)} + {htmlspecialchars($val->title)} {zdate($val->regdate,"Y-m-d")} {$lang->cmd_delete} diff --git a/modules/layout/tpl/js/layout_admin.js b/modules/layout/tpl/js/layout_admin.js index ef266da91..13b0a8f3b 100644 --- a/modules/layout/tpl/js/layout_admin.js +++ b/modules/layout/tpl/js/layout_admin.js @@ -1,7 +1,7 @@ /* 레이아웃 신규 생성시 완료 후 요청하는 함수 */ function completeInsertLayout(ret_obj) { var layout_srl = ret_obj['layout_srl']; - var url = location.href.setQuery('act','dispLayoutAdminMenu').setQuery('layout_srl',layout_srl); + var url = location.href.setQuery('act','dispLayoutAdminModify').setQuery('layout_srl',layout_srl); location.href = url; } diff --git a/modules/layout/tpl/layout_info.html b/modules/layout/tpl/layout_modify.html similarity index 95% rename from modules/layout/tpl/layout_info.html rename to modules/layout/tpl/layout_modify.html index bd01c16c4..2bbf682cd 100644 --- a/modules/layout/tpl/layout_info.html +++ b/modules/layout/tpl/layout_modify.html @@ -34,9 +34,12 @@ - {$lang->title} + {$lang->title} + + {$lang->about_title} + {$var->name} diff --git a/modules/menu/conf/module.xml b/modules/menu/conf/module.xml index a1c06d53f..bbe0a1ee5 100644 --- a/modules/menu/conf/module.xml +++ b/modules/menu/conf/module.xml @@ -3,7 +3,6 @@ - diff --git a/modules/menu/layout.class.php b/modules/menu/layout.class.php deleted file mode 100644 index 16524b231..000000000 --- a/modules/menu/layout.class.php +++ /dev/null @@ -1,52 +0,0 @@ -insertActionForward('layout', 'view', 'dispLayoutAdminContent'); - $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInsert'); - $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminMenu'); - $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminDownloadedList'); - $oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInfo'); - - //$oModuleController->insertActionForward('layout', 'model', 'getLayoutAdminMenuTplInfo'); - - //$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminInsert'); - //$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminUpdate'); - //$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminDelete'); - //$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminInsertMenu'); - //$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminDeleteMenu'); - //$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminMakeXmlFile'); - //$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminMoveMenu'); - - // 레이아웃에서 사용할 디렉토리 생성 - FileHandler::makeDir('./files/cache/layout'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function moduleIsInstalled() { - return new Object(); - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - return new Object(); - } - } -?> diff --git a/modules/menu/layout.view.php b/modules/menu/layout.view.php deleted file mode 100644 index 9a84aea91..000000000 --- a/modules/menu/layout.view.php +++ /dev/null @@ -1,104 +0,0 @@ -setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 레이아웃 관리의 첫 페이지 - **/ - function dispLayoutAdminContent() { - $oLayoutModel = &getModel('layout'); - $layout_list = $oLayoutModel->getLayoutList(); - Context::set('layout_list', $layout_list); - - $this->setTemplateFile('index'); - } - - /** - * @brief 레이아웃 등록 페이지 - * 1차적으로 레이아웃만 선택한 후 DB 에 빈 값을 넣고 그 후 상세 값 설정하는 단계를 거침 - **/ - function dispLayoutAdminInsert() { - // 레이아웃 목록을 세팅 - $oLayoutModel = &getModel('layout'); - $layout_list = $oLayoutModel->getDownloadedLayoutList(); - Context::set('layout_list', $layout_list); - - $this->setTemplateFile('insert_layout'); - } - - /** - * @brief 레이아웃 세부 정보 입력 - **/ - function dispLayoutAdminMenu() { - // 선택된 레이아웃의 정보르 구해서 세팅 - $layout_srl = Context::get('layout_srl'); - - // 레이아웃의 정보를 가져옴 - $oLayoutModel = &getModel('layout'); - $layout_info = $oLayoutModel->getLayout($layout_srl); - - // 등록된 레이아웃이 없으면 오류 표시 - if(!$layout_info) return $this->dispLayoutAdminContent(); - - Context::set('layout_info', $layout_info); - - $this->setTemplateFile('layout_info'); - } - - /** - * @brief 레이아웃의 상세 정보(conf/info.xml)를 팝업 출력 - **/ - function dispLayoutAdminInfo() { - // 선택된 레이아웃 정보를 구함 - $oLayoutModel = &getModel('layout'); - $layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout')); - Context::set('layout_info', $layout_info); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('layout_detail_info'); - } - - /** - * @brief 레이아웃에서 선택할 수 있는 mid목록을 보여줌 - **/ - function dispLayoutAdminMidList() { - // mid 목록을 구해옴 - $oModuleModel = &getModel('module'); - $mid_list = $oModuleModel->getMidList(); - Context::set('mid_list', $mid_list); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('mid_list'); - } - - /** - * @brief 레이아웃 목록을 보여줌 - **/ - function dispLayoutAdminDownloadedList() { - // 레이아웃 목록을 세팅 - $oLayoutModel = &getModel('layout'); - $layout_list = $oLayoutModel->getDownloadedLayoutList(); - Context::set('layout_list', $layout_list); - - $this->setTemplateFile('downloaded_layout_list'); - } - } -?> diff --git a/modules/menu/menu.class.php b/modules/menu/menu.class.php new file mode 100644 index 000000000..866d09e8f --- /dev/null +++ b/modules/menu/menu.class.php @@ -0,0 +1,39 @@ +insertActionForward('menu', 'view', 'dispMenuAdminContent'); + $oModuleController->insertActionForward('menu', 'view', 'dispMenuAdminInsert'); + + // 레이아웃에서 사용할 디렉토리 생성 + FileHandler::makeDir('./files/cache/menu'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function moduleIsInstalled() { + return new Object(); + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + return new Object(); + } + } +?> diff --git a/modules/menu/layout.controller.php b/modules/menu/menu.controller.php similarity index 72% rename from modules/menu/layout.controller.php rename to modules/menu/menu.controller.php index 34edfcf06..d2ce7f325 100644 --- a/modules/menu/layout.controller.php +++ b/modules/menu/menu.controller.php @@ -1,11 +1,11 @@ layout_srl = getNextSequence(); - $args->layout = Context::get('layout'); - $args->title = Context::get('title'); - - $output = executeQuery("layout.insertLayout", $args); - if(!$output->toBool()) return $output; - - $this->add('layout_srl', $args->layout_srl); - } /** - * @brief 레이아웃 정보 변경 - * 생성된 레이아웃의 제목과 확장변수(extra_vars)를 적용한다 - **/ - function procLayoutAdminUpdate() { - // module, act, layout_srl, layout, title을 제외하면 확장변수로 판단.. 좀 구리다.. - $extra_vars = Context::getRequestVars(); - unset($extra_vars->module); - unset($extra_vars->act); - unset($extra_vars->layout_srl); - unset($extra_vars->layout); - unset($extra_vars->title); - - // DB에 입력하기 위한 변수 설정 - $args = Context::gets('layout_srl','title'); - $args->extra_vars = serialize($extra_vars); - - $output = executeQuery('layout.updateLayout', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_updated'); - } - - /** - * @brief 레이아웃 삭제 + * @brief 메뉴 삭제 * 삭제시 메뉴 xml 캐시 파일도 삭제 **/ - function procLayoutAdminDelete() { - $layout_srl = Context::get('layout_srl'); + function procMenuAdminDelete() { + $menu_srl = Context::get('menu_srl'); // 캐시 파일 삭제 - $cache_list = FileHandler::readDir("./files/cache/layout","",false,true); + $cache_list = FileHandler::readDir("./files/cache/menu","",false,true); if(count($cache_list)) { foreach($cache_list as $cache_file) { - $pos = strpos($cache_file, $layout_srl.'_'); + $pos = strpos($cache_file, $menu_srl.'_'); if($pos>0) unlink($cache_file); } } // DB에서 삭제 - // 레이아웃 메뉴 삭제 - $args->layout_srl = $layout_srl; - $output = executeQuery("layout.deleteLayoutMenus", $args); + // 메뉴 메뉴 삭제 + $args->menu_srl = $menu_srl; + $output = executeQuery("menu.deleteMenuMenus", $args); if(!$output->toBool()) return $output; - // 레이아웃 삭제 - $output = executeQuery("layout.deleteLayout", $args); + // 메뉴 삭제 + $output = executeQuery("menu.deleteMenu", $args); if(!$output->toBool()) return $output; $this->setMessage('success_deleted'); } /** - * @brief 레이아웃에 메뉴 추가 + * @brief 메뉴에 메뉴 추가 **/ - function procLayoutAdminInsertMenu() { + function procMenuAdminInsertMenu() { // 입력할 변수 정리 $source_args = Context::getRequestVars(); unset($source_args->module); @@ -97,7 +60,7 @@ // 변수를 다시 정리 (form문의 column과 DB column이 달라서) $args->menu_srl = $source_args->menu_srl; $args->parent_srl = $source_args->parent_srl; - $args->layout_srl = $source_args->layout_srl; + $args->menu_srl = $source_args->menu_srl; $args->menu_id = $source_args->menu_id; $args->name = $source_args->menu_name; $args->url = trim($source_args->menu_url); @@ -108,73 +71,73 @@ $args->active_btn = $source_args->menu_active_btn; $args->group_srls = $source_args->group_srls; - $layout = Context::get('layout'); + $menu = Context::get('menu'); // 이미 존재하는지를 확인 - $oLayoutModel = &getModel('layout'); - $menu_info = $oLayoutModel->getLayoutMenuInfo($args->menu_srl); + $oMenuModel = &getModel('menu'); + $menu_info = $oMenuModel->getMenuMenuInfo($args->menu_srl); // 존재하게 되면 update를 해준다 if($menu_info->menu_srl == $args->menu_srl) { - $output = executeQuery('layout.updateLayoutMenu', $args); + $output = executeQuery('menu.updateMenuMenu', $args); if(!$output->toBool()) return $output; // 존재하지 않으면 insert를 해준다 } else { $args->listorder = -1*$args->menu_srl; - $output = executeQuery('layout.insertLayoutMenu', $args); + $output = executeQuery('menu.insertMenuMenu', $args); if(!$output->toBool()) return $output; } // 해당 메뉴의 정보를 구함 - $layout_info = $oLayoutModel->getLayoutInfo($layout); - $menu_title = $layout_info->menu->{$args->menu_id}->name; + $menu_info = $oMenuModel->getMenuInfo($menu); + $menu_title = $menu_info->menu->{$args->menu_id}->name; // XML 파일을 갱신하고 위치을 넘겨 받음 - $xml_file = $this->makeXmlFile($args->layout_srl, $args->menu_id); + $xml_file = $this->makeXmlFile($args->menu_srl, $args->menu_id); $this->add('xml_file', $xml_file); $this->add('menu_srl', $args->menu_srl); $this->add('menu_id', $args->menu_id); $this->add('menu_title', $menu_title); - // 현재 mid에 해당하는 모듈의 layout_srl 을 무조건 변경 + // 현재 mid에 해당하는 모듈의 menu_srl 을 무조건 변경 if(eregi("^mid=", $args->url)) { - $target_args->layout_srl = $args->layout_srl; + $target_args->menu_srl = $args->menu_srl; $target_args->mid = substr($args->url,4); - $output = executeQuery("module.updateModuleLayout", $target_args); + $output = executeQuery("module.updateModuleMenu", $target_args); if(!$output->toBool()) return $output; } } /** - * @brief 레이아웃 메뉴 삭제 + * @brief 메뉴 메뉴 삭제 **/ - function procLayoutAdminDeleteMenu() { + function procMenuAdminDeleteMenu() { // 변수 정리 - $args = Context::gets('layout_srl','layout','menu_srl','menu_id'); + $args = Context::gets('menu_srl','menu','menu_srl','menu_id'); - $oLayoutModel = &getModel('layout'); + $oMenuModel = &getModel('menu'); // 원정보를 가져옴 - $node_info = $oLayoutModel->getLayoutMenuInfo($args->menu_srl); + $node_info = $oMenuModel->getMenuMenuInfo($args->menu_srl); if($node_info->parent_srl) $parent_srl = $node_info->parent_srl; // 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력 - $output = executeQuery('layout.getChildMenuCount', $args); + $output = executeQuery('menu.getChildMenuCount', $args); if(!$output->toBool()) return $output; if($output->data->count>0) return new Object(-1, msg_cannot_delete_for_child); // DB에서 삭제 - $output = executeQuery("layout.deleteLayoutMenu", $args); + $output = executeQuery("menu.deleteMenuMenu", $args); if(!$output->toBool()) return $output; // 해당 메뉴의 정보를 구함 - $layout_info = $oLayoutModel->getLayoutInfo($args->layout); - $menu_title = $layout_info->menu->{$args->menu_id}->name; + $menu_info = $oMenuModel->getMenuInfo($args->menu); + $menu_title = $menu_info->menu->{$args->menu_id}->name; // XML 파일을 갱신하고 위치을 넘겨 받음 - $xml_file = $this->makeXmlFile($args->layout_srl, $args->menu_id); + $xml_file = $this->makeXmlFile($args->menu_srl, $args->menu_id); $this->add('xml_file', $xml_file); $this->add('menu_id', $args->menu_id); @@ -183,34 +146,34 @@ } /** - * @brief 레이아웃의 메뉴를 이동 + * @brief 메뉴의 메뉴를 이동 **/ - function procLayoutAdminMoveMenu() { + function procMenuAdminMoveMenu() { // 변수 설정 $menu_id = Context::get('menu_id'); $source_node_srl = str_replace('menu_'.$menu_id.'_','',Context::get('source_node_srl')); $target_node_srl = str_replace('menu_'.$menu_id.'_','',Context::get('target_node_srl')); // target_node 의 값을 구함 - $oLayoutModel = &getModel('layout'); - $target_node = $oLayoutModel->getLayoutMenuInfo($target_node_srl); + $oMenuModel = &getModel('menu'); + $target_node = $oMenuModel->getMenuMenuInfo($target_node_srl); // source_node에 target_node_srl의 parent_srl, listorder 값을 입력 $source_args->menu_srl = $source_node_srl; $source_args->parent_srl = $target_node->parent_srl; $source_args->listorder = $target_node->listorder; - $output = executeQuery('layout.updateLayoutMenuParent', $source_args); + $output = executeQuery('menu.updateMenuMenuParent', $source_args); if(!$output->toBool()) return $output; // target_node의 listorder값을 +1해 준다 $target_args->menu_srl = $target_node_srl; $target_args->parent_srl = $target_node->parent_srl; $target_args->listorder = $target_node->listorder -1; - $output = executeQuery('layout.updateLayoutMenuParent', $target_args); + $output = executeQuery('menu.updateMenuMenuParent', $target_args); if(!$output->toBool()) return $output; // xml파일 재생성 - $xml_file = $this->makeXmlFile($target_node->layout_srl, $menu_id); + $xml_file = $this->makeXmlFile($target_node->menu_srl, $menu_id); // return 변수 설정 $this->add('menu_id', $menu_id); @@ -223,19 +186,19 @@ * 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n * 개발 중간의 문제인 것 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능 **/ - function procLayoutAdminMakeXmlFile() { + function procMenuAdminMakeXmlFile() { // 입력값을 체크 $menu_id = Context::get('menu_id'); - $layout = Context::get('layout'); - $layout_srl = Context::get('layout_srl'); + $menu = Context::get('menu'); + $menu_srl = Context::get('menu_srl'); // 해당 메뉴의 정보를 구함 - $oLayoutModel = &getModel('layout'); - $layout_info = $oLayoutModel->getLayoutInfo($layout); - $menu_title = $layout_info->menu->{$menu_id}->name; + $oMenuModel = &getModel('menu'); + $menu_info = $oMenuModel->getMenuInfo($menu); + $menu_title = $menu_info->menu->{$menu_id}->name; // xml파일 재생성 - $xml_file = $this->makeXmlFile($layout_srl, $menu_id); + $xml_file = $this->makeXmlFile($menu_srl, $menu_id); // return 값 설정 $this->add('menu_id',$menu_id); @@ -246,19 +209,19 @@ /** * @brief 메뉴의 xml 파일을 만들고 위치를 return **/ - function makeXmlFile($layout_srl, $menu_id) { + function makeXmlFile($menu_srl, $menu_id) { // xml파일 생성시 필요한 정보가 없으면 그냥 return - if(!$layout_srl || !$menu_id) return; + if(!$menu_srl || !$menu_id) return; - // DB에서 layout_srl에 해당하는 메뉴 목록을 listorder순으로 구해옴 - $args->layout_srl = $layout_srl; + // DB에서 menu_srl에 해당하는 메뉴 목록을 listorder순으로 구해옴 + $args->menu_srl = $menu_srl; $args->menu_id = $menu_id; - $output = executeQuery("layout.getLayoutMenuList", $args); + $output = executeQuery("menu.getMenuMenuList", $args); if(!$output->toBool()) return; // 캐시 파일의 이름을 지정 - $xml_file = sprintf("./files/cache/layout/%s_%s.xml.php", $layout_srl, $menu_id); - $php_file = sprintf("./files/cache/layout/%s_%s.php", $layout_srl, $menu_id); + $xml_file = sprintf("./files/cache/menu/%s_%s.xml.php", $menu_srl, $menu_id); + $php_file = sprintf("./files/cache/menu/%s_%s.php", $menu_srl, $menu_id); // 구해온 데이터가 없다면 노드데이터가 없는 xml 파일만 생성 $list = $output->data; @@ -342,7 +305,7 @@ /** * @brief array로 정렬된 노드들을 php code로 변경하여 return - * 레이아웃에서 메뉴를 tpl에 사용시 xml데이터를 사용할 수도 있지만 별도의 javascript 사용이 필요하기에 + * 메뉴에서 메뉴를 tpl에 사용시 xml데이터를 사용할 수도 있지만 별도의 javascript 사용이 필요하기에 * php로 된 캐시파일을 만들어서 db이용없이 바로 메뉴 정보를 구할 수 있도록 한다 * 이 캐시는 ModuleHandler::displayContent() 에서 include하여 Context::set() 한다 **/ diff --git a/modules/menu/layout.model.php b/modules/menu/menu.model.php similarity index 53% rename from modules/menu/layout.model.php rename to modules/menu/menu.model.php index f98714eee..1ab14f590 100644 --- a/modules/menu/layout.model.php +++ b/modules/menu/menu.model.php @@ -1,12 +1,12 @@ getLayoutMenuInfo($parent_srl); + $parent_info = $this->getMenuMenuInfo($parent_srl); // 추가하려는 메뉴의 기본 변수 설정 $menu_info->menu_srl = getNextSequence(); @@ -43,7 +43,7 @@ // root에 메뉴 추가하거나 기존 메뉴의 수정일 경우 } else { // menu_srl 이 있으면 해당 메뉴의 정보를 가져온다 - if($menu_srl) $menu_info = $this->getLayoutMenuInfo($menu_srl); + if($menu_srl) $menu_info = $this->getMenuMenuInfo($menu_srl); // 찾아진 값이 없다면 신규 메뉴 추가로 보고 menu_srl값만 구해줌 if(!$menu_info->menu_srl) { @@ -56,7 +56,7 @@ // template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다. require_once("./classes/template/TemplateHandler.class.php"); $oTemplate = new TemplateHandler(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'layout_menu_info'); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'menu_info'); // return 할 변수 설정 $this->add('menu_id', $menu_id); @@ -64,11 +64,11 @@ } /** - * @brief DB 에 생성된 레이아웃의 목록을 구함 + * @brief DB 에 생성된 메뉴의 목록을 구함 * 생성되었다는 것은 DB에 등록이 되었다는 것을 의미 **/ - function getLayoutList() { - $output = executeQuery('layout.getLayoutList'); + function getMenuList() { + $output = executeQuery('menu.getMenuList'); if(!$output->data) return; if(is_array($output->data)) return $output->data; @@ -76,53 +76,53 @@ } /** - * @brief DB 에 생성된 한개의 레이아웃 정보를 구함 - * 생성된 레이아웃의 DB정보+XML정보를 return + * @brief DB 에 생성된 한개의 메뉴 정보를 구함 + * 생성된 메뉴의 DB정보+XML정보를 return **/ - function getLayout($layout_srl) { + function getMenu($menu_srl) { // 일단 DB에서 정보를 가져옴 - $args->layout_srl = $layout_srl; - $output = executeQuery('layout.getLayout', $args); + $args->menu_srl = $menu_srl; + $output = executeQuery('menu.getMenu', $args); if(!$output->data) return; - // layout, extra_vars를 정리한 후 xml 파일 정보를 불러옴 (불러올때 결합) + // menu, extra_vars를 정리한 후 xml 파일 정보를 불러옴 (불러올때 결합) $info = $output->data; - $layout_title = $info->title; - $layout = $info->layout; + $menu_title = $info->title; + $menu = $info->menu; $vars = unserialize($info->extra_vars); - return $this->getLayoutInfo($layout, $layout_srl, $layout_title, $vars); + return $this->getMenuInfo($menu, $menu_srl, $menu_title, $vars); } /** - * @brief 레이아웃의 경로를 구함 + * @brief 메뉴의 경로를 구함 **/ - function getLayoutPath($layout_name) { - $class_path = sprintf('./layouts/%s/', $layout_name); + function getMenuPath($menu_name) { + $class_path = sprintf('./menus/%s/', $menu_name); if(is_dir($class_path)) return $class_path; return ""; } /** - * @brief 레이아웃의 종류와 정보를 구함 - * 다운로드되어 있는 레이아웃의 종류 (생성과 다른 의미) + * @brief 메뉴의 종류와 정보를 구함 + * 다운로드되어 있는 메뉴의 종류 (생성과 다른 의미) **/ - function getDownloadedLayoutList() { - // 다운받은 레이아웃과 설치된 레이아웃의 목록을 구함 - $searched_list = FileHandler::readDir('./layouts'); + function getDownloadedMenuList() { + // 다운받은 메뉴과 설치된 메뉴의 목록을 구함 + $searched_list = FileHandler::readDir('./menus'); $searched_count = count($searched_list); if(!$searched_count) return; - // 찾아진 레이아웃 목록을 loop돌면서 필요한 정보를 간추려 return + // 찾아진 메뉴 목록을 loop돌면서 필요한 정보를 간추려 return for($i=0;$i<$searched_count;$i++) { - // 레이아웃의 이름 - $layout = $searched_list[$i]; + // 메뉴의 이름 + $menu = $searched_list[$i]; - // 해당 레이아웃의 정보를 구함 - $layout_info = $this->getLayoutInfo($layout); + // 해당 메뉴의 정보를 구함 + $menu_info = $this->getMenuInfo($menu); - $list[] = $layout_info; + $list[] = $menu_info; } return $list; } @@ -131,59 +131,59 @@ * @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함 * 이것 역시 캐싱을 통해서 xml parsing 시간을 줄인다.. **/ - function getLayoutInfo($layout, $layout_srl = 0, $layout_title = "", $vars = null) { + function getMenuInfo($menu, $menu_srl = 0, $menu_title = "", $vars = null) { // 요청된 모듈의 경로를 구한다. 없으면 return - $layout_path = $this->getLayoutPath($layout); - if(!$layout_path) return; + $menu_path = $this->getMenuPath($menu); + if(!$menu_path) return; // 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음 - $xml_file = sprintf("%sconf/info.xml", $layout_path); + $xml_file = sprintf("%sconf/info.xml", $menu_path); if(!file_exists($xml_file)) return; - // cache 파일을 비교하여 문제 없으면 include하고 $layout_info 변수를 return - $cache_file = sprintf('./files/cache/layout/%s.%s.cache.php', $layout, Context::getLangType()); + // cache 파일을 비교하여 문제 없으면 include하고 $menu_info 변수를 return + $cache_file = sprintf('./files/cache/menu/%s.%s.cache.php', $menu, Context::getLangType()); if(file_exists($cache_file)&&filectime($cache_file)>filectime($xml_file)) { include $cache_file; - return $layout_info; + return $menu_info; } // cache 파일이 없으면 xml parsing하고 변수화 한 후에 캐시 파일에 쓰고 변수 바로 return $oXmlParser = new XmlParser(); $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); - $xml_obj = $tmp_xml_obj->layout; + $xml_obj = $tmp_xml_obj->menu; if(!$xml_obj) return; $buff = ''; - // 레이아웃의 제목, 버전 - $buff .= sprintf('$layout_info->layout = "%s";', $layout); - $buff .= sprintf('$layout_info->path = "%s";', $layout_path); - $buff .= sprintf('$layout_info->title = "%s";', $xml_obj->title->body); - $buff .= sprintf('$layout_info->version = "%s";', $xml_obj->attrs->version); - $buff .= sprintf('$layout_info->layout_srl = $layout_srl;'); - $buff .= sprintf('$layout_info->layout_title = $layout_title;'); + // 메뉴의 제목, 버전 + $buff .= sprintf('$menu_info->menu = "%s";', $menu); + $buff .= sprintf('$menu_info->path = "%s";', $menu_path); + $buff .= sprintf('$menu_info->title = "%s";', $xml_obj->title->body); + $buff .= sprintf('$menu_info->version = "%s";', $xml_obj->attrs->version); + $buff .= sprintf('$menu_info->menu_srl = $menu_srl;'); + $buff .= sprintf('$menu_info->menu_title = $menu_title;'); // 작성자 정보 - $buff .= sprintf('$layout_info->author->name = "%s";', $xml_obj->author->name->body); - $buff .= sprintf('$layout_info->author->email_address = "%s";', $xml_obj->author->attrs->email_address); - $buff .= sprintf('$layout_info->author->homepage = "%s";', $xml_obj->author->attrs->link); - $buff .= sprintf('$layout_info->author->date = "%s";', $xml_obj->author->attrs->date); - $buff .= sprintf('$layout_info->author->description = "%s";', $xml_obj->author->description->body); + $buff .= sprintf('$menu_info->author->name = "%s";', $xml_obj->author->name->body); + $buff .= sprintf('$menu_info->author->email_address = "%s";', $xml_obj->author->attrs->email_address); + $buff .= sprintf('$menu_info->author->homepage = "%s";', $xml_obj->author->attrs->link); + $buff .= sprintf('$menu_info->author->date = "%s";', $xml_obj->author->attrs->date); + $buff .= sprintf('$menu_info->author->description = "%s";', $xml_obj->author->description->body); // 추가 변수 (템플릿에서 사용할 제작자 정의 변수) if(!is_array($xml_obj->extra_vars->var)) $extra_vars[] = $xml_obj->extra_vars->var; else $extra_vars = $xml_obj->extra_vars->var; $extra_var_count = count($extra_vars); - $buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count); + $buff .= sprintf('$menu_info->extra_var_count = "%s";', $extra_var_count); for($i=0;$i<$extra_var_count;$i++) { unset($var); unset($options); $var = $extra_vars[$i]; - $buff .= sprintf('$layout_info->extra_var->%s->name = "%s";', $var->attrs->id, $var->name->body); - $buff .= sprintf('$layout_info->extra_var->%s->type = "%s";', $var->attrs->id, $var->type->body); - $buff .= sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $var->attrs->id, $var->attrs->id); - $buff .= sprintf('$layout_info->extra_var->%s->description = "%s";', $var->attrs->id, str_replace('"','\"',$var->description->body)); + $buff .= sprintf('$menu_info->extra_var->%s->name = "%s";', $var->attrs->id, $var->name->body); + $buff .= sprintf('$menu_info->extra_var->%s->type = "%s";', $var->attrs->id, $var->type->body); + $buff .= sprintf('$menu_info->extra_var->%s->value = $vars->%s;', $var->attrs->id, $var->attrs->id); + $buff .= sprintf('$menu_info->extra_var->%s->description = "%s";', $var->attrs->id, str_replace('"','\"',$var->description->body)); $options = $var->options; if(!$options) continue; @@ -191,7 +191,7 @@ if(!is_array($options)) $options = array($options); $options_count = count($options); for($j=0;$j<$options_count;$j++) { - $buff .= sprintf('$layout_info->extra_var->%s->options["%s"] = "%s";', $var->attrs->id, $options[$j]->value->body, $options[$j]->name->body); + $buff .= sprintf('$menu_info->extra_var->%s->options["%s"] = "%s";', $var->attrs->id, $options[$j]->value->body, $options[$j]->name->body); } } @@ -200,32 +200,32 @@ else $menus = $xml_obj->menus->menu; $menu_count = count($menus); - $buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count); + $buff .= sprintf('$menu_info->menu_count = "%s";', $menu_count); for($i=0;$i<$menu_count;$i++) { $id = $menus[$i]->attrs->id; - if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $id); - $buff .= sprintf('$layout_info->menu->{%s}->id = "%s";',$id, $menus[$i]->attrs->id); - $buff .= sprintf('$layout_info->menu->{%s}->name = "%s";',$id, $menus[$i]->name->body); - $buff .= sprintf('$layout_info->menu->{%s}->maxdepth = "%s";',$id, $menus[$i]->maxdepth->body); - $buff .= sprintf('$layout_info->menu->{%s}->xml_file = "./files/cache/layout/".$layout_srl."_%s.xml.php";',$id, $id); - $buff .= sprintf('$layout_info->menu->{%s}->php_file = "./files/cache/layout/".$layout_srl."_%s.php";',$id, $id); + if($menus[$i]->attrs->default == "true") $buff .= sprintf('$menu_info->default_menu = "%s";', $id); + $buff .= sprintf('$menu_info->menu->{%s}->id = "%s";',$id, $menus[$i]->attrs->id); + $buff .= sprintf('$menu_info->menu->{%s}->name = "%s";',$id, $menus[$i]->name->body); + $buff .= sprintf('$menu_info->menu->{%s}->maxdepth = "%s";',$id, $menus[$i]->maxdepth->body); + $buff .= sprintf('$menu_info->menu->{%s}->xml_file = "./files/cache/menu/".$menu_srl."_%s.xml.php";',$id, $id); + $buff .= sprintf('$menu_info->menu->{%s}->php_file = "./files/cache/menu/".$menu_srl."_%s.php";',$id, $id); } $buff = ''; FileHandler::writeFile($cache_file, $buff); if(file_exists($cache_file)) include $cache_file; - return $layout_info; + return $menu_info; } /** * @brief 특정 menu_srl의 정보를 return * 이 정보중에 group_srls의 경우는 , 로 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴 **/ - function getLayoutMenuInfo($menu_srl) { + function getMenuMenuInfo($menu_srl) { // menu_srl 이 있으면 해당 메뉴의 정보를 가져온다 $args->menu_srl = $menu_srl; - $output = executeQuery('layout.getLayoutMenu', $args); + $output = executeQuery('menu.getMenuMenu', $args); if(!$output->toBool()) return $output; $node = $output->data; diff --git a/modules/menu/menu.view.php b/modules/menu/menu.view.php new file mode 100644 index 000000000..e3d00cb4f --- /dev/null +++ b/modules/menu/menu.view.php @@ -0,0 +1,91 @@ +setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 메뉴 관리의 첫 페이지 + **/ + function dispMenuAdminContent() { + $oMenuModel = &getModel('menu'); + $menu_list = $oMenuModel->getMenuList(); + Context::set('menu_list', $menu_list); + + $this->setTemplateFile('index'); + } + + /** + * @brief 메뉴 등록/수정 페이지 + **/ + function dispMenuAdminInsert() { + // 선택된 메뉴의 정보르 구해서 세팅 + $menu_srl = Context::get('menu_srl'); + + // 메뉴의 정보를 가져옴 + $oMenuModel = &getModel('menu'); + $menu_info = $oMenuModel->getMenu($menu_srl); + + // 등록된 메뉴이 없으면 오류 표시 + if(!$menu_info) return $this->dispMenuAdminContent(); + + Context::set('menu_info', $menu_info); + + $this->setTemplateFile('menu_info'); + } + + /** + * @brief 메뉴의 상세 정보(conf/info.xml)를 팝업 출력 + **/ + function dispMenuAdminInfo() { + // 선택된 메뉴 정보를 구함 + $oMenuModel = &getModel('menu'); + $menu_info = $oMenuModel->getMenuInfo(Context::get('selected_menu')); + Context::set('menu_info', $menu_info); + + // 메뉴을 팝업으로 지정 + $this->setMenuFile('popup_menu'); + + // 템플릿 파일 지정 + $this->setTemplateFile('menu_detail_info'); + } + + /** + * @brief 메뉴에서 선택할 수 있는 mid목록을 보여줌 + **/ + function dispMenuAdminMidList() { + // mid 목록을 구해옴 + $oModuleModel = &getModel('module'); + $mid_list = $oModuleModel->getMidList(); + Context::set('mid_list', $mid_list); + + // 메뉴을 팝업으로 지정 + $this->setMenuFile('popup_menu'); + + // 템플릿 파일 지정 + $this->setTemplateFile('mid_list'); + } + + /** + * @brief 메뉴 목록을 보여줌 + **/ + function dispMenuAdminDownloadedList() { + // 메뉴 목록을 세팅 + $oMenuModel = &getModel('menu'); + $menu_list = $oMenuModel->getDownloadedMenuList(); + Context::set('menu_list', $menu_list); + + $this->setTemplateFile('downloaded_menu_list'); + } + } +?> diff --git a/modules/menu/queries/deleteLayoutMenu.xml b/modules/menu/queries/deleteLayoutMenu.xml index 77a6c6fdb..98842b5ee 100644 --- a/modules/menu/queries/deleteLayoutMenu.xml +++ b/modules/menu/queries/deleteLayoutMenu.xml @@ -1,6 +1,6 @@ - +
diff --git a/modules/menu/queries/deleteLayoutMenus.xml b/modules/menu/queries/deleteLayoutMenus.xml index 5501567ce..b46ce1ba3 100644 --- a/modules/menu/queries/deleteLayoutMenus.xml +++ b/modules/menu/queries/deleteLayoutMenus.xml @@ -1,6 +1,6 @@ -
+
diff --git a/modules/menu/queries/getChildMenuCount.xml b/modules/menu/queries/getChildMenuCount.xml index 65262e538..afe8a8c92 100644 --- a/modules/menu/queries/getChildMenuCount.xml +++ b/modules/menu/queries/getChildMenuCount.xml @@ -1,6 +1,6 @@ -
+
diff --git a/modules/menu/queries/getLayoutMenu.xml b/modules/menu/queries/getLayoutMenu.xml index 959ce8714..809a04c1d 100644 --- a/modules/menu/queries/getLayoutMenu.xml +++ b/modules/menu/queries/getLayoutMenu.xml @@ -1,6 +1,6 @@ -
+
diff --git a/modules/menu/queries/getLayoutMenuList.xml b/modules/menu/queries/getLayoutMenuList.xml index 7cc5fd119..35151deba 100644 --- a/modules/menu/queries/getLayoutMenuList.xml +++ b/modules/menu/queries/getLayoutMenuList.xml @@ -1,6 +1,6 @@ -
+
diff --git a/modules/menu/queries/insertLayoutMenu.xml b/modules/menu/queries/insertLayoutMenu.xml index 47891e916..c415fc887 100644 --- a/modules/menu/queries/insertLayoutMenu.xml +++ b/modules/menu/queries/insertLayoutMenu.xml @@ -1,6 +1,6 @@ -
+
diff --git a/modules/menu/queries/updateLayoutMenu.xml b/modules/menu/queries/updateLayoutMenu.xml index d90b8edaf..d4a0f7808 100644 --- a/modules/menu/queries/updateLayoutMenu.xml +++ b/modules/menu/queries/updateLayoutMenu.xml @@ -1,6 +1,6 @@ -
+
diff --git a/modules/menu/queries/updateLayoutMenuParent.xml b/modules/menu/queries/updateLayoutMenuParent.xml index bf5650406..433524db1 100644 --- a/modules/menu/queries/updateLayoutMenuParent.xml +++ b/modules/menu/queries/updateLayoutMenuParent.xml @@ -1,6 +1,6 @@ -
+
diff --git a/modules/menu/schemas/layout_menu.xml b/modules/menu/schemas/menu.xml similarity index 97% rename from modules/menu/schemas/layout_menu.xml rename to modules/menu/schemas/menu.xml index 170c98588..9166f94c6 100644 --- a/modules/menu/schemas/layout_menu.xml +++ b/modules/menu/schemas/menu.xml @@ -1,4 +1,4 @@ -
+
diff --git a/modules/menu/tpl/downloaded_layout_list.html b/modules/menu/tpl/downloaded_layout_list.html deleted file mode 100644 index 3231995c4..000000000 --- a/modules/menu/tpl/downloaded_layout_list.html +++ /dev/null @@ -1,39 +0,0 @@ - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$lang->layout_name}{$lang->version}{$lang->author}{$lang->menu_count}{$lang->date}{$lang->path}{$lang->layout_info}{$lang->cmd_make}
- {$val->title}
- ({$val->layout}) -
{$val->version}{$val->author->name}{$val->menu_count}{$val->author->date}{$val->path}{$lang->cmd_view}{$lang->cmd_make}
- {nl2br($val->author->description)} -
- diff --git a/modules/menu/tpl/filter/delete_layout.xml b/modules/menu/tpl/filter/delete_layout.xml deleted file mode 100644 index 1e2961876..000000000 --- a/modules/menu/tpl/filter/delete_layout.xml +++ /dev/null @@ -1,9 +0,0 @@ - -
- - - - - - -
diff --git a/modules/menu/tpl/filter/insert_layout.xml b/modules/menu/tpl/filter/insert_layout.xml deleted file mode 100644 index 9b5b52c1a..000000000 --- a/modules/menu/tpl/filter/insert_layout.xml +++ /dev/null @@ -1,14 +0,0 @@ - -
- - - - - - - - - - - -
diff --git a/modules/menu/tpl/filter/update_layout_info.xml b/modules/menu/tpl/filter/update_layout_info.xml deleted file mode 100644 index 1cf5f5dc6..000000000 --- a/modules/menu/tpl/filter/update_layout_info.xml +++ /dev/null @@ -1,9 +0,0 @@ - -
- - - - - - -
diff --git a/modules/menu/tpl/header.html b/modules/menu/tpl/header.html deleted file mode 100644 index c905d679f..000000000 --- a/modules/menu/tpl/header.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -
- style="font-weight:bold">[{$lang->layout_list}] - style="font-weight:bold">[{$lang->downloaded_list}] -
- diff --git a/modules/menu/tpl/insert_layout.html b/modules/menu/tpl/insert_layout.html deleted file mode 100644 index 50a4ef471..000000000 --- a/modules/menu/tpl/insert_layout.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - -
-
- - - - - - - - - - - - - - - -
{$lang->layout_name} - -
{$lang->title}
{$lang->about_title}
- - -
-
-
diff --git a/modules/menu/tpl/layout_detail_info.html b/modules/menu/tpl/layout_detail_info.html deleted file mode 100644 index 7bff986fa..000000000 --- a/modules/menu/tpl/layout_detail_info.html +++ /dev/null @@ -1,56 +0,0 @@ - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$lang->layout_maker}
{$lang->title}{$layout_info->title} ver {$layout_info->version}
{$lang->author}{$layout_info->author->name}
{$lang->homepage}{$layout_info->author->homepage}
{$lang->regdate}{$layout_info->author->date}
{$lang->description}{nl2br($layout_info->author->description)}
{$lang->layout_history}
{$lang->name}{$history->name}
{$lang->homepage}{$history->homepage}
{$lang->regdate}{$history->date}
{$lang->description}{nl2br($history->description)}
- {$lang->cmd_close} -
diff --git a/modules/menu/tpl/layout_info.html b/modules/menu/tpl/layout_info.html index 085b2c146..04e984b88 100644 --- a/modules/menu/tpl/layout_info.html +++ b/modules/menu/tpl/layout_info.html @@ -1,4 +1,3 @@ - @@ -12,79 +11,6 @@ -
- - - - - - - - - - - - - - - - - - - -
{$lang->layout}{$layout_info->title} ver {$layout_info->version} ({$layout_info->layout})
{$lang->path}{$layout_info->path}
{$lang->author}{$layout_info->author->name}
{$lang->description}{nl2br($layout_info->author->description)}
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$lang->title}
{$var->name} - -
{$var->description}
- - - - - - -
- -
-
-

{$lang->menu_management}

@@ -97,7 +23,7 @@ - + @@ -122,7 +48,7 @@

diff --git a/modules/menu/tpl/layout_menu_info.html b/modules/menu/tpl/menu_info.html similarity index 95% rename from modules/menu/tpl/layout_menu_info.html rename to modules/menu/tpl/menu_info.html index bd7121438..1e24cf2e9 100644 --- a/modules/menu/tpl/layout_menu_info.html +++ b/modules/menu/tpl/menu_info.html @@ -19,7 +19,7 @@ {$lang->menu_url} - + {$lang->about_menu_url}