mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
commit
c5758ddfd9
13 changed files with 170 additions and 41 deletions
|
|
@ -293,12 +293,23 @@ class boardController extends board
|
|||
}
|
||||
// generate document module controller object
|
||||
$oDocumentController = getController('document');
|
||||
|
||||
// delete the document
|
||||
$output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager);
|
||||
if(!$output->toBool())
|
||||
if($this->module_info->trash_use == 'Y')
|
||||
{
|
||||
return $output;
|
||||
// move the trash
|
||||
$output = $oDocumentController->moveDocumentToTrash($oDocument);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// delete the document
|
||||
$output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// alert an message
|
||||
|
|
|
|||
|
|
@ -69,3 +69,5 @@ $lang->msg_admin_update_log = '관리자가 수정한 적이 있는 게시물입
|
|||
$lang->msg_update_log_revert = '정말로 이 버전으로 되돌리시겠습니까?';
|
||||
$lang->write_admin = '관리자작성';
|
||||
$lang->revert_reason_update = '이 버전으로 되돌림';
|
||||
$lang->document_force_to_move = '삭제시 휴지통으로 강제이동';
|
||||
$lang->about_document_force_to_move = '게시글을 삭제시 휴지통으로 강제이동할지 않할지를 선택하는 옵션입니다.';
|
||||
|
|
|
|||
|
|
@ -238,6 +238,18 @@
|
|||
<p>{$lang->msg_warning_update_log}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->document_force_to_move}</label>
|
||||
<div class="x_controls">
|
||||
<label class="x_inline">
|
||||
<input type="radio" id="trash_use_y" name="trash_use" value="Y" checked="checked"|cond="$module_info->trash_use == 'Y'" /> {$lang->cmd_yes}
|
||||
</label>
|
||||
<label class="x_inline">
|
||||
<input type="radio" id="trash_use_n" name="trash_use" value="N" checked="checked"|cond="$module_info->trash_use == 'N'" /> {$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_document_force_to_move}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->protect_content}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
|
|
@ -67,16 +67,6 @@ $lang->in_trash = '휴지통';
|
|||
$lang->trash_nick_name = '옮긴사람';
|
||||
$lang->trash_date = '삭제 날짜';
|
||||
$lang->trash_description = '설명';
|
||||
$lang->search_target_trash_list['title'] = '제목';
|
||||
$lang->search_target_trash_list['content'] = '내용';
|
||||
$lang->search_target_trash_list['user_id'] = '아이디';
|
||||
$lang->search_target_trash_list['member_srl'] = '회원 번호';
|
||||
$lang->search_target_trash_list['user_name'] = '사용자 이름';
|
||||
$lang->search_target_trash_list['nick_name'] = '닉네임';
|
||||
$lang->search_target_trash_list['trash_member_srl'] = '삭제자 회원 번호';
|
||||
$lang->search_target_trash_list['trash_user_name'] = '삭제자 이름';
|
||||
$lang->search_target_trash_list['trash_date'] = '삭제일';
|
||||
$lang->search_target_trash_list['trash_ipaddress'] = '삭제자 IP 주소';
|
||||
$lang->success_trashed = '휴지통으로 이동되었습니다.';
|
||||
$lang->msg_not_selected_document = '선택한 문서가 없습니다.';
|
||||
$lang->status = '상태';
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class ncenterlite extends ModuleObject
|
|||
array('communication.sendMessage', 'ncenterlite', 'controller', 'triggerAfterSendMessage', 'after'),
|
||||
array('document.updateVotedCount', 'ncenterlite', 'controller', 'triggerAfterVotedupdate', 'after'),
|
||||
array('moduleHandler.init', 'ncenterlite', 'controller', 'triggerAddMemberMenu', 'after'),
|
||||
array('document.moveDocumentToTrash', 'ncenterlite', 'controller', 'triggerAfterMoveToTrash', 'after'),
|
||||
);
|
||||
private $delete_triggers = array(
|
||||
array('moduleObject.proc', 'ncenterlite', 'controller', 'triggerBeforeModuleObjectProc', 'before')
|
||||
|
|
|
|||
|
|
@ -432,6 +432,22 @@ class ncenterliteController extends ncenterlite
|
|||
return new Object();
|
||||
}
|
||||
|
||||
function triggerAfterMoveToTrash(&$obj)
|
||||
{
|
||||
$oNcenterliteModel = getModel('ncenterlite');
|
||||
$config = $oNcenterliteModel->getConfig();
|
||||
|
||||
if(empty($config->use))
|
||||
{
|
||||
return new Object();
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->srl = $obj->document_srl;
|
||||
$output = executeQuery('ncenterlite.deleteNotifyBySrl', $args);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerAfterModuleHandlerProc(&$oModule)
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
|
|
|||
|
|
@ -12,10 +12,18 @@ $lang->fail_empty = '휴지통을 비우지 못했습니다.';
|
|||
$lang->success_restore = '복원했습니다.';
|
||||
$lang->fail_restore = '복원하지 못했습니다.';
|
||||
$lang->origin_module_type = '타입';
|
||||
$lang->remove_all_trash_item = '휴지통을 완전히 비웁니다. 실행 후에는 복원이 불가능합니다.';
|
||||
$lang->remove_all_trash_item = '선택한 항목의 휴지통 리스트들을 완전히 비웁니다. 실행 후에는 복원이 불가능합니다.';
|
||||
$lang->title = '제목';
|
||||
$lang->content = '내용';
|
||||
$lang->trasher = '삭제자';
|
||||
$lang->origin_info = '원문 정보';
|
||||
$lang->delete_info = '삭제 정보';
|
||||
$lang->cmd_restore = '복원';
|
||||
$lang->cmd_trash_list = '휴지통 목록';
|
||||
$lang->cmd_trash_type = '휴지통비우기 타입';
|
||||
$lang->trash_warning = '주의!';
|
||||
$lang->trash_nick_name = '옮긴사람';
|
||||
$lang->search_target_trash_list['title'] = '제목';
|
||||
$lang->search_target_trash_list['user_id'] = '삭제자 아이디';
|
||||
$lang->search_target_trash_list['nick_name'] = '삭제자 닉네임';
|
||||
$lang->search_target_trash_list['trash_ipaddress'] = '삭제자 IP 주소';
|
||||
|
|
|
|||
|
|
@ -12,6 +12,12 @@
|
|||
<condition operation="equal" column="T.remover_srl" default="M.member_srl" notnull="notnull" />
|
||||
<condition operation="in" column="trash_srl" var="trashSrl" filter="number" pipe="and" />
|
||||
<condition operation="in" column="origin_module" var="originModule" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="T.title" var="s_title" />
|
||||
<condition operation="like" column="M.user_id" var="s_user_id" pipe="or" />
|
||||
<condition operation="like" column="M.nick_name" var="s_nick_name" pipe="or" />
|
||||
<condition operation="like_prefix" column="T.ipaddress" var="s_ipaddress" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="trash_srl" order="desc" />
|
||||
|
|
|
|||
|
|
@ -1,2 +1,15 @@
|
|||
<load target="js/trash_admin.js" />
|
||||
<h3 class="xeAdmin">{$lang->cmd_trash} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
<div class="x_page-header">
|
||||
<h1>{$lang->cmd_trash}</h1>
|
||||
</div>
|
||||
|
||||
<div class="header4">
|
||||
<ul class="x_nav x_nav-tabs">
|
||||
<li class="x_active"|cond="$act=='dispTrashAdminList'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispTrashAdminList')}">{$lang->cmd_trash_list}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,24 +3,36 @@ var confirm_restore_msg = '{$lang->confirm_restore}';
|
|||
var no_text_comment = '{$lang->no_text_comment}';
|
||||
</script>
|
||||
<load target="js/trash_admin.js" />
|
||||
<div class="x_page-header">
|
||||
<h1>{$lang->trash} <a class="x_icon-question-sign" href="./common/manual/admin/index.html#UMAN_content_trash" target="_blank">{$lang->help}</a></h1>
|
||||
</div>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/trash/tpl/trash_list/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<include target="./header.html" />
|
||||
<form ruleset="emptyTrash" action="./" method="post">
|
||||
<input type="hidden" name="module" value="trash" />
|
||||
<input type="hidden" name="act" value="procTrashAdminEmptyTrash" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="is_all" value="true" />
|
||||
<div class="x_control-group">
|
||||
<h2>{$lang->cmd_trash_type}</h2>
|
||||
<div class="x_controls">
|
||||
<label class="x_inline">
|
||||
<input type="radio" name="is_type" value="document" /> {$lang->document}
|
||||
</label>
|
||||
<label class="x_inline">
|
||||
<input type="radio" name="is_type" value="comment" /> {$lang->comment}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="x_btn x_btn-warning x_btn-primary" name="is_all" value="true">{$lang->empty_trash_all}</button>
|
||||
{$lang->remove_all_trash_item}
|
||||
<span class="x_label x_label-important">{$lang->trash_warning}</span>{$lang->remove_all_trash_item}
|
||||
</p>
|
||||
<table id="trashListTable" class="x_table x_table-striped x_table-hover">
|
||||
<caption>
|
||||
<strong>{$lang->all}({number_format($total_count)})</strong>
|
||||
<strong></strong>
|
||||
<a href="{getUrl('', 'module', 'admin', 'act', 'dispTrashAdminList', 'originModule', '')}" class="active"|cond="$originModule == ''">{$lang->all}({number_format($total_count)})</a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('originModule', 'document')}" class="active"|cond="$originModule == 'document'">{$lang->document}</a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('originModule', 'comment')}" class="active"|cond="$originModule == 'comment'">{$lang->comment}</a>
|
||||
<div class="x_pull-right x_btn-group">
|
||||
<a href="#fo_list" class="x_btn modalAnchor" data-name="is_all" data-value="false">{$lang->delete}</a>
|
||||
<a href="#fo_list" class="x_btn modalAnchor" data-name="act" data-value="procTrashAdminRestore">{$lang->restore}</a>
|
||||
|
|
@ -72,8 +84,6 @@ var no_text_comment = '{$lang->no_text_comment}';
|
|||
<input type="hidden" name="error_return_url" value="" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
<ul>
|
||||
<li class="x_disabled"|cond="!$page || $page == 1"><a href="{getUrl('page', '')}">« {$lang->first_page}</a></li>
|
||||
<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
|
||||
|
|
@ -105,7 +115,20 @@ var no_text_comment = '{$lang->no_text_comment}';
|
|||
<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}" title="{$page_navigation->last_page}">{$lang->last_page} »</a></li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
<form action="./" method="get" class="search center x_input-append x_clearfix">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
|
||||
<!--@foreach($lang->search_target_trash_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="search" name="search_keyword" value="{htmlspecialchars($search_keyword, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" title="{$lang->cmd_search}" />
|
||||
<button type="submit" class="x_btn x_btn-inverse">{$lang->cmd_search}</button>
|
||||
<a href="{getUrl('','module',$module,'act',$act)}" class="x_btn">{$lang->cmd_cancel}</a>
|
||||
</form>
|
||||
<form ruleset="emptyTrash" id="fo_list" action="./" method="post" class="x_modal">
|
||||
<input type="hidden" name="module" value="trash" />
|
||||
<input type="hidden" name="act" value="procTrashAdminEmptyTrash" />
|
||||
|
|
|
|||
|
|
@ -47,16 +47,23 @@ class trashAdminController extends trash
|
|||
$isAll = Context::get('is_all');
|
||||
$originModule = Context::get('origin_module');
|
||||
$tmpTrashSrls = Context::get('cart');
|
||||
$is_type = Context::get('is_type');
|
||||
|
||||
$trashSrls = array();
|
||||
if($isAll != 'true')
|
||||
{
|
||||
if(is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
|
||||
else $trashSrls = explode('|@|', $tmpTrashSrls);
|
||||
if(is_array($tmpTrashSrls))
|
||||
{
|
||||
$trashSrls = $tmpTrashSrls;
|
||||
}
|
||||
else
|
||||
{
|
||||
$trashSrls = explode('|@|', $tmpTrashSrls);
|
||||
}
|
||||
}
|
||||
|
||||
//module relation data delete...
|
||||
$output = $this->_relationDataDelete($isAll, $trashSrls);
|
||||
$output = $this->_relationDataDelete($isAll, $is_type, $trashSrls);
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
|
||||
if(!$this->_emptyTrash($trashSrls)) return new Object(-1, $lang->fail_empty);
|
||||
|
|
@ -70,15 +77,19 @@ class trashAdminController extends trash
|
|||
/**
|
||||
* Empty trash - private method
|
||||
* @param string $isAll
|
||||
* @param string $is_type
|
||||
* @param array trashSrls
|
||||
* @return Object
|
||||
*/
|
||||
function _relationDataDelete($isAll, &$trashSrls)
|
||||
function _relationDataDelete($isAll, $is_type, &$trashSrls)
|
||||
{
|
||||
$oTrashModel = getModel('trash');
|
||||
if($isAll == 'true')
|
||||
{
|
||||
$output = $oTrashModel->getTrashAllList(array());
|
||||
$args = new stdClass();
|
||||
$args->originModule = $is_type;
|
||||
$output = $oTrashModel->getTrashAllList($args);
|
||||
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return new Object(-1, $output->message);
|
||||
|
|
@ -122,7 +133,7 @@ class trashAdminController extends trash
|
|||
if(!$output2->toBool()) return new Object(-1, $output2->message);
|
||||
}
|
||||
}
|
||||
return new Object(0, $lang->success_deleted);
|
||||
return new Object(0, lang('success_deleted'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -31,17 +31,30 @@ class trashAdminView extends trash
|
|||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of posts to display on a single page
|
||||
$args->page_count = 5; // /< the number of pages that appear in the page navigation
|
||||
$args->originModule = Context::get('originModule');
|
||||
|
||||
$args->search_target = Context::get('search_target'); // /< search (title, contents ...)
|
||||
$args->search_keyword = Context::get('search_keyword'); // /< keyword to search
|
||||
$search_target = Context::get('search_target'); // /< search (title, contents ...)
|
||||
$search_keyword = Context::get('search_keyword'); // /< keyword to search
|
||||
|
||||
switch($search_target)
|
||||
{
|
||||
case 'title':
|
||||
$args->s_title = $search_keyword;
|
||||
break;
|
||||
case 'user_id':
|
||||
$args->s_user_id = $search_keyword;
|
||||
break;
|
||||
case 'nick_name':
|
||||
$args->s_nick_name = $search_keyword;
|
||||
break;
|
||||
case 'trash_ipaddress':
|
||||
$args->s_ipaddress = $search_keyword;
|
||||
break;
|
||||
}
|
||||
|
||||
$oTrashModel = getModel('trash');
|
||||
$output = $oTrashModel->getTrashList($args);
|
||||
|
||||
// for no text comment language and for document manange language
|
||||
$oCommentModel = getModel('comment');
|
||||
$oDocumentModel = getModel('document');
|
||||
|
||||
Context::set('trash_list', $output->data);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
|
|
@ -110,7 +123,6 @@ class trashAdminView extends trash
|
|||
}
|
||||
$this->setTemplateFile('trash_view');
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file trash.admin.view.php */
|
||||
/* Location: ./modules/trash/trash.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -10,6 +10,30 @@
|
|||
*/
|
||||
class trashModel extends trash
|
||||
{
|
||||
private static $config = NULL;
|
||||
|
||||
/**
|
||||
* get Tresh Module Config
|
||||
*
|
||||
* @return trash config
|
||||
*/
|
||||
function getConfig()
|
||||
{
|
||||
if(self::$config === NULL)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('trash');
|
||||
if(!$config)
|
||||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
|
||||
self::$config = $config;
|
||||
}
|
||||
|
||||
return self::$config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get one trash object
|
||||
* @param int $trashSrl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue