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@1167 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8b610f5334
commit
6b38f2b8bd
35 changed files with 300 additions and 599 deletions
|
|
@ -47,7 +47,7 @@
|
|||
<!--@if($logged_info->is_admin == 'Y')-->
|
||||
<!-- 관리자일 경우 레이아웃 관리 메뉴 -->
|
||||
<div class="layout_admin">
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminMenu','layout_srl',$layout_info->layout_srl)}';return false;">{$lang->cmd_layout_management}</a>
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminModify','layout_srl',$layout_info->layout_srl)}';return false;">{$lang->cmd_layout_management}</a>
|
||||
</div>
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ xe_layout_menu['bottom_menu'][1][{$first_key}] = { "text":"{htmlspecialchars($fi
|
|||
<!--@if($logged_info->is_admin == 'Y')-->
|
||||
<!-- 관리자일 경우 레이아웃 관리 메뉴 -->
|
||||
<div class="layout_admin">
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminMenu','layout_srl',$layout_info->layout_srl)}';return false;">{$lang->cmd_layout_management}</a>
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminModify','layout_srl',$layout_info->layout_srl)}';return false;">{$lang->cmd_layout_management}</a>
|
||||
</div>
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
<!--@if($logged_info->is_admin == 'Y')-->
|
||||
<!-- 관리자일 경우 레이아웃 관리 메뉴 -->
|
||||
<div class="layout_admin">
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminMenu','layout_srl',$layout_info->layout_srl)}';return false;">{$lang->cmd_layout_management}</a>
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminModify','layout_srl',$layout_info->layout_srl)}';return false;">{$lang->cmd_layout_management}</a>
|
||||
</div>
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,11 +16,12 @@
|
|||
|
||||
$oAdminController->insertShortCut('board');
|
||||
$oAdminController->insertShortCut('page');
|
||||
$oAdminController->insertShortCut('member');
|
||||
$oAdminController->insertShortCut('module');
|
||||
$oAdminController->insertShortCut('menu');
|
||||
$oAdminController->insertShortCut('layout');
|
||||
$oAdminController->insertShortCut('addon');
|
||||
$oAdminController->insertShortCut('plugin');
|
||||
$oAdminController->insertShortCut('member');
|
||||
$oAdminController->insertShortCut('module');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
<actions>
|
||||
<action name="dispLayoutAdminContent" type="view" admin_index="true" standalone="true" />
|
||||
<action name="dispLayoutAdminInsert" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminModify" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminDownloadedList" type="view" standalone="true" />
|
||||
|
||||
<action name="dispLayoutAdminInfo" type="view" standalone="true" />
|
||||
|
||||
<action name="procLayoutAdminInsert" type="controller" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminContent');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInsert');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminModify');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminDownloadedList');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInfo');
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
/**
|
||||
* @brief 레이아웃 세부 정보 입력
|
||||
**/
|
||||
function dispLayoutAdminMenu() {
|
||||
function dispLayoutAdminModify() {
|
||||
// 선택된 레이아웃의 정보르 구해서 세팅
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
||||
|
|
@ -54,7 +54,19 @@
|
|||
|
||||
Context::set('layout_info', $layout_info);
|
||||
|
||||
$this->setTemplateFile('layout_info');
|
||||
$this->setTemplateFile('layout_modify');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 목록을 보여줌
|
||||
**/
|
||||
function dispLayoutAdminDownloadedList() {
|
||||
// 레이아웃 목록을 세팅
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('downloaded_layout_list');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -72,17 +84,5 @@
|
|||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('layout_detail_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 목록을 보여줌
|
||||
**/
|
||||
function dispLayoutAdminDownloadedList() {
|
||||
// 레이아웃 목록을 세팅
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('downloaded_layout_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<tr>
|
||||
<td>{$no+1}</td>
|
||||
<td>{$val->layout}</td>
|
||||
<td><a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminMenu','layout_srl',$val->layout_srl)}';return false;">{htmlspecialchars($val->title)}</a></td>
|
||||
<td><a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminModify','layout_srl',$val->layout_srl)}';return false;">{htmlspecialchars($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>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* 레이아웃 신규 생성시 완료 후 요청하는 함수 */
|
||||
function completeInsertLayout(ret_obj) {
|
||||
var layout_srl = ret_obj['layout_srl'];
|
||||
var url = location.href.setQuery('act','dispLayoutAdminMenu').setQuery('layout_srl',layout_srl);
|
||||
var url = location.href.setQuery('act','dispLayoutAdminModify').setQuery('layout_srl',layout_srl);
|
||||
location.href = url;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,9 +34,12 @@
|
|||
<col width="140" />
|
||||
<col width="*" />
|
||||
<tr>
|
||||
<th>{$lang->title}</th>
|
||||
<th rowspan="2">{$lang->title}</th>
|
||||
<td><input type="text" name="title" value="{htmlspecialchars($layout_info->layout_title)}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$lang->about_title}</td>
|
||||
</tr>
|
||||
<!--@foreach($layout_info->extra_var as $id => $var)-->
|
||||
<tr>
|
||||
<th rowspan="2">{$var->name}</th>
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
<actions>
|
||||
<action name="dispMenuAdminContent" type="view" admin_index="true" standalone="true" />
|
||||
<action name="dispMenuAdminInsert" type="view" standalone="true" />
|
||||
<action name="dispMenuAdminInfo" type="view" standalone="true" />
|
||||
<action name="dispMenuAdminMidList" type="view" standalone="true" />
|
||||
|
||||
<action name="getMenuAdminTplInfo" type="model" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layout
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief layout 모듈의 high class
|
||||
**/
|
||||
|
||||
class layout extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminContent');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInsert');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminMenu');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminDownloadedList');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInfo');
|
||||
|
||||
//$oModuleController->insertActionForward('layout', 'model', 'getLayoutAdminMenuTplInfo');
|
||||
|
||||
//$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminInsert');
|
||||
//$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminUpdate');
|
||||
//$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminDelete');
|
||||
//$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminInsertMenu');
|
||||
//$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminDeleteMenu');
|
||||
//$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminMakeXmlFile');
|
||||
//$oModuleController->insertActionForward('layout', 'controller', 'procLayoutAdminMoveMenu');
|
||||
|
||||
// 레이아웃에서 사용할 디렉토리 생성
|
||||
FileHandler::makeDir('./files/cache/layout');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function moduleIsInstalled() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
<?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');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 관리의 첫 페이지
|
||||
**/
|
||||
function dispLayoutAdminContent() {
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 등록 페이지
|
||||
* 1차적으로 레이아웃만 선택한 후 DB 에 빈 값을 넣고 그 후 상세 값 설정하는 단계를 거침
|
||||
**/
|
||||
function dispLayoutAdminInsert() {
|
||||
// 레이아웃 목록을 세팅
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('insert_layout');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 세부 정보 입력
|
||||
**/
|
||||
function dispLayoutAdminMenu() {
|
||||
// 선택된 레이아웃의 정보르 구해서 세팅
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
||||
// 레이아웃의 정보를 가져옴
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
|
||||
// 등록된 레이아웃이 없으면 오류 표시
|
||||
if(!$layout_info) return $this->dispLayoutAdminContent();
|
||||
|
||||
Context::set('layout_info', $layout_info);
|
||||
|
||||
$this->setTemplateFile('layout_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃의 상세 정보(conf/info.xml)를 팝업 출력
|
||||
**/
|
||||
function dispLayoutAdminInfo() {
|
||||
// 선택된 레이아웃 정보를 구함
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
|
||||
Context::set('layout_info', $layout_info);
|
||||
|
||||
// 레이아웃을 팝업으로 지정
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('layout_detail_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃에서 선택할 수 있는 mid목록을 보여줌
|
||||
**/
|
||||
function dispLayoutAdminMidList() {
|
||||
// mid 목록을 구해옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$mid_list = $oModuleModel->getMidList();
|
||||
Context::set('mid_list', $mid_list);
|
||||
|
||||
// 레이아웃을 팝업으로 지정
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('mid_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 목록을 보여줌
|
||||
**/
|
||||
function dispLayoutAdminDownloadedList() {
|
||||
// 레이아웃 목록을 세팅
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('downloaded_layout_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
39
modules/menu/menu.class.php
Normal file
39
modules/menu/menu.class.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* @class menu
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief menu 모듈의 high class
|
||||
**/
|
||||
|
||||
class menu extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('menu', 'view', 'dispMenuAdminContent');
|
||||
$oModuleController->insertActionForward('menu', 'view', 'dispMenuAdminInsert');
|
||||
|
||||
// 레이아웃에서 사용할 디렉토리 생성
|
||||
FileHandler::makeDir('./files/cache/menu');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function moduleIsInstalled() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layoutController
|
||||
* @class menuController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief layout 모듈의 Controller class
|
||||
* @brief menu 모듈의 Controller class
|
||||
**/
|
||||
|
||||
class layoutController extends layout {
|
||||
class menuController extends menu {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -13,78 +13,41 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 신규 생성
|
||||
* 레이아웃의 신규 생성은 제목만 받아서 layouts테이블에 입력함
|
||||
**/
|
||||
function procLayoutAdminInsert() {
|
||||
$args->layout_srl = getNextSequence();
|
||||
$args->layout = Context::get('layout');
|
||||
$args->title = Context::get('title');
|
||||
|
||||
$output = executeQuery("layout.insertLayout", $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('layout_srl', $args->layout_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 정보 변경
|
||||
* 생성된 레이아웃의 제목과 확장변수(extra_vars)를 적용한다
|
||||
**/
|
||||
function procLayoutAdminUpdate() {
|
||||
// module, act, layout_srl, layout, title을 제외하면 확장변수로 판단.. 좀 구리다..
|
||||
$extra_vars = Context::getRequestVars();
|
||||
unset($extra_vars->module);
|
||||
unset($extra_vars->act);
|
||||
unset($extra_vars->layout_srl);
|
||||
unset($extra_vars->layout);
|
||||
unset($extra_vars->title);
|
||||
|
||||
// DB에 입력하기 위한 변수 설정
|
||||
$args = Context::gets('layout_srl','title');
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
|
||||
$output = executeQuery('layout.updateLayout', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 삭제
|
||||
* @brief 메뉴 삭제
|
||||
* 삭제시 메뉴 xml 캐시 파일도 삭제
|
||||
**/
|
||||
function procLayoutAdminDelete() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
function procMenuAdminDelete() {
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
|
||||
// 캐시 파일 삭제
|
||||
$cache_list = FileHandler::readDir("./files/cache/layout","",false,true);
|
||||
$cache_list = FileHandler::readDir("./files/cache/menu","",false,true);
|
||||
if(count($cache_list)) {
|
||||
foreach($cache_list as $cache_file) {
|
||||
$pos = strpos($cache_file, $layout_srl.'_');
|
||||
$pos = strpos($cache_file, $menu_srl.'_');
|
||||
if($pos>0) unlink($cache_file);
|
||||
}
|
||||
}
|
||||
|
||||
// DB에서 삭제
|
||||
|
||||
// 레이아웃 메뉴 삭제
|
||||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery("layout.deleteLayoutMenus", $args);
|
||||
// 메뉴 메뉴 삭제
|
||||
$args->menu_srl = $menu_srl;
|
||||
$output = executeQuery("menu.deleteMenuMenus", $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 레이아웃 삭제
|
||||
$output = executeQuery("layout.deleteLayout", $args);
|
||||
// 메뉴 삭제
|
||||
$output = executeQuery("menu.deleteMenu", $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃에 메뉴 추가
|
||||
* @brief 메뉴에 메뉴 추가
|
||||
**/
|
||||
function procLayoutAdminInsertMenu() {
|
||||
function procMenuAdminInsertMenu() {
|
||||
// 입력할 변수 정리
|
||||
$source_args = Context::getRequestVars();
|
||||
unset($source_args->module);
|
||||
|
|
@ -97,7 +60,7 @@
|
|||
// 변수를 다시 정리 (form문의 column과 DB column이 달라서)
|
||||
$args->menu_srl = $source_args->menu_srl;
|
||||
$args->parent_srl = $source_args->parent_srl;
|
||||
$args->layout_srl = $source_args->layout_srl;
|
||||
$args->menu_srl = $source_args->menu_srl;
|
||||
$args->menu_id = $source_args->menu_id;
|
||||
$args->name = $source_args->menu_name;
|
||||
$args->url = trim($source_args->menu_url);
|
||||
|
|
@ -108,73 +71,73 @@
|
|||
$args->active_btn = $source_args->menu_active_btn;
|
||||
$args->group_srls = $source_args->group_srls;
|
||||
|
||||
$layout = Context::get('layout');
|
||||
$menu = Context::get('menu');
|
||||
|
||||
// 이미 존재하는지를 확인
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$menu_info = $oLayoutModel->getLayoutMenuInfo($args->menu_srl);
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_info = $oMenuModel->getMenuMenuInfo($args->menu_srl);
|
||||
|
||||
// 존재하게 되면 update를 해준다
|
||||
if($menu_info->menu_srl == $args->menu_srl) {
|
||||
$output = executeQuery('layout.updateLayoutMenu', $args);
|
||||
$output = executeQuery('menu.updateMenuMenu', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 존재하지 않으면 insert를 해준다
|
||||
} else {
|
||||
$args->listorder = -1*$args->menu_srl;
|
||||
$output = executeQuery('layout.insertLayoutMenu', $args);
|
||||
$output = executeQuery('menu.insertMenuMenu', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
// 해당 메뉴의 정보를 구함
|
||||
$layout_info = $oLayoutModel->getLayoutInfo($layout);
|
||||
$menu_title = $layout_info->menu->{$args->menu_id}->name;
|
||||
$menu_info = $oMenuModel->getMenuInfo($menu);
|
||||
$menu_title = $menu_info->menu->{$args->menu_id}->name;
|
||||
|
||||
// XML 파일을 갱신하고 위치을 넘겨 받음
|
||||
$xml_file = $this->makeXmlFile($args->layout_srl, $args->menu_id);
|
||||
$xml_file = $this->makeXmlFile($args->menu_srl, $args->menu_id);
|
||||
|
||||
$this->add('xml_file', $xml_file);
|
||||
$this->add('menu_srl', $args->menu_srl);
|
||||
$this->add('menu_id', $args->menu_id);
|
||||
$this->add('menu_title', $menu_title);
|
||||
|
||||
// 현재 mid에 해당하는 모듈의 layout_srl 을 무조건 변경
|
||||
// 현재 mid에 해당하는 모듈의 menu_srl 을 무조건 변경
|
||||
if(eregi("^mid=", $args->url)) {
|
||||
$target_args->layout_srl = $args->layout_srl;
|
||||
$target_args->menu_srl = $args->menu_srl;
|
||||
$target_args->mid = substr($args->url,4);
|
||||
$output = executeQuery("module.updateModuleLayout", $target_args);
|
||||
$output = executeQuery("module.updateModuleMenu", $target_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 메뉴 삭제
|
||||
* @brief 메뉴 메뉴 삭제
|
||||
**/
|
||||
function procLayoutAdminDeleteMenu() {
|
||||
function procMenuAdminDeleteMenu() {
|
||||
// 변수 정리
|
||||
$args = Context::gets('layout_srl','layout','menu_srl','menu_id');
|
||||
$args = Context::gets('menu_srl','menu','menu_srl','menu_id');
|
||||
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$oMenuModel = &getModel('menu');
|
||||
|
||||
// 원정보를 가져옴
|
||||
$node_info = $oLayoutModel->getLayoutMenuInfo($args->menu_srl);
|
||||
$node_info = $oMenuModel->getMenuMenuInfo($args->menu_srl);
|
||||
if($node_info->parent_srl) $parent_srl = $node_info->parent_srl;
|
||||
|
||||
// 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력
|
||||
$output = executeQuery('layout.getChildMenuCount', $args);
|
||||
$output = executeQuery('menu.getChildMenuCount', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
if($output->data->count>0) return new Object(-1, msg_cannot_delete_for_child);
|
||||
|
||||
// DB에서 삭제
|
||||
$output = executeQuery("layout.deleteLayoutMenu", $args);
|
||||
$output = executeQuery("menu.deleteMenuMenu", $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 해당 메뉴의 정보를 구함
|
||||
$layout_info = $oLayoutModel->getLayoutInfo($args->layout);
|
||||
$menu_title = $layout_info->menu->{$args->menu_id}->name;
|
||||
$menu_info = $oMenuModel->getMenuInfo($args->menu);
|
||||
$menu_title = $menu_info->menu->{$args->menu_id}->name;
|
||||
|
||||
// XML 파일을 갱신하고 위치을 넘겨 받음
|
||||
$xml_file = $this->makeXmlFile($args->layout_srl, $args->menu_id);
|
||||
$xml_file = $this->makeXmlFile($args->menu_srl, $args->menu_id);
|
||||
|
||||
$this->add('xml_file', $xml_file);
|
||||
$this->add('menu_id', $args->menu_id);
|
||||
|
|
@ -183,34 +146,34 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃의 메뉴를 이동
|
||||
* @brief 메뉴의 메뉴를 이동
|
||||
**/
|
||||
function procLayoutAdminMoveMenu() {
|
||||
function procMenuAdminMoveMenu() {
|
||||
// 변수 설정
|
||||
$menu_id = Context::get('menu_id');
|
||||
$source_node_srl = str_replace('menu_'.$menu_id.'_','',Context::get('source_node_srl'));
|
||||
$target_node_srl = str_replace('menu_'.$menu_id.'_','',Context::get('target_node_srl'));
|
||||
|
||||
// target_node 의 값을 구함
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$target_node = $oLayoutModel->getLayoutMenuInfo($target_node_srl);
|
||||
$oMenuModel = &getModel('menu');
|
||||
$target_node = $oMenuModel->getMenuMenuInfo($target_node_srl);
|
||||
|
||||
// source_node에 target_node_srl의 parent_srl, listorder 값을 입력
|
||||
$source_args->menu_srl = $source_node_srl;
|
||||
$source_args->parent_srl = $target_node->parent_srl;
|
||||
$source_args->listorder = $target_node->listorder;
|
||||
$output = executeQuery('layout.updateLayoutMenuParent', $source_args);
|
||||
$output = executeQuery('menu.updateMenuMenuParent', $source_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// target_node의 listorder값을 +1해 준다
|
||||
$target_args->menu_srl = $target_node_srl;
|
||||
$target_args->parent_srl = $target_node->parent_srl;
|
||||
$target_args->listorder = $target_node->listorder -1;
|
||||
$output = executeQuery('layout.updateLayoutMenuParent', $target_args);
|
||||
$output = executeQuery('menu.updateMenuMenuParent', $target_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// xml파일 재생성
|
||||
$xml_file = $this->makeXmlFile($target_node->layout_srl, $menu_id);
|
||||
$xml_file = $this->makeXmlFile($target_node->menu_srl, $menu_id);
|
||||
|
||||
// return 변수 설정
|
||||
$this->add('menu_id', $menu_id);
|
||||
|
|
@ -223,19 +186,19 @@
|
|||
* 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n
|
||||
* 개발 중간의 문제인 것 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능
|
||||
**/
|
||||
function procLayoutAdminMakeXmlFile() {
|
||||
function procMenuAdminMakeXmlFile() {
|
||||
// 입력값을 체크
|
||||
$menu_id = Context::get('menu_id');
|
||||
$layout = Context::get('layout');
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$menu = Context::get('menu');
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
|
||||
// 해당 메뉴의 정보를 구함
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayoutInfo($layout);
|
||||
$menu_title = $layout_info->menu->{$menu_id}->name;
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_info = $oMenuModel->getMenuInfo($menu);
|
||||
$menu_title = $menu_info->menu->{$menu_id}->name;
|
||||
|
||||
// xml파일 재생성
|
||||
$xml_file = $this->makeXmlFile($layout_srl, $menu_id);
|
||||
$xml_file = $this->makeXmlFile($menu_srl, $menu_id);
|
||||
|
||||
// return 값 설정
|
||||
$this->add('menu_id',$menu_id);
|
||||
|
|
@ -246,19 +209,19 @@
|
|||
/**
|
||||
* @brief 메뉴의 xml 파일을 만들고 위치를 return
|
||||
**/
|
||||
function makeXmlFile($layout_srl, $menu_id) {
|
||||
function makeXmlFile($menu_srl, $menu_id) {
|
||||
// xml파일 생성시 필요한 정보가 없으면 그냥 return
|
||||
if(!$layout_srl || !$menu_id) return;
|
||||
if(!$menu_srl || !$menu_id) return;
|
||||
|
||||
// DB에서 layout_srl에 해당하는 메뉴 목록을 listorder순으로 구해옴
|
||||
$args->layout_srl = $layout_srl;
|
||||
// DB에서 menu_srl에 해당하는 메뉴 목록을 listorder순으로 구해옴
|
||||
$args->menu_srl = $menu_srl;
|
||||
$args->menu_id = $menu_id;
|
||||
$output = executeQuery("layout.getLayoutMenuList", $args);
|
||||
$output = executeQuery("menu.getMenuMenuList", $args);
|
||||
if(!$output->toBool()) return;
|
||||
|
||||
// 캐시 파일의 이름을 지정
|
||||
$xml_file = sprintf("./files/cache/layout/%s_%s.xml.php", $layout_srl, $menu_id);
|
||||
$php_file = sprintf("./files/cache/layout/%s_%s.php", $layout_srl, $menu_id);
|
||||
$xml_file = sprintf("./files/cache/menu/%s_%s.xml.php", $menu_srl, $menu_id);
|
||||
$php_file = sprintf("./files/cache/menu/%s_%s.php", $menu_srl, $menu_id);
|
||||
|
||||
// 구해온 데이터가 없다면 노드데이터가 없는 xml 파일만 생성
|
||||
$list = $output->data;
|
||||
|
|
@ -342,7 +305,7 @@
|
|||
|
||||
/**
|
||||
* @brief array로 정렬된 노드들을 php code로 변경하여 return
|
||||
* 레이아웃에서 메뉴를 tpl에 사용시 xml데이터를 사용할 수도 있지만 별도의 javascript 사용이 필요하기에
|
||||
* 메뉴에서 메뉴를 tpl에 사용시 xml데이터를 사용할 수도 있지만 별도의 javascript 사용이 필요하기에
|
||||
* php로 된 캐시파일을 만들어서 db이용없이 바로 메뉴 정보를 구할 수 있도록 한다
|
||||
* 이 캐시는 ModuleHandler::displayContent() 에서 include하여 Context::set() 한다
|
||||
**/
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layoutModel
|
||||
* @class menuModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @version 0.1
|
||||
* @brief layout 모듈의 Model class
|
||||
* @brief menu 모듈의 Model class
|
||||
**/
|
||||
|
||||
class layoutModel extends layout {
|
||||
class menuModel extends menu {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -18,11 +18,11 @@
|
|||
* @brief 특정 menu_srl의 정보를 이용하여 템플릿을 구한후 return
|
||||
* 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return
|
||||
**/
|
||||
function getLayoutAdminMenuTplInfo() {
|
||||
function getMenuAdminTplInfo() {
|
||||
// 해당 메뉴의 정보를 가져오기 위한 변수 설정
|
||||
$menu_id = Context::get('menu_id');
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
$layuot = Context::get('layout');
|
||||
$layuot = Context::get('menu');
|
||||
$parent_srl = Context::get('parent_srl');
|
||||
|
||||
// 회원 그룹의 목록을 가져옴
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
// parent_srl이 있고 menu_srl이 없으면 하부 메뉴 추가임
|
||||
if(!$menu_srl && $parent_srl) {
|
||||
// 상위 메뉴의 정보를 가져옴
|
||||
$parent_info = $this->getLayoutMenuInfo($parent_srl);
|
||||
$parent_info = $this->getMenuMenuInfo($parent_srl);
|
||||
|
||||
// 추가하려는 메뉴의 기본 변수 설정
|
||||
$menu_info->menu_srl = getNextSequence();
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
// root에 메뉴 추가하거나 기존 메뉴의 수정일 경우
|
||||
} else {
|
||||
// menu_srl 이 있으면 해당 메뉴의 정보를 가져온다
|
||||
if($menu_srl) $menu_info = $this->getLayoutMenuInfo($menu_srl);
|
||||
if($menu_srl) $menu_info = $this->getMenuMenuInfo($menu_srl);
|
||||
|
||||
// 찾아진 값이 없다면 신규 메뉴 추가로 보고 menu_srl값만 구해줌
|
||||
if(!$menu_info->menu_srl) {
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
// template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다.
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'layout_menu_info');
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'menu_info');
|
||||
|
||||
// return 할 변수 설정
|
||||
$this->add('menu_id', $menu_id);
|
||||
|
|
@ -64,11 +64,11 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief DB 에 생성된 레이아웃의 목록을 구함
|
||||
* @brief DB 에 생성된 메뉴의 목록을 구함
|
||||
* 생성되었다는 것은 DB에 등록이 되었다는 것을 의미
|
||||
**/
|
||||
function getLayoutList() {
|
||||
$output = executeQuery('layout.getLayoutList');
|
||||
function getMenuList() {
|
||||
$output = executeQuery('menu.getMenuList');
|
||||
if(!$output->data) return;
|
||||
|
||||
if(is_array($output->data)) return $output->data;
|
||||
|
|
@ -76,53 +76,53 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief DB 에 생성된 한개의 레이아웃 정보를 구함
|
||||
* 생성된 레이아웃의 DB정보+XML정보를 return
|
||||
* @brief DB 에 생성된 한개의 메뉴 정보를 구함
|
||||
* 생성된 메뉴의 DB정보+XML정보를 return
|
||||
**/
|
||||
function getLayout($layout_srl) {
|
||||
function getMenu($menu_srl) {
|
||||
// 일단 DB에서 정보를 가져옴
|
||||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery('layout.getLayout', $args);
|
||||
$args->menu_srl = $menu_srl;
|
||||
$output = executeQuery('menu.getMenu', $args);
|
||||
if(!$output->data) return;
|
||||
|
||||
// layout, extra_vars를 정리한 후 xml 파일 정보를 불러옴 (불러올때 결합)
|
||||
// menu, extra_vars를 정리한 후 xml 파일 정보를 불러옴 (불러올때 결합)
|
||||
$info = $output->data;
|
||||
$layout_title = $info->title;
|
||||
$layout = $info->layout;
|
||||
$menu_title = $info->title;
|
||||
$menu = $info->menu;
|
||||
$vars = unserialize($info->extra_vars);
|
||||
|
||||
return $this->getLayoutInfo($layout, $layout_srl, $layout_title, $vars);
|
||||
return $this->getMenuInfo($menu, $menu_srl, $menu_title, $vars);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃의 경로를 구함
|
||||
* @brief 메뉴의 경로를 구함
|
||||
**/
|
||||
function getLayoutPath($layout_name) {
|
||||
$class_path = sprintf('./layouts/%s/', $layout_name);
|
||||
function getMenuPath($menu_name) {
|
||||
$class_path = sprintf('./menus/%s/', $menu_name);
|
||||
if(is_dir($class_path)) return $class_path;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃의 종류와 정보를 구함
|
||||
* 다운로드되어 있는 레이아웃의 종류 (생성과 다른 의미)
|
||||
* @brief 메뉴의 종류와 정보를 구함
|
||||
* 다운로드되어 있는 메뉴의 종류 (생성과 다른 의미)
|
||||
**/
|
||||
function getDownloadedLayoutList() {
|
||||
// 다운받은 레이아웃과 설치된 레이아웃의 목록을 구함
|
||||
$searched_list = FileHandler::readDir('./layouts');
|
||||
function getDownloadedMenuList() {
|
||||
// 다운받은 메뉴과 설치된 메뉴의 목록을 구함
|
||||
$searched_list = FileHandler::readDir('./menus');
|
||||
$searched_count = count($searched_list);
|
||||
if(!$searched_count) return;
|
||||
|
||||
// 찾아진 레이아웃 목록을 loop돌면서 필요한 정보를 간추려 return
|
||||
// 찾아진 메뉴 목록을 loop돌면서 필요한 정보를 간추려 return
|
||||
for($i=0;$i<$searched_count;$i++) {
|
||||
// 레이아웃의 이름
|
||||
$layout = $searched_list[$i];
|
||||
// 메뉴의 이름
|
||||
$menu = $searched_list[$i];
|
||||
|
||||
// 해당 레이아웃의 정보를 구함
|
||||
$layout_info = $this->getLayoutInfo($layout);
|
||||
// 해당 메뉴의 정보를 구함
|
||||
$menu_info = $this->getMenuInfo($menu);
|
||||
|
||||
$list[] = $layout_info;
|
||||
$list[] = $menu_info;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
|
@ -131,59 +131,59 @@
|
|||
* @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
|
||||
* 이것 역시 캐싱을 통해서 xml parsing 시간을 줄인다..
|
||||
**/
|
||||
function getLayoutInfo($layout, $layout_srl = 0, $layout_title = "", $vars = null) {
|
||||
function getMenuInfo($menu, $menu_srl = 0, $menu_title = "", $vars = null) {
|
||||
// 요청된 모듈의 경로를 구한다. 없으면 return
|
||||
$layout_path = $this->getLayoutPath($layout);
|
||||
if(!$layout_path) return;
|
||||
$menu_path = $this->getMenuPath($menu);
|
||||
if(!$menu_path) return;
|
||||
|
||||
// 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
|
||||
$xml_file = sprintf("%sconf/info.xml", $layout_path);
|
||||
$xml_file = sprintf("%sconf/info.xml", $menu_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
|
||||
// cache 파일을 비교하여 문제 없으면 include하고 $layout_info 변수를 return
|
||||
$cache_file = sprintf('./files/cache/layout/%s.%s.cache.php', $layout, Context::getLangType());
|
||||
// cache 파일을 비교하여 문제 없으면 include하고 $menu_info 변수를 return
|
||||
$cache_file = sprintf('./files/cache/menu/%s.%s.cache.php', $menu, Context::getLangType());
|
||||
if(file_exists($cache_file)&&filectime($cache_file)>filectime($xml_file)) {
|
||||
include $cache_file;
|
||||
return $layout_info;
|
||||
return $menu_info;
|
||||
}
|
||||
|
||||
// cache 파일이 없으면 xml parsing하고 변수화 한 후에 캐시 파일에 쓰고 변수 바로 return
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
$xml_obj = $tmp_xml_obj->layout;
|
||||
$xml_obj = $tmp_xml_obj->menu;
|
||||
if(!$xml_obj) return;
|
||||
|
||||
$buff = '';
|
||||
|
||||
// 레이아웃의 제목, 버전
|
||||
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
|
||||
$buff .= sprintf('$layout_info->path = "%s";', $layout_path);
|
||||
$buff .= sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$layout_info->version = "%s";', $xml_obj->attrs->version);
|
||||
$buff .= sprintf('$layout_info->layout_srl = $layout_srl;');
|
||||
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
|
||||
// 메뉴의 제목, 버전
|
||||
$buff .= sprintf('$menu_info->menu = "%s";', $menu);
|
||||
$buff .= sprintf('$menu_info->path = "%s";', $menu_path);
|
||||
$buff .= sprintf('$menu_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$menu_info->version = "%s";', $xml_obj->attrs->version);
|
||||
$buff .= sprintf('$menu_info->menu_srl = $menu_srl;');
|
||||
$buff .= sprintf('$menu_info->menu_title = $menu_title;');
|
||||
|
||||
// 작성자 정보
|
||||
$buff .= sprintf('$layout_info->author->name = "%s";', $xml_obj->author->name->body);
|
||||
$buff .= sprintf('$layout_info->author->email_address = "%s";', $xml_obj->author->attrs->email_address);
|
||||
$buff .= sprintf('$layout_info->author->homepage = "%s";', $xml_obj->author->attrs->link);
|
||||
$buff .= sprintf('$layout_info->author->date = "%s";', $xml_obj->author->attrs->date);
|
||||
$buff .= sprintf('$layout_info->author->description = "%s";', $xml_obj->author->description->body);
|
||||
$buff .= sprintf('$menu_info->author->name = "%s";', $xml_obj->author->name->body);
|
||||
$buff .= sprintf('$menu_info->author->email_address = "%s";', $xml_obj->author->attrs->email_address);
|
||||
$buff .= sprintf('$menu_info->author->homepage = "%s";', $xml_obj->author->attrs->link);
|
||||
$buff .= sprintf('$menu_info->author->date = "%s";', $xml_obj->author->attrs->date);
|
||||
$buff .= sprintf('$menu_info->author->description = "%s";', $xml_obj->author->description->body);
|
||||
|
||||
// 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
|
||||
if(!is_array($xml_obj->extra_vars->var)) $extra_vars[] = $xml_obj->extra_vars->var;
|
||||
else $extra_vars = $xml_obj->extra_vars->var;
|
||||
$extra_var_count = count($extra_vars);
|
||||
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
|
||||
$buff .= sprintf('$menu_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++) {
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->name = "%s";', $var->attrs->id, $var->name->body);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->type = "%s";', $var->attrs->id, $var->type->body);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $var->attrs->id, $var->attrs->id);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->description = "%s";', $var->attrs->id, str_replace('"','\"',$var->description->body));
|
||||
$buff .= sprintf('$menu_info->extra_var->%s->name = "%s";', $var->attrs->id, $var->name->body);
|
||||
$buff .= sprintf('$menu_info->extra_var->%s->type = "%s";', $var->attrs->id, $var->type->body);
|
||||
$buff .= sprintf('$menu_info->extra_var->%s->value = $vars->%s;', $var->attrs->id, $var->attrs->id);
|
||||
$buff .= sprintf('$menu_info->extra_var->%s->description = "%s";', $var->attrs->id, str_replace('"','\"',$var->description->body));
|
||||
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
|
@ -191,7 +191,7 @@
|
|||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++) {
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"] = "%s";', $var->attrs->id, $options[$j]->value->body, $options[$j]->name->body);
|
||||
$buff .= sprintf('$menu_info->extra_var->%s->options["%s"] = "%s";', $var->attrs->id, $options[$j]->value->body, $options[$j]->name->body);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -200,32 +200,32 @@
|
|||
else $menus = $xml_obj->menus->menu;
|
||||
|
||||
$menu_count = count($menus);
|
||||
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
|
||||
$buff .= sprintf('$menu_info->menu_count = "%s";', $menu_count);
|
||||
for($i=0;$i<$menu_count;$i++) {
|
||||
$id = $menus[$i]->attrs->id;
|
||||
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $id);
|
||||
$buff .= sprintf('$layout_info->menu->{%s}->id = "%s";',$id, $menus[$i]->attrs->id);
|
||||
$buff .= sprintf('$layout_info->menu->{%s}->name = "%s";',$id, $menus[$i]->name->body);
|
||||
$buff .= sprintf('$layout_info->menu->{%s}->maxdepth = "%s";',$id, $menus[$i]->maxdepth->body);
|
||||
$buff .= sprintf('$layout_info->menu->{%s}->xml_file = "./files/cache/layout/".$layout_srl."_%s.xml.php";',$id, $id);
|
||||
$buff .= sprintf('$layout_info->menu->{%s}->php_file = "./files/cache/layout/".$layout_srl."_%s.php";',$id, $id);
|
||||
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$menu_info->default_menu = "%s";', $id);
|
||||
$buff .= sprintf('$menu_info->menu->{%s}->id = "%s";',$id, $menus[$i]->attrs->id);
|
||||
$buff .= sprintf('$menu_info->menu->{%s}->name = "%s";',$id, $menus[$i]->name->body);
|
||||
$buff .= sprintf('$menu_info->menu->{%s}->maxdepth = "%s";',$id, $menus[$i]->maxdepth->body);
|
||||
$buff .= sprintf('$menu_info->menu->{%s}->xml_file = "./files/cache/menu/".$menu_srl."_%s.xml.php";',$id, $id);
|
||||
$buff .= sprintf('$menu_info->menu->{%s}->php_file = "./files/cache/menu/".$menu_srl."_%s.php";',$id, $id);
|
||||
}
|
||||
|
||||
$buff = '<?php if(!defined("__ZBXE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
|
||||
if(file_exists($cache_file)) include $cache_file;
|
||||
return $layout_info;
|
||||
return $menu_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 menu_srl의 정보를 return
|
||||
* 이 정보중에 group_srls의 경우는 , 로 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴
|
||||
**/
|
||||
function getLayoutMenuInfo($menu_srl) {
|
||||
function getMenuMenuInfo($menu_srl) {
|
||||
// menu_srl 이 있으면 해당 메뉴의 정보를 가져온다
|
||||
$args->menu_srl = $menu_srl;
|
||||
$output = executeQuery('layout.getLayoutMenu', $args);
|
||||
$output = executeQuery('menu.getMenuMenu', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$node = $output->data;
|
||||
91
modules/menu/menu.view.php
Normal file
91
modules/menu/menu.view.php
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
/**
|
||||
* @class menuView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief menu 모듈의 View class
|
||||
**/
|
||||
|
||||
class menuView extends menu {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 메뉴 관리의 첫 페이지
|
||||
**/
|
||||
function dispMenuAdminContent() {
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_list = $oMenuModel->getMenuList();
|
||||
Context::set('menu_list', $menu_list);
|
||||
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 메뉴 등록/수정 페이지
|
||||
**/
|
||||
function dispMenuAdminInsert() {
|
||||
// 선택된 메뉴의 정보르 구해서 세팅
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
|
||||
// 메뉴의 정보를 가져옴
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_info = $oMenuModel->getMenu($menu_srl);
|
||||
|
||||
// 등록된 메뉴이 없으면 오류 표시
|
||||
if(!$menu_info) return $this->dispMenuAdminContent();
|
||||
|
||||
Context::set('menu_info', $menu_info);
|
||||
|
||||
$this->setTemplateFile('menu_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 메뉴의 상세 정보(conf/info.xml)를 팝업 출력
|
||||
**/
|
||||
function dispMenuAdminInfo() {
|
||||
// 선택된 메뉴 정보를 구함
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_info = $oMenuModel->getMenuInfo(Context::get('selected_menu'));
|
||||
Context::set('menu_info', $menu_info);
|
||||
|
||||
// 메뉴을 팝업으로 지정
|
||||
$this->setMenuFile('popup_menu');
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('menu_detail_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 메뉴에서 선택할 수 있는 mid목록을 보여줌
|
||||
**/
|
||||
function dispMenuAdminMidList() {
|
||||
// mid 목록을 구해옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$mid_list = $oModuleModel->getMidList();
|
||||
Context::set('mid_list', $mid_list);
|
||||
|
||||
// 메뉴을 팝업으로 지정
|
||||
$this->setMenuFile('popup_menu');
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('mid_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 메뉴 목록을 보여줌
|
||||
**/
|
||||
function dispMenuAdminDownloadedList() {
|
||||
// 메뉴 목록을 세팅
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_list = $oMenuModel->getDownloadedMenuList();
|
||||
Context::set('menu_list', $menu_list);
|
||||
|
||||
$this->setTemplateFile('downloaded_menu_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<query id="deleteLayoutMenu" action="delete">
|
||||
<tables>
|
||||
<table name="layout_menu" />
|
||||
<table name="menu" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<query id="deleteLayoutMenus" action="delete">
|
||||
<tables>
|
||||
<table name="layout_menu" />
|
||||
<table name="menu" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<query id="getChildMenuCount" action="select">
|
||||
<tables>
|
||||
<table name="layout_menu" />
|
||||
<table name="menu" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<query id="getLayoutMenu" action="select">
|
||||
<tables>
|
||||
<table name="layout_menu" />
|
||||
<table name="menu" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<query id="getLayoutMenuList" action="select">
|
||||
<tables>
|
||||
<table name="layout_menu" />
|
||||
<table name="menu" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<query id="insertLayoutMenu" action="insert">
|
||||
<tables>
|
||||
<table name="layout_menu" />
|
||||
<table name="menu" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<query id="updateLayoutMenu" action="update">
|
||||
<tables>
|
||||
<table name="layout_menu" />
|
||||
<table name="menu" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="name" var="name" notnull="notnull" />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<query id="updateLayoutMenuParent" action="update">
|
||||
<tables>
|
||||
<table name="layout_menu" />
|
||||
<table name="menu" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="parent_srl" var="parent_srl" default="0" />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<table name="layout_menu">
|
||||
<table name="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" />
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!--#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="popopen('{getUrl('','module','layout','act','dispLayoutAdminInfo','selected_layout',$val->layout)}','layout_info');return false">{$lang->cmd_view}</a></td>
|
||||
<td><a href="{getUrl('act','dispLayoutAdminInsert','layout',$val->layout)}">{$lang->cmd_make}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
{nl2br($val->author->description)}
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<filter name="delete_layout" module="layout" act="procLayoutAdminDelete" confirm_msg_code="confirm_delete">
|
||||
<form>
|
||||
<node target="layout_srl" required="true" />
|
||||
</form>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<filter name="insert_layout" module="layout" act="procLayoutAdminInsert" 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>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<filter name="update_layout_info" module="layout" act="procLayoutAdminUpdate" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="title" required="true" />
|
||||
</form>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<!--%import("js/layout_admin.js")-->
|
||||
|
||||
<!--@if($module == 'admin')-->
|
||||
<div style="margin-bottom:20px;">
|
||||
<span <!--@if($act=='dispLayoutAdminContent')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispLayoutAdminContent')}">{$lang->layout_list}</a>]</span>
|
||||
<span <!--@if($act=='dispLayoutAdminDownloadedList')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispLayoutAdminDownloadedList')}">{$lang->downloaded_list}</a>]</span>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<!--%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','dispLayoutAdminContent')}';return false;" />
|
||||
<input type="submit" value="{$lang->cmd_next}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
<!--%import("filter/update_layout_info.xml")-->
|
||||
<!--%import("filter/insert_layout_menu.xml")-->
|
||||
<!--%import("filter/delete_layout_menu.xml")-->
|
||||
<!--%import("filter/move_layout_menu.xml")-->
|
||||
|
|
@ -12,79 +11,6 @@
|
|||
<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="{htmlspecialchars($layout_info->layout_title)}" /></td>
|
||||
</tr>
|
||||
<!--@foreach($layout_info->extra_var as $id => $var)-->
|
||||
<tr>
|
||||
<th rowspan="2">{$var->name}</th>
|
||||
<!--@if($var->type == "text")-->
|
||||
<td><input type="text" name="{$id}" value="{htmlspecialchars($var->value)}" /></td>
|
||||
|
||||
<!--@elseif($var->type == "textarea")-->
|
||||
<td><textarea name="{$id}">{htmlspecialchars($var->value)}</textarea></td>
|
||||
|
||||
<!--@elseif($var->type == "select")-->
|
||||
<td>
|
||||
<select name="{$id}">
|
||||
<!--@foreach($var->options as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($key==$var->value)-->selected="true"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</td>
|
||||
<!--@end-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$var->description}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<!--@if($module=='admin')-->
|
||||
<input type="button" value="{$lang->cmd_list}" onclick="location.href='{getUrl('act','dispLayoutAdminContent')}';return false;"/>
|
||||
<!--@else-->
|
||||
<input type="button" value="{$lang->cmd_back}" onclick="location.href='{getUrl('act','')}';return false;"/>
|
||||
<!--@end-->
|
||||
<input type="submit" value="{$lang->cmd_save}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom:10px;">
|
||||
<div>
|
||||
<h4>{$lang->menu_management}</h4>
|
||||
|
|
@ -97,7 +23,7 @@
|
|||
<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}" />
|
||||
<input type="hidden" name="xml_file" value="{$menu_info->xml_file}" />
|
||||
|
||||
<table border="1" width="100%">
|
||||
<col width="300" />
|
||||
|
|
@ -122,7 +48,7 @@
|
|||
</table>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
loadTreeMenu("{$menu->xml_file}", "{$menu_id}", "menu_zone_{$menu_id}", "{$menu->name} ({$lang->limit_menu_depth} : {$menu->maxdepth} {$lang->depth})", doGetMenuInfo, 0, doMoveTree);
|
||||
loadTreeMenu("{$menu_info->xml_file}", "{$menu_id}", "menu_zone_{$menu_id}", "{$menu_info->name} ({$lang->limit_menu_depth} : {$menu_info->maxdepth} {$lang->depth})", doGetMenuInfo, 0, doMoveTree);
|
||||
</script>
|
||||
<br />
|
||||
<!--@end-->
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">{$lang->menu_url}</th>
|
||||
<td><input type="text" name="menu_url" value="{htmlspecialchars($menu_info->url)}" /><input type="button" value="{$lang->cmd_search_mid}" onclick="popopen('{getUrl('module','layout','act','dispLayoutAdminMidList','menu_id', $menu_id)}');return false;"/></td>
|
||||
<td><input type="text" name="menu_url" value="{htmlspecialchars($menu_info->url)}" /><input type="button" value="{$lang->cmd_search_mid}" onclick="popopen('{getUrl('module','menu','act','dispMenuAdminMidList','menu_id', $menu_id)}');return false;"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$lang->about_menu_url}</td>
|
||||
Loading…
Add table
Add a link
Reference in a new issue