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

This commit is contained in:
zero 2007-03-08 01:11:47 +00:00
parent 25516bb21c
commit b6268cf13f
7 changed files with 73 additions and 1 deletions

View file

@ -9,6 +9,7 @@
<action name="getLayoutMenuSrl" type="model" standalone="true" />
<action name="getMenuTplInfo" type="model" standalone="true" />
<action name="procInsertLayout" 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" />

View file

@ -92,6 +92,36 @@
$this->add('menu_title', $menu_title);
}
/**
* @brief 레이아웃 삭제
**/
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 레이아웃 메뉴 삭제
**/

View 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>

View 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>

View 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>

View file

@ -1,7 +1,14 @@
<!--%import("js/admin.js")-->
<!--%import("filter/delete_layout.xml")-->
<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>
@ -19,7 +26,7 @@
<td>{$val->layout}</td>
<td><a href="#" onclick="location.href='{getUrl('act','dispLayoutInfo','layout_srl',$val->layout_srl)}';return false;">{$val->title}</a></td>
<td>{zdate($val->regdate,"Y-m-d")}</td>
<td><a href="{getUrl('act','dispAdminDeleteBoard','module_srl', $val->module_srl)}">{$lang->cmd_delete}</a></td>
<td><a href="#" onclick="doDeleteLayout('{$val->layout_srl}');return false;">{$lang->cmd_delete}</a></td>
</tr>
<!--@end-->
</table>

View file

@ -82,3 +82,12 @@ function completeGetMenuInfo(ret_obj, response_tags) {
xInnerHtml("menu_zone_info_"+menu_id, "");
xInnerHtml("menu_zone_info_"+menu_id, tpl);
}
/* 레이아웃 삭제 */
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);
}