git-svn-id: http://xe-core.googlecode.com/svn/trunk@1166 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-04-16 08:40:12 +00:00
parent f76be59f46
commit 8b610f5334
47 changed files with 1358 additions and 681 deletions

View file

@ -3,19 +3,11 @@
<actions>
<action name="dispLayoutAdminContent" type="view" admin_index="true" standalone="true" />
<action name="dispLayoutAdminInsert" type="view" standalone="true" />
<action name="dispLayoutAdminMenu" type="view" standalone="true" />
<action name="dispLayoutAdminDownloadedList" type="view" standalone="true" />
<action name="dispLayoutAdminInfo" type="view" standalone="true" />
<action name="dispLayoutAdminMidList" type="view" standalone="true" />
<action name="getLayoutAdminMenuTplInfo" type="model" standalone="true" />
<action name="procLayoutAdminInsert" type="controller" standalone="true" />
<action name="procLayoutAdminUpdate" type="controller" standalone="true" />
<action name="procLayoutAdminDelete" type="controller" standalone="true" />
<action name="procLayoutAdminInsertMenu" type="controller" standalone="true" />
<action name="procLayoutAdminDeleteMenu" type="controller" standalone="true" />
<action name="procLayoutAdminMakeXmlFile" type="controller" standalone="true" />
<action name="procLayoutAdminMoveMenu" type="controller" standalone="true" />
</actions>
</module>

View file

@ -8,44 +8,14 @@
$lang->cmd_layout_management = '레이아웃 설정';
$lang->layout_name = '레이아웃 이름';
$lang->menu_count = '메뉴의 수';
$lang->menu_management = '메뉴 관리';
$lang->depth = '단계';
$lang->parent_menu_name = '상위 메뉴명';
$lang->menu_name = '메뉴명';
$lang->menu_srl = '메뉴의 고유 번호';
$lang->menu_id = '메뉴의 이름';
$lang->menu_url = '연결 url';
$lang->menu_open_window = '새창 열기';
$lang->menu_expand = '펼침';
$lang->menu_img_btn = '이미지 버튼';
$lang->menu_normal_btn = '일반';
$lang->menu_hover_btn = '마우스오버';
$lang->menu_active_btn = '선택시';
$lang->menu_group_srls = '그룹 제한';
$lang->layout_maker = "레이아웃 제작자";
$lang->layout_history = "변경 사항 ";
$lang->layout_info = "레이아웃 정보";
$lang->layout_list = '레이아웃 목록';
$lang->downloaded_list = '다운로드 목록';
$lang->limit_menu_depth = '표시 가능';
$lang->cmd_make_child = '하부 메뉴 추가';
$lang->cmd_remake_cache = "캐시파일 재생성";
$lang->cmd_move_to_installed_list = "생성된 목록 보기";
$lang->cmd_enable_move_menu = "메뉴 옮기기 (선택후 위 메뉴를 드래그하세요)";
$lang->cmd_search_mid = "mid 찾기";
$lang->about_downloaded_layouts = "다운로드 되어 있는 레이아웃 목록";
$lang->about_title = '모듈에 연결시 쉽게 구분할 수 있는 제목을 입력해주세요';
$lang->about_menu_management = "메뉴관리는 선택하신 레이아웃에서 사용하는 메뉴를 구성할 수 있도록 합니다.\n정해진 단계까지 메뉴를 구성 가능하며 입력하신 메뉴를 클릭하시면 상세 정보를 입력할 수 있습니다.\n폴더그림을 클릭하시면 메뉴를 확장하실 수 있습니다.\n간혹 메뉴가 정상적으로 나타나지 않으면 \"캐시파일 재생성\" 버튼을 눌러서 정보를 갱신하세요.\n* 정해진 단계 이상의 메뉴는 제대로 표시되지 않을 수 있습니다.";
$lang->about_menu_name = '관리 및 이미지 버튼이 아닐경우 메뉴 명으로 나타날 제목입니다';
$lang->about_menu_url = "메뉴를 선택시 이동한 URL입니다.<br />다른 mid를 연결하고자 할때는 \"module=모듈명\" 또는 \"mid=모듈\"등으로<br />입력하시면 됩니다.<br />내용이 없을시 메뉴를 선택하여도 아무런 동작이 없게 됩니다.";
$lang->about_menu_open_window = '메뉴 선택시 새창으로 띄울 것인지를 정할 수 있습니다';
$lang->about_menu_expand = '트리메뉴(tree_menu.js)를 사용시 늘 펼쳐진 상태로 있게 합니다';
$lang->about_menu_img_btn = '이미지 버튼을 등록하시면 레이아웃에서 자동으로 이미지 버튼으로 교체되어 표시가 됩니다.';
$lang->about_menu_group_srls = '그룹을 선택하시면 해당 그룹의 사용자만 메뉴가 보이게 됩니다. (xml파일을 직접 열람하면 노출이 됩니다)';
$lang->msg_cannot_delete_for_child = '하부 메뉴가 있는 메뉴는 삭제하실 수 없습니다';
?>

View file

@ -15,20 +15,9 @@
$oModuleController = &getController('module');
$oModuleController->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');

View file

@ -67,13 +67,6 @@
}
}
// DB에서 삭제
// 레이아웃 메뉴 삭제
$args->layout_srl = $layout_srl;
$output = executeQuery("layout.deleteLayoutMenus", $args);
if(!$output->toBool()) return $output;
// 레이아웃 삭제
$output = executeQuery("layout.deleteLayout", $args);
if(!$output->toBool()) return $output;
@ -81,325 +74,5 @@
$this->setMessage('success_deleted');
}
/**
* @brief 레이아웃에 메뉴 추가
**/
function procLayoutAdminInsertMenu() {
// 입력할 변수 정리
$source_args = Context::getRequestVars();
unset($source_args->module);
unset($source_args->act);
if($source_args->menu_open_window!="Y") $source_args->menu_open_window = "N";
if($source_args->menu_expand !="Y") $source_args->menu_expand = "N";
$source_args->group_srls = str_replace('|@|',',',$source_args->group_srls);
$source_args->parent_srl = (int)$source_args->parent_srl;
// 변수를 다시 정리 (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_id = $source_args->menu_id;
$args->name = $source_args->menu_name;
$args->url = trim($source_args->menu_url);
$args->open_window = $source_args->menu_open_window;
$args->expand = $source_args->menu_expand;
$args->normal_btn = $source_args->menu_normal_btn;
$args->hover_btn = $source_args->menu_hover_btn;
$args->active_btn = $source_args->menu_active_btn;
$args->group_srls = $source_args->group_srls;
$layout = Context::get('layout');
// 이미 존재하는지를 확인
$oLayoutModel = &getModel('layout');
$menu_info = $oLayoutModel->getLayoutMenuInfo($args->menu_srl);
// 존재하게 되면 update를 해준다
if($menu_info->menu_srl == $args->menu_srl) {
$output = executeQuery('layout.updateLayoutMenu', $args);
if(!$output->toBool()) return $output;
// 존재하지 않으면 insert를 해준다
} else {
$args->listorder = -1*$args->menu_srl;
$output = executeQuery('layout.insertLayoutMenu', $args);
if(!$output->toBool()) return $output;
}
// 해당 메뉴의 정보를 구함
$layout_info = $oLayoutModel->getLayoutInfo($layout);
$menu_title = $layout_info->menu->{$args->menu_id}->name;
// XML 파일을 갱신하고 위치을 넘겨 받음
$xml_file = $this->makeXmlFile($args->layout_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 을 무조건 변경
if(eregi("^mid=", $args->url)) {
$target_args->layout_srl = $args->layout_srl;
$target_args->mid = substr($args->url,4);
$output = executeQuery("module.updateModuleLayout", $target_args);
if(!$output->toBool()) return $output;
}
}
/**
* @brief 레이아웃 메뉴 삭제
**/
function procLayoutAdminDeleteMenu() {
// 변수 정리
$args = Context::gets('layout_srl','layout','menu_srl','menu_id');
$oLayoutModel = &getModel('layout');
// 원정보를 가져옴
$node_info = $oLayoutModel->getLayoutMenuInfo($args->menu_srl);
if($node_info->parent_srl) $parent_srl = $node_info->parent_srl;
// 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력
$output = executeQuery('layout.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);
if(!$output->toBool()) return $output;
// 해당 메뉴의 정보를 구함
$layout_info = $oLayoutModel->getLayoutInfo($args->layout);
$menu_title = $layout_info->menu->{$args->menu_id}->name;
// XML 파일을 갱신하고 위치을 넘겨 받음
$xml_file = $this->makeXmlFile($args->layout_srl, $args->menu_id);
$this->add('xml_file', $xml_file);
$this->add('menu_id', $args->menu_id);
$this->add('menu_title', $menu_title);
$this->add('menu_srl', $parent_srl);
}
/**
* @brief 레이아웃의 메뉴를 이동
**/
function procLayoutAdminMoveMenu() {
// 변수 설정
$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);
// 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);
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);
if(!$output->toBool()) return $output;
// xml파일 재생성
$xml_file = $this->makeXmlFile($target_node->layout_srl, $menu_id);
// return 변수 설정
$this->add('menu_id', $menu_id);
$this->add('source_node_srl', Context::get('source_node_srl'));
}
/**
* @brief xml 파일을 갱신
* 관리자페이지에서 메뉴 구성 간혹 xml파일이 재생성 안되는 경우가 있는데\n
* 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n
* 개발 중간의 문제인 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능
**/
function procLayoutAdminMakeXmlFile() {
// 입력값을 체크
$menu_id = Context::get('menu_id');
$layout = Context::get('layout');
$layout_srl = Context::get('layout_srl');
// 해당 메뉴의 정보를 구함
$oLayoutModel = &getModel('layout');
$layout_info = $oLayoutModel->getLayoutInfo($layout);
$menu_title = $layout_info->menu->{$menu_id}->name;
// xml파일 재생성
$xml_file = $this->makeXmlFile($layout_srl, $menu_id);
// return 값 설정
$this->add('menu_id',$menu_id);
$this->add('menu_title',$menu_title);
$this->add('xml_file',$xml_file);
}
/**
* @brief 메뉴의 xml 파일을 만들고 위치를 return
**/
function makeXmlFile($layout_srl, $menu_id) {
// xml파일 생성시 필요한 정보가 없으면 그냥 return
if(!$layout_srl || !$menu_id) return;
// DB에서 layout_srl에 해당하는 메뉴 목록을 listorder순으로 구해옴
$args->layout_srl = $layout_srl;
$args->menu_id = $menu_id;
$output = executeQuery("layout.getLayoutMenuList", $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 파일만 생성
$list = $output->data;
if(!$list) {
$xml_buff = "<root />";
FileHandler::writeFile($xml_file, $xml_buff);
return $xml_file;
}
// 구해온 데이터가 하나라면 array로 바꾸어줌
if(!is_array($list)) $list = array($list);
// 루프를 돌면서 tree 구성
$list_count = count($list);
for($i=0;$i<$list_count;$i++) {
$node = $list[$i];
$menu_srl = $node->menu_srl;
$parent_srl = $node->parent_srl;
$tree[$parent_srl][$menu_srl] = $node;
}
// xml 캐시 파일 생성
$xml_buff = sprintf('<?php header("Content-Type: text/xml; charset=UTF-8"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); @session_start(); ?><root>%s</root>', $this->getXmlTree($tree[0], $tree));
// php 캐시 파일 생성
$php_output = $this->getPhpCacheCode($tree[0], $tree);
$php_buff = sprintf('<?php if(!defined("__ZBXE__")) exit(); $menu->list = array(%s); ?>', $php_output['buff']);
// 파일 저장
FileHandler::writeFile($xml_file, $xml_buff);
FileHandler::writeFile($php_file, $php_buff);
return $xml_file;
}
/**
* @brief array로 정렬된 노드들을 parent_srl을 참조하면서 recursive하게 돌면서 xml 데이터 생성
* 메뉴 xml파일은 node라는 tag가 중첩으로 사용되며 xml doc으로 관리자 페이지에서 메뉴를 구성해줌\n
* (tree_menu.js 에서 xml파일을 바로 읽고 tree menu를 구현)
**/
function getXmlTree($source_node, $tree) {
if(!$source_node) return;
foreach($source_node as $menu_srl => $node) {
$child_buff = "";
// 자식 노드의 데이터 가져옴
if($menu_srl&&$tree[$menu_srl]) $child_buff = $this->getXmlTree($tree[$menu_srl], $tree);
// 변수 정리
$name = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->name);
$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
$open_window = $node->open_window;
$expand = $node->expand;
$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
$group_srls = $node->group_srls;
// node->group_srls값이 있으면
if($group_srls) $group_check_code = sprintf('($_SESSION["is_admin"]==true||(is_array($_SESSION["group_srls"])&&count(array_intersect($_SESSION["group_srls"], array(%s)))))',$group_srls);
else $group_check_code = "true";
$attribute = sprintf(
'node_srl="%s" text=\'<?=(%s?"%s":"")?>\' url=\'<?=(%s?"%s":"")?>\' open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" ',
$menu_srl,
$group_check_code,
$name,
$group_check_code,
$url,
$open_window,
$expand,
$normal_btn,
$hover_btn,
$active_btn
);
if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
else $buff .= sprintf('<node %s />', $attribute);
}
return $buff;
}
/**
* @brief array로 정렬된 노드들을 php code로 변경하여 return
* 레이아웃에서 메뉴를 tpl에 사용시 xml데이터를 사용할 수도 있지만 별도의 javascript 사용이 필요하기에
* php로 캐시파일을 만들어서 db이용없이 바로 메뉴 정보를 구할 있도록 한다
* 캐시는 ModuleHandler::displayContent() 에서 include하여 Context::set() 한다
**/
function getPhpCacheCode($source_node, $tree) {
$output = array("buff"=>"", "url_list"=>array());
if(!$source_node) return $output;
foreach($source_node as $menu_srl => $node) {
// 자식 노드가 있으면 자식 노드의 데이터를 먼저 얻어옴
if($menu_srl&&$tree[$menu_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_srl], $tree);
else $child_output = array("buff"=>"", "url_list"=>array());
// 노드의 url에 ://가 있으면 바로 링크, 아니면 제로보드의 링크를 설정한다 ($node->href가 완성된 url)
if($node->url && !strpos($node->url, '://')) $node->href = "./?".$node->url;
else $node->href = $node->url;
// 현재 노드의 url값이 공란이 아니라면 url_list 배열값에 입력
if($node->url) $child_output['url_list'][] = $node->url;
$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
// node->group_srls값이 있으면
if($node->group_srls) $group_check_code = sprintf('($_SESSION["is_admin"]==true||(is_array($_SESSION["group_srls"])&&count(array_intersect($_SESSION["group_srls"], array(%s)))))',$node->group_srls);
else $group_check_code = "true";
// 변수 정리
$name = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->name);
$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
$open_window = $node->open_window;
$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
$selected = '"'.implode('","',$child_output['url_list']).'"';
$child_buff = $child_output['buff'];
// 속성을 생성한다 ( url_list를 이용해서 선택된 메뉴의 노드에 속하는지를 검사한다. 꽁수지만 빠르고 강력하다고 생각;;)
$attribute = sprintf(
'"node_srl"=>"%s","text"=>(%s?"%s":""),"href"=>(%s?"%s":""),"url"=>(%s?"%s":""),"open_window"=>"%s","normal_btn"=>"%s","hover_btn"=>"%s","active_btn"=>"%s","selected"=>(in_array(Context::get("zbxe_url"),array(%s))?1:0),"list"=>array(%s)',
$node->menu_srl,
$group_check_code,
$name,
$group_check_code,
$href,
$group_check_code,
$url,
$open_window,
$normal_btn,
$hover_btn,
$active_btn,
$selected,
$child_buff
);
// buff 데이터를 생성한다
$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_srl, $attribute);
}
return $output;
}
}
?>

View file

@ -14,55 +14,6 @@
function init() {
}
/**
* @brief 특정 menu_srl의 정보를 이용하여 템플릿을 구한후 return
* 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 html을 직접 return
**/
function getLayoutAdminMenuTplInfo() {
// 해당 메뉴의 정보를 가져오기 위한 변수 설정
$menu_id = Context::get('menu_id');
$menu_srl = Context::get('menu_srl');
$layuot = Context::get('layout');
$parent_srl = Context::get('parent_srl');
// 회원 그룹의 목록을 가져옴
$oMemberModel = &getModel('member');
$group_list = $oMemberModel->getGroups();
Context::set('group_list', $group_list);
// parent_srl이 있고 menu_srl이 없으면 하부 메뉴 추가임
if(!$menu_srl && $parent_srl) {
// 상위 메뉴의 정보를 가져옴
$parent_info = $this->getLayoutMenuInfo($parent_srl);
// 추가하려는 메뉴의 기본 변수 설정
$menu_info->menu_srl = getNextSequence();
$menu_info->parent_srl = $parent_srl;
$menu_info->parent_menu_name = $parent_info->name;
// root에 메뉴 추가하거나 기존 메뉴의 수정일 경우
} else {
// menu_srl 이 있으면 해당 메뉴의 정보를 가져온다
if($menu_srl) $menu_info = $this->getLayoutMenuInfo($menu_srl);
// 찾아진 값이 없다면 신규 메뉴 추가로 보고 menu_srl값만 구해줌
if(!$menu_info->menu_srl) {
$menu_info->menu_srl = getNextSequence();
}
}
Context::set('menu_info', $menu_info);
// template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다.
require_once("./classes/template/TemplateHandler.class.php");
$oTemplate = new TemplateHandler();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'layout_menu_info');
// return 할 변수 설정
$this->add('menu_id', $menu_id);
$this->add('tpl', $tpl);
}
/**
* @brief DB 생성된 레이아웃의 목록을 구함
* 생성되었다는 것은 DB에 등록이 되었다는 것을 의미
@ -218,20 +169,5 @@
return $layout_info;
}
/**
* @brief 특정 menu_srl의 정보를 return
* 정보중에 group_srls의 경우는 , 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴
**/
function getLayoutMenuInfo($menu_srl) {
// menu_srl 이 있으면 해당 메뉴의 정보를 가져온다
$args->menu_srl = $menu_srl;
$output = executeQuery('layout.getLayoutMenu', $args);
if(!$output->toBool()) return $output;
$node = $output->data;
if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
else $node->group_srls = array();
return $node;
}
}
?>

View file

@ -73,22 +73,6 @@
$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 레이아웃 목록을 보여줌
**/

View file

@ -1,8 +0,0 @@
<query id="deleteLayoutMenu" action="delete">
<tables>
<table name="layout_menu" />
</tables>
<conditions>
<condition operation="equal" column="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -1,8 +0,0 @@
<query id="deleteLayoutMenus" action="delete">
<tables>
<table name="layout_menu" />
</tables>
<conditions>
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -1,11 +0,0 @@
<query id="getChildMenuCount" action="select">
<tables>
<table name="layout_menu" />
</tables>
<columns>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="equal" column="parent_srl" var="menu_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -1,14 +0,0 @@
<query id="getLayoutMenu" action="select">
<tables>
<table name="layout_menu" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
</conditions>
<navigation>
<index var="sort_index" default="listorder" order="asc" />
</navigation>
</query>

View file

@ -1,15 +0,0 @@
<query id="getLayoutMenuList" action="select">
<tables>
<table name="layout_menu" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
<condition operation="equal" column="menu_id" var="menu_id" notnull="notnull" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="listorder" order="desc" />
</navigation>
</query>

View file

@ -1,21 +0,0 @@
<query id="insertLayoutMenu" action="insert">
<tables>
<table name="layout_menu" />
</tables>
<columns>
<column name="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
<column name="parent_srl" var="parent_srl" filter="number" default="0" />
<column name="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
<column name="menu_id" var="menu_id" filter="number" notnull="notnull" />
<column name="name" var="name" notnull="notnull" />
<column name="url" var="url" />
<column name="open_window" var="open_window" />
<column name="expand" var="expand" />
<column name="normal_btn" var="normal_btn" />
<column name="hover_btn" var="hover_btn" />
<column name="active_btn" var="active_btn" />
<column name="group_srls" var="group_srls" />
<column name="listorder" var="listorder" notnull="notnull" />
<column name="regdate" var="regdate" default="curdate()" />
</columns>
</query>

View file

@ -1,18 +0,0 @@
<query id="updateLayoutMenu" action="update">
<tables>
<table name="layout_menu" />
</tables>
<columns>
<column name="name" var="name" notnull="notnull" />
<column name="url" var="url" />
<column name="open_window" var="open_window" />
<column name="expand" var="expand" />
<column name="normal_btn" var="normal_btn" />
<column name="hover_btn" var="hover_btn" />
<column name="active_btn" var="active_btn" />
<column name="group_srls" var="group_srls" />
</columns>
<conditions>
<condition operation="equal" column="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -1,12 +0,0 @@
<query id="updateLayoutMenuParent" action="update">
<tables>
<table name="layout_menu" />
</tables>
<columns>
<column name="parent_srl" var="parent_srl" default="0" />
<column name="listorder" var="listorder" notnull="notnull" />
</columns>
<conditions>
<condition operation="equal" column="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -1,16 +0,0 @@
<table name="layout_menu">
<column name="menu_srl" type="number" size="12" notnull="notnull" primary_key="primary_key" />
<column name="parent_srl" type="number" size="12" notnull="notnull" default="0" />
<column name="layout_srl" type="number" size="12" notnull="notnull" index="idx_layout_menu" />
<column name="menu_id" type="varchar" size="250" notnull="notnull" index="idx_layout_menu" />
<column name="name" type="varchar" size="250" />
<column name="url" type="varchar" size="250" />
<column name="open_window" type="char" size="1" default="N" />
<column name="expand" type="char" size="1" default="N" />
<column name="normal_btn" type="varchar" size="255" />
<column name="hover_btn" type="varchar" size="255" />
<column name="active_btn" type="varchar" size="255" />
<column name="group_srls" type="text" />
<column name="listorder" type="number" size="11" default="0" inex="idx_listorder" />
<column name="regdate" type="date" index="idx_regdate" />
</table>

View file

@ -1,16 +0,0 @@
<filter name="delete_layout_menu" module="layout" act="procLayoutAdminDeleteMenu" confirm_msg_code="confirm_delete">
<form>
<node target="layout_srl" required="true" />
<node target="layout" required="true" />
<node target="menu_srl" required="true" />
<node target="menu_id" required="true" />
</form>
<response callback_func="completeInsertLayoutMenu">
<tag name="error" />
<tag name="message" />
<tag name="menu_srl" />
<tag name="xml_file" />
<tag name="menu_id" />
<tag name="menu_title" />
</response>
</filter>

View file

@ -1,17 +0,0 @@
<filter name="insert_layout_menu" module="layout" act="procLayoutAdminInsertMenu" confirm_msg_code="confirm_submit">
<form>
<node target="layout_srl" required="true" />
<node target="layout" required="true" />
<node target="menu_srl" required="true" />
<node target="menu_id" required="true" />
<node target="menu_name" required="true" />
</form>
<response callback_func="completeInsertLayoutMenu">
<tag name="error" />
<tag name="message" />
<tag name="menu_srl" />
<tag name="xml_file" />
<tag name="menu_id" />
<tag name="menu_title" />
</response>
</filter>

View file

@ -1,10 +0,0 @@
<filter name="move_layout_menu" module="layout" act="procLayoutAdminMoveMenu" confirm_msg_code="confirm_move">
<form />
<parameter />
<response callback_func="completeMoveLayoutMenu">
<tag name="error" />
<tag name="message" />
<tag name="menu_id" />
<tag name="source_node_srl" />
</response>
</filter>

View file

@ -5,19 +5,6 @@ function completeInsertLayout(ret_obj) {
location.href = url;
}
/* 레이아웃메뉴 입력후 */
function completeInsertLayoutMenu(ret_obj) {
var menu_id = ret_obj['menu_id'];
var xml_file = ret_obj['xml_file'];
var menu_title = ret_obj['menu_title'];
var menu_srl = ret_obj['menu_srl'];
if(!xml_file) return;
loadTreeMenu(xml_file, menu_id, "menu_zone_"+menu_id, menu_title, doGetMenuInfo, menu_srl, doMoveTree);
if(!menu_srl) xInnerHtml("menu_zone_info_"+menu_id, "");
}
/* 레이아웃 삭제 */
function doDeleteLayout(layout_srl) {
var fo_obj = xGetElementById("fo_layout");
@ -26,121 +13,3 @@ function doDeleteLayout(layout_srl) {
procFilter(fo_obj, delete_layout);
}
/* 레이아웃 메뉴 삭제 */
function doDeleteLayoutMenu(menu_srl, menu_id) {
var fo_obj = xGetElementById("fo_"+menu_id);
if(!fo_obj) return;
procFilter(fo_obj, delete_layout_menu);
}
/* 레이아웃 메뉴에를 클릭시 적용할 함수 */
function doGetMenuInfo(menu_id, obj) {
// layout, menu_id, node_srl을 추출
var fo_obj = xGetElementById("fo_layout");
var layout = fo_obj.layout.value;
var node_srl = 0;
var parent_srl = 0;
if(typeof(obj.getAttribute)!="undefined") {
node_srl = obj.getAttribute("node_srl");
} else {
node_srl = obj.node_srl;
parent_srl = obj.parent_srl;
}
var params = new Array();
params["menu_id"] = menu_id;
params["layout"] = layout;
params["menu_srl"] = node_srl;
params["parent_srl"] = parent_srl;
// 서버에 요청하여 해당 노드의 정보를 수정할 수 있도록 한다.
var response_tags = new Array('error','message','menu_id', 'tpl');
exec_xml('layout', 'getLayoutAdminMenuTplInfo', params, completeGetMenuInfo, response_tags, params);
}
/* 메뉴를 드래그하여 이동한 후 실행할 함수 , 이동하는 node_srl과 대상 node_srl을 받음 */
function doMoveTree(menu_id, source_node_srl, target_node_srl) {
var fo_obj = xGetElementById("fo_move_menu");
fo_obj.menu_id.value = menu_id;
fo_obj.source_node_srl.value = source_node_srl;
fo_obj.target_node_srl.value = target_node_srl;
// 이동 취소를 선택하였을 경우 다시 그림;;
if(!procFilter(fo_obj, move_layout_menu)) {
var params = new Array();
params["menu_id"] = menu_id;
params["source_node_srl"] = source_node_srl;
completeMoveLayoutMenu(params);
}
}
function completeMoveLayoutMenu(ret_obj) {
var menu_id = ret_obj['menu_id'];
var source_node_srl = ret_obj['source_node_srl'];
var fo_menu = xGetElementById("fo_"+menu_id);
if(!fo_menu) return;
var params = new Array();
params["menu_id"] = menu_id;
params["layout"] = fo_menu.layout.value;
params["layout_srl"] = fo_menu.layout_srl.value;
var xml_file = fo_menu.xml_file.value;
var menu_title = fo_menu.menu_title.value;
var tmp = source_node_srl.split('_');
var menu_srl = tmp[tmp.length-1];
loadTreeMenu(xml_file, menu_id, "menu_zone_"+menu_id, menu_title, doGetMenuInfo, menu_srl, doMoveTree);
}
/* 서버로부터 받아온 메뉴 정보를 출력 */
function completeGetMenuInfo(ret_obj, response_tags) {
var menu_id = ret_obj['menu_id'];
var tpl = ret_obj['tpl'];
xInnerHtml("menu_zone_info_"+menu_id, "");
xInnerHtml("menu_zone_info_"+menu_id, tpl);
var fo_obj = xGetElementById("fo_"+menu_id);
fo_obj.menu_name.focus();
}
/* 빈 메뉴 추가시 사용 */
function doInsertLayoutMenu(menu_id, parent_srl) {
if(typeof(parent_srl)=='undefined') parent_srl = 0;
var params = {node_srl:0, parent_srl:parent_srl}
doGetMenuInfo(menu_id, params);
deSelectNode();
}
/* 메뉴 목록 갱신 */
function doReloadTreeMenu(menu_id) {
var fo_obj = xGetElementById("fo_"+menu_id);
if(!fo_obj) return;
var params = new Array();
params["menu_id"] = menu_id;
params["layout"] = fo_obj.layout.value;
params["layout_srl"] = fo_obj.layout_srl.value;
// 서버에 요청하여 해당 노드의 정보를 수정할 수 있도록 한다.
var response_tags = new Array('error','message','menu_id', 'xml_file', 'menu_title');
exec_xml('layout', 'procLayoutAdminMakeXmlFile', params, completeInsertLayoutMenu, response_tags, params);
}
/* 레이아웃의 메뉴에 mid 추가 */
function doInsertMid(mid, menu_id) {
if(!opener) {
window.close();
return;
}
var fo_obj = opener.xGetElementById("fo_"+menu_id);
if(!fo_obj) {
window.close();
return;
}
fo_obj.menu_url.value = "mid="+mid;
window.close();
}

View file

@ -1,17 +1,7 @@
<!--%import("filter/update_layout_info.xml")-->
<!--%import("filter/insert_layout_menu.xml")-->
<!--%import("filter/delete_layout_menu.xml")-->
<!--%import("filter/move_layout_menu.xml")-->
<!--#include("header.html")-->
<!-- 메뉴 이동을 위해 임시로 사용하는 form -->
<form id="fo_move_menu" action="./" method="get">
<input type="hidden" name="menu_id" />
<input type="hidden" name="source_node_srl" />
<input type="hidden" name="target_node_srl" />
</form>
<div style="margin-bottom:10px;">
<table border="1" width="100%">
<col width="140" />
@ -84,46 +74,3 @@
</form>
</div>
<div style="margin-bottom:10px;">
<div>
<h4>{$lang->menu_management}</h4>
<h5>{nl2br($lang->about_menu_management)}</h5>
</div>
<!--@foreach($layout_info->menu as $menu_id => $menu)-->
<form id="fo_{$menu_id}" action="./" method="get" onsubmit="return procFilter(this, insert_layout_menu)">
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
<input type="hidden" name="layout" value="{$layout_info->layout}" />
<input type="hidden" name="menu_id" value="{$menu_id}" />
<input type="hidden" name="menu_title" value="{$menu->name}" />
<input type="hidden" name="xml_file" value="{$menu->xml_file}" />
<table border="1" width="100%">
<col width="300" />
<col width="*" />
<tr valign="top">
<td>
<div id="menu_zone_{$menu_id}"></div>
<div>
<input type="checkbox" id="{$menu_id}_enable_move" /> <label for="{$menu_id}_enable_move">{$lang->cmd_enable_move_menu}</label>
</div>
<div>
<input type="button" value="{$lang->cmd_insert}" onclick="doInsertLayoutMenu('{$menu_id}');return false;" />
<input type="button" value="{$lang->cmd_open_all}" onclick="openAllTreeMenu('{$menu_id}');return false;" />
<input type="button" value="{$lang->cmd_close_all}" onclick="closeAllTreeMenu('{$menu_id}');return false;" />
<input type="button" value="{$lang->cmd_remake_cache}" onclick="doReloadTreeMenu('{$menu_id}');return false;" />
</div>
</td>
<td>
<div id="menu_zone_info_{$menu_id}"></div>
</td>
</tr>
</table>
</form>
<script type="text/javascript">
loadTreeMenu("{$menu->xml_file}", "{$menu_id}", "menu_zone_{$menu_id}", "{$menu->name} ({$lang->limit_menu_depth} : {$menu->maxdepth} {$lang->depth})", doGetMenuInfo, 0, doMoveTree);
</script>
<br />
<!--@end-->
</div>

View file

@ -1,80 +0,0 @@
<input type="hidden" name="menu_srl" value="{$menu_info->menu_srl}" />
<input type="hidden" name="parent_srl" value="{$menu_info->parent_srl}" />
<table border="1" width="100%">
<col width="100" />
<col width="*" />
<!--@if($menu_info->parent_menu_name)-->
<tr>
<th>{$lang->parent_menu_name}</th>
<td>{$menu_info->parent_menu_name}</td>
</tr>
<!--@end-->
<tr>
<th rowspan="2">{$lang->menu_name}</th>
<td><input type="text" name="menu_name" value="{htmlspecialchars($menu_info->name)}" /></td>
</tr>
<tr>
<td>{$lang->about_menu_name}</td>
</tr>
<tr>
<th rowspan="2">{$lang->menu_url}</th>
<td><input type="text" name="menu_url" value="{htmlspecialchars($menu_info->url)}" /><input type="button" value="{$lang->cmd_search_mid}" onclick="popopen('{getUrl('module','layout','act','dispLayoutAdminMidList','menu_id', $menu_id)}');return false;"/></td>
</tr>
<tr>
<td>{$lang->about_menu_url}</td>
</tr>
<tr>
<th rowspan="2">{$lang->menu_open_window}</th>
<td><input type="checkbox" name="menu_open_window" value="Y" <!--@if($menu_info->open_window=="Y")-->checked="true"<!--@end--> /></td>
</tr>
<tr>
<td>{$lang->about_menu_open_window}</td>
</tr>
<tr>
<th rowspan="2">{$lang->menu_expand}</th>
<td><input type="checkbox" name="menu_expand" value="Y" <!--@if($menu_info->expand=="Y")-->checked="true"<!--@end--> /></td>
</tr>
<tr>
<td>{$lang->about_menu_expand}</td>
</tr>
<tr>
<th>{$lang->menu_img_btn}</th>
<td>{$lang->about_menu_img_btn}</td>
</tr>
<tr>
<td>{$lang->menu_normal_btn}</td>
<td><input type="text" name="menu_normal_btn" value="{htmlspecialchars($menu_info->normal_btn)}" /></td>
</tr>
<tr>
<td>{$lang->menu_hover_btn}</td>
<td><input type="text" name="menu_hover_btn" value="{htmlspecialchars($menu_info->hover_btn)}" /></td>
</tr>
<tr>
<td>{$lang->menu_active_btn}</td>
<td><input type="text" name="menu_active_btn" value="{htmlspecialchars($menu_info->active_btn)}" /></td>
</tr>
<tr>
<th rowspan="2">{$lang->menu_group_srls}</th>
<td>
<!--@foreach($group_list as $key=>$val)-->
<input type="checkbox" name="group_srls" value="{$key}" id="group_{$key}" <!--@if(in_array($key, $menu_info->group_srls))-->checked="true"<!--@end-->/>
<label for="group_{$key}">{$val->title}</label>
<!--@end-->
</td>
</tr>
<tr>
<td>{$lang->about_menu_group_srls}</td>
</tr>
<tr>
<td colspan="2">
<!--@if($menu_info->name)-->
<input type="submit" value="{$lang->cmd_save}" />
<input type="button" value="{$lang->cmd_make_child}" onclick="doInsertLayoutMenu('{$menu_info->menu_id}','{$menu_info->menu_srl}');return false" />
<input type="button" value="{$lang->cmd_delete}" onclick="doDeleteLayoutMenu('{$menu_srl}','{$menu_info->menu_id}');return false" />
<!--@else-->
<input type="submit" value="{$lang->cmd_submit}" />
<!--@end-->
</td>
</tr>
</table>

View file

@ -1,19 +0,0 @@
<!--%import("js/layout_admin.js")-->
<div style="width:400px">
<table border="1" width="400">
<tr>
<th>{$lang->mid}</th>
<th>{$lang->title}</th>
<th>{$lang->cmd_select}</th>
</tr>
<tbody>
<!--@foreach($mid_list as $key => $val)-->
<tr>
<td>{$key}</td>
<td>{$val->browser_title}</td>
<td><a href="#" onclick="doInsertMid('{$key}','{$menu_id}'); return false;">{$lang->cmd_select}</a></td>
</tr>
<!--@end-->
</tbody>
</table>
</div>