mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1188 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
1b57bf401f
commit
6a0f11e893
8 changed files with 76 additions and 8 deletions
|
|
@ -55,10 +55,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
// 정해진 메뉴가 있으면 해당 메뉴에 속한 모듈/mid의 layout값을 모두 변경
|
||||
// 정해진 메뉴가 있으면 모듈 및 메뉴에 대한 레이아웃 연동
|
||||
if(count($menu_srl_list)) {
|
||||
// 해당 메뉴와 레이아웃 값을 매핑
|
||||
$oMenuController = &getController('menu');
|
||||
$oMenuController->updateMenuLayout($args->layout_srl, $menu_srl_list);
|
||||
|
||||
// 해당 메뉴에 속한 mid의 layout값을 모두 변경
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleLayout($args->layout_srl, implode(',',$menu_srl_list));
|
||||
$oModuleController->updateModuleLayout($args->layout_srl, $menu_srl_list);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,8 +126,17 @@
|
|||
// url에 mid=? 있을 경우 기록 남김
|
||||
if(substr($args->url,0,4)=='mid=') {
|
||||
$mid = substr($args->url,4);
|
||||
|
||||
$mid_args->menu_srl = $args->menu_srl;
|
||||
$mid_args->mid = $mid;
|
||||
|
||||
// menu_srl에 해당하는 레이아웃 값을 구함
|
||||
$output = executeQuery('menu.getMenuLayout', $args);
|
||||
if($output->data->layout_srl) $mid_args->layout_srl = $output->data->layout_srl;
|
||||
|
||||
// 해당 mid의 메뉴값을 선택된 메뉴로 변경
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleMenu($mid, $args->menu_srl);
|
||||
$oModuleController->updateModuleMenu($args);
|
||||
}
|
||||
|
||||
$this->add('xml_file', $xml_file);
|
||||
|
|
@ -388,5 +397,26 @@
|
|||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 메뉴와 레이아웃 매핑
|
||||
* 레이아웃에서 메뉴를 지정할때 지정된 메뉴의 기본 레이아웃을 매핑
|
||||
**/
|
||||
function updateMenuLayout($layout_srl, $menu_srl_list) {
|
||||
if(!count($menu_srls)) return;
|
||||
|
||||
// 일단 menu_srls의 값을 지움
|
||||
$args->menu_srls = $menu_srls;
|
||||
$output = executeQuery('menu.deleteMenuLayout', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// menu_srls, layout_srl 매핑
|
||||
for($i=0;$i<count($menu_srl_list);$i++) {
|
||||
$args->menu_srl = $menu_srl_list[$i];
|
||||
$output = executeQuery('menu.insertMenuLayout', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
8
modules/menu/queries/deleteMenuLayout.xml
Normal file
8
modules/menu/queries/deleteMenuLayout.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteMenuLayout" action="delete">
|
||||
<tables>
|
||||
<table name="menu_layout" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/menu/queries/getMenuLayout.xml
Normal file
11
modules/menu/queries/getMenuLayout.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getMenuLayout" action="select">
|
||||
<tables>
|
||||
<table name="menu_layout" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="layout_srl" alias="layout_srl" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
9
modules/menu/queries/insertMenuLayout.xml
Normal file
9
modules/menu/queries/insertMenuLayout.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<query id="insertMenuLayout" action="insert">
|
||||
<tables>
|
||||
<table name="menu_layout" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="menu_srl" var="menu_srl" filter="number" notnull="notnull" />
|
||||
<column name="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||
</columns>
|
||||
</query>
|
||||
4
modules/menu/schemas/menu_layout.xml
Normal file
4
modules/menu/schemas/menu_layout.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<table name="menu_layout">
|
||||
<column name="menu_srl" type="number" size="12" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="layout_srl" type="number" size="12" notnull="notnull" />
|
||||
</table>
|
||||
|
|
@ -272,18 +272,18 @@
|
|||
/**
|
||||
* @brief 지정된 menu_srl에 속한 mid 의 menu_srl 을 변경
|
||||
**/
|
||||
function updateModuleMenu($mid, $menu_srl) {
|
||||
$args->mid = $mid;
|
||||
$args->menu_srl = $menu_srl;
|
||||
function updateModuleMenu($args) {
|
||||
return executeQuery('module.updateModuleMenu', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 지정된 menu_srl에 속한 mid 의 layout_srl을 변경
|
||||
**/
|
||||
function updateModuleLayout($layout_srl, $menu_srls) {
|
||||
function updateModuleLayout($layout_srl, $menu_srl_list) {
|
||||
if(!count($menu_srls)) return;
|
||||
|
||||
$args->layout_srl = $layout_srl;
|
||||
$args->menu_srls = $menu_srls;
|
||||
$args->menu_srls = implode(',',$menu_srl_list);
|
||||
return executeQuery('module.updateModuleLayout', $args);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
</tables>
|
||||
<columns>
|
||||
<column name="menu_srl" var="menu_srl" />
|
||||
<column name="layout_srl" var="layout_srl" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="mid" var="mid" notnull="notnull"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue