git-svn-id: http://xe-core.googlecode.com/svn/trunk@804 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-30 05:21:30 +00:00
parent a6c416bf9b
commit 84d0a85ebb
5 changed files with 109 additions and 101 deletions

View file

@ -17,6 +17,11 @@
* @brief 설치시 추가 작업이 필요할시 구현 * @brief 설치시 추가 작업이 필요할시 구현
**/ **/
function moduleInstall() { function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionFoward('document', 'view', 'dispDocumentAdminList');
$oModuleController->insertActionFoward('document', 'controller', 'procDocumentAdminDeleteChecked');
return new Object(); return new Object();
} }

View file

@ -13,6 +13,28 @@
function init() { function init() {
} }
/**
* @brief 관리자 페이지에서 선택된 문서들 삭제
**/
function procDocumentAdminDeleteChecked() {
// 선택된 글이 없으면 오류 표시
$cart = Context::get('cart');
if(!$cart) return $this->stop('msg_cart_is_null');
$document_srl_list= explode('|@|', $cart);
$document_count = count($document_srl_list);
if(!$document_count) return $this->stop('msg_cart_is_null');
// 글삭제
for($i=0;$i<$document_count;$i++) {
$document_srl = trim($document_srl_list[$i]);
if(!$document_srl) continue;
$this->deleteDocument($document_srl, true);
}
$this->setMessage( sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) );
}
/** /**
* @brief 문서의 권한 부여 * @brief 문서의 권한 부여
* 세션값으로 접속상태에서만 사용 가능 * 세션값으로 접속상태에서만 사용 가능
@ -532,28 +554,5 @@
return new Object(); return new Object();
} }
/**
* @brief 관리자 페이지에서 선택된 문서들 삭제
**/
function procDeleteChecked() {
// 선택된 글이 없으면 오류 표시
$cart = Context::get('cart');
if(!$cart) return $this->stop('msg_cart_is_null');
$document_srl_list= explode('|@|', $cart);
$document_count = count($document_srl_list);
if(!$document_count) return $this->stop('msg_cart_is_null');
// 글삭제
for($i=0;$i<$document_count;$i++) {
$document_srl = trim($document_srl_list[$i]);
if(!$document_srl) continue;
$this->deleteDocument($document_srl, true);
}
$this->setMessage( sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) );
}
} }
?> ?>

View file

@ -16,7 +16,7 @@
/** /**
* @brief 목록 출력 (관리자용) * @brief 목록 출력 (관리자용)
**/ **/
function dispList() { function dispDocumentAdminList() {
// 목록을 구하기 위한 옵션 // 목록을 구하기 위한 옵션
$args->page = Context::get('page'); ///< 페이지 $args->page = Context::get('page'); ///< 페이지
$args->list_count = 50; ///< 한페이지에 보여줄 글 수 $args->list_count = 50; ///< 한페이지에 보여줄 글 수

View file

@ -2,88 +2,92 @@
<!-- 게시판 정보 --> <!-- 게시판 정보 -->
<div> <div>
{$lang->document_count} : {number_format($total_count)}, {$lang->document_count} : {number_format($total_count)},
{$lang->page_count} : {number_format($page)} / {number_format($total_page)} {$lang->page_count} : {number_format($page)} / {number_format($total_page)}
</div> </div>
<form action="./" method="get" onsubmit="return procFilter(this, delete_checked)"> <form action="./" method="get" onsubmit="return procFilter(this, delete_checked)">
<input type="hidden" name="page" value="{$page}" /> <input type="hidden" name="page" value="{$page}" />
<!-- 목록 --> <!-- 목록 -->
<div> <div>
<table> <table>
<tr> <tr>
<th colspan="2">{$lang->no}</th> <th colspan="2">{$lang->no}</th>
<th>{$lang->module}</th> <th>{$lang->module}</th>
<th>{$lang->title}</th> <th>{$lang->title}</th>
<th>{$lang->user_name}</th> <th>{$lang->user_name}</th>
<th>{$lang->readed_count}</th> <th>{$lang->readed_count}</th>
<th>{$lang->voted_count}</th> <th>{$lang->voted_count}</th>
<th>{$lang->date}</th> <th>{$lang->date}</th>
</tr> </tr>
<!--@foreach($document_list as $no => $val)-->
<tr>
<td>{$no}</td>
<td><input type="checkbox" name="cart" value="{$val->document_srl}" /></td>
<td><a href="#" onclick="window.open('./?mid={$val->mid}');return false">{$module_list[$val->module_srl]->browser_title}</a></td>
<td>
<a href="#" onclick="window.open('./?document_srl={$val->document_srl}');return false">{$val->title}</a>
<!--@if($val->comment_count>0)-->
[{$val->comment_count}]
<!--@end-->
<!--@if($val->trackback_count>0)-->
[{$val->trackback_count}]
<!--@end-->
</td>
<td>{$val->user_name}</td>
<td>{$val->readed_count}</td>
<td>{$val->voted_count}</td>
<td>{zdate($val->regdate,"Y-m-d")}</td>
</tr>
<!--@end-->
</table>
</div>
<!-- 버튼 --> <!--@foreach($document_list as $no => $val)-->
<div> <tr>
<input type="submit" value="{$lang->cmd_delete_checked_document}" /> <td>{$no}</td>
</div> <td><input type="checkbox" name="cart" value="{$val->document_srl}" /></td>
<td><a href="#" onclick="window.open('./?mid={$val->mid}');return false">{$module_list[$val->module_srl]->browser_title}</a></td>
<td>
<a href="#" onclick="window.open('./?document_srl={$val->document_srl}');return false">{$val->title}</a>
<!--@if($val->comment_count>0)-->
[{$val->comment_count}]
<!--@end-->
<!--@if($val->trackback_count>0)-->
[{$val->trackback_count}]
<!--@end-->
</td>
<td>{$val->user_name}</td>
<td>{$val->readed_count}</td>
<td>{$val->voted_count}</td>
<td>{zdate($val->regdate,"Y-m-d")}</td>
</tr>
<!--@end-->
</table>
</div>
<!-- 버튼 -->
<div>
<input type="submit" value="{$lang->cmd_delete_checked_document}" />
</div>
</form> </form>
<!-- 검색 --> <!-- 검색 -->
<div> <div>
<form action="./" method="get"> <form action="./" method="get">
<input type="hidden" name="module" value="{$module}" /> <input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="mo" value="{$mo}" /> <input type="hidden" name="mo" value="{$mo}" />
<input type="hidden" name="act" value="{$act}" /> <input type="hidden" name="act" value="{$act}" />
<div> <div>
<select name="search_target"> <select name="search_target">
<option value="">{$lang->search_target}</option> <option value="">{$lang->search_target}</option>
<!--@foreach($lang->search_target_list as $key => $val)--> <!--@foreach($lang->search_target_list as $key => $val)-->
<option value="{$key}" <!--@if($search_target==$key)-->selected="true"<!--@end-->>{$val}</option> <option value="{$key}" <!--@if($search_target==$key)-->selected="true"<!--@end-->>{$val}</option>
<!--@end--> <!--@end-->
</select> </select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" /> <input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
<input type="submit" value="{$lang->cmd_search}" /> <input type="submit" value="{$lang->cmd_search}" />
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('','module',$module,'mo',$mo,'act',$act)}'"/> <input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('','module',$module,'mo',$mo,'act',$act)}'"/>
</div> </div>
</form> </form>
</div> </div>
<!-- 페이지 네비게이션 --> <!-- 페이지 네비게이션 -->
<div> <div>
<a href="{getUrl('page','','document_srl','')}">[{$lang->first_page}]</a> <a href="{getUrl('page','','document_srl','')}">[{$lang->first_page}]</a>
<!--@while($page_no = $page_navigation->getNextPage())--> <!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)--> <!--@if($page == $page_no)-->
{$page_no} {$page_no}
<!--@else--> <!--@else-->
<a href="{getUrl('page',$page_no,'document_srl','')}">[{$page_no}]</a> <a href="{getUrl('page',$page_no,'document_srl','')}">[{$page_no}]</a>
<!--@end--> <!--@end-->
<!--@end--> <!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'document_srl','')}">[{$lang->last_page}]</a> <a href="{getUrl('page',$page_navigation->last_page,'document_srl','')}">[{$lang->last_page}]</a>
</div> </div>

View file

@ -1,12 +1,12 @@
<filter name="delete_checked" module="document" act="procDeleteChecked" confirm_msg_code="confirm_delete"> <filter name="delete_checked" module="document" act="procDocumentAdminDeleteChecked" confirm_msg_code="confirm_delete">
<form> <form>
<node target="cart" required="true" /> <node target="cart" required="true" />
</form> </form>
<parameter> <parameter>
<param name="cart" target="cart" /> <param name="cart" target="cart" />
</parameter> </parameter>
<response> <response>
<tag name="error" /> <tag name="error" />
<tag name="message" /> <tag name="message" />
</response> </response>
</filter> </filter>