mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@411 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d915912c41
commit
13c860a959
40 changed files with 1695 additions and 9 deletions
|
|
@ -8,13 +8,6 @@
|
||||||
|
|
||||||
class Plugin extends Object {
|
class Plugin extends Object {
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief constructor
|
|
||||||
**/
|
|
||||||
function Plugin($addon_name) {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,9 @@
|
||||||
require_once("./classes/db/DB.class.php");
|
require_once("./classes/db/DB.class.php");
|
||||||
require_once("./classes/file/FileHandler.class.php");
|
require_once("./classes/file/FileHandler.class.php");
|
||||||
require_once("./classes/object/Object.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/ModuleObject.class.php");
|
||||||
require_once("./classes/module/ModuleHandler.class.php");
|
require_once("./classes/module/ModuleHandler.class.php");
|
||||||
require_once("./classes/display/DisplayHandler.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());
|
if(__DEBUG__) define('__RequireClassEndTime__', getMicroTime());
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
11
modules/plugin/conf/info.xml
Normal file
11
modules/plugin/conf/info.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<module version="0.1">
|
||||||
|
<title xml:lang="ko">레이아웃 관리</title>
|
||||||
|
<title xml:lang="en">layout management</title>
|
||||||
|
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||||
|
<name xml:lang="ko">제로</name>
|
||||||
|
<name xml:lang="en">zero</name>
|
||||||
|
<description xml:lang="ko">레이아웃 관리 모듈</description>
|
||||||
|
<description xml:lang="en">layout management</description>
|
||||||
|
</author>
|
||||||
|
</module>
|
||||||
19
modules/plugin/conf/module.xml
Normal file
19
modules/plugin/conf/module.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<module>
|
||||||
|
<actions>
|
||||||
|
<action name="dispContent" type="view" admin_index="true" standalone="true" />
|
||||||
|
<action name="dispInsertLayout" type="view" standalone="true" />
|
||||||
|
<action name="dispLayoutMenu" type="view" standalone="true" />
|
||||||
|
<action name="dispDownloadedLayoutList" type="view" standalone="true" />
|
||||||
|
<action name="dispLayoutInfo" type="view" standalone="true" />
|
||||||
|
<action name="getLayoutMenuSrl" type="model" standalone="true" />
|
||||||
|
<action name="getMenuTplInfo" type="model" standalone="true" />
|
||||||
|
<action name="procInsertLayout" type="controller" standalone="true" />
|
||||||
|
<action name="procUpdateLayout" type="controller" standalone="true" />
|
||||||
|
<action name="procDeleteLayout" type="controller" standalone="true" />
|
||||||
|
<action name="procInsertLayoutMenu" type="controller" standalone="true" />
|
||||||
|
<action name="procDeleteLayoutMenu" type="controller" standalone="true" />
|
||||||
|
<action name="procMakeXmlFile" type="controller" standalone="true" />
|
||||||
|
<action name="procMoveLayoutMenu" type="controller" standalone="true" />
|
||||||
|
</actions>
|
||||||
|
</module>
|
||||||
51
modules/plugin/lang/ko.lang.php
Normal file
51
modules/plugin/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @file modules/layout/lang/ko.lang.php
|
||||||
|
* @author zero <zero@nzeo.com>
|
||||||
|
* @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입니다.<br /> 다른 모듈을 설치하시고자 할때는 \"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 = '하부 메뉴가 있는 메뉴는 삭제하실 수 없습니다';
|
||||||
|
?>
|
||||||
43
modules/plugin/layout.class.php
Normal file
43
modules/plugin/layout.class.php
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @class layout
|
||||||
|
* @author zero (zero@nzeo.com)
|
||||||
|
* @brief layout 모듈의 high class
|
||||||
|
**/
|
||||||
|
|
||||||
|
class layout extends ModuleObject {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 설치시 추가 작업이 필요할시 구현
|
||||||
|
**/
|
||||||
|
function moduleInstall() {
|
||||||
|
// layout 에서 사용할 cache디렉토리 생성
|
||||||
|
$directory_list = array(
|
||||||
|
'./files',
|
||||||
|
'./files/cache',
|
||||||
|
'./files/cache/layout',
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($directory_list as $dir) {
|
||||||
|
if(is_dir($dir)) continue;
|
||||||
|
@mkdir($dir, 0707);
|
||||||
|
@chmod($dir, 0707);
|
||||||
|
}
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 설치가 이상이 없는지 체크하는 method
|
||||||
|
**/
|
||||||
|
function moduleIsInstalled() {
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 업데이트 실행
|
||||||
|
**/
|
||||||
|
function moduleUpdate() {
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
415
modules/plugin/layout.controller.php
Normal file
415
modules/plugin/layout.controller.php
Normal file
|
|
@ -0,0 +1,415 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @class layoutController
|
||||||
|
* @author zero (zero@nzeo.com)
|
||||||
|
* @brief layout 모듈의 Controller class
|
||||||
|
**/
|
||||||
|
|
||||||
|
class layoutController extends layout {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 초기화
|
||||||
|
**/
|
||||||
|
function init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 레이아웃 신규 생성
|
||||||
|
* 레이아웃의 신규 생성은 제목만 받아서 layouts테이블에 입력함
|
||||||
|
**/
|
||||||
|
function procInsertLayout() {
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
|
$args->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 = "<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(!__ZB5__) 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('&','"','<','>'),$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('<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('&','"','<','>'),$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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
247
modules/plugin/layout.model.php
Normal file
247
modules/plugin/layout.model.php
Normal file
|
|
@ -0,0 +1,247 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @class layoutModel
|
||||||
|
* @author zero (zero@nzeo.com)
|
||||||
|
* @version 0.1
|
||||||
|
* @brief layout 모듈의 Model class
|
||||||
|
**/
|
||||||
|
|
||||||
|
class layoutModel extends layout {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 초기화
|
||||||
|
**/
|
||||||
|
function init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief DB 에 생성된 레이아웃의 목록을 구함
|
||||||
|
* 생성되었다는 것은 DB에 등록이 되었다는 것을 의미
|
||||||
|
**/
|
||||||
|
function getLayoutList() {
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
$output = $oDB->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 = '<?php if(!__ZB5__) exit(); '.$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
91
modules/plugin/layout.view.php
Normal file
91
modules/plugin/layout.view.php
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @class layoutView
|
||||||
|
* @author zero (zero@nzeo.com)
|
||||||
|
* @brief layout 모듈의 View class
|
||||||
|
**/
|
||||||
|
|
||||||
|
class layoutView extends layout {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 초기화
|
||||||
|
**/
|
||||||
|
function init() {
|
||||||
|
$this->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');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
8
modules/plugin/queries/deleteLayout.xml
Normal file
8
modules/plugin/queries/deleteLayout.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<query id="deleteLayout" action="delete">
|
||||||
|
<tables>
|
||||||
|
<table name="layouts" />
|
||||||
|
</tables>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
8
modules/plugin/queries/deleteLayoutMenu.xml
Normal file
8
modules/plugin/queries/deleteLayoutMenu.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<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>
|
||||||
8
modules/plugin/queries/deleteLayoutMenus.xml
Normal file
8
modules/plugin/queries/deleteLayoutMenus.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<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>
|
||||||
11
modules/plugin/queries/getChildMenuCount.xml
Normal file
11
modules/plugin/queries/getChildMenuCount.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<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>
|
||||||
11
modules/plugin/queries/getLayout.xml
Normal file
11
modules/plugin/queries/getLayout.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<query id="getLayout" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="layouts" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="*" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
11
modules/plugin/queries/getLayoutList.xml
Normal file
11
modules/plugin/queries/getLayoutList.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<query id="getLayoutList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="layouts" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="*" />
|
||||||
|
</columns>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="layout_srl" order="desc" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
14
modules/plugin/queries/getLayoutMenu.xml
Normal file
14
modules/plugin/queries/getLayoutMenu.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<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>
|
||||||
15
modules/plugin/queries/getLayoutMenuList.xml
Normal file
15
modules/plugin/queries/getLayoutMenuList.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<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" filter="number" notnull="notnull" pipe="and" />
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="listorder" order="desc" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
11
modules/plugin/queries/insertLayout.xml
Normal file
11
modules/plugin/queries/insertLayout.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<query id="insertLayout" action="insert">
|
||||||
|
<tables>
|
||||||
|
<table name="layouts" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||||
|
<column name="layout" var="layout" notnull="notnull" />
|
||||||
|
<column name="title" var="title" notnull="notnull" />
|
||||||
|
<column name="regdate" var="regdate" default="curdate()" />
|
||||||
|
</columns>
|
||||||
|
</query>
|
||||||
21
modules/plugin/queries/insertLayoutMenu.xml
Normal file
21
modules/plugin/queries/insertLayoutMenu.xml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<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>
|
||||||
12
modules/plugin/queries/updateLayout.xml
Normal file
12
modules/plugin/queries/updateLayout.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<query id="updateLayout" action="update">
|
||||||
|
<tables>
|
||||||
|
<table name="layouts" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="title" var="title" notnull="notnull" />
|
||||||
|
<column name="extra_vars" var="extra_vars" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
18
modules/plugin/queries/updateLayoutMenu.xml
Normal file
18
modules/plugin/queries/updateLayoutMenu.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<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>
|
||||||
12
modules/plugin/queries/updateLayoutMenuParent.xml
Normal file
12
modules/plugin/queries/updateLayoutMenuParent.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<query id="updateLayoutMenuParent" action="update">
|
||||||
|
<tables>
|
||||||
|
<table name="layout_menu" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="parent_srl" var="parent_srl" />
|
||||||
|
<column name="listorder" var="listorder" notnull="notnull" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
16
modules/plugin/schemas/layout_menu.xml
Normal file
16
modules/plugin/schemas/layout_menu.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<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>
|
||||||
7
modules/plugin/schemas/layouts.xml
Normal file
7
modules/plugin/schemas/layouts.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<table name="layouts">
|
||||||
|
<column name="layout_srl" type="number" size="12" notnull="notnull" primary_key="primary_key" />
|
||||||
|
<column name="layout" type="varchar" size="250" />
|
||||||
|
<column name="title" type="varchar" size="250" />
|
||||||
|
<column name="extra_vars" type="text" />
|
||||||
|
<column name="regdate" type="date" index="idx_regdate" />
|
||||||
|
</table>
|
||||||
37
modules/plugin/tpl.admin/downloaded_layout_list.html
Normal file
37
modules/plugin/tpl.admin/downloaded_layout_list.html
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<!--#include("header.html")-->
|
||||||
|
|
||||||
|
<!-- 레이아웃의 목록 -->
|
||||||
|
<div>
|
||||||
|
<table border="1" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->layout_name}</td>
|
||||||
|
<td>{$lang->version}</td>
|
||||||
|
<td>{$lang->author}</td>
|
||||||
|
<td>{$lang->menu_count}</td>
|
||||||
|
<td>{$lang->date}</td>
|
||||||
|
<td>{$lang->path}</td>
|
||||||
|
<td>{$lang->layout_info}</td>
|
||||||
|
<td>{$lang->cmd_make}</td>
|
||||||
|
</tr>
|
||||||
|
<!--@foreach($layout_list as $key => $val)-->
|
||||||
|
<tr>
|
||||||
|
<td rowspan="2">
|
||||||
|
{$val->title} <br />
|
||||||
|
({$val->layout})
|
||||||
|
</td>
|
||||||
|
<td>{$val->version}</td>
|
||||||
|
<td><a href="#" onclick="window.open('{$val->author->homepage}')">{$val->author->name}</a></td>
|
||||||
|
<td>{$val->menu_count}</td>
|
||||||
|
<td>{$val->author->date}</td>
|
||||||
|
<td>{$val->path}</td>
|
||||||
|
<td><a href="#" onclick="winopen('{getUrl('','module','layout','act','dispLayoutInfo','selected_layout',$val->layout)}','layout_info','width=10,height=10,toolbars=no,scrollbars=yes,resizable=yes');return false">{$lang->cmd_view}</a></td>
|
||||||
|
<td><a href="{getUrl('mo','layout','act','dispInsertLayout','layout',$val->layout)}">{$lang->cmd_make}</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7">
|
||||||
|
{nl2br($val->author->description)}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!--@end-->
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
9
modules/plugin/tpl.admin/filter/delete_layout.xml
Normal file
9
modules/plugin/tpl.admin/filter/delete_layout.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<filter name="delete_layout" module="layout" act="procDeleteLayout" confirm_msg_code="confirm_delete">
|
||||||
|
<form>
|
||||||
|
<node target="layout_srl" required="true" />
|
||||||
|
</form>
|
||||||
|
<response>
|
||||||
|
<tag name="error" />
|
||||||
|
<tag name="message" />
|
||||||
|
</response>
|
||||||
|
</filter>
|
||||||
16
modules/plugin/tpl.admin/filter/delete_layout_menu.xml
Normal file
16
modules/plugin/tpl.admin/filter/delete_layout_menu.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<filter name="delete_layout_menu" module="layout" act="procDeleteLayoutMenu" 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>
|
||||||
14
modules/plugin/tpl.admin/filter/insert_layout.xml
Normal file
14
modules/plugin/tpl.admin/filter/insert_layout.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<filter name="insert_layout" module="layout" act="procInsertLayout" confirm_msg_code="confirm_submit">
|
||||||
|
<form>
|
||||||
|
<node target="title" required="true" />
|
||||||
|
</form>
|
||||||
|
<parameter>
|
||||||
|
<param name="layout" target="layout" />
|
||||||
|
<param name="title" target="title" />
|
||||||
|
</parameter>
|
||||||
|
<response callback_func="completeInsertLayout">
|
||||||
|
<tag name="error" />
|
||||||
|
<tag name="message" />
|
||||||
|
<tag name="layout_srl" />
|
||||||
|
</response>
|
||||||
|
</filter>
|
||||||
17
modules/plugin/tpl.admin/filter/insert_layout_menu.xml
Normal file
17
modules/plugin/tpl.admin/filter/insert_layout_menu.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<filter name="insert_layout_menu" module="layout" act="procInsertLayoutMenu" 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>
|
||||||
10
modules/plugin/tpl.admin/filter/move_layout_menu.xml
Normal file
10
modules/plugin/tpl.admin/filter/move_layout_menu.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<filter name="move_layout_menu" module="layout" act="procMoveLayoutMenu" 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>
|
||||||
9
modules/plugin/tpl.admin/filter/update_layout_info.xml
Normal file
9
modules/plugin/tpl.admin/filter/update_layout_info.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<filter name="update_layout_info" module="layout" act="procUpdateLayout" confirm_msg_code="confirm_submit">
|
||||||
|
<form>
|
||||||
|
<node target="title" required="true" />
|
||||||
|
</form>
|
||||||
|
<response>
|
||||||
|
<tag name="error" />
|
||||||
|
<tag name="message" />
|
||||||
|
</response>
|
||||||
|
</filter>
|
||||||
7
modules/plugin/tpl.admin/header.html
Normal file
7
modules/plugin/tpl.admin/header.html
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<!--%import("js/admin.js")-->
|
||||||
|
|
||||||
|
<div style="margin-bottom:20px;">
|
||||||
|
<span <!--@if($act=='dispContent')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispContent')}">{$lang->layout_list}</a>]</span>
|
||||||
|
<span <!--@if($act=='dispDownloadedLayoutList')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispDownloadedLayoutList')}">{$lang->downloaded_list}</a>]</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
40
modules/plugin/tpl.admin/index.html
Normal file
40
modules/plugin/tpl.admin/index.html
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
<!--%import("js/admin.js")-->
|
||||||
|
<!--%import("filter/delete_layout.xml")-->
|
||||||
|
|
||||||
|
<!--#include("header.html")-->
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{$lang->total_count} {number_format(count($layout_list))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 삭제를 위한 임시 form -->
|
||||||
|
<form id="fo_layout" action="./" method="get" onsubmit="return procFilter(this, delete_layout)">
|
||||||
|
<input type="hidden" name="layout_srl" value="" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- 목록 -->
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->no}</th>
|
||||||
|
<th>{$lang->layout}</th>
|
||||||
|
<th>{$lang->title}</th>
|
||||||
|
<th>{$lang->regdate}</th>
|
||||||
|
<th>{$lang->cmd_delete}</th>
|
||||||
|
</tr>
|
||||||
|
<!--@foreach($layout_list as $no => $val)-->
|
||||||
|
<tr>
|
||||||
|
<td>{$no+1}</td>
|
||||||
|
<td>{$val->layout}</td>
|
||||||
|
<td><a href="#" onclick="location.href='{getUrl('act','dispLayoutMenu','layout_srl',$val->layout_srl)}';return false;">{$val->title}</a></td>
|
||||||
|
<td>{zdate($val->regdate,"Y-m-d")}</td>
|
||||||
|
<td><a href="#" onclick="doDeleteLayout('{$val->layout_srl}');return false;">{$lang->cmd_delete}</a></td>
|
||||||
|
</tr>
|
||||||
|
<!--@end-->
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 버튼 -->
|
||||||
|
<div>
|
||||||
|
[<a href="{getUrl('act','dispInsertLayout','layout_srl','')}">{$lang->cmd_make}</a>]
|
||||||
|
</div>
|
||||||
34
modules/plugin/tpl.admin/insert_layout.html
Normal file
34
modules/plugin/tpl.admin/insert_layout.html
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<!--%import("js/admin.js")-->
|
||||||
|
<!--%import("filter/insert_layout.xml")-->
|
||||||
|
|
||||||
|
<!--#include("header.html")-->
|
||||||
|
|
||||||
|
<form action="./" method="get" onsubmit="return procFilter(this, insert_layout)">
|
||||||
|
<div style="margin-bottom:10px;">
|
||||||
|
<table border="1" width="100%">
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->layout_name}</th>
|
||||||
|
<td>
|
||||||
|
<select name="layout">
|
||||||
|
<!--@foreach($layout_list as $key => $val)-->
|
||||||
|
<option value="{$val->layout}" <!--@if($layout == $val->layout)-->selected="true"<!--@end-->>{$val->title} ({$val->layout})</option>
|
||||||
|
<!--@end-->
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2">{$lang->title}</th>
|
||||||
|
<td><input type="text" name="title" value="{$info->title}" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{$lang->about_title}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<input type="button" value="{$lang->cmd_list}" onclick="location.href='{getUrl('act',dispContent)}';return false;" />
|
||||||
|
<input type="submit" value="{$lang->cmd_next}" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
130
modules/plugin/tpl.admin/js/admin.js
Normal file
130
modules/plugin/tpl.admin/js/admin.js
Normal file
|
|
@ -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);
|
||||||
|
}
|
||||||
56
modules/plugin/tpl.admin/layout_detail_info.html
Normal file
56
modules/plugin/tpl.admin/layout_detail_info.html
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
<table border="1" width="400">
|
||||||
|
<col width="100" />
|
||||||
|
<col width="300" />
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">{$lang->layout_maker}</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->title}</th>
|
||||||
|
<td>{$layout_info->title} ver {$layout_info->version}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->author}</th>
|
||||||
|
<td><a href="mailto:{$layout_info->author->email_address}">{$layout_info->author->name}</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->homepage}</th>
|
||||||
|
<td><a href="#" onclick="window.open('{$layout_info->author->homepage}');return false;">{$layout_info->author->homepage}</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->regdate}</th>
|
||||||
|
<td>{$layout_info->author->date}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->description}</th>
|
||||||
|
<td>{nl2br($layout_info->author->description)}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th colspan="2">{$lang->layout_history}</th>
|
||||||
|
</tr>
|
||||||
|
<!--@foreach($layout_info->history as $history)-->
|
||||||
|
<!--@if($history->name)-->
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->name}</th>
|
||||||
|
<td><a href="mailto:{$history->email_address}">{$history->name}</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->homepage}</th>
|
||||||
|
<td><a href="#" onclick="window.open('{$history->homepage}');return false;">{$history->homepage}</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->regdate}</th>
|
||||||
|
<td>{$history->date}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->description}</th>
|
||||||
|
<td>{nl2br($history->description)}</td>
|
||||||
|
</tr>
|
||||||
|
<!--@end-->
|
||||||
|
<!--@end-->
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<a href="#" onclick="self.close()">{$lang->cmd_close}</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
128
modules/plugin/tpl.admin/layout_info.html
Normal file
128
modules/plugin/tpl.admin/layout_info.html
Normal file
|
|
@ -0,0 +1,128 @@
|
||||||
|
<!--%import("js/admin.js")-->
|
||||||
|
<!--%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">
|
||||||
|
<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" />
|
||||||
|
<col width="*" />
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->layout}</th>
|
||||||
|
<td>{$layout_info->title} ver {$layout_info->version} ({$layout_info->layout})</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->path}</th>
|
||||||
|
<td>{$layout_info->path}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->author}</th>
|
||||||
|
<td><a href="#" onclick="window.open('{$layout_info->author->homepage}');return false;">{$layout_info->author->name}</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->description}</th>
|
||||||
|
<td>{nl2br($layout_info->author->description)}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-bottom:10px;">
|
||||||
|
<form id="fo_layout" action="./" method="get" onsubmit="return procFilter(this, update_layout_info)">
|
||||||
|
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||||
|
<input type="hidden" name="layout" value="{$layout_info->layout}" />
|
||||||
|
|
||||||
|
<table border="1" width="100%">
|
||||||
|
<col width="140" />
|
||||||
|
<col width="*" />
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->title}</th>
|
||||||
|
<td><input type="text" name="title" value="{$layout_info->layout_title}" /></td>
|
||||||
|
</tr>
|
||||||
|
<!--@foreach($layout_info->extra_var as $id => $var)-->
|
||||||
|
<tr>
|
||||||
|
<th>{$var->name}</th>
|
||||||
|
<!--@if($var->type == "text")-->
|
||||||
|
<td><input type="text" name="{$id}" value="{$var->value}" /></td>
|
||||||
|
<!--@elseif($var->type == "textarea")-->
|
||||||
|
<td><textarea name="{$id}">{$var->value}</textarea></td>
|
||||||
|
<!--@elseif($var->type == "select")-->
|
||||||
|
<td>
|
||||||
|
<select name="{$id}">
|
||||||
|
<!--@foreach($var->options as $key => $val)-->
|
||||||
|
<option value="{$val}" <!--@if($val==$var->value)-->selected="true"<!--@end-->>{$val}</option>
|
||||||
|
<!--@end-->
|
||||||
|
</select>
|
||||||
|
<!--@end-->
|
||||||
|
</tr>
|
||||||
|
<!--@end-->
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" align="center">
|
||||||
|
<input type="button" value="{$lang->cmd_list}" onclick="location.href='{getUrl('act','dispContent')}';return false;"/>
|
||||||
|
<input type="submit" value="{$lang->cmd_save}" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-bottom:10px;">
|
||||||
|
<table border="1" width="100%">
|
||||||
|
<col width="140" />
|
||||||
|
<col width="*" />
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->menu_management}</th>
|
||||||
|
<td>{nl2br($lang->about_menu_management)}</td>
|
||||||
|
</tr>
|
||||||
|
<!--@foreach($layout_info->menu as $menu_id => $menu)-->
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
{$menu->name} <br />
|
||||||
|
({$menu->maxdepth} {$lang->depth})
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<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="0">
|
||||||
|
<tr valign="top">
|
||||||
|
<td width="350">
|
||||||
|
<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}", doGetMenuInfo, 0, doMoveTree);
|
||||||
|
</script>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!--@end-->
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
81
modules/plugin/tpl.admin/layout_menu_info.html
Normal file
81
modules/plugin/tpl.admin/layout_menu_info.html
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
<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)}" /></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>
|
||||||
32
plugins/newest_document/conf/info.xml
Normal file
32
plugins/newest_document/conf/info.xml
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<plugin version="0.1">
|
||||||
|
<title xml:lang="ko">최근 문서</title>
|
||||||
|
<title xml:lang="en">newest document </title>
|
||||||
|
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||||
|
<name xml:lang="ko">제로</name>
|
||||||
|
<name xml:lang="en">zero</name>
|
||||||
|
<description xml:lang="ko">최근 문서 (document)를 출력하는 플러그인입니다.</description>
|
||||||
|
<description xml:lang="en">display newest document</description>
|
||||||
|
</author>
|
||||||
|
<extra_vars>
|
||||||
|
<var id="title">
|
||||||
|
<name xml:lang="ko">제목</name>
|
||||||
|
<name xml:lang="en">title</name>
|
||||||
|
<type>text</type>
|
||||||
|
</var>
|
||||||
|
<var id="order_type">
|
||||||
|
<name xml:lang="ko">정렬 방법</name>
|
||||||
|
<name xml:lang="en">order type</name>
|
||||||
|
<type>select</type>
|
||||||
|
<options>
|
||||||
|
<value>regdate</value>
|
||||||
|
<value>last update</value>
|
||||||
|
</options>
|
||||||
|
</var>
|
||||||
|
<var id="list_count">
|
||||||
|
<name xml:lang="ko">목록수</name>
|
||||||
|
<name xml:lang="en">list_count</name>
|
||||||
|
<type>text</type>
|
||||||
|
</var>
|
||||||
|
</extra_vars>
|
||||||
|
</plugin>
|
||||||
14
plugins/newest_document/newest_document.class.php
Normal file
14
plugins/newest_document/newest_document.class.php
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class newest_document
|
||||||
|
* @author zero (zero@nzeo.com)
|
||||||
|
* @brief 최근 게시물을 출력하는 플러그인
|
||||||
|
* @version 0.1
|
||||||
|
**/
|
||||||
|
|
||||||
|
function class newest_document extends Plugin {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue