git-svn-id: http://xe-core.googlecode.com/svn/trunk@1180 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-04-16 12:45:11 +00:00
parent 6268b48e0b
commit e3be6964f7
8 changed files with 78 additions and 8 deletions

View file

@ -41,10 +41,31 @@
unset($extra_vars->layout);
unset($extra_vars->title);
// DB에 입력하기 위한 변수 설정
$args = Context::gets('layout_srl','title');
// 레이아웃의 정보를 가져옴
$oLayoutModel = &getModel('layout');
$layout_info = $oLayoutModel->getLayout($args->layout_srl);
$menus = get_object_vars($layout_info->menu);
if(count($menus)) {
foreach($menus as $menu_id => $val) {
$menu_srl = Context::get($menu_id);
if($menu_srl) {
$menu_srl_list[] = $menu_srl;
}
}
// 정해진 메뉴가 있으면 해당 메뉴에 속한 모듈/mid의 layout값을 모두 변경
if(count($menu_srl_list)) {
$oModuleController = &getController('module');
$oModuleController->updateModuleLayout($args->layout_srl, implode(',',$menu_srl_list));
}
}
// DB에 입력하기 위한 변수 설정
$args->extra_vars = serialize($extra_vars);
$output = executeQuery('layout.updateLayout', $args);
if(!$output->toBool()) return $output;

View file

@ -123,8 +123,11 @@
// XML 파일을 갱신하고 위치을 넘겨 받음
$xml_file = $this->makeXmlFile($args->menu_srl);
// url에 mid=? 또는 module=? 가 있을 경우 기록 남김
if(eregi("^(mid|module)", $args->url)) {
// url에 mid=? 있을 경우 기록 남김
if(sbustr($args->url,0,4)=='mid=') {
$mid = substr($args->url,4);
$oModuleController = &getController('module');
$oModuleController->updateModuleMenu($mid, $args->menu_srl);
}
$this->add('xml_file', $xml_file);

View file

@ -0,0 +1,9 @@
<filter name="update_menu_title" module="menu" act="procMenuAdminUpdate" confirm_msg_code="confirm_modify">
<form>
<node target="menu_srl" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -268,5 +268,23 @@
$args->module_category_srl = Context::get('module_category_srl');
return executeQuery('module.deleteModuleCategory', $args);
}
/**
* @brief 지정된 menu_srl에 속한 mid menu_srl 변경
**/
function updateModuleMenu($mid, $menu_srl) {
$args->mid = $mid;
$args->menu_srl = $menu_srl;
return executeQuery('module.updateModuleMenu', $args);
}
/**
* @brief 지정된 menu_srl에 속한 mid layout_srl을 변경
**/
function updateModuleLayout($layout_srl, $menu_srls) {
$args->layout_srl = $layout_srl;
$args->menu_srls = $menu_srls;
return executeQuery('module.updateModuleLayout', $args);
}
}
?>

View file

@ -0,0 +1,11 @@
<query id="updateModuleLayout" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="layout_srl" var="layout_srl" />
</columns>
<conditions>
<condition operation="in" column="menu_srl" var="menu_srls" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="updateModuleMenu" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="menu_srl" var="menu_srl" />
</columns>
<conditions>
<condition operation="equal" column="mid" var="mid" notnull="notnull"/>
</conditions>
</query>

View file

@ -1,5 +0,0 @@
<table name="module_layout">
<column name="zbxe_url" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="menu_srl" type="number" size="11" notnull="notnull" />
<column name="layout_srl" type="number" size="11" notnull="notnull" />
</table>

View file

@ -2,6 +2,8 @@
<column name="module_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module" type="varchar" size="80" notnull="notnull" index="idx_module" />
<column name="module_category_srl" type="number" size="11" default="0" index="idx_module_category" />
<column name="layout_srl" type="number" size="11" default="0" />
<column name="menu_srl" type="number" size="11" default="0" />
<column name="mid" type="varchar" size="40" notnull="notnull" unique="unique_mid"/>
<column name="skin" type="varchar" size="250" />
<column name="browser_title" type="varchar" size="250" notnull="notnull"/>