mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +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');
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 파일을 갱신
|
||||
* 관리자페이지에서 메뉴 구성 후 간혹 xml파일이 재생성 안되는 경우가 있는데\n
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
function init() {
|
||||
if(substr_count($this->act, 'Admin')) $this->initAdmin();
|
||||
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()
|
||||
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->page_count = $this->module_info->page_count?$this->module_info->page_count:10;
|
||||
|
|
@ -85,6 +86,8 @@
|
|||
|
||||
// rss url
|
||||
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="procBlogAdminDeleteCategory" type="controller" standalone="true" />
|
||||
<action name="procBlogAdminMakeXmlFile" type="controller" standalone="true" />
|
||||
<action name="procBlogAdminMoveCategory" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</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;
|
||||
}
|
||||
|
||||
#blog_category {
|
||||
padding:10px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
|
||||
/* 컨텐츠 */
|
||||
.layout_content {
|
||||
position:absolute;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<!-- 블로그 메뉴를 common/js/tree_menu.js를 이용해서 표시 -->
|
||||
<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>
|
||||
|
||||
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
<!--@end-->
|
||||
|
||||
<!-- 블로그 메뉴 출력 -->
|
||||
<div id="menu"></div>
|
||||
<div id="blog_category"></div>
|
||||
|
||||
<!--@if($rss_url)-->
|
||||
<!-- rss 버튼 -->
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@
|
|||
<title xml:lang="ko">프로필</title>
|
||||
<description lang="ko">간단한 프로필을 입력해주세요</description>
|
||||
</var>
|
||||
<var name="memo" type="textarea">
|
||||
<title xml:lang="ko">분류 메뉴명</title>
|
||||
<description lang="ko">분류 메뉴의 제목을 입력해주세요.</description>
|
||||
<var name="category_name" type="text">
|
||||
<title xml:lang="ko">카테고리명</title>
|
||||
<description lang="ko">카테고리의 이름을 입력해주세요.</description>
|
||||
</var>
|
||||
</extra_vars>
|
||||
</skin>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<td>
|
||||
<div id="zone_category"></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>
|
||||
<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 />
|
||||
<parameter />
|
||||
<response callback_func="completeMoveBlogCategory">
|
||||
<response callback_func="completeMoveCategory">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
<tag name="xml_file" />
|
||||
|
|
|
|||
|
|
@ -181,8 +181,9 @@ function completeInsertCategory(ret_obj) {
|
|||
|
||||
/* 카테고리를 드래그하여 이동한 후 실행할 함수 , 이동하는 category_srl과 대상 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");
|
||||
fo_obj.category_id.value = category_id;
|
||||
fo_obj.source_category_srl.value = source_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 xml_file = ret_obj['xml_file'];
|
||||
|
||||
var fo_category = xGetElementById("fo_category");
|
||||
if(!fo_category) return;
|
||||
|
||||
var title = fo_category.title.value;
|
||||
loadTreeMenu(xml_file, 'category', "category_zone_category", title, doGetCategoryInfo, source_category_srl, doMoveTree);
|
||||
loadTreeMenu(xml_file, 'category', "zone_category", category_title, doGetCategoryInfo, source_category_srl, doMoveTree);
|
||||
}
|
||||
|
||||
/* 카테고리 목록 갱신 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue