mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 09:14:48 +09:00
issue 70 list count modified in content admin
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8854 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b87aedbd2b
commit
ac9bf88af4
13 changed files with 355 additions and 183 deletions
|
|
@ -6,9 +6,25 @@
|
|||
<permission action="procTrashAdminRestore" target="manager" />
|
||||
</permissions>
|
||||
<actions>
|
||||
<action name="dispTrashAdminList" type="view" standalone="true" admin_index="true" />
|
||||
<action name="dispTrashAdminList" type="view" standalone="true" admin_index="true" menu_name="document" menu_index="true" />
|
||||
|
||||
<action name="procTrashAdminEmptyTrash" type="controller" standalone="true" ruleset="emptyTrash" />
|
||||
<action name="procTrashAdminRestore" type="controller" standalone="true" />
|
||||
<action name="procTrashAdminGetList" type="controller" standalone="true" />
|
||||
</actions>
|
||||
<menus>
|
||||
<menu name="document">
|
||||
<title xml:lang="en">Document</title>
|
||||
<title xml:lang="ko">문서</title>
|
||||
<title xml:lang="zh-CN">Document</title>
|
||||
<title xml:lang="jp">Document</title>
|
||||
<title xml:lang="es">Document</title>
|
||||
<title xml:lang="ru">Document</title>
|
||||
<title xml:lang="fr">Document</title>
|
||||
<title xml:lang="zh-TW">Document</title>
|
||||
<title xml:lang="vi">Document</title>
|
||||
<title xml:lang="mn">Document</title>
|
||||
<title xml:lang="tr">Document</title>
|
||||
</menu>
|
||||
</menus>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="T.remover_srl" default="M.member_srl" notnull="notnull" />
|
||||
<condition operation="equal" column="trash_srl" var="trashSrl" filter="number" />
|
||||
<condition operation="in" column="trash_srl" var="trashSrl" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="trash_srl" order="desc" />
|
||||
|
|
|
|||
|
|
@ -31,3 +31,48 @@ function completeRestore(ret_obj)
|
|||
alert(message);
|
||||
if(error == '0') window.location.reload();
|
||||
}
|
||||
|
||||
function getTrashList()
|
||||
{
|
||||
var trashListTable = jQuery('#trashListTable');
|
||||
var cartList = [];
|
||||
trashListTable.find(':checkbox[name=cart').each(function(){
|
||||
if(this.checked) cartList.push(this.value);
|
||||
});
|
||||
|
||||
var params = new Array();
|
||||
var response_tags = ['error','message', 'trash_list'];
|
||||
params["trash_srls"] = cartList.join(",");
|
||||
|
||||
exec_xml('trash','procTrashAdminGetList',params, completeGetTrashList, response_tags);
|
||||
}
|
||||
|
||||
function completeGetTrashList(ret_obj, response_tags)
|
||||
{
|
||||
var htmlListBuffer = '';
|
||||
|
||||
if(ret_obj['trash_list'] == null)
|
||||
{
|
||||
htmlListBuffer = '<tr>' +
|
||||
'<td colspan="3" style="text-align:center;">'+ret_obj['message']+'</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
var trash_list = ret_obj['trash_list']['item'];
|
||||
|
||||
if(!jQuery.isArray(trash_list)) trash_list = [trash_list];
|
||||
for(var x in trash_list)
|
||||
{
|
||||
var objTrash = trash_list[x];
|
||||
htmlListBuffer += '<tr>' +
|
||||
'<td class="title">'+ objTrash.title +'</td>' +
|
||||
'<td>'+ objTrash.nickName +'</td>' +
|
||||
'<td>'+ objTrash.ipaddress +'</td>' +
|
||||
'</tr>' +
|
||||
'<input type="hidden" name="cart[]" value="'+objTrash.trashSrl+'" />';
|
||||
}
|
||||
jQuery('#selectedTrashCount').html(trash_list.length);
|
||||
}
|
||||
jQuery('#trashManageListTable>tbody').html(htmlListBuffer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,72 +1,148 @@
|
|||
<script>
|
||||
var confirm_restore_msg = '{$lang->confirm_restore}';
|
||||
</script>
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<!--%import("js/trash_admin.js")-->
|
||||
<div class="content" id="content">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<form ruleset="emptyTrash" id="fo_list" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procTrashAdminEmptyTrash" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="is_all" value="false" />
|
||||
<form ruleset="emptyTrash" action="./" method="post" class="form">
|
||||
<input type="hidden" name="act" value="procTrashAdminEmptyTrash" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="is_all" value="true" />
|
||||
<h1 class="h1">{$lang->document}</h1>
|
||||
<div class="table even">
|
||||
<div class="cnb">
|
||||
<a href="{getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList')}">All</a>
|
||||
| <a href="{getUrl('search_target', 'is_secret', 'search_keyword', 'N')}">{$status_name_list['PUBLIC']}</a>
|
||||
| <a href="{getUrl('search_target', 'is_secret', 'search_keyword', 'Y')}">{$status_name_list['SECRET']}</a>
|
||||
| <a href="{getUrl('search_target', 'is_secret', 'search_keyword', 'temp')}">{$status_name_list['TEMP']}</a>
|
||||
| <a href="{getUrl('', 'module', 'admin', 'act', 'dispTrashAdminList')}" class="active">{$lang->cmd_trash}</a>
|
||||
</div>
|
||||
<table width="100%" border="1" cellspacing="0" id="trashListTable">
|
||||
<caption>
|
||||
{$lang->cmd_trash}({number_format($total_count)})
|
||||
<span class="side"><span class="btn"><a href="#listManager" class="modalAnchor" onclick="getTrashList();">선택한 글 관리...</a></span>
|
||||
<span class="btn"><button type="submit" name="is_all" value="true">{$lang->empty_trash_all}</button></span></span>
|
||||
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="title">{$lang->document} ({$lang->trash_type})</th>
|
||||
<th scope="col">{$lang->trash_nick_name}</th>
|
||||
<th scope="col">{$lang->trash_date}</th>
|
||||
<th scope="col">{$lang->ipaddress}</th>
|
||||
<th scope="col">{$lang->trash_description}</th>
|
||||
<th scope="col"><input type="checkbox" title="Check All" data-name="cart" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th scope="col" class="title">{$lang->document} ({$lang->trash_type})</th>
|
||||
<th scope="col">{$lang->trash_nick_name}</th>
|
||||
<th scope="col">{$lang->trash_date}</th>
|
||||
<th scope="col">{$lang->ipaddress}</th>
|
||||
<th scope="col">{$lang->trash_description}</th>
|
||||
<th scope="col"><input type="checkbox" title="Check All" data-name="cart" /></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<!--@foreach($trash_list as $no => $oTrashVO)-->
|
||||
<tr>
|
||||
<td class="title">
|
||||
{$oTrashVO->getTitle()} (
|
||||
<!--@if($oTrashVO->getOriginModule() == 'document')-->
|
||||
{$lang->document}
|
||||
<!--@else if($oTrashVO->getOriginModule() == 'comment')-->
|
||||
{$lang->replies}
|
||||
<!--@else-->
|
||||
{$lang->etc}
|
||||
<!--@end-->
|
||||
)
|
||||
</td>
|
||||
<td><span class="member_{$oTrashVO->getMemberSrl()">{htmlspecialchars($oTrashVO->getNickName())}</span></td>
|
||||
<td>{zdate($oTrashVO->getRegdate(), "Y-m-d H:i:s")}</td>
|
||||
<td>{$oTrashVO->getIpaddress()}</td>
|
||||
<td>{$oTrashVO->getDescription()}</td>
|
||||
<td><input type="checkbox" name="cart" value="{$oTrashVO->getTrashSrl()}" /></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getTrashList();">선택한 글 관리...</a></span>
|
||||
<span class="btn"><button type="submit" name="is_all" value="true">{$lang->empty_trash_all}</button></span>
|
||||
</div>
|
||||
</form>
|
||||
<div class="modal" id="listManager">
|
||||
<form ruleset="emptyTrash" id="fo_list" action="./" method="post" class="fg form">
|
||||
<input type="hidden" name="act" value="procTrashAdminEmptyTrash" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="is_all" value="false" />
|
||||
<h2 class="h2">선택한 글 관리</h2>
|
||||
<div class="table even">
|
||||
<table width="100%" border="1" cellspacing="0" id="trashManageListTable">
|
||||
<caption>선택한 글 <strong id="selectedTrashCount">8</strong></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="title">{$lang->document} ({$lang->trash_type})</th>
|
||||
<th scope="col">{$lang->trash_nick_name}</th>
|
||||
<th scope="col">{$lang->ipaddress}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><button type="submit" name="is_all" value="false">{$lang->empty_trash_selected}</button></span>
|
||||
<span class="btn"><button type="submit" name="act" value="procTrashAdminRestore">{$lang->cmd_restore}</button></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="search">
|
||||
<form action="" class="pagination">
|
||||
<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}" />
|
||||
|
||||
<!-- 목록 -->
|
||||
<table cellspacing="0" class="rowTable clear">
|
||||
<caption>Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><div>{$lang->no}</div></th>
|
||||
<th scope="col"><div><input type="checkbox" onclick="XE.checkboxToggleAll('trash_srls[]');" /></div></th>
|
||||
<th scope="col" class="wide"><div>{$lang->document} ({$lang->trash_type})</div></th>
|
||||
<th scope="col"><div>{$lang->trash_nick_name}</div></th>
|
||||
<th scope="col"><div>{$lang->trash_date}</div></th>
|
||||
<th scope="col"><div>{$lang->ipaddress}</div></th>
|
||||
<th scope="col"><dib>{$lang->trash_description}</div></th>
|
||||
<th scope="col"><div>{$lang->cmd_restore}</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($trash_list as $no => $oTrashVO)-->
|
||||
<tr>
|
||||
<td class="number center">{$no}</td>
|
||||
<td><div><input type="checkbox" name="trash_srls[]" value="{$oTrashVO->getTrashSrl()}" /></div></t>
|
||||
<td class="left subject">
|
||||
{$oTrashVO->getTitle()} (
|
||||
<!--@if($oTrashVO->getOriginModule() == 'document')-->
|
||||
{$lang->document}
|
||||
<!--@else if($oTrashVO->getOriginModule() == 'comment')-->
|
||||
{$lang->replies}
|
||||
<!--@else-->
|
||||
{$lang->etc}
|
||||
<!--@end-->
|
||||
)
|
||||
</td>
|
||||
<td class="nowrap"><span class="member_{$oTrashVO->getMemberSrl()">{htmlspecialchars($oTrashVO->getNickName())}</span></td>
|
||||
<td class="date center nowrap">{zdate($oTrashVO->getRegdate(), "Y-m-d H:i:s")}</td>
|
||||
<td class="number center nowrap">{$oTrashVO->getIpaddress()}</td>
|
||||
<td class="left">{$oTrashVO->getDescription()}</td>
|
||||
<td class="center"><a href="#" onclick="goRestore({$oTrashVO->getTrashSrl()})">{$lang->cmd_restore}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="fr">
|
||||
<span class="button green"><input type="submit" value="{$lang->empty_trash_selected}" onclick="this.form.is_all.value=false" /></span>
|
||||
<span class="button blue"><input type="submit" value="{$lang->empty_trash_all}" onclick="this.form.is_all.value=true" /></span>
|
||||
</div>
|
||||
<a href="{getUrl('page', '')}" class="direction">« FIRST</a>
|
||||
<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
|
||||
<a href="{getUrl('page', '')}">1</a>
|
||||
<a href="#goTo" class="tgSimple" title="{$lang->cmd_go_to_page}">...</a>
|
||||
</block>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
{@$last_page = $page_no}
|
||||
<strong cond="$page_no == $page">{$page_no}</strong>
|
||||
<a cond="$page_no != $page" href="{getUrl('page', $page_no)}">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<block cond="$last_page != $page_navigation->last_page">
|
||||
<a href="#goTo" class="tgSimple" title="{$lang->cmd_go_to_page}">...</a>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
|
||||
</block>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">LAST »</a>
|
||||
<span id="goTo" class="tgContent">
|
||||
<input name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit">Go</button>
|
||||
</span>
|
||||
</form>
|
||||
|
||||
<!-- 페이지 네비게이션 -->
|
||||
<div class="pagination a1">
|
||||
<a href="{getUrl('page','','module_srl',$module_srl)}" class="prevEnd">{$lang->first_page}</a>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<!--@if($page == $page_no)-->
|
||||
<strong>{$page_no}</strong>
|
||||
<!--@else-->
|
||||
<a href="{getUrl('page',$page_no,'module_srl',$module_srl)}">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
<a href="{getUrl('page',$page_navigation->last_page,'module_srl',$module_srl)}" class="nextEnd">{$lang->last_page}</a>
|
||||
<form action="">
|
||||
<select>
|
||||
<option>제목</option>
|
||||
<option>내용</option>
|
||||
<option>닉네임</option>
|
||||
<option>아이디</option>
|
||||
<option>사용자 이름</option>
|
||||
<option>공지사항</option>
|
||||
<option>IP 주소</option>
|
||||
<option>모듈 아이디</option>
|
||||
</select>
|
||||
<input title="Search" />
|
||||
<input type="submit" value="Search" />
|
||||
<a href="#">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -39,93 +39,136 @@ class trashAdminController extends trash
|
|||
{
|
||||
global $lang;
|
||||
$isAll = Context::get('is_all');
|
||||
$tmpTrashSrls = Context::get('trash_srls');
|
||||
$tmpTrashSrls = Context::get('cart');
|
||||
if(is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
|
||||
else $trashSrls = explode('|@|', $tmpTrashSrls);
|
||||
|
||||
$oTrashModel = &getModel('trash');
|
||||
if($isAll == 'true')
|
||||
{
|
||||
$trashSrls = array();
|
||||
//module relation data delete...
|
||||
$output = $this->_relationDataDelete($isAll, $trashSrls);
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
|
||||
//module relation data delete...
|
||||
$output = $oTrashModel->getTrashList($args);
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
|
||||
if(is_array($output->data))
|
||||
{
|
||||
foreach($output->data AS $key=>$oTrashVO)
|
||||
{
|
||||
//class file check
|
||||
$classPath = ModuleHandler::getModulePath($oTrashVO->getOriginModule());
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
|
||||
|
||||
$classFile = sprintf('%s%s.admin.controller.php', $classPath, $oTrashVO->getOriginModule());
|
||||
$classFile = FileHandler::getRealPath($classFile);
|
||||
if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
|
||||
|
||||
$oAdminController = &getAdminController($oTrashVO->getOriginModule());
|
||||
if(!method_exists($oAdminController, 'emptyTrash')) return new Object(-1, 'not exist restore method in module class file');
|
||||
|
||||
$output = $oAdminController->emptyTrash($oTrashVO->getSerializedObject());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->_emptyTrash($trashSrls))
|
||||
return new Object(-1, $lang->fail_empty);
|
||||
if(!$this->_emptyTrash($trashSrls)) return new Object(-1, $lang->fail_empty);
|
||||
|
||||
$this->setMessage('success_deleted', 'info');
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrashAdminList');
|
||||
header('location:'.$returnUrl);
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
return;
|
||||
}
|
||||
return new Object(0, $lang->success_empty);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief empty trash - private method
|
||||
**/
|
||||
function _relationDataDelete($isAll, &$trashSrls)
|
||||
{
|
||||
if($isAll == 'true') $trashSrls = array();
|
||||
$oTrashModel = &getModel('trash');
|
||||
if(count($trashSrls) > 0) $args->trashSrl = $trashSrls;
|
||||
$output = $oTrashModel->getTrashList($args);
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
|
||||
if(is_array($output->data))
|
||||
{
|
||||
foreach($output->data AS $key=>$oTrashVO)
|
||||
{
|
||||
if($isAll == 'true') array_push($trashSrls, $oTrashVO->getTrashSrl());
|
||||
|
||||
//class file check
|
||||
$classPath = ModuleHandler::getModulePath($oTrashVO->getOriginModule());
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
|
||||
|
||||
$classFile = sprintf('%s%s.admin.controller.php', $classPath, $oTrashVO->getOriginModule());
|
||||
$classFile = FileHandler::getRealPath($classFile);
|
||||
if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
|
||||
|
||||
$oAdminController = &getAdminController($oTrashVO->getOriginModule());
|
||||
if(!method_exists($oAdminController, 'emptyTrash')) return new Object(-1, 'not exist restore method in module class file');
|
||||
|
||||
$output = $oAdminController->emptyTrash($oTrashVO->getSerializedObject());
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
}
|
||||
}
|
||||
return new Object(0, $lang->success_deleted);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief restore content object
|
||||
**/
|
||||
function procTrashAdminRestore()
|
||||
{
|
||||
global $lang;
|
||||
$trashSrl = Context::get('trash_srl');
|
||||
$trashSrlList = Context::get('cart');
|
||||
|
||||
$oTrashModel = &getModel('trash');
|
||||
$output = $oTrashModel->getTrash($trashSrl);
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
if(is_array($trashSrlList))
|
||||
{
|
||||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
// eache restore method call in each classfile
|
||||
foreach($trashSrlList AS $key=>$value)
|
||||
{
|
||||
$oTrashModel = &getModel('trash');
|
||||
$output = $oTrashModel->getTrash($value);
|
||||
if(!$output->toBool()) return new Object(-1, $output->message);
|
||||
|
||||
//class file check
|
||||
$classPath = ModuleHandler::getModulePath($output->data->getOriginModule());
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
|
||||
//class file check
|
||||
$classPath = ModuleHandler::getModulePath($output->data->getOriginModule());
|
||||
if(!is_dir(FileHandler::getRealPath($classPath))) return new Object(-1, 'not exist restore module directory');
|
||||
|
||||
$classFile = sprintf('%s%s.admin.controller.php', $classPath, $output->data->getOriginModule());
|
||||
$classFile = FileHandler::getRealPath($classFile);
|
||||
if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
|
||||
$classFile = sprintf('%s%s.admin.controller.php', $classPath, $output->data->getOriginModule());
|
||||
$classFile = FileHandler::getRealPath($classFile);
|
||||
if(!file_exists($classFile)) return new Object(-1, 'not exist restore module class file');
|
||||
|
||||
$oAdminController = &getAdminController($output->data->getOriginModule());
|
||||
if(!method_exists($oAdminController, 'restoreTrash')) return new Object(-1, 'not exist restore method in module class file');
|
||||
$oAdminController = &getAdminController($output->data->getOriginModule());
|
||||
if(!method_exists($oAdminController, 'restoreTrash')) return new Object(-1, 'not exist restore method in module class file');
|
||||
|
||||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
$originObject = unserialize($output->data->getSerializedObject());
|
||||
$output = $oAdminController->restoreTrash($originObject);
|
||||
|
||||
$originObject = unserialize($output->data->getSerializedObject());
|
||||
$output = $oAdminController->restoreTrash($originObject);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1, $output->message);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1, $output->message);
|
||||
// restore object delete in trash box
|
||||
if(!$this->_emptyTrash($trashSrlList)) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1, $lang->fail_empty);
|
||||
}
|
||||
$oDB->commit();
|
||||
}
|
||||
|
||||
$this->setMessage('success_restore', 'info');
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrashAdminList');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function procTrashAdminGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
$trashSrls = Context::get('trash_srls');
|
||||
if($trashSrls) $trashSrlList = explode(',', $trashSrls);
|
||||
|
||||
if(count($trashSrlList) > 0) {
|
||||
$oTrashModel = &getModel('trash');
|
||||
$args->trashSrl = $trashSrlList;
|
||||
$output = $oTrashModel->getTrashList($args);
|
||||
$trashList = $output->data;
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::set('is_all', 'false');
|
||||
Context::set('trash_srls', $trashSrl);
|
||||
$output = $this->procTrashAdminEmptyTrash();
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1, $output->message);
|
||||
}
|
||||
global $lang;
|
||||
$trashList = array();
|
||||
$this->setMessage($lang->no_documents);
|
||||
}
|
||||
$oDB->commit();
|
||||
return new Object(0, $lang->success_restore);
|
||||
|
||||
$this->add('trash_list', $trashList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,14 +20,26 @@ class trashAdminView extends trash {
|
|||
* @brief trash list
|
||||
**/
|
||||
function dispTrashAdminList() {
|
||||
$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->search_target = Context::get('search_target'); // /< search (title, contents ...)
|
||||
$args->search_keyword = Context::get('search_keyword'); // /< keyword to search
|
||||
|
||||
$oTrashModel = getModel('trash');
|
||||
$output = $oTrashModel->getTrashList($args);
|
||||
|
||||
// get Status name list
|
||||
$oDocumentModel = &getModel('document');
|
||||
$statusNameList = $oDocumentModel->getStatusNameList();
|
||||
|
||||
Context::set('trash_list', $output->data);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('status_name_list', $statusNameList);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('trash_list');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue