diff --git a/classes/plugin/Plugin.class.php b/classes/plugin/Plugin.class.php
index cf3e18f6a..8146c6b52 100644
--- a/classes/plugin/Plugin.class.php
+++ b/classes/plugin/Plugin.class.php
@@ -8,13 +8,6 @@
class Plugin extends Object {
- /**
- * @brief constructor
- **/
- function Plugin($addon_name) {
- }
-
-
}
?>
diff --git a/config/config.inc.php b/config/config.inc.php
index b3e18ff9e..3a499b961 100644
--- a/config/config.inc.php
+++ b/config/config.inc.php
@@ -48,10 +48,9 @@
require_once("./classes/db/DB.class.php");
require_once("./classes/file/FileHandler.class.php");
require_once("./classes/object/Object.class.php");
+ require_once("./classes/module/Plugin.class.php");
require_once("./classes/module/ModuleObject.class.php");
require_once("./classes/module/ModuleHandler.class.php");
require_once("./classes/display/DisplayHandler.class.php");
- //require_once("./classes/addon/AddOnHandler.class.php");
- //require_once("./classes/layout/LayoutHandler.class.php");
if(__DEBUG__) define('__RequireClassEndTime__', getMicroTime());
?>
diff --git a/modules/plugin/conf/info.xml b/modules/plugin/conf/info.xml
new file mode 100644
index 000000000..830bd046d
--- /dev/null
+++ b/modules/plugin/conf/info.xml
@@ -0,0 +1,11 @@
+
+
+ 레이아웃 관리
+ layout management
+
+ 제로
+ zero
+ 레이아웃 관리 모듈
+ layout management
+
+
diff --git a/modules/plugin/conf/module.xml b/modules/plugin/conf/module.xml
new file mode 100644
index 000000000..9cb787b0d
--- /dev/null
+++ b/modules/plugin/conf/module.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/lang/ko.lang.php b/modules/plugin/lang/ko.lang.php
new file mode 100644
index 000000000..da489c7db
--- /dev/null
+++ b/modules/plugin/lang/ko.lang.php
@@ -0,0 +1,51 @@
+
+ * @brief 레이아웃(layout) 모듈의 기본 언어팩
+ **/
+ $lang->cmd_make_child = '하부 메뉴 추가';
+
+ $lang->layout = '레이아웃';
+ $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->cmd_move_to_installed_list = "생성된 목록 보기";
+
+ $lang->cmd_enable_move_menu = "메뉴 옮기기";
+
+ $lang->about_downloaded_layouts = "다운로드 되어 있는 레이아웃 목록";
+ $lang->about_title = '모듈에 연결시 쉽게 구분할 수 있는 제목을 입력해주세요';
+ $lang->about_menu_management = "메뉴관리는 선택하신 레이아웃에서 사용하는 메뉴를 구성할 수 있도록 합니다.\n정해진 단계까지 메뉴를 구성 가능하며 입력하신 메뉴를 클릭하시면 상세 정보를 입력할 수 있습니다.\n폴더그림을 클릭하시면 메뉴를 확장하실 수 있습니다.\n간혹 메뉴가 정상적으로 나타나지 않으면 \"캐시파일 재생성\" 버튼을 눌러서 정보를 갱신하세요.\n* 정해진 단계 이상의 메뉴는 제대로 표시되지 않을 수 있습니다.";
+
+ $lang->about_menu_name = '관리 및 이미지 버튼이 아닐경우 메뉴 명으로 나타날 제목입니다';
+ $lang->about_menu_url = "메뉴를 선택시 이동한 URL입니다.
다른 모듈을 설치하시고자 할때는 \"module=모듈명\" 또는 \"mid=모듈\"등으로
입력하시면 됩니다.
내용이 없을시 메뉴를 선택하여도 아무런 동작이 없게 됩니다.";
+ $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 = '하부 메뉴가 있는 메뉴는 삭제하실 수 없습니다';
+?>
diff --git a/modules/plugin/layout.class.php b/modules/plugin/layout.class.php
new file mode 100644
index 000000000..91a3e50eb
--- /dev/null
+++ b/modules/plugin/layout.class.php
@@ -0,0 +1,43 @@
+
diff --git a/modules/plugin/layout.controller.php b/modules/plugin/layout.controller.php
new file mode 100644
index 000000000..64f0f6d04
--- /dev/null
+++ b/modules/plugin/layout.controller.php
@@ -0,0 +1,415 @@
+layout_srl = $oDB->getNextSequence();
+ $args->layout = Context::get('layout');
+ $args->title = Context::get('title');
+
+ $output = $oDB->executeQuery("layout.insertLayout", $args);
+ if(!$output->toBool()) return $output;
+
+ $this->add('layout_srl', $args->layout_srl);
+ }
+
+ /**
+ * @brief 레이아웃 정보 변경
+ * 생성된 레이아웃의 제목과 확장변수(extra_vars)를 적용한다
+ **/
+ function procUpdateLayout() {
+ // 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);
+
+ $oDB = &DB::getInstance();
+ $output = $oDB->executeQuery('layout.updateLayout', $args);
+ if(!$output->toBool()) return $output;
+
+ $this->setMessage('success_updated');
+ }
+
+ /**
+ * @brief 레이아웃 삭제
+ * 삭제시 메뉴 xml 캐시 파일도 삭제
+ **/
+ function procDeleteLayout() {
+ $layout_srl = Context::get('layout_srl');
+
+ // 캐시 파일 삭제
+ $cache_list = FileHandler::readDir("./files/cache/layout","",false,true);
+ if(count($cache_list)) {
+ foreach($cache_list as $cache_file) {
+ $pos = strpos($cache_file, $layout_srl.'_');
+ if($pos>0) unlink($cache_file);
+ }
+ }
+
+ // DB에서 삭제
+ $oDB = &DB::getInstance();
+
+ // 레이아웃 메뉴 삭제
+ $args->layout_srl = $layout_srl;
+ $output = $oDB->executeQuery("layout.deleteLayoutMenus", $args);
+ if(!$output->toBool()) return $output;
+
+ // 레이아웃 삭제
+ $output = $oDB->executeQuery("layout.deleteLayout", $args);
+ if(!$output->toBool()) return $output;
+
+ $this->setMessage('success_deleted');
+ }
+
+ /**
+ * @brief 레이아웃에 메뉴 추가
+ **/
+ function procInsertLayoutMenu() {
+ // 입력할 변수 정리
+ $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);
+
+ $oDB = &DB::getInstance();
+
+ // 존재하게 되면 update를 해준다
+ if($menu_info->menu_srl == $args->menu_srl) {
+ $output = $oDB->executeQuery('layout.updateLayoutMenu', $args);
+ if(!$output->toBool()) return $output;
+
+ // 존재하지 않으면 insert를 해준다
+ } else {
+ $args->listorder = -1*$args->menu_srl;
+ $output = $oDB->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 = $oDB->executeQuery("module.updateModuleLayout", $target_args);
+ if(!$output->toBool()) return $output;
+ }
+ }
+
+ /**
+ * @brief 레이아웃 메뉴 삭제
+ **/
+ function procDeleteLayoutMenu() {
+ // 변수 정리
+ $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;
+
+ $oDB = &DB::getInstance();
+
+ // 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력
+ $output = $oDB->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 = $oDB->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 procMoveLayoutMenu() {
+ // 변수 설정
+ $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 값을 입력
+ $oDB = &DB::getInstance();
+ $source_args->menu_srl = $source_node_srl;
+ $source_args->parent_srl = $target_node->parent_srl;
+ $source_args->listorder = $target_node->listorder;
+ $output = $oDB->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 = $oDB->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 procMakeXmlFile() {
+ // 입력값을 체크
+ $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순으로 구해옴
+ $oDB = &DB::getInstance();
+ $args->layout_srl = $layout_srl;
+ $args->menu_id = $menu_id;
+ $output = $oDB->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 = "";
+ 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('%s', $this->getXmlTree($tree[0], $tree));
+
+ // php 캐시 파일 생성
+ $php_output = $this->getPhpCacheCode($tree[0], $tree);
+ $php_buff = sprintf('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('&','"','<','>'),$node->name);
+ $url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
+ $open_window = $node->open_window;
+ $expand = $node->expand;
+ $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->normal_btn);
+ $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->hover_btn);
+ $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$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('%s', $attribute, $child_buff);
+ else $buff .= sprintf('', $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('&','"','<','>'),$node->name);
+ $href = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->href);
+ $url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
+ $open_window = $node->open_window;
+ $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->normal_btn);
+ $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->hover_btn);
+ $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$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;
+ }
+ }
+?>
diff --git a/modules/plugin/layout.model.php b/modules/plugin/layout.model.php
new file mode 100644
index 000000000..b48b1c7cf
--- /dev/null
+++ b/modules/plugin/layout.model.php
@@ -0,0 +1,247 @@
+executeQuery('layout.getLayoutList');
+ if(!$output->data) return;
+
+ if(is_array($output->data)) return $output->data;
+ return array($output->data);
+ }
+
+ /**
+ * @brief DB 에 생성된 한개의 레이아웃 정보를 구함
+ * 생성된 레이아웃의 DB정보+XML정보를 return
+ **/
+ function getLayout($layout_srl) {
+ // 일단 DB에서 정보를 가져옴
+ $oDB = &DB::getInstance();
+ $args->layout_srl = $layout_srl;
+ $output = $oDB->executeQuery('layout.getLayout', $args);
+ if(!$output->data) return;
+
+ // layout, extra_vars를 정리한 후 xml 파일 정보를 불러옴 (불러올때 결합)
+ $info = $output->data;
+ $layout_title = $info->title;
+ $layout = $info->layout;
+ $vars = unserialize($info->extra_vars);
+
+ return $this->getLayoutInfo($layout, $layout_srl, $layout_title, $vars);
+ }
+
+ /**
+ * @brief 레이아웃의 경로를 구함
+ * 기본으로는 ./layouts에 있지만 웹관리기능으로 다운로드시 ./files/layouts에 존재함
+ **/
+ function getLayoutPath($layout_name) {
+ $class_path = sprintf('./files/layouts/%s/', $layout_name);
+ if(is_dir($class_path)) return $class_path;
+
+ $class_path = sprintf('./layouts/%s/', $layout_name);
+ if(is_dir($class_path)) return $class_path;
+
+ return "";
+ }
+
+ /**
+ * @brief 레이아웃의 종류와 정보를 구함
+ * 다운로드되어 있는 레이아웃의 종류 (생성과 다른 의미)
+ **/
+ function getDownloadedLayoutList() {
+ // 다운받은 레이아웃과 설치된 레이아웃의 목록을 구함
+ $downloaded_list = FileHandler::readDir('./files/layouts');
+ $installed_list = FileHandler::readDir('./layouts');
+ $searched_list = array_merge($downloaded_list, $installed_list);
+ $searched_count = count($searched_list);
+ if(!$searched_count) return;
+
+ // 찾아진 레이아웃 목록을 loop돌면서 필요한 정보를 간추려 return
+ for($i=0;$i<$searched_count;$i++) {
+ // 레이아웃의 이름
+ $layout = $searched_list[$i];
+
+ // 해당 레이아웃의 정보를 구함
+ $layout_info = $this->getLayoutInfo($layout);
+
+ $list[] = $layout_info;
+ }
+ return $list;
+ }
+
+ /**
+ * @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
+ * 이것 역시 캐싱을 통해서 xml parsing 시간을 줄인다..
+ **/
+ function getLayoutInfo($layout, $layout_srl = 0, $layout_title = "", $vars = null) {
+ // 요청된 모듈의 경로를 구한다. 없으면 return
+ $layout_path = $this->getLayoutPath($layout);
+ if(!$layout_path) return;
+
+ // 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
+ $xml_file = sprintf("%sconf/info.xml", $layout_path);
+ if(!file_exists($xml_file)) return;
+
+ // cache 파일을 비교하여 문제 없으면 include하고 $layout_info 변수를 return
+ $cache_file = sprintf('./files/cache/layout/%s.cache.php', $layout);
+ if(file_exists($cache_file)&&filectime($cache_file)>filectime($xml_file)) {
+ include $cache_file;
+ return $layout_info;
+ }
+
+ // cache 파일이 없으면 xml parsing하고 변수화 한 후에 캐시 파일에 쓰고 변수 바로 return
+ $oXmlParser = new XmlParser();
+ $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
+ $xml_obj = $tmp_xml_obj->layout;
+ 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('$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);
+
+ // 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
+ 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);
+ for($i=0;$i<$extra_var_count;$i++) {
+ unset($var);
+ $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);
+
+ $options = $var->options->value;
+ if(!$options) continue;
+ if(!is_array($options)) $options = array($options);
+ $options_count = count($options);
+ for($i=0;$i<$options_count;$i++) {
+ $buff .= sprintf('$layout_info->extra_var->%s->options[] = "%s";', $var->attrs->id, $options[$i]->body);
+
+ }
+ }
+
+
+ // 메뉴
+ if(!is_array($xml_obj->menus->menu)) $menus[] = $xml_obj->menus->menu;
+ else $menus = $xml_obj->menus->menu;
+
+ $menu_count = count($menus);
+ $buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
+ for($i=0;$i<$menu_count;$i++) {
+ $id = $menus[$i]->attrs->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);
+ }
+
+ $buff = '';
+ FileHandler::writeFile($cache_file, $buff);
+
+ if(file_exists($cache_file)) include $cache_file;
+ return $layout_info;
+ }
+
+ /**
+ * @brief 특정 menu_srl의 정보를 return
+ * 이 정보중에 group_srls의 경우는 , 로 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴
+ **/
+ function getLayoutMenuInfo($menu_srl) {
+ $oDB = &DB::getInstance();
+
+ // menu_srl 이 있으면 해당 메뉴의 정보를 가져온다
+ $args->menu_srl = $menu_srl;
+ $output = $oDB->executeQuery('layout.getLayoutMenu', $args);
+ if(!$output->toBool()) return $output;
+
+ $node = $output->data;
+ if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
+ return $node;
+ }
+
+ /**
+ * @brief 특정 menu_srl의 정보를 이용하여 템플릿을 구한후 return
+ * 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return
+ **/
+ function getMenuTplInfo() {
+ // 해당 메뉴의 정보를 가져오기 위한 변수 설정
+ $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);
+
+ // 추가하려는 메뉴의 기본 변수 설정
+ $oDB = &DB::getInstance();
+ $menu_info->menu_srl = $oDB->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) {
+ $oDB = &DB::getInstance();
+ $menu_info->menu_srl = $oDB->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.admin', 'layout_menu_info');
+
+ // return 할 변수 설정
+ $this->add('menu_id', $menu_id);
+ $this->add('tpl', $tpl);
+ }
+ }
+?>
diff --git a/modules/plugin/layout.view.php b/modules/plugin/layout.view.php
new file mode 100644
index 000000000..093d32d6d
--- /dev/null
+++ b/modules/plugin/layout.view.php
@@ -0,0 +1,91 @@
+setTemplatePath($this->module_path.'tpl.admin');
+ }
+
+ /**
+ * @brief 레이아웃 관리의 첫 페이지
+ **/
+ function dispContent() {
+ $oLayoutModel = &getModel('layout');
+ $layout_list = $oLayoutModel->getLayoutList();
+ Context::set('layout_list', $layout_list);
+
+ $this->setTemplateFile('index');
+ }
+
+ /**
+ * @brief 레이아웃 등록 페이지
+ * 1차적으로 레이아웃만 선택한 후 DB 에 빈 값을 넣고 그 후 상세 값 설정하는 단계를 거침
+ **/
+ function dispInsertLayout() {
+ // 레이아웃 목록을 세팅
+ $oLayoutModel = &getModel('layout');
+ $layout_list = $oLayoutModel->getDownloadedLayoutList();
+ Context::set('layout_list', $layout_list);
+
+ $this->setTemplateFile('insert_layout');
+ }
+
+ /**
+ * @brief 레이아웃 세부 정보 입력
+ **/
+ function dispLayoutMenu() {
+ // 선택된 레이아웃의 정보르 구해서 세팅
+ $layout_srl = Context::get('layout_srl');
+
+ // 레이아웃의 정보를 가져옴
+ $oLayoutModel = &getModel('layout');
+ $layout_info = $oLayoutModel->getLayout($layout_srl);
+
+ // 등록된 레이아웃이 없으면 오류 표시
+ if(!$layout_info) return $this->dispContent();
+
+ Context::set('layout_info', $layout_info);
+
+ $this->setTemplateFile('layout_info');
+ }
+
+ /**
+ * @brief 레이아웃의 상세 정보(conf/info.xml)를 팝업 출력
+ **/
+ function dispLayoutInfo() {
+ // 모듈 목록을 구해서
+ $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 레이아웃 목록을 보여줌
+ **/
+ function dispDownloadedLayoutList() {
+ // 레이아웃 목록을 세팅
+ $oLayoutModel = &getModel('layout');
+ $layout_list = $oLayoutModel->getDownloadedLayoutList();
+ Context::set('layout_list', $layout_list);
+
+ $this->setTemplateFile('downloaded_layout_list');
+ }
+
+
+ }
+?>
diff --git a/modules/plugin/queries/deleteLayout.xml b/modules/plugin/queries/deleteLayout.xml
new file mode 100644
index 000000000..ed7b9bbd4
--- /dev/null
+++ b/modules/plugin/queries/deleteLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/queries/deleteLayoutMenu.xml b/modules/plugin/queries/deleteLayoutMenu.xml
new file mode 100644
index 000000000..d4f203deb
--- /dev/null
+++ b/modules/plugin/queries/deleteLayoutMenu.xml
@@ -0,0 +1,8 @@
+
diff --git a/modules/plugin/queries/deleteLayoutMenus.xml b/modules/plugin/queries/deleteLayoutMenus.xml
new file mode 100644
index 000000000..8494bc66e
--- /dev/null
+++ b/modules/plugin/queries/deleteLayoutMenus.xml
@@ -0,0 +1,8 @@
+
diff --git a/modules/plugin/queries/getChildMenuCount.xml b/modules/plugin/queries/getChildMenuCount.xml
new file mode 100644
index 000000000..dccb4b454
--- /dev/null
+++ b/modules/plugin/queries/getChildMenuCount.xml
@@ -0,0 +1,11 @@
+
diff --git a/modules/plugin/queries/getLayout.xml b/modules/plugin/queries/getLayout.xml
new file mode 100644
index 000000000..92dea89c0
--- /dev/null
+++ b/modules/plugin/queries/getLayout.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/queries/getLayoutList.xml b/modules/plugin/queries/getLayoutList.xml
new file mode 100644
index 000000000..de23d6d67
--- /dev/null
+++ b/modules/plugin/queries/getLayoutList.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/queries/getLayoutMenu.xml b/modules/plugin/queries/getLayoutMenu.xml
new file mode 100644
index 000000000..75e4c3f90
--- /dev/null
+++ b/modules/plugin/queries/getLayoutMenu.xml
@@ -0,0 +1,14 @@
+
diff --git a/modules/plugin/queries/getLayoutMenuList.xml b/modules/plugin/queries/getLayoutMenuList.xml
new file mode 100644
index 000000000..87b4fde4c
--- /dev/null
+++ b/modules/plugin/queries/getLayoutMenuList.xml
@@ -0,0 +1,15 @@
+
diff --git a/modules/plugin/queries/insertLayout.xml b/modules/plugin/queries/insertLayout.xml
new file mode 100644
index 000000000..5e56198f6
--- /dev/null
+++ b/modules/plugin/queries/insertLayout.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/queries/insertLayoutMenu.xml b/modules/plugin/queries/insertLayoutMenu.xml
new file mode 100644
index 000000000..69280433c
--- /dev/null
+++ b/modules/plugin/queries/insertLayoutMenu.xml
@@ -0,0 +1,21 @@
+
diff --git a/modules/plugin/queries/updateLayout.xml b/modules/plugin/queries/updateLayout.xml
new file mode 100644
index 000000000..6e33ffa27
--- /dev/null
+++ b/modules/plugin/queries/updateLayout.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/queries/updateLayoutMenu.xml b/modules/plugin/queries/updateLayoutMenu.xml
new file mode 100644
index 000000000..e24515a64
--- /dev/null
+++ b/modules/plugin/queries/updateLayoutMenu.xml
@@ -0,0 +1,18 @@
+
diff --git a/modules/plugin/queries/updateLayoutMenuParent.xml b/modules/plugin/queries/updateLayoutMenuParent.xml
new file mode 100644
index 000000000..4f1cf576c
--- /dev/null
+++ b/modules/plugin/queries/updateLayoutMenuParent.xml
@@ -0,0 +1,12 @@
+
diff --git a/modules/plugin/schemas/layout_menu.xml b/modules/plugin/schemas/layout_menu.xml
new file mode 100644
index 000000000..36846a02e
--- /dev/null
+++ b/modules/plugin/schemas/layout_menu.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/schemas/layouts.xml b/modules/plugin/schemas/layouts.xml
new file mode 100644
index 000000000..94fd19326
--- /dev/null
+++ b/modules/plugin/schemas/layouts.xml
@@ -0,0 +1,7 @@
+
diff --git a/modules/plugin/tpl.admin/downloaded_layout_list.html b/modules/plugin/tpl.admin/downloaded_layout_list.html
new file mode 100644
index 000000000..786a49ee4
--- /dev/null
+++ b/modules/plugin/tpl.admin/downloaded_layout_list.html
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ | {$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/plugin/tpl.admin/filter/delete_layout.xml b/modules/plugin/tpl.admin/filter/delete_layout.xml
new file mode 100644
index 000000000..b7d8daa3e
--- /dev/null
+++ b/modules/plugin/tpl.admin/filter/delete_layout.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
diff --git a/modules/plugin/tpl.admin/filter/delete_layout_menu.xml b/modules/plugin/tpl.admin/filter/delete_layout_menu.xml
new file mode 100644
index 000000000..4a9de5f93
--- /dev/null
+++ b/modules/plugin/tpl.admin/filter/delete_layout_menu.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/tpl.admin/filter/insert_layout.xml b/modules/plugin/tpl.admin/filter/insert_layout.xml
new file mode 100644
index 000000000..81c8f43da
--- /dev/null
+++ b/modules/plugin/tpl.admin/filter/insert_layout.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/tpl.admin/filter/insert_layout_menu.xml b/modules/plugin/tpl.admin/filter/insert_layout_menu.xml
new file mode 100644
index 000000000..26025b827
--- /dev/null
+++ b/modules/plugin/tpl.admin/filter/insert_layout_menu.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/tpl.admin/filter/move_layout_menu.xml b/modules/plugin/tpl.admin/filter/move_layout_menu.xml
new file mode 100644
index 000000000..0fd6b8a67
--- /dev/null
+++ b/modules/plugin/tpl.admin/filter/move_layout_menu.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/plugin/tpl.admin/filter/update_layout_info.xml b/modules/plugin/tpl.admin/filter/update_layout_info.xml
new file mode 100644
index 000000000..0c869e6d1
--- /dev/null
+++ b/modules/plugin/tpl.admin/filter/update_layout_info.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
diff --git a/modules/plugin/tpl.admin/header.html b/modules/plugin/tpl.admin/header.html
new file mode 100644
index 000000000..37855aa62
--- /dev/null
+++ b/modules/plugin/tpl.admin/header.html
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/modules/plugin/tpl.admin/index.html b/modules/plugin/tpl.admin/index.html
new file mode 100644
index 000000000..4e929fb75
--- /dev/null
+++ b/modules/plugin/tpl.admin/index.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+ {$lang->total_count} {number_format(count($layout_list))}
+
+
+
+
+
+
+
+
+
+ | {$lang->no} |
+ {$lang->layout} |
+ {$lang->title} |
+ {$lang->regdate} |
+ {$lang->cmd_delete} |
+
+
+
+ | {$no+1} |
+ {$val->layout} |
+ {$val->title} |
+ {zdate($val->regdate,"Y-m-d")} |
+ {$lang->cmd_delete} |
+
+
+
+
+
+
+
diff --git a/modules/plugin/tpl.admin/insert_layout.html b/modules/plugin/tpl.admin/insert_layout.html
new file mode 100644
index 000000000..48a485ced
--- /dev/null
+++ b/modules/plugin/tpl.admin/insert_layout.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+
diff --git a/modules/plugin/tpl.admin/js/admin.js b/modules/plugin/tpl.admin/js/admin.js
new file mode 100644
index 000000000..a6be75c68
--- /dev/null
+++ b/modules/plugin/tpl.admin/js/admin.js
@@ -0,0 +1,130 @@
+/* 레이아웃 신규 생성시 완료 후 요청하는 함수 */
+function completeInsertLayout(ret_obj) {
+ var layout_srl = ret_obj['layout_srl'];
+ location.href="./?module=admin&mo=layout&act=dispLayoutMenu&layout_srl="+layout_srl;
+}
+
+/* 레이아웃메뉴 입력후 */
+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");
+ if(!fo_obj) return;
+ fo_obj.layout_srl.value = 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', 'getMenuTplInfo', 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', 'procMakeXmlFile', params, completeInsertLayoutMenu, response_tags, params);
+}
diff --git a/modules/plugin/tpl.admin/layout_detail_info.html b/modules/plugin/tpl.admin/layout_detail_info.html
new file mode 100644
index 000000000..1d940bbb8
--- /dev/null
+++ b/modules/plugin/tpl.admin/layout_detail_info.html
@@ -0,0 +1,56 @@
+
+
+
+
+ | {$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/plugin/tpl.admin/layout_info.html b/modules/plugin/tpl.admin/layout_info.html
new file mode 100644
index 000000000..a2ddaf0bd
--- /dev/null
+++ b/modules/plugin/tpl.admin/layout_info.html
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | {$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->menu_management} |
+ {nl2br($lang->about_menu_management)} |
+
+
+
+
+ {$menu->name}
+ ({$menu->maxdepth} {$lang->depth})
+ |
+
+
+
+ |
+
+
+
+
diff --git a/modules/plugin/tpl.admin/layout_menu_info.html b/modules/plugin/tpl.admin/layout_menu_info.html
new file mode 100644
index 000000000..7185334d2
--- /dev/null
+++ b/modules/plugin/tpl.admin/layout_menu_info.html
@@ -0,0 +1,81 @@
+
+
+
+
diff --git a/plugins/newest_document/conf/info.xml b/plugins/newest_document/conf/info.xml
new file mode 100644
index 000000000..a67520490
--- /dev/null
+++ b/plugins/newest_document/conf/info.xml
@@ -0,0 +1,32 @@
+
+
+ 최근 문서
+ newest document
+
+ 제로
+ zero
+ 최근 문서 (document)를 출력하는 플러그인입니다.
+ display newest document
+
+
+
+ 제목
+ title
+ text
+
+
+ 정렬 방법
+ order type
+ select
+
+ regdate
+ last update
+
+
+
+ 목록수
+ list_count
+ text
+
+
+
diff --git a/plugins/newest_document/newest_document.class.php b/plugins/newest_document/newest_document.class.php
new file mode 100644
index 000000000..02904385c
--- /dev/null
+++ b/plugins/newest_document/newest_document.class.php
@@ -0,0 +1,14 @@
+