mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-31 00:59:58 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1246 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d0f90bf3c9
commit
495ac679be
10 changed files with 67 additions and 16 deletions
|
|
@ -458,6 +458,39 @@
|
||||||
$this->setMessage('success_deleted');
|
$this->setMessage('success_deleted');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 카테고리 이동
|
||||||
|
**/
|
||||||
|
function procBlogAdminMoveCategory() {
|
||||||
|
$source_category_srl = Context::get('source_category_srl');
|
||||||
|
$target_category_srl = Context::get('target_category_srl');
|
||||||
|
|
||||||
|
$oBlogModel = &getModel('blog');
|
||||||
|
$target_category = $oBlogModel->getCategoryInfo($target_category_srl);
|
||||||
|
$source_category = $oBlogModel->getCategoryInfo($source_category_srl);
|
||||||
|
|
||||||
|
// source_category에 target_category_srl의 parent_srl, listorder 값을 입력
|
||||||
|
$source_args->category_srl = $source_category_srl;
|
||||||
|
$source_args->parent_srl = $target_category->parent_srl;
|
||||||
|
$source_args->listorder = $target_category->listorder;
|
||||||
|
$output = executeQuery('blog.updateCategoryParent', $source_args);
|
||||||
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
|
// target_category의 listorder값을 +1해 준다
|
||||||
|
$target_args->category_srl = $target_category_srl;
|
||||||
|
$target_args->parent_srl = $target_category->parent_srl;
|
||||||
|
$target_args->listorder = $target_category->listorder -1;
|
||||||
|
$output = executeQuery('blog.updateCategoryParent', $target_args);
|
||||||
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
|
// xml파일 재생성
|
||||||
|
$xml_file = $this->makeXmlFile($target_category->module_srl);
|
||||||
|
|
||||||
|
// return 변수 설정
|
||||||
|
$this->add('xml_file', $xml_file);
|
||||||
|
$this->add('source_category_srl', $source_category_srl);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief xml 파일을 갱신
|
* @brief xml 파일을 갱신
|
||||||
* 관리자페이지에서 메뉴 구성 후 간혹 xml파일이 재생성 안되는 경우가 있는데\n
|
* 관리자페이지에서 메뉴 구성 후 간혹 xml파일이 재생성 안되는 경우가 있는데\n
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@
|
||||||
function init() {
|
function init() {
|
||||||
if(substr_count($this->act, 'Admin')) $this->initAdmin();
|
if(substr_count($this->act, 'Admin')) $this->initAdmin();
|
||||||
else $this->initNormal();
|
else $this->initNormal();
|
||||||
|
|
||||||
|
// 카테고리 xml 파일 위치 지정
|
||||||
|
$this->module_info->category_xml_file = sprintf('./files/cache/blog_category/%d.xml.php', $this->module_info->module_srl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -67,8 +70,6 @@
|
||||||
// 템플릿에서 사용할 변수를 Context::set()
|
// 템플릿에서 사용할 변수를 Context::set()
|
||||||
if($this->module_srl) Context::set('module_srl',$this->module_srl);
|
if($this->module_srl) Context::set('module_srl',$this->module_srl);
|
||||||
|
|
||||||
Context::set('module_info',$this->module_info);
|
|
||||||
|
|
||||||
// 기본 모듈 정보들 설정
|
// 기본 모듈 정보들 설정
|
||||||
$this->list_count = $this->module_info->list_count?$this->module_info->list_count:1;
|
$this->list_count = $this->module_info->list_count?$this->module_info->list_count:1;
|
||||||
$this->page_count = $this->module_info->page_count?$this->module_info->page_count:10;
|
$this->page_count = $this->module_info->page_count?$this->module_info->page_count:10;
|
||||||
|
|
@ -85,6 +86,8 @@
|
||||||
|
|
||||||
// rss url
|
// rss url
|
||||||
if($this->grant->list) Context::set('rss_url', getUrl('','mid',$this->mid,'act','dispBlogRss'));
|
if($this->grant->list) Context::set('rss_url', getUrl('','mid',$this->mid,'act','dispBlogRss'));
|
||||||
|
|
||||||
|
Context::set('module_info',$this->module_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -64,5 +64,6 @@
|
||||||
<action name="procBlogAdminInsertCategory" type="controller" standalone="true" />
|
<action name="procBlogAdminInsertCategory" type="controller" standalone="true" />
|
||||||
<action name="procBlogAdminDeleteCategory" type="controller" standalone="true" />
|
<action name="procBlogAdminDeleteCategory" type="controller" standalone="true" />
|
||||||
<action name="procBlogAdminMakeXmlFile" type="controller" standalone="true" />
|
<action name="procBlogAdminMakeXmlFile" type="controller" standalone="true" />
|
||||||
|
<action name="procBlogAdminMoveCategory" type="controller" standalone="true" />
|
||||||
</actions>
|
</actions>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
12
modules/blog/queries/updateCategoryParent.xml
Normal file
12
modules/blog/queries/updateCategoryParent.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<query id="updateCategoryParent" action="update">
|
||||||
|
<tables>
|
||||||
|
<table name="blog_category" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="parent_srl" var="parent_srl" default="0" />
|
||||||
|
<column name="listorder" var="listorder" notnull="notnull" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="category_srl" var="category_srl" filter="number" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
|
|
@ -41,6 +41,11 @@ body {
|
||||||
z-index:10;
|
z-index:10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#blog_category {
|
||||||
|
padding:10px;
|
||||||
|
margin-bottom:10px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 컨텐츠 */
|
/* 컨텐츠 */
|
||||||
.layout_content {
|
.layout_content {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<!-- 블로그 메뉴를 common/js/tree_menu.js를 이용해서 표시 -->
|
<!-- 블로그 메뉴를 common/js/tree_menu.js를 이용해서 표시 -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//loadTreeMenu("{$blog_menu->xml_file}", "blog_menu", "menu", "{$module_info->main_menu_name?$module_info->main_menu_name:'home'}");
|
loadTreeMenu("{$module_info->category_xml_file}", "blog_category", "blog_category", "{$module_info->category_name?$module_info->category_name:'category'}");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
||||||
<!-- 블로그 메뉴 출력 -->
|
<!-- 블로그 메뉴 출력 -->
|
||||||
<div id="menu"></div>
|
<div id="blog_category"></div>
|
||||||
|
|
||||||
<!--@if($rss_url)-->
|
<!--@if($rss_url)-->
|
||||||
<!-- rss 버튼 -->
|
<!-- rss 버튼 -->
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@
|
||||||
<title xml:lang="ko">프로필</title>
|
<title xml:lang="ko">프로필</title>
|
||||||
<description lang="ko">간단한 프로필을 입력해주세요</description>
|
<description lang="ko">간단한 프로필을 입력해주세요</description>
|
||||||
</var>
|
</var>
|
||||||
<var name="memo" type="textarea">
|
<var name="category_name" type="text">
|
||||||
<title xml:lang="ko">분류 메뉴명</title>
|
<title xml:lang="ko">카테고리명</title>
|
||||||
<description lang="ko">분류 메뉴의 제목을 입력해주세요.</description>
|
<description lang="ko">카테고리의 이름을 입력해주세요.</description>
|
||||||
</var>
|
</var>
|
||||||
</extra_vars>
|
</extra_vars>
|
||||||
</skin>
|
</skin>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<td>
|
<td>
|
||||||
<div id="zone_category"></div>
|
<div id="zone_category"></div>
|
||||||
<div>
|
<div>
|
||||||
<input type="checkbox" id="menu_enable_move" /> <label for="menu_enable_move">{$lang->cmd_enable_move_category}</label>
|
<input type="checkbox" id="category_enable_move" /> <label for="category_enable_move">{$lang->cmd_enable_move_category}</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<input type="button" value="{$lang->cmd_insert}" onclick="doInsertCategory(0);return false;" />
|
<input type="button" value="{$lang->cmd_insert}" onclick="doInsertCategory(0);return false;" />
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<filter name="move_category" module="menu" act="procBlogAdminMoveCategory" confirm_msg_code="confirm_move">
|
<filter name="move_category" module="blog" act="procBlogAdminMoveCategory" confirm_msg_code="confirm_move">
|
||||||
<form />
|
<form />
|
||||||
<parameter />
|
<parameter />
|
||||||
<response callback_func="completeMoveBlogCategory">
|
<response callback_func="completeMoveCategory">
|
||||||
<tag name="error" />
|
<tag name="error" />
|
||||||
<tag name="message" />
|
<tag name="message" />
|
||||||
<tag name="xml_file" />
|
<tag name="xml_file" />
|
||||||
|
|
|
||||||
|
|
@ -181,8 +181,9 @@ function completeInsertCategory(ret_obj) {
|
||||||
|
|
||||||
/* 카테고리를 드래그하여 이동한 후 실행할 함수 , 이동하는 category_srl과 대상 category_srl을 받음 */
|
/* 카테고리를 드래그하여 이동한 후 실행할 함수 , 이동하는 category_srl과 대상 category_srl을 받음 */
|
||||||
function doMoveTree(category_id, source_category_srl, target_category_srl) {
|
function doMoveTree(category_id, source_category_srl, target_category_srl) {
|
||||||
|
source_category_srl = source_category_srl.replace(/menu_category_/,'');
|
||||||
|
target_category_srl = target_category_srl.replace(/menu_category_/,'');
|
||||||
var fo_obj = xGetElementById("fo_move_category");
|
var fo_obj = xGetElementById("fo_move_category");
|
||||||
fo_obj.category_id.value = category_id;
|
|
||||||
fo_obj.source_category_srl.value = source_category_srl;
|
fo_obj.source_category_srl.value = source_category_srl;
|
||||||
fo_obj.target_category_srl.value = target_category_srl;
|
fo_obj.target_category_srl.value = target_category_srl;
|
||||||
|
|
||||||
|
|
@ -199,11 +200,7 @@ function completeMoveCategory(ret_obj) {
|
||||||
var source_category_srl = ret_obj['source_category_srl'];
|
var source_category_srl = ret_obj['source_category_srl'];
|
||||||
var xml_file = ret_obj['xml_file'];
|
var xml_file = ret_obj['xml_file'];
|
||||||
|
|
||||||
var fo_category = xGetElementById("fo_category");
|
loadTreeMenu(xml_file, 'category', "zone_category", category_title, doGetCategoryInfo, source_category_srl, doMoveTree);
|
||||||
if(!fo_category) return;
|
|
||||||
|
|
||||||
var title = fo_category.title.value;
|
|
||||||
loadTreeMenu(xml_file, 'category', "category_zone_category", title, doGetCategoryInfo, source_category_srl, doMoveTree);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 카테고리 목록 갱신 */
|
/* 카테고리 목록 갱신 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue