mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-02 16:52:16 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1166 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f76be59f46
commit
8b610f5334
47 changed files with 1358 additions and 681 deletions
|
|
@ -14,55 +14,6 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 menu_srl의 정보를 이용하여 템플릿을 구한후 return
|
||||
* 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return
|
||||
**/
|
||||
function getLayoutAdminMenuTplInfo() {
|
||||
// 해당 메뉴의 정보를 가져오기 위한 변수 설정
|
||||
$menu_id = Context::get('menu_id');
|
||||
$menu_srl = Context::get('menu_srl');
|
||||
$layuot = Context::get('layout');
|
||||
$parent_srl = Context::get('parent_srl');
|
||||
|
||||
// 회원 그룹의 목록을 가져옴
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
// parent_srl이 있고 menu_srl이 없으면 하부 메뉴 추가임
|
||||
if(!$menu_srl && $parent_srl) {
|
||||
// 상위 메뉴의 정보를 가져옴
|
||||
$parent_info = $this->getLayoutMenuInfo($parent_srl);
|
||||
|
||||
// 추가하려는 메뉴의 기본 변수 설정
|
||||
$menu_info->menu_srl = getNextSequence();
|
||||
$menu_info->parent_srl = $parent_srl;
|
||||
$menu_info->parent_menu_name = $parent_info->name;
|
||||
|
||||
// root에 메뉴 추가하거나 기존 메뉴의 수정일 경우
|
||||
} else {
|
||||
// menu_srl 이 있으면 해당 메뉴의 정보를 가져온다
|
||||
if($menu_srl) $menu_info = $this->getLayoutMenuInfo($menu_srl);
|
||||
|
||||
// 찾아진 값이 없다면 신규 메뉴 추가로 보고 menu_srl값만 구해줌
|
||||
if(!$menu_info->menu_srl) {
|
||||
$menu_info->menu_srl = getNextSequence();
|
||||
}
|
||||
}
|
||||
|
||||
Context::set('menu_info', $menu_info);
|
||||
|
||||
// template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다.
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'layout_menu_info');
|
||||
|
||||
// return 할 변수 설정
|
||||
$this->add('menu_id', $menu_id);
|
||||
$this->add('tpl', $tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DB 에 생성된 레이아웃의 목록을 구함
|
||||
* 생성되었다는 것은 DB에 등록이 되었다는 것을 의미
|
||||
|
|
@ -218,20 +169,5 @@
|
|||
return $layout_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 menu_srl의 정보를 return
|
||||
* 이 정보중에 group_srls의 경우는 , 로 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴
|
||||
**/
|
||||
function getLayoutMenuInfo($menu_srl) {
|
||||
// menu_srl 이 있으면 해당 메뉴의 정보를 가져온다
|
||||
$args->menu_srl = $menu_srl;
|
||||
$output = executeQuery('layout.getLayoutMenu', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$node = $output->data;
|
||||
if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
|
||||
else $node->group_srls = array();
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue