mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 12:49:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1254 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4d61c7a666
commit
1d28f14c5f
8 changed files with 110 additions and 14 deletions
|
|
@ -325,11 +325,13 @@
|
|||
|
||||
// 기본 값외의 것들을 정리
|
||||
$extra_var = delObjectVars(Context::getRequestVars(), $args);
|
||||
unset($extra_var->mo);
|
||||
unset($extra_var->act);
|
||||
unset($extra_var->page);
|
||||
unset($extra_var->blog_name);
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// module_srl이 넘어오면 원 모듈이 있는지 확인
|
||||
if($args->module_srl) {
|
||||
$oModuleModel = &getModel('module');
|
||||
|
|
@ -350,8 +352,12 @@
|
|||
|
||||
// module_srl의 값에 따라 insert/update
|
||||
if(!$args->module_srl) {
|
||||
// 블로그 등록
|
||||
$output = $oModuleController->insertModule($args);
|
||||
$msg_code = 'success_registed';
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 글작성, 파일첨부, 댓글 파일첨부, 관리에 대한 권한 지정
|
||||
if($output->toBool()) {
|
||||
|
|
@ -362,14 +368,52 @@
|
|||
$module_srl = $output->get('module_srl');
|
||||
$grants = serialize(array('write_document'=>array($admin_group_srl), 'fileupload'=>array($admin_group_srl), 'comment_fileupload'=>array($admin_group_srl), 'manager'=>array($admin_group_srl)));
|
||||
|
||||
$oModuleController->updateModuleGrant($module_srl, $grants);
|
||||
$output = $oModuleController->updateModuleGrant($module_srl, $grants);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// 레이아웃 등록
|
||||
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
|
||||
$layout_args->layout = 'blog';
|
||||
$layout_args->title = sprintf('%s (%s)',$args->browser_title, $args->mid);
|
||||
$layout_args->layout_path = sprintf('./modules/blog/skin/%s/layout.html', $args->skin);
|
||||
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->insertLayout($layout_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$msg_code = 'success_registed';
|
||||
} else {
|
||||
// 블로그 데이터 수정
|
||||
$output = $oModuleController->updateModule($args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 레이아웃 수정
|
||||
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
|
||||
$layout_args->title = $args->browser_title;
|
||||
$layout_args->extra_vars = $args->extra_vars;
|
||||
$layout_args->layout_path = sprintf('./modules/blog/skin/%s/layout.html', $args->skin);
|
||||
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->updateLayout($layout_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$msg_code = 'success_updated';
|
||||
}
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
$oDB->commit();
|
||||
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->add('module_srl',$output->get('module_srl'));
|
||||
|
|
@ -382,10 +426,28 @@
|
|||
function procBlogAdminDeleteBlog() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 원본을 구해온다
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->deleteModule($module_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 레이아웃 삭제
|
||||
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
|
||||
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->deleteLayout($layout_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$this->add('module','blog');
|
||||
$this->add('page',Context::get('page'));
|
||||
|
|
|
|||
|
|
@ -22,12 +22,17 @@
|
|||
$args->layout = Context::get('layout');
|
||||
$args->title = Context::get('title');
|
||||
|
||||
$output = executeQuery("layout.insertLayout", $args);
|
||||
$output = $this->insertLayout($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('layout_srl', $args->layout_srl);
|
||||
}
|
||||
|
||||
function insertLayout($args) {
|
||||
$output = executeQuery("layout.insertLayout", $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 정보 변경
|
||||
* 생성된 레이아웃의 제목과 확장변수(extra_vars)를 적용한다
|
||||
|
|
@ -70,13 +75,17 @@
|
|||
// DB에 입력하기 위한 변수 설정
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
|
||||
|
||||
$output = executeQuery('layout.updateLayout', $args);
|
||||
$output = $this->updateLayout($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
function updateLayout($args) {
|
||||
$output = executeQuery('layout.updateLayout', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 삭제
|
||||
* 삭제시 메뉴 xml 캐시 파일도 삭제
|
||||
|
|
@ -95,11 +104,16 @@
|
|||
|
||||
// 레이아웃 삭제
|
||||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery("layout.deleteLayout", $args);
|
||||
|
||||
$output = $this->deleteLayout($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
function deleteLayout($args) {
|
||||
$output = executeQuery("layout.deleteLayout", $args);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
<column name="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||
<column name="layout" var="layout" notnull="notnull" />
|
||||
<column name="title" var="title" notnull="notnull" />
|
||||
<column name="module_srl" var="module_srl" />
|
||||
<column name="layout_path" var="layout_path" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
<columns>
|
||||
<column name="title" var="title" notnull="notnull" />
|
||||
<column name="extra_vars" var="extra_vars" />
|
||||
<column name="layout_path" var="layout_path" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||
|
|
|
|||
|
|
@ -3,5 +3,7 @@
|
|||
<column name="layout" type="varchar" size="250" />
|
||||
<column name="title" type="varchar" size="250" />
|
||||
<column name="extra_vars" type="text" />
|
||||
<column name="layout_path" type="varchar" size="250" />
|
||||
<column name="module_srl" type="number" size="12" default="0" index="idx_module_srl" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -25,10 +25,25 @@
|
|||
<!--@foreach($layout_list as $no => $val)-->
|
||||
<tr>
|
||||
<td>{$no+1}</td>
|
||||
<td>{$val->layout}</td>
|
||||
<td><a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminModify','layout_srl',$val->layout_srl)}';return false;">{htmlspecialchars($val->title)}</a></td>
|
||||
<td>
|
||||
{$val->layout}
|
||||
<!--@if($val->module_srl)-->
|
||||
(module)
|
||||
<!--@end-->
|
||||
</td>
|
||||
<td>
|
||||
<!--@if(!$val->module_srl)-->
|
||||
<a href="#" onclick="location.href='{getUrl('act','dispLayoutAdminModify','layout_srl',$val->layout_srl)}';return false;">{htmlspecialchars($val->title)}</a>
|
||||
<!--@else-->
|
||||
{htmlspecialchars($val->title)}
|
||||
<!--@end-->
|
||||
</td>
|
||||
<td>{zdate($val->regdate,"Y-m-d")}</td>
|
||||
<td><a href="#" onclick="doDeleteLayout('{$val->layout_srl}');return false;">{$lang->cmd_delete}</a></td>
|
||||
<td>
|
||||
<!--@if(!$val->module_srl)-->
|
||||
<a href="#" onclick="doDeleteLayout('{$val->layout_srl}');return false;">{$lang->cmd_delete}</a>
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40" />
|
||||
<column name="skin" var="skin" minlength="1" maxlength="250" />
|
||||
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
|
||||
<column name="layout_srl" var="layout_srl" notnull="notnull" />
|
||||
<column name="layout_srl" var="layout_srl" />
|
||||
<column name="description" var="description" />
|
||||
<column name="content" var="content" />
|
||||
<column name="module" var="module" notnull="notnull" maxlength="80"/>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<column name="module_category_srl" var="module_category_srl" />
|
||||
<column name="skin" var="skin" minlength="1" maxlength="250" />
|
||||
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
|
||||
<column name="layout_srl" var="layout_srl" notnull="notnull" />
|
||||
<column name="layout_srl" var="layout_srl" />
|
||||
<column name="description" var="description" />
|
||||
<column name="content" var="content" />
|
||||
<column name="module" var="module" notnull="notnull" maxlength="80"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue